How to solve a nonlinear Second-Order ODEs like the following in Mathematica?

$ y’’(t) + y’(t) - e^{y(t)} = 0 $

I tried DSolve, but it dose not work:

DSolve[D[y[t],{t,2}] + D[y[t],{t,1}] - Exp[y[t]] ==0, y[t],t]

While DSolve has no problem with something like:

DSolve[D[y[t],{t,2}] + D[y[t],{t,1}] - Exp[t]==0, y[t],t]

  • 1
    $\begingroup$ Most ODEs don't have explicit closed-form solutions, particularly if they're non-linear. Do you have any reason to think that this one does? $\endgroup$ – Michael Seifert May 20 '19 at 17:52

Define Exp[y[t]] as a function with variable t

eq[t_] := Exp[y[t]]

edit you equation to put -Exp[y[t]] in the other side to equate the equation like this and then take natural logarithmic for them this will simplify the equation because of the exponential, this is just basic math stuff.

Log[D[y[t], {t, 2}] +D[y[t], {t, 1}]] == Log[eq[t]]

Finally put them in DSolve

DSolve[Log[D[y[t], {t, 2}] + D[y[t], {t, 1}]] == Log[eq[t]], y[t], t]

This way the only way i get result and solution, where output is

enter image description here

| improve this answer | |
  • 1
    $\begingroup$ I think you made a small error: $A+B=C$ is not equivalent with $\log A + \log B = \log C$. (And there's no need to define eq[]. You can just use Exp[y[t]]` instead. $\endgroup$ – Michael E2 Apr 20 '19 at 16:36
  • $\begingroup$ oh yes you right $\endgroup$ – Alrubaie Apr 20 '19 at 16:37
  • 1
    $\begingroup$ i use version 10 $\endgroup$ – Alrubaie Apr 20 '19 at 17:27
  • 1
    $\begingroup$ Your solution for y[t] has eq[K[1]] on the RHS, but this function depends on y[t]. It is not a solution to the ODE. $\endgroup$ – Carl Woll Apr 20 '19 at 18:24
  • 1
    $\begingroup$ Not every ODE has a symbolic solution. Perhaps, yours is one of them. $\endgroup$ – bbgodfrey Apr 21 '19 at 16:26

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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