Re: Re: Re: How to simplify to a result that is real

*To*: mathgroup at smc.vnet.net*Subject*: [mg50815] Re: [mg50788] Re: [mg50735] Re: How to simplify to a result that is real*From*: DrBob <drbob at bigfoot.com>*Date*: Wed, 22 Sep 2004 00:11:42 -0400 (EDT)*References*: <cidt38$brv$1@smc.vnet.net> <200409180948.FAA00572@smc.vnet.net> <200409210749.DAA27752@smc.vnet.net>*Reply-to*: drbob at bigfoot.com*Sender*: owner-wri-mathgroup at wolfram.com

Mathematica simplifies the difference (when it should): Simplify[ArcTan[u, v] - ArcTan[v/u]] -ArcTan[v/u] + ArcTan[u, v] Simplify[ArcTan[u, v] - ArcTan[v/u], u > 0] 0 Simplify[ArcTan[Sqrt[a^2 - b^2], (a - b)*Tan[c/2]] - ArcTan[((a - b)*Tan[c/2])/ Sqrt[a^2 - b^2]], {a > b > 0, 0 < c < Pi}] 0 But which expression is simpler? LeafCount/@{ArcTan[u,v],ArcTan[v/u]} {3,6} The first form is simpler as Mathematica measures things, and I think it's simpler mathematically, too. It doesn't come with that nasty caveat "if u != 0". In your specific example, there's no reason for Mathematica to change either form into the other. They're both equally "simple": LeafCount /@ {ArcTan[Sqrt[a^2 - b^2], (a - b)*Tan[c/2]], ArcTan[((a - b)*Tan[c/2])/Sqrt[a^2 - b^2]]} {26, 26} But this works (in version 5.0.1.0): ArcTan[Sqrt[a^2 - b^2], (a - b)*Tan[c/2]] /. ArcTan[u_, v_] :> ArcTan[v/u] ArcTan[((a - b)*Tan[c/2])/Sqrt[a^2 - b^2]] and so does this: ch = Integrate[1/(a + b*Cos[t]), {t, 0, c}, Assumptions -> {a > b > 0, 0 < c < Pi}]; FullSimplify[ComplexExpand[ch, TargetFunctions -> {Re, Im}], {a > b > 0, 0 < c < Pi}] /. ArcTan[u_, v_] :> ArcTan[v/u] (ArcTan[((a - b)*Tan[c/2])/Sqrt[a^2 - b^2]] + ArcTan[Sqrt[-1 + (2*a)/(a + b)]*Tan[c/2]])/ Sqrt[(a - b)*(a + b)] Bobby On Tue, 21 Sep 2004 03:49:05 -0400 (EDT), Richard Chen <richard at doubleprime.com> wrote: > I have seen quite a few responses here. I'll just Thank all of you > with one response. > > I still feel that at this stage, simplifying expressions > in mathematica is still a kind of art and requires intimate knowledge > of how esoteric mathematica options work. For example, > I just tried this technique on a problem which is essentially > the same: > > ch = Integrate[1/(a + b Cos[t]), {t, 0, c}, > Assumptions -> {a > b > 0, 0 < c < Pi}] > > FullSimplify[ComplexExpand[ch, TargetFunctions -> {Re, Im}], { > a > b > 0, 0 < c < Pi}] > > This time, mathematica comes back with an expression involving > ArcTan[u,v] which is just ArcTan[v/u], by direct inspection. > So the 2 terms involving different ArcTan are actually the same. > But I cannot easily make Mathematica to recognize that they > are the same. Even if I use the rule ArcTan[u_,v_]->ArcTan[v/u] > it still does not think the 2 expressions are the same. It is easier > to simply copy and paste an anwser than manipulate mathematica > to get a simpler result. > > Perhaps future versions of mathematica will be smarter and does not > require as much intervention from the user. > > Thanks > > Richard > > On Sat, Sep 18, 2004 at 05:48:55AM -0400, Peter Valko wrote: >> Richard Chen <richard at doubleprime.com> wrote in message news:<cidt38$brv$1 at smc.vnet.net>... >> > The command: >> > >> > Integrate[1/(1 + e Cos[t]), {t, 0, a}, >> > Assumptions -> {-1 < e < 1, 0 < a < Pi}] >> > >> > leads to a complex valued result. I could not make >> > mathematica to render the result in a form that is >> > purely real. ComplexExpand, Refine all do not seem to work. >> > >> > Does anyone know how to make mathematica to simplify this >> > result into a real form? >> > >> > Thanks for any info. >> > >> > Richard >> >> >> >> Richard, >> >> I think this will work: >> >> >> ch = Integrate[1/(1 + e Cos[t]), {t, 0, a}, Assumptions -> {-1 < e < >> 1, 0 < a < Pi}] >> >> FullSimplify[ComplexExpand[ch, TargetFunctions -> {Re, Im}], {-1 < e < >> 1, 0 < a < Pi}] >> >> >> The result is >> >> (-2*ArcTan[((-1 + e)*Tan[a/2])/Sqrt[1 - e^2]])/Sqrt[1 - e^2] >> >> >> Peter >> > > > -- DrBob at bigfoot.com www.eclecticdreams.net

**References**:**Re: How to simplify to a result that is real***From:*p-valko@tamu.edu (Peter Valko)

**Re: Re: How to simplify to a result that is real***From:*Richard Chen <richard@doubleprime.com>