Consider the following equation $$ y''(x) = -2e^{-y}. $$
The following code
DSolve[y''[x] == -2 Exp[-y[x]], y[x], x] //FullSimplify
returns
{{y[x] -> Log[(2 (-1 + Cosh[Sqrt[C[1]] (x + C[2])]))/C[1]]},
{y[x] -> Log[(2 (-1 + Cosh[Sqrt[C[1]] (x + C[2])]))/C[1]]}}
(They the same solution. Let's ignore that first.) If I impose an initial condition $y(0) = 0$ then Mathematica fails to return a solution
DSolve[{y''[x] == -2 Exp[-y[x]], y[0] == 0}, y[x], x]
with the error message
DSolve::bvfail: For some branches of the general solution, unable to solve the conditions.
But a solution does exist. One can choose $C[1] = 1$ and $C[2] = \cosh^{-1}(3/2)$ in the solution and verify that $y(0) = 0$.
Any idea why is this the case?
bvfail
pops up, rather than a workaround, right? $\endgroup$DSolve
behaves as it does, and only Wolfram, Inc. can answer that. Suffice it to say thatDSolve
fails at solving many seemingly simple ODEs. By the way, it also is strange that the two solutions are identical. $\endgroup$bvfail
pops up $\endgroup$