1
$\begingroup$

This ode

$$ y''(x)=y'(x) e^{y(x)} $$

With IC $y(3)=0,y'(3)=1$ has solution $y=\ln\left(\frac{-1}{x-4}\right)$. DSolve is not able to obtain this solution. Any suggestion for a workaround? Here is the code

ClearAll[y,x]
ode=y''[x]==y'[x]*Exp[y[x]]
ic={y[3]==0,y'[3]==1}
DSolve[{ode,ic},y[x],x]

enter image description here

Maple gives the solution

restart;
ode:=diff(diff(y(x),x),x) = diff(y(x),x)*exp(y(x));
ic:=y(3) = 0, D(y)(3) = 1;
sol:=dsolve([ode,ic],y(x))

#sol := y(x) = ln(-1/(x - 4))

Which according to Mathematica, is valid solution

mapleSol = y -> Function[{x}, Log[-1/(x - 4)]]
ode /. mapleSol // Simplify
eq1 = 0 == Log[-1/(x - 4)] /. x -> 3
eq2 = 1 == D[Log[-1/(x - 4)], x] /. x -> 3

(* True, True, True *)

btw, I think the problem is with solving for constants of integrations from the general solution. Here is a similar example, where Mathematica gives solution if no IC are given, but do not solve it if IC is given

$$ y'' = 2 y y' $$ with IC $y(0)=1,y'(0)=2$. It gives similar warning as the above when using DSolve

ClearAll[x, y]
ode = y''[x] == 2*y[x]*y'[x]
ic = {y[0] == 1, y'[0] == 2}
DSolve[{ode, ic}, y[x], x]

enter image description here

Maple gives the solution $y=\tan\left(x+\frac{\pi}{4} \right)$ which Mathematica verifies it is valid

mapleSol = y -> Function[{x}, Tan[x + Pi/4]]
ode /. mapleSol // Simplify
eq1 = 1 == Tan[x + Pi/4] /. x -> 0
eq2 = 2 == D[Tan[x + Pi/4], x] /. x -> 0

(* True, True, True *)

So it looks like the issue is in the stage of solving for the constants of integration from initial conditions.

Using version 12.3.1

$\endgroup$
1
  • $\begingroup$ gensol = DSolve[{ode}, y, x]; ivpsol = Limit[y[x] /. gensol, {C[1], C[2]} -> {0, -4}], but one cannot directly substitute C[1] -> 0 into gensol. Probably why DSolve fails on the IVP. $\endgroup$
    – Michael E2
    Aug 8, 2021 at 4:57

3 Answers 3

6
$\begingroup$

You can solve it exactly using AsymptoticDSolveValue as follows:

AsymptoticDSolveValue[{y''[x] == y'[x] E^(a y[x]), y[3] == 0, 
   y'[3] == 1}, y[x], x, {a, 1, 10}] /. a -> 1
$\endgroup$
1
  • 2
    $\begingroup$ Your parameter $a$ is a nice idea. How about asol = DSolveValue[{y''[x] == y'[x] E^(a y[x]), y[3] == 0, y'[3] == 1}, y[x], x]; ysol = Limit[asol, a -> 1] $\endgroup$
    – LouisB
    Aug 8, 2021 at 7:53
2
$\begingroup$
Clear["Global`*"]

ode = y''[x] == y'[x]*Exp[y[x]];
ic = {y[3] == 0, y'[3] == 1};

Since,

ode === D[y'[x] == Exp[y[x]], x]

(* True *)

Then

sol = DSolve[{y'[x] == Exp[y[x]], ic}, y, x][[1]] // Quiet

(* {y -> Function[{x}, -Log[4 - x]]} *)

This is a solution to the original ode and satisfies the initial conditions

{ode, ic} /. sol

(* {True, {True, True}} *)
$\endgroup$
1
  • $\begingroup$ Thanks for the suggestion. But I think strictly speaking, it should be ode === D[y'[x] == Exp[y[x] + c], x] where c is arbitrary constant? Since second order ODE should have general solution that contains two constants of integration. So that your next step would become DSolve[y'[x] == Exp[y[x]] + c, y, x] instead of DSolve[y'[x] == Exp[y[x]] , y, x] and now we are back to square one, since now it can't solve it. So your method basically set one constant of integration to zero at the start. But it does give a solution that satisfies the ODE and IC's. $\endgroup$
    – Nasser
    Aug 8, 2021 at 1:14
2
$\begingroup$

Perhaps you can solve it in two steps:

First (only one ic y[3] == 0 !)

Y = DSolveValue[{y''[x] == y'[x] E^(  y[x]), y[3] == 0}, y , x] //PowerExpand // Simplify

This solution fullfills

{Y[3], Y'[3]} // Simplify
(*{0, 1 + C[1]}*)

To get the second ic y'[3]==1 set C[1]==0

Limit[ Y[x], C[1] -> 0]
(*-Log[4 - x]*)

which gives the expected result!

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.