# Question regarding Solutions to the equation $y'' + y = y^3$

A while ago I had a question given to me by a tutoring student that read as follows:

A solution to the differential equation $$y'' + y = y^3$$ is:
A) $$y = \tanh(x/\sqrt{2})$$
B) $$y = \tanh(x\sqrt{2})$$
C) $$y = \coth(x/\sqrt{2})$$
D) $$y = \coth(x\sqrt{2})$$
E) None of these.
[3 Marks]

Given the low marks available, I presumed that the desired method would be to simply 'plug-in' the given solutions to see which were satisfactory.

Interestingly, I found that both A) and C) satisfied this equation. I was curious about this, since the formatting to me implied that only one of these should be correct...

I decided to scout around online a bit to see if there was an actual method to solving a DE like this to see if I could narrow it down, or pull these solutions out directly (for my own interest).

The results I obtained this way were interesting. My method is as below

$$y''+y=y^3$$ $$y''y'+yy'=y^3y'$$ $$\frac{1}{2}((y')^2)'+\frac{1}{2}(y^2)'=\frac{1}{4}(y^4)'$$ $$(y')^2+y^2=\frac{1}{2}y^4$$ $$y'=\frac{1}{\sqrt{2}}\sqrt{y^4-2y^2}$$

Separating variables and integrating both sides:

$$\int \frac{dy}{y\sqrt{y^2-2}} = \frac{x}{\sqrt{2}} + C$$ Answers I got from here then vary slightly;

in my initial attempt I made the substitution $$y = \sqrt{2}\cosh{u} \rightarrow dy=\sqrt{2}\sinh{u}du$$, leading to:

$$\frac{1}{\sqrt{2}}\int{\frac{du}{\cosh{u}}} = \frac{x}{\sqrt{2}}+C$$ Using a further substitution of $$v = e^u$$ I finally arrived at a solution:

$$\frac{2}{\sqrt{2}}\arctan{e^{\cosh^{-1}{\frac{y}{\sqrt{2}}}}} = \frac{x}{\sqrt{2}}+C$$ After doing some rearranging, I arrived at:

$$y = \sqrt{2}\cosh{\left(\ln\left({\tan{\left(\frac{x}{2}+K_1\right)}}\right)\right)}$$ With $$K_1 = C/\sqrt{2}$$

Sticking this into wolfram alpha seems to show that this is another satisfactory solution to my original equation.

Further; when I checked an integral calculator for the result of $$\int\frac{dy}{y\sqrt{y^2-2}}$$ I instead managed to acquire:

$$\frac{1}{\sqrt{2}}\arctan{\left(\frac{1}{\sqrt{2}}\sqrt{y^2-2}\right)}=\frac{x}{\sqrt{2}}+C$$ leading to $$y = \sqrt{2}\sec(x+K_2)$$ where $$K_2 = C\sqrt{2}$$

Again, putting this into wolfram alpha seems to indicate that it is too another solution to the equation.

What I'm wondering is

1. How to extract the two solutions indicated in the question out of the DE, as I've clearly been unable to do so,
1. What's the deal with the solutions I've found? I wouldn't be as surprised or intrigued if they both simplified to one (or both) of the results expected from the question, but plotting them indicates that they are not equivalent.

Would be greatful to hear some insight from the wider community. Thanks!

• I guess you missed a constant: $$\frac{1}{2}((y')^2)'+\frac{1}{2}(y^2)'=\frac{1}{4}(y^4)' \\ \iff \left((y')^2+y^2 -\frac{1}{2}(y^4) \right)' =0\\ \iff (y')^2+y^2-\frac{1}{2}y^4+C_1=0\\ \iff (y')^2+y^2=\frac{1}{2}y^4+C_1$$ Commented May 7, 2022 at 16:01
• The two solutions you found were actually the same solution, just with different $+C$ translations in $x$. The integration step wouldn't have retrieved $\tanh$ because the square root assumes the solution is greater than $\sqrt{2}$ while $\tanh \in (-1,1)$. It wouldn't have retrieved the $\coth$ solution either because $y'$ was simlutaneously taken to be positive. but $\coth$ is a decreasing function on intervals it is continuous. Commented May 7, 2022 at 16:20
• I managed to clock that; and realised that some discrepancies in my two found solutions (negative regions existing in the latter, and not the former) and such could be due to me being a little careless by omitting $|\cdot|$ when doing some of my operations.. Now to figure out how you'd find the $\tanh$ and $\coth$ solutions without the prior knowledge (based on the information in the answer below) Commented May 7, 2022 at 17:15

The first integral is $$(y')^2+y^2=\frac12y^4+C_1. \tag1$$ Suppose $$y\neq0$$. Let $$u=y^{-1}$$. Then $$u'=-y^{-2}y', u''=2y^{-3}(y')^2-y^{-2}y''$$ and hence $$\begin{eqnarray} u''+u-u^3&=&2y^{-3}(y')^2-y^{-2}y''+y^{-1}-y^{-3}\\ &=&2y^{-3}[-y^2+\frac12y^4+C_1]-y^{-2}(-y+y^3)+y^{-1}-y^{-3}\\ &=&(2C_1-1)y^{-3}. \end{eqnarray}$$ Thus for $$C_1=\frac12$$, then if $$y$$ is a solution, so is $$u=y^{-1}$$. Clearly $$y=\tanh(x/\sqrt{2})$$ satisfies (1) for $$C_1=\frac12$$.
Your proposed solutions are all asymptotically constant. The equilibrium positions are $$y=-1,0,1$$. You have computed for the case of the zero equilibrium. However the proposed solutions converge to $$\pm 1$$. For these the constant of the first integration is such that $$y'^2=\frac12(y^2-1)^2.$$ This has $$y'=\pm\frac{1}{\sqrt2}(y^2-1)$$ as roots, and these separable equations can be solved by separation or as Riccati equations.
• The functions $\tanh$ and $\coth$ have a limit at infinity (both directions). At such a limit the derivatives converge to zero, making this an equilibrium. Now insert $y''=y'=0$ into the original equation, giving $y=y^3$ with the 3 given solutions. After your integration with its implied integration constant, insertion of $y'=0$ leads to $y^2=\frac12y^4$. The only equilibrium is that at zero, $y=0$. Commented May 7, 2022 at 16:48
• Hmmmm, okay. As an aside- is there anything that would allow one to work this information out without knowledge of what the solutions 'should be' ? I.e. how would you tell this based on $y'' + y = y^3$ alone? Would you be able to find the $\tanh$ and $\coth$ solutions without the prior knowledge that they were solutions in this case? Commented May 7, 2022 at 17:09