1 | initial version |
That is a very good question, and my answer will both be workarounds. I'm not sure we can solve this directly because of the way we interact with Maxima. Below is some gory detail of trying to do it directly in Maxima.
That will be annoying because the syntax will be different, but then you could answer the question. Unfortunately, the syntax is not nice, and took me a bit of reading through our code for desolve??
as well as the Maxima desolve docs.
But in fact the solution doesn't even seem to solve it - there is a y
on the left hand side in several places. I'm also not sure why x0
doesn't appear, but I suspect it has something to do with the reason it asks a question - probably there is some two integrations happening internally and it's not getting the initial condition in right?
sage: maxima_console()
<snip stuff>
(%o13) [x0 > 0]
(%i14) assume(P>0);
(%o14) [P > 0]
(%i15) atvalue(y(x),x=0,x0);
(%o15) x0
(%i16) atvalue('diff(y(x),x),x=0,0);
(%o16) 0
(%i17) display2d:false;
(%o17) false
(%i18) ode2('diff(y,x,2)*y^2+P,y,x);
Is %k1 positive or negative?
p;
(%o18) [(sqrt(2)*atan(sqrt(-(%k1*y-1)/y)/sqrt(%k1))
+sqrt(2)*sqrt(%k1)*y*sqrt(-(%k1*y-1)/y))
/(2*%k1^(3/2)*sqrt(P))
= x+%k2,
-(sqrt(2)*atan(sqrt(-(%k1*y-1)/y)/sqrt(%k1))
+sqrt(2)*sqrt(%k1)*y*sqrt(-(%k1*y-1)/y))
/(2*%k1^(3/2)*sqrt(P))
= x+%k2]
(%i19) ode2('diff(y,x,2)*y^2+P,y,x);
Is %k1 positive or negative?
n;
(%o19) [(sqrt(2)*log((sqrt(-(%k1*y-1)/y)-sqrt(-%k1))
/(sqrt(-(%k1*y-1)/y)+sqrt(-%k1)))
+2^(3/2)*sqrt(-%k1)*y*sqrt(-(%k1*y-1)/y))
/(4*sqrt(-%k1)*%k1*sqrt(P))
= x+%k2,
-(sqrt(2)*log((sqrt(-(%k1*y-1)/y)-sqrt(-%k1))
/(sqrt(-(%k1*y-1)/y)+sqrt(-%k1)))
+2^(3/2)*sqrt(-%k1)*y*sqrt(-(%k1*y-1)/y))
/(4*sqrt(-%k1)*%k1*sqrt(P))
= x+%k2]