How to get a reduced solution?



On Nov. 6, 2010, linwaytin wrote:
-----------------------------
> I want to solve a differential equation y'' = e^y.
> It seems Maxima got the solution but in the form x=f(y). I would like it 
> in
> the form y=f(x), how to get it?
> By the way, I tried Mathematica and it gave me directly the form y=f(x). 
> Can
> Maxima do that automatically?
-----------------------
I agree that Maxima's ode2 function returns only two implicit
solutions for y as a function of x (I do this two ways below).

As for Mathematica's explicit solution,

1. what did Mathematica say were the explicit solutions??

2. Have you checked the solutions returned by substituting them
     into your original ode?

-----------------------------------------
method 1 is ode2 with a nonlinear second order ode:

(%i1) de : 'diff(y,x,2) = exp (y)$
(%i2) ode2 (de,y,x);
Is  %k1  positive or negative?

p;
(%o2) [ -log((sqrt(%e^y+%k1) -
                 sqrt(%k1))/(sqrt(%e^y+%k1)+sqrt(%k1)))
                       /(sqrt(2)*sqrt(%k1))     =   x+%k2,

       log((sqrt(%e^y+%k1) -
                 sqrt(%k1))/(sqrt(%e^y+%k1)+sqrt(%k1)))
                     /(sqrt(2)*sqrt(%k1))   =   x+%k2  ]


METHOD 2 IS TO START WITH THE FIRST INTEGRAL.

If p (y)  = dy/dx, then  y'' = dp/dx  =  (dp/dy)*(dy/dx) = p*dp/dy = exp(y)
so first solve p*dp/dy = exp(y) for p and then integrate once more.

(%i3) depends (p,y)$
(%i4) gradef (y,x,p)$
(%i5) [diff(y,x), diff(y,x,2)];
(%o5) [ p,  p*'diff(p,y,1)]
(%i6) de1 : diff(y,x,2) = exp(y)$
(%i7) ode2 (de1,p,y);
(%o7) p^2/2  =  %e^y  +  %c

(%i8) psoln  :  solve ( %, p);
(%o8) [ p = -sqrt(2)*sqrt(%e^y+%c),  p = sqrt(2)*sqrt(%e^y+%c)]

(%i9) kill(p,y)$
(%i10) [diff(y,x),diff(y,x,2)];
(%o10) [0,0]

(%i11) psoln : map ('rhs,psoln);
(%o11) [-sqrt(2)*sqrt(%e^y+%c), sqrt(2)*sqrt(%e^y+%c)]

(%i12) de11 : 'diff(y,x) = first(psoln);
(%o12) 'diff(y,x,1) = -sqrt(2)*sqrt(%e^y+%c)
(%i13) ode2(de11,y,x);
Is  %c  positive or negative?
p;
(%o13) -log((sqrt(%e^y+%c) -
                 sqrt(%c))/(sqrt(%e^y+%c)+sqrt(%c)))
                   /(sqrt(2)*sqrt(%c))   = x+%c

(%i14) de11 : 'diff(y,x) = second(psoln);
(%o14) 'diff(y,x,1) = sqrt(2)*sqrt(%e^y+%c)
(%i15) ode2 (de11,y,x);
Is  %c  positive or negative?
p;
(%o15) log((sqrt(%e^y+%c) -
                  sqrt(%c))/(sqrt(%e^y+%c)+sqrt(%c)))
                    /(sqrt(2)*sqrt(%c))  = x+%c
==============================
Ted Woollett