# Simplify produces an incorrect result.

I am using sagemath.com for this test on 19 Feb 2014. I applied Simplify to

C = ((((K - 1)*L*sin(-(K - 1)*t/K) + (K - 1)) *
((K - 1)^2*L*sin(-(K - 1)*t/K)/K + (K - 1)*sin(t))) -
((K - 1)*L*cos(-(K - 1)*t/K) - (K - 1)*cos(t)) *
(-(K - 1)^2*L*cos(-(K - 1)*t/K)/K + (K - 1)*cos(t)))
/ ((((K - 1)*L*sin(-(K - 1)*t/K) + (K - 1)*sin(t))^2 +
((K - 1)*L*cos(-(K - 1)*t/K) - (K - 1)*cos(t))^2)^(3/2))


The result returned is about 10 times too small and the peaks shift position as K is increased toward 1. K and L are parameters that should be within (0,1). Plot with K = 0.42 and L = 0.22 in Sagemath demonstrates the problem.

Cs = ((K - 1)*L*cos((K - 1)*t/K) - (K - 1)*cos(t)) *
((K - 1)^2*L*cos((K - 1)*t/K)/K - (K - 1)*cos(t)) +
((K - 1)*L*sin((K - 1)*t/K) - K + 1) *
((K - 1)^2*L*sin((K - 1)*t/K)/K - (K - 1)*sin(t))


As K approaches 0, the results more closely agree. Is this possibly a roundoff problem because of the numerator in C?

I verified the difference between the two using both Sagemath.com plot and Geogebra.

edit retag close merge delete

Can you put the entire session here? C.simplify() doesn't seem to really change things except rearrange terms. C.simplify_full() gives quite a different result. Is it possible that your Cs is only the numerator and this is why it's different from C?