HI,
Also feel similar kind of problem. In your case you can do 

>>> from sympy.simplify.fu import fu
>>> fu(S.Half - cos(2*x)/2)
# o/p:    sin(x)**2
>>> from sympy.simplify.fu import TR7
>>> TR7(cos(x)**2)
# o/p:    cos(2*x)/2 + 1/2

Hope these will help.

--
Shekhar


On Tuesday, 31 May 2016 03:43:06 UTC+5:30, chaowen guo wrote:
>
> Hi:
>
> My formula has a lot of square of half angle trigonometric functions. We 
> all know that sin(x/2)**2=(1-cos(x))/2 and cos(x/2)**2=(1+cos(x))/2. But 
> how to do that in sympy? I try trigsimp and expand_trig, both of them are 
> not working.
>
> import sympy
> x=sympy.symbols('x',real=True)
> sympy.expand_trig(sympy.cos(x/2)**2)
> sympy.trigsimp(sympy.sin(x/2)**2)
>
> output is the original half angle formula.
>
> Is there any function like trigreduce in maxima? It does such job.
>

-- 
You received this message because you are subscribed to the Google Groups 
"sympy" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/sympy.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sympy/f9d91c85-930a-4f2c-85d0-51d1951c0771%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to