Status: Accepted
Owner: smichr
Labels: Type-Defect Priority-Medium

New issue 2054 by smichr: does factor need to use cancel?
http://code.google.com/p/sympy/issues/detail?id=2054

This seems kind of strange to me. I was testing an "A == B" routine and ran into a problem with this trig identity:

Here is the expression (which is symbolically identical to 0)

ee = I*(exp(I*x) - exp(-I*x))/(exp(I*x) + exp(-I*x)) - I*(exp(I*x)/2 - exp(-I*x)/2)/(exp(I*x)/2 + exp(-I*x)/2)

I try to factor the derivative wrt x

factor(ee.diff(x))
-(2 - exp(-2*I*x) - exp(2*I*x))*exp(I*x)/(2*(1 + exp(2*I*x))*(exp(I*x) + exp(-I*x)))

Hmmm...it factored. Does cancel know that it is zero?

cancel(ee.diff(x))
0

Yes. factor already expands. Perhaps it should cancel an expression, too? Or is there reason to not do that?

--
You received this message because you are subscribed to the Google Groups 
"sympy-issues" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/sympy-issues?hl=en.

Reply via email to