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...
 A: 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.
A: 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.
