# Anharmonic oscillator solution function

I am solving a CLASSICAL an-harmonic oscillator problem with Hamiltonian given by $$H= (1/2)\dot{x}^2+(1/2)x^2-(1/2)x^4$$ with all the constants ($k$'s) and mass being taken as 1 (one).

I find that $x= \tanh(t/\sqrt{2})$ is satisfying the equation of motion.

But my question is how to incorporate the Hamiltonian, $H$ in to this solution so that by providing $H$ we can control the initial conditions of this problem. Or any other solution function that can have $H$ in it.

PS= In SHO (m=k=1) lets say $x=A\sin(t)$ then $A= \sqrt{2H}$, where $H$ is the total energy or the Hamiltonian. So $x=\sqrt{H}\sin(t)$.

I need a solution function like this.

• Where is your constant of integration from solving the equation of motion? Oct 28, 2013 at 8:44
• Thanks for the response. Okay, suppose I take "A" to be the constant of integration and so x= Atanh(t/sqrt(2)) and put it in the equation of motion and do some back calculation then it's turning out to be 1. Oct 28, 2013 at 9:00
• A differential equation gives a family of solutions. For exmaple you $x(t)=\tanh(t/\sqrt 2)$ implies $x(0)=0$. There will also be a solution for $x(0)=9001$ and, for suitable $x_0$, for $x(0)=x_0$. Find $x(t)$ with unspecified $x_0$, and then plug that $x(t)$ into $H(x(t),x'(t))\overset{!}{=}E$ and solve for $x_0$ as function of $E$. Oct 28, 2013 at 9:03
• Finding $x(t)$ by hand is freaking me out. It's so difficult and can you give me any other tips or tricks. But I want to do it by hand only. Oct 28, 2013 at 14:30
• Mhm, seems tricky. The equations of motion should be $x''(t)=-(x(t)-2\ x(t)^3)$ right? Are you sure that $\tanh$ is even a solution of that? Oct 28, 2013 at 15:10

Let us do everything in our power to force your function to become a "closed form solution" to this particular problem. For this to happen we must take $x(0)=0$ and $\dot{x}_0=1/\sqrt{2}$. As you rightfully figured out the particle moves in a finite potential well and as such if its initial kinetic energy is small enough it will adopt a bounded trajectory. Unfortunately in order to please you we needed to kick off with an initial velocity that is far to big for the trajectory to be bounded. The particle will therefore run out of the well and then escape to infinity with ever-increasing velocity.

Below is a piece of Mathematica code that does the following. Firstly it solves the equation of motion numerically , secondly it produces the analytical solution and thirdly it also plots your favorite $\tanh(t/\sqrt{2})$ curve. The first, the second and the third curves are plotted in Purple , Green and Blue respectively. Enjoy:

Clear[x]; t =.;
x[t_] = First[
x[t] /. NDSolve[{x''[t] == -x[t] + 2 x[t]^3, x == 0,
x' == 1/Sqrt}, x[t], {t, -2, 2}]]
t = Range[-2, 2, 1/100];
exSol = Flatten[
x /. NSolve[
Sqrt[1 - I] EllipticF[I ArcSinh[Sqrt[-1 - I] x], -I] == #,
x] & /@ t];
ListPlot[Transpose[{t, #}] & /@ {Evaluate[x[t]], exSol,
Tanh[t/Sqrt]}, PlotStyle -> {Purple, Green, Blue},
ImageSize :> 800] As we can see the Purple and the Green curves match perfectly but despite our hard efforts to please you the later curves do not match the Blue one.

Now, how did we get the analytical solution? Since this is a conservative system (with the energy being conserved) the equation of motion always reduces to a first order ODE which in this particular case is separable. Assume $x_0=0$ and $\dot{x}_0=v$. Therefore we have: \begin{eqnarray} &&\dot{x} = v^2 - x^2 + x^4\\ &&\int\limits_0^x \frac{d\xi}{\sqrt{v^2-\xi^2+\xi^4}} = t\\ -\frac{i \sqrt{\frac{\sqrt{1-4 v^2}-1}{v^2}} F\left(i \sinh ^{-1}\left(\sqrt{2} \sqrt{\frac{1}{\sqrt{1-4 v^2}-1}} x\right)|\frac{1-\sqrt{1-4 v^2}}{\sqrt{1-4 v^2}+1}\right)}{\sqrt{2}} = t \end{eqnarray}

Here $F(\phi|m)$ is the elliptic integral of the first kind. The way we derived this solution is the following. From the general theory of elliptic integrals we know that antiderivatives of all rational functions involving square roots of polynomials of order four can be reduced to $F(\phi|m)$, $E(\phi|m)$ and $\Pi(n; \phi|m)$ meaning elliptic integral of the first, of the second and or the third kinds respectively. Rather than presenting the whole theory in here , something that I do not feel myself qualified to do right now, I just used Mathematica to find the antiderivative then simplified the result and checked it and pasted it in here.

The final remark is that if $v<1/2$ the trajectories are bounded orbits and otherwise they are unbounded.

• Are the purple and green curves on top of each other? Aug 23, 2018 at 15:56
• By curiosity, what does the analytical solution look like? Aug 23, 2018 at 20:38
• I always feel uneasy to provide the solution in such cases. First of all such questions are usually formulated in a very particular way in order to get an answer that falls into a particular class of mathematical functions. It means if you were to replace the cubic term in the Hamiltonian by some higher order term then the solution would not be expressible in terms of elliptic functions, in fact I would not know of any functions that would solve the equation. This is cheating. We don't know how to solve an equation so we define a class of functions as solutions to that equation and use those. Aug 24, 2018 at 9:52