2.15   ODE No. 15

\[ x^4-2 x^2 y(x)+y'(x)+y(x)^2-2 x-1=0 \] Mathematica : cpu = 0.0794561 (sec), leaf count = 25


\[\left \{\left \{y(x)\to x^2+\frac {1}{-\frac {1}{2}+c_1 \left (-e^{2 x}\right )}+1\right \}\right \}\] Maple : cpu = 0.181 (sec), leaf count = 35


\[y \relax (x ) = \frac {x^{2} {\mathrm e}^{2 x}-x^{2} c_{1}+{\mathrm e}^{2 x}+c_{1}}{{\mathrm e}^{2 x}-c_{1}}\]

Hand solution

\begin {align} x^{4}-2x^{2}y\relax (x) +y^{\prime }\relax (x) +y^{2}\left ( x\right ) -2x-1 & =0\nonumber \\ y^{\prime }\relax (x) & =-x^{4}+2x+1+2x^{2}y\relax (x) -y^{2}\relax (x) \tag {1} \end {align}

This is Riccati first order non-linear ODE of the form \begin {equation} y^{\prime }\relax (x) =P\relax (x) +Q\relax (x) y+R\left ( x\right ) y^{2}\relax (x) \tag {2} \end {equation} where in this case \(Q\relax (x) =2x^{2},R\relax (x) =-1,P\left ( x\right ) =-x^{4}+2x+1\).  

Let \(u=y-x^{2}\) or \(y=u+x^{2}\) then\begin {align*} u^{\prime } & =y^{\prime }-2x\\ & =\left (-x^{4}+2x+1+2x^{2}y-y^{2}\right ) -2x\\ & =\left (-x^{4}+2x+1+2x^{2}\left (u+x^{2}\right ) -\left (u+x^{2}\right ) ^{2}\right ) -2x\\ & =\left (-x^{4}+2x+1+2x^{2}u+2x^{4}-\left (u^{2}+x^{4}+2ux^{2}\right ) \right ) -2x\\ & =-x^{4}+2x+1+2x^{2}u+2x^{4}-u^{2}-x^{4}-2ux^{2}-2x\\ & =1-u^{2} \end {align*}

Hence\[ u^{\prime }=1-u^{2}\] This is separable\begin {align*} \frac {du}{dx} & =1-u^{2}\\ \frac {du}{1-u^{2}} & =dx \end {align*}

Integrating both sides \begin {align*} \tanh ^{-1}\relax (u) & =x+C\\ u\relax (x) & =\tanh \left (x+C\right ) \\ & =\frac {e^{x+C}-e^{-x-C}}{e^{x+C}+e^{-x-C}}\\ & =\frac {e^{x}e^{C}-e^{-x}e^{-C}}{e^{x}e^{C}+e^{-x}e^{-C}} \end {align*}

Multiplying numerator and denominator by \(e^{-C}e^{x}\)\[ u\relax (x) =\frac {e^{2x}-e^{-2C}}{e^{2x}+e^{-2C}}\] Let \(e^{-2C}=C_{1}\)\[ u\relax (x) =\frac {e^{2x}-C_{1}}{e^{2x}+C_{1}}\] Since \(u=y-x^{2}\) then\begin {align*} y & =u+x^{2}\\ & =\frac {e^{2x}-C_{1}}{e^{2x}+C_{1}}+x^{2}\\ & =\frac {e^{2x}-C_{1}+x^{2}e^{2x}+x^{2}C_{1}}{e^{2x}+C_{1}} \end {align*}

To obtain same solution as Maple, we divide by \(C_{1}\)\[ y=\frac {\frac {1}{C_{1}}e^{2x}-1+\frac {1}{C_{1}}x^{2}e^{2x}+x^{2}}{\frac {1}{C_{1}}e^{2x}+1}\] Let \(\frac {1}{C_{1}}=-C\) then\begin {align*} y & =\frac {-Ce^{2x}-1-Cx^{2}e^{2x}+x^{2}}{-Ce^{2x}+1}\\ & =\frac {Ce^{2x}+1+Cx^{2}e^{2x}-x^{2}}{Ce^{2x}-1} \end {align*}

Which now agrees with the Maple solution form. Mathematica solution also verified to be correct.