On Tue, 2010-10-12 at 00:50 +0200, Dieter Kaiser wrote:
> At first the example from the testsuite which I think has a wrong
> result:
> 'diff(y,x,2)+y*('diff(y,x,1))^3 = 0;
> I will not present the calculation to show that the expected answer is
> wrong, but I will show that the following is a correct answer for the
> initial problem y(0)=0 and y'(0)=2:
>
> sol:(y^3+3*y)/6=x
I agree, ode2 is working fine in this example, while ic2 is failing. If
you want to see another way to arrive at the correct solution, here it
is:
(%i1) display2d: false$
(%i2) eq: 'diff(y,x,2)+y*('diff(y,x,1))^3 = 0$
(%i3) sol: ode2(eq,y,x);
(%o3) (y^3+6*%k1*y)/6 = x+%k2
(%i4) depends(y,x)$
(%i5) sold: first(solve(diff(sol,x),diff(y,x)));
(%o5) 'diff(y,x,1) = 2/(y^2+2*%k1)
(%i6) solve( ev(sold, y=0, 'diff(y,x)=2));
(%o6) [%k1 = 1/2]
(%i7) ev(sol,%);
(%o7) (y^3+3*y)/6 = x+%k2
(%i8) solve( ev(%,x=0,y=0));
(%o8) [%k2 = 0]
(%i9) ev(sol,%o6,%o8);
(%o9) (y^3+3*y)/6 = x
Regards,
Jaime