       Re: simplify a trig expression

• To: mathgroup at smc.vnet.net
• Subject: [mg65446] Re: simplify a trig expression
• From: "Scout" <Scout at nodomain.com>
• Date: Sun, 2 Apr 2006 05:00:05 -0400 (EDT)
• References: <e0j3a1\$foe\$1@smc.vnet.net>
• Sender: owner-wri-mathgroup at wolfram.com

```"Murray Eisenberg" <murray at math.umass.edu>
news:e0j3a1\$foe\$1 at smc.vnet.net...
>A direct substitution (with paper and pencil) gives that the integral of
>  Cos[x]/(Sin[x] + 1) is Log[Sin[x] + 1].  This is valid provided Sin[x]
> is not -1.
>
> Mathematica gives:
>
>   Integrate[Cos[x]/(Sin[x] + 1), x]
> 2 Log[Cos[x/2] + Sin[x/2]]
>
> Is there some simple way to coerce the latter Mathematica-supplied
> result into the paper-and-pencil answer?
>
> The closest I could get is:
>
>   Log[TrigExpand[Expand[(Cos[x/2] + Sin[x/2])^2]]] /.
>   {Sin[x/2] -> Sqrt[(1 - Cos[x])/2],
>    Cos[x/2] -> Sqrt[(1 + Cos[x])/2]}
> Log[1 + Sqrt[1 - Cos[x]]*Sqrt[1 + Cos[x]]]
>
> Am I not seeing some easier TrigExpand or TrigReduce method?
>
> --
> Murray Eisenberg                     murray at math.umass.edu
> Mathematics & Statistics Dept.
> Lederle Graduate Research Tower      phone 413 549-1020 (H)
> University of Massachusetts                413 545-2859 (W)
> 710 North Pleasant Street            fax   413 545-1801
> Amherst, MA 01003-9305
>

Hi Murray,
one could think to use Simplify or FullSimplify but it doesn't work!
Let's say

In:=  f1[x_] := 2 Log[Cos[x/2] + Sin[x/2]];
f2[x_] := Log[(Cos[x/2] + Sin[x/2])^2];
g[x_] := Log[1 + Sin[x]];

Note that f2(x) derives from f1(x) applying the logarithm property :
n*Log[x]==Log[x^n] ,
valid in this case.

Let's show that the functions are equal:

In:= FullSimplify[ f1[x] == g[x], {k \[Element] Integers && x !=  1/2
(3 + 4 k)/ Pi}]
Out= 2 Log[Cos[x/2] + Sin[x/2]] == Log[1 + Sin[x]]

In:= FullSimplify[ f2[x] == g[x], {k \[Element] Integers && x !=
1/2 (3 + 4 k)/ Pi}]
Out= True

So, the problem is that the function FullSimplify[] (Simplify[]) doesn't
match the previous Log property!

To force the Simplify[] function to use the Log property, write down our
transformation function:

In:= tf[a_ Log[x_]] := FullSimplify[Log[x^a]];

Thus,

In:= Simplify[f1[x], TransformationFunctions -> tf]
Out= Log[1 + Sin[x]].

Hope this helps.
Regards,
~Scout~

```

• Prev by Date: Re: Convex Hull 3D
• Next by Date: Re: Re: simplify a trig expression
• Previous by thread: Re: simplify a trig expression
• Next by thread: Re: simultaneous nonlinear regression of a lot of data