# Non linear first order differential equation

I am trying to solve a differential equation of the type $x''=-x+x^3$. Now when I first integrate it with respect to time, $t$, then I am getting $x'=x(x^2-1)+C$, which is a non-linear first order differential equation. Now if the constant happens to be zero then I can solve it by partial fraction method but as life is not easier that constant term tagged to the $x'$ is actually not zero. So how to proceed forward in this case.

Thank you...

• Hey where is the other answer to my answer now? – bluesquare Oct 28 '13 at 13:52

Starting with: $${\frac {d^{2}}{d{t}^{2}}}x \left( t \right) = x \left( t \right) ^{3}-x \left( t \right) \tag{1}$$ substitute: $$x \left( t \right) ={\frac {\sqrt{2}\,k\,y \left( t \right)}{ \sqrt{(1+{k}^{ 2})}}}$$ into $(1)$ and then rename the variable to: $$t=T\sqrt{1+k^2}$$ and you get the equation for the Jacobi elliptic sn function : $${\frac {d^{2}}{d{T}^{2}}}y \left( T \right) -2\, y \left( T \right) ^{3}{k}^{2}+ \left( 1+{k}^{2} \right) y \left( T \right)$$ which has solution: $$y(T)=sn(T+\tau_0,k)$$ and you are free to pick the value for the elliptic modulus $k$ and starting value $\tau_0$ as these are your two free parameters for the second order differential equation. Back substitution then gives: $$x \left( t \right) ={\frac {\sqrt {2}k}{\sqrt {1+{k}^{2}}}sn\left( {\frac {t}{\sqrt { 1+{k}^{2}}}}+{\it \tau_0},k \right) }$$ You will recover an elementary function if you chose $k=1$ and you get: $$x \left( t \right) =\tanh \left( \frac{t}{\sqrt {2}}+\tau_0\right)$$ as you are aware.

• Hey tons of thanks for the answer but how did you get the substitution for the $x(t)$? – bluesquare Oct 29 '13 at 13:13
• From experience I recognised an elliptic function differential equation. To read off the solution you have to manipulate the equation to match the well known form, there are a few basic tricks rescaling the function shifting the function (adding a constant) e.t.c.. there was no need to add a constant in this instance so rescaling the variable and the function suffices, putting in starting guesses e.g. $x(t)=a y(t)$ and $T=bt$ you then look at the equation again and solve for those unkowns $a,b$ in terms of $k$ to match the coefficients in the more familiar form. – Graham Hesketh Oct 29 '13 at 13:46

Multiplying your equation by $x'$ and using the facts that $x''x'=(\frac{x'^2}{2})'$, $xx'=(\frac{x^2}{2})'$ and $x^3x'=(\frac{x^4}{4})'$, where primes represents the derivatives w.r.t. $t$, and interating the resulting equation you get

$\frac{x'^2}{2}= \frac{x^2}{2}-\frac{x^4}{4}$ (we have taken $c_1=0$),

or $x'= \pm\sqrt{x^2-\frac{x^4}{2}}$ or $\pm\frac{dx}{\sqrt{x^2-\frac{x^4}{2}}}=dt$ or $\pm\int\frac{dx}{\sqrt{x^2-\frac{x^4}{2}}}=t$ ($c_2=0$). Evaluation of the integral (by trigonometric substitution $x=\sqrt{2}\sin\theta$) gives you the result. We have chosen constants of integration for the sake of simplicity.

• Now you have substituted $x=\sqrt{2}sin(t)$ in here but when you substitute this back in main equation because you can't have two expression for the $x(t)$ then that equation is not satisfying. So i think that's basically wrong but the way you calculated $\dot{x}$ I got that. Thanks – bluesquare Oct 29 '13 at 13:23
• blusquare it is a typo. Of course it should be $x=\sqrt{2}\sin\theta$. After this substitution your integral to be $\int\csc\theta d\theta=\ln|cot\theta-\csc\theta|+c$. – daulomb Oct 29 '13 at 20:29
• Hey, wait a minute. My main equation is negative of what you're taken. – bluesquare Oct 30 '13 at 8:57
• You are right. The integral is $I=\pm\int\frac{dx}{\sqrt{\frac{x^4}{2}-x^2}}=\pm\int\frac{dx}{x\sqrt{\frac{x^2}{2}-1}}$ and the substitution is $x=\sqrt{2}\sec\theta$. So, $I=\int d\theta=\theta+c_2$. – daulomb Oct 30 '13 at 18:51