Question: Do I really get all values from this RootOf expression

I was about to verify two solutions of dsolve from here but could not find an agreement for negative values. This makes me wonder if all values are computed.

There is also a different behaviour that I do not understand when allvalues is given a RootOf expression or an equation containing a RootOf expression.
 

dsolve without method

ode:=diff(y(x), x) = (3*x - y(x) + 1)/(3*y(x) - x + 5);
ic:=y(0)=0;
dsolve({ode,ic});
plot(rhs(%),x=-10..10,numpoints=10);
evalf(subs(x=3,%%));
evalf(subs(x=-3,%%%));

diff(y(x), x) = (3*x-y(x)+1)/(3*y(x)-x+5)

 

y(0) = 0

 

y(x) = -(-(1/36)*(x+1)^2*((-324+12*(96*x^3+288*x^2+288*x+825)^(1/2))^(2/3)-24*x-24)^2/(-324+12*(96*x^3+288*x^2+288*x+825)^(1/2))^(2/3)-x^3-x^2+x+1)/(x+1)^2

 

 

y(3) = 2.135964164

 

y(-3) = -2.302775638+0.4883358175e-9*I

(1)

dsolve with a particular method

sol:=dsolve([ode,ic],[dAlembert]);
odetest(sol,[ode,ic]);

y(x) = RootOf(-6*((x+_Z+3)/(5+3*_Z-x))^(2/3)*(-4*(-x+_Z+1)/(5+3*_Z-x))^(1/3)*_Z+2*((x+_Z+3)/(5+3*_Z-x))^(2/3)*(-4*(-x+_Z+1)/(5+3*_Z-x))^(1/3)*x+2*(-4)^(1/3)*3^(2/3)-10*((x+_Z+3)/(5+3*_Z-x))^(2/3)*(-4*(-x+_Z+1)/(5+3*_Z-x))^(1/3))

 

[0, 0]

(2)

Since allvalues fails on this expression for real valued x, rational and integer values are tried for punctual comaprision

subs(x=3,sol);
allvalues(%);
evalf(%)

y(3) = RootOf(-6*((6+_Z)/(2+3*_Z))^(2/3)*(-4*(-2+_Z)/(2+3*_Z))^(1/3)*_Z-4*((6+_Z)/(2+3*_Z))^(2/3)*(-4*(-2+_Z)/(2+3*_Z))^(1/3)+2*(-4)^(1/3)*3^(2/3))

 

y(3) = (6873/256)*(-(4/6873)*(20994724+82476*6873^(1/2))^(1/3)-(128/3)/(20994724+82476*6873^(1/2))^(1/3)+1/3-((1/2)*I)*3^(1/2)*((8/6873)*(20994724+82476*6873^(1/2))^(1/3)-(256/3)/(20994724+82476*6873^(1/2))^(1/3)))^2+(1/96)*(20994724+82476*6873^(1/2))^(1/3)+(2291/3)/(20994724+82476*6873^(1/2))^(1/3)-8947/768+((2291/256)*I)*3^(1/2)*((8/6873)*(20994724+82476*6873^(1/2))^(1/3)-(256/3)/(20994724+82476*6873^(1/2))^(1/3)), y(3) = (6873/256)*((8/6873)*(20994724+82476*6873^(1/2))^(1/3)+(256/3)/(20994724+82476*6873^(1/2))^(1/3)+1/3)^2-(1/48)*(20994724+82476*6873^(1/2))^(1/3)-(4582/3)/(20994724+82476*6873^(1/2))^(1/3)-8947/768, y(3) = (6873/256)*((8/6873)*(20994724+82476*6873^(1/2))^(1/3)+(256/3)/(20994724+82476*6873^(1/2))^(1/3)+1/3)^2-(1/48)*(20994724+82476*6873^(1/2))^(1/3)-(4582/3)/(20994724+82476*6873^(1/2))^(1/3)-8947/768

 

y(3) = -6.067982077+1.049560864*I, y(3) = 2.13596417, y(3) = 2.13596417

(3)

Two roots match the dsolve solution without method. However doing the same only on the right hand side produces different output. For some reason allvalues produces 3 RootOf expressions with a numerical root selector.

subs(x=3,rhs(sol));
allvalues(%);
evalf(%)

RootOf(-6*((6+_Z)/(2+3*_Z))^(2/3)*(-4*(-2+_Z)/(2+3*_Z))^(1/3)*_Z-4*((6+_Z)/(2+3*_Z))^(2/3)*(-4*(-2+_Z)/(2+3*_Z))^(1/3)+2*(-4)^(1/3)*3^(2/3))

 

RootOf((3*I)*3^(1/6)*2^(2/3)+2^(2/3)*3^(2/3)-6*((6+_Z)/(2+3*_Z))^(2/3)*(-4*(-2+_Z)/(2+3*_Z))^(1/3)*_Z-4*((6+_Z)/(2+3*_Z))^(2/3)*(-4*(-2+_Z)/(2+3*_Z))^(1/3), -6.067982082+1.049560860*I), RootOf((3*I)*3^(1/6)*2^(2/3)+2^(2/3)*3^(2/3)-6*((6+_Z)/(2+3*_Z))^(2/3)*(-4*(-2+_Z)/(2+3*_Z))^(1/3)*_Z-4*((6+_Z)/(2+3*_Z))^(2/3)*(-4*(-2+_Z)/(2+3*_Z))^(1/3), 2.135964164), RootOf((3*I)*3^(1/6)*2^(2/3)+2^(2/3)*3^(2/3)-6*((6+_Z)/(2+3*_Z))^(2/3)*(-4*(-2+_Z)/(2+3*_Z))^(1/3)*_Z-4*((6+_Z)/(2+3*_Z))^(2/3)*(-4*(-2+_Z)/(2+3*_Z))^(1/3), 2.135964164-0.*I)

 

-6.067982082+1.049560860*I, 2.135964164, -6.067982082+1.049560860*I

(4)

Why this change?
Now the same with a negative value. Now the root does not match the solution of the dsolve call without method.

subs(x=-3,sol);
allvalues(%);
evalf(%)

y(-3) = RootOf(-6*(_Z/(8+3*_Z))^(2/3)*(-4*(4+_Z)/(8+3*_Z))^(1/3)*_Z-16*(_Z/(8+3*_Z))^(2/3)*(-4*(4+_Z)/(8+3*_Z))^(1/3)+2*(-4)^(1/3)*3^(2/3))

 

y(-3) = -1/2+(1/2)*13^(1/2)

 

y(-3) = 1.302775638

(5)

subs(x = -3, rhs(sol));
allvalues(%);
evalf(%);

RootOf(-6*(_Z/(8+3*_Z))^(2/3)*(-4*(4+_Z)/(8+3*_Z))^(1/3)*_Z-16*(_Z/(8+3*_Z))^(2/3)*(-4*(4+_Z)/(8+3*_Z))^(1/3)+2*(-4)^(1/3)*3^(2/3))

 

RootOf((3*I)*3^(1/6)*2^(2/3)-6*(_Z/(8+3*_Z))^(2/3)*(-4*(4+_Z)/(8+3*_Z))^(1/3)*_Z+2^(2/3)*3^(2/3)-16*(_Z/(8+3*_Z))^(2/3)*(-4*(4+_Z)/(8+3*_Z))^(1/3), 1.302775638+0.*I)

 

1.302775638

(6)

NULL

 

NULL


 

Download allvalues.mw

Please Wait...