MathGroup Archive 2006

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: simplify a trig expression

  • To: mathgroup at smc.vnet.net
  • Subject: [mg65438] Re: [mg65415] simplify a trig expression
  • From: Adam Strzebonski <adams at wolfram.com>
  • Date: Sat, 1 Apr 2006 05:38:57 -0500 (EST)
  • References: <200603311109.GAA15029@smc.vnet.net> <E2726B55-498F-412D-871F-5B1CEE7D1175@mimuw.edu.pl>
  • Reply-to: adams at wolfram.com
  • Sender: owner-wri-mathgroup at wolfram.com

Andrzej Kozlowski wrote:
> This is one of those cases where FullSimplify will not work because  it 
> lacks a suitable transformation function. In this particular case  the 
> transformation function is of the form:
> 
> f[n_*Log[a_]] := Log[a^n]
> 
> Of course this is only valid with various assumptions on n and a, but  I 
> won't bother with this here. 

Indeed, the two expressions are not equal for all values of x.

In[1]:= {2 Log[Cos[x/2] + Sin[x/2]], Log[Sin[x] + 1]} /. x->5Pi/2

                    Log[2]
Out[1]= {2 (I Pi + ------), Log[2]}
                      2

If we assume that 2 Log[Cos[x/2] + Sin[x/2]] is real we can use
the following transformation to simplify it.

In[2]:= g[x_]:=Log[TrigReduce[E^x]]

In[3]:= g[2 Log[Cos[x/2] + Sin[x/2]]]
Out[3]= Log[1 + Sin[x]]

> Anyway, observe that:
> 
> 
> FullSimplify[Integrate[Cos[x]/(Sin[x] + 1), x],
>   TransformationFunctions -> {Automatic, f}]
> 
> 
> Log[Sin[x] + 1]
> 
> Note also that Simplify will not work even when you add f.

This is because f itself does not make the expression simpler.
Simplify does not use TrigReduce, FullSimplify does.

Best Regards,

Adam Strzebonski
Wolfram Research

> 
> I am not sure if there are good reasons for adding a version of f  
> (taking account of suitable assumptions) to the default  transformation 
> functions of FullSimplify. It may however be a good  idea to have 
> another possible value for the option  TransformationFunctions besides 
> only Automatic and user defined ones.  In fact I have suggested in the 
> past one or two other useful  TransformationFunctions; perhaps it might 
> be a good idea to define  more and  collect them into a single option 
> value or maybe several.
> 
> Andrzej Kozlowski
> 
> 
> 
> 
> 
> 
> On 31 Mar 2006, at 13:09, Murray Eisenberg wrote:
> 
>> 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
>>
> 


  • Prev by Date: Re: simplify a trig expression
  • Next by Date: Re: A test with options
  • Previous by thread: Re: simplify a trig expression
  • Next by thread: Re: simplify a trig expression