Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

why canonicalize_radical() gives a wrong answer ?

Hello,

Here is the script :

var('epsilon t')
y=function('y')(t)

de = diff(y,t,2)+2*epsilon*diff(y,t,1)+y == 0

assume(epsilon<1)
assume(epsilon>-1)
u(t) = desolve(de,y,ivar=t)

var('k_1')
sol=solve(diff(u(t).subs(_K2=0),t).subs(t=0).subs(_K1=k_1)==1,k_1)
sol[0].rhs().simplify_full()

u(t).subs(_K2=0).subs(_K1=sol[0].rhs().simplify_full())

gives the right answer:

2e^(-epsilont)sin(1/2sqrt(-4epsilon^2 + 4)t)/sqrt(-4*epsilon^2 + 4)

but

(u(t).subs(_K2=0).subs(_K1=sol[0].rhs().simplify_full())).canonicalize_radical()

gives a wrong answer (sinh instead of sin)

e^(-epsilont)sinh(sqrt(epsilon + 1)sqrt(epsilon - 1)t)/(sqrt(epsilon + 1)*sqrt(epsilon - 1))

Could anyone tell me why ?

Thank you

why canonicalize_radical() gives a wrong answer ?

Hello,

Here is the script :

var('epsilon t')
y=function('y')(t)

de = diff(y,t,2)+2*epsilon*diff(y,t,1)+y == 0

assume(epsilon<1)
assume(epsilon>-1)
u(t) = desolve(de,y,ivar=t)

var('k_1')
sol=solve(diff(u(t).subs(_K2=0),t).subs(t=0).subs(_K1=k_1)==1,k_1)
sol[0].rhs().simplify_full()

u(t).subs(_K2=0).subs(_K1=sol[0].rhs().simplify_full())

gives the right answer:

2e^(-epsilont)sin(1/2sqrt(-4epsilon^2 + 4)t)/sqrt(-4*epsilon^2 + 4)

but

(u(t).subs(_K2=0).subs(_K1=sol[0].rhs().simplify_full())).canonicalize_radical()

gives a wrong answer (sinh instead of sin)sin):

e^(-epsilont)sinh(sqrt(epsilon + 1)sqrt(epsilon - 1)t)/(sqrt(epsilon + 1)*sqrt(epsilon - 1))

Could anyone tell me why ?

Thank you