Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

why won't simplify multiply out square roots?

I was trying to remove half angles in an expression. And it seems simplify() does not like to multiply out square root.

sage:theta=var('theta')

sage:assume(theta,'real')

sage:assume(theta>0)

sage:assume(theta<pi)< p="">

sage:m=((sin((1/2)theta)cos((1/2)*theta)).trig_expand(half_angles=True))

sage:view(m.simplify_full())

The output I get is $\frac{1}{2}\sqrt{-\cos\left(\theta\right) + 1} \sqrt{\cos\left(\theta\right) + 1}$

Is there a way I can make sage multiply out the the expression and give me $(1/2)sin \theta$

click to hide/show revision 2
No.2 Revision

why won't simplify multiply out square roots?

I was trying to remove half angles in an expression. And it seems simplify() does not like to multiply out square root.

sage:theta=var('theta')

sage:assume(theta,'real')

sage:assume(theta>0)

sage:assume(theta<pi)< p="">

sage:m=((sin((1/2)theta)cos((1/2)*theta)).trig_expand(half_angles=True))

sage:view(m.simplify_full())

sage:theta=var('theta')
sage:assume(theta,'real')
sage:assume(theta>0)
sage:assume(theta<pi)
sage:m=((sin((1/2)*theta)*cos((1/2)*theta)).trig_expand(half_angles=True))
sage:view(m.simplify_full())

The output I get is $\frac{1}{2}\sqrt{-\cos\left(\theta\right) + 1} \sqrt{\cos\left(\theta\right) + 1}$

Is there a way I can make sage multiply out the the expression and give me $(1/2)sin \theta$