I'm trying to solve the following differential equation

$\ddot{y}(t)=F\cos(\Omega t)-\frac{1}{m}\left(c-\frac{\alpha^2}{R_l+R_i}\right)\dot{y}(t)-\frac{k}{m}y(t)-\frac{k_3}{m}y^3(t)-g$

with initial condition $y(0)=y_0$. Note that the parameters $F,\ \Omega,\ m,\ c,\ \alpha,\ R_l,\ R_i,\ k, \ k_3,\ g$ and $y_0$ are arbitrary.

I tried using the following code

ode:=diff(y(t),t,t)=F*cos(Omega*t)-(c-alpha^2/(R_l+R_i))*(diff(y(t), t))/m-k*y(t)/m-k3*y(t)^3/m-g;

dsolve({ode, y(0) = y0});

in Maple, but I didn't obtain any solution. Can somebody help me?

Thank you, Ana.

  • $\begingroup$ Mathematica DSolve can't solve it either. Do you think this nonlinear ODE has analytical solution? Why not use numerical solver? $\endgroup$
    – Nasser
    May 3, 2018 at 8:51
  • $\begingroup$ btw, a second oder ODE needs to initial conditions, not one, for full solution. $\endgroup$
    – Nasser
    May 3, 2018 at 8:58
  • $\begingroup$ I guess you are aware that this is the Duffing equation. Analytical solutions are not available you will have to simulate and use the numerical solver. $\endgroup$
    – Hugh
    May 3, 2018 at 17:54

1 Answer 1


Mathematica DSolve can't solve it analytically. But you can try asymptotic approximation solution. I used y[0]==1 and y'[0]==0 below. Change as needed. Here solution expanded around t=0 with 4 terms.

ode=y''[t]==f*Cos[omega t]-(c-alpha^2/(rL+ri))*y'[t]/m - k*y[t]/m- k3*y[t]^3/m-g;

Mathematica graphics


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.