38.8 problem Ex 8

38.8.1 Solving as second order integrable as is ode
38.8.2 Solving as type second_order_integrable_as_is (not using ABC version)

Internal problem ID [11342]
Internal file name [OUTPUT/10329_Friday_January_27_2023_02_37_04_AM_83539008/index.tex]

Book: An elementary treatise on differential equations by Abraham Cohen. DC heath publishers. 1906
Section: Chapter IX, Miscellaneous methods for solving equations of higher order than first. Article 62. Summary. Page 144
Problem number: Ex 8.
ODE order: 2.
ODE degree: 1.

The type(s) of ODE detected by this program : "second_order_integrable_as_is"

Maple gives the following as the ode type

[[_2nd_order, _exact, _nonlinear], [_2nd_order, _reducible, _mu_xy]]

\[ \boxed {x \left (x +2 y\right ) y^{\prime \prime }+2 x {y^{\prime }}^{2}+4 \left (x +y\right ) y^{\prime }+2 y=-x^{2}} \]

38.8.1 Solving as second order integrable as is ode

Integrating both sides of the ODE w.r.t \(x\) gives \begin {align*} \int \left (\left (2 y x +x^{2}\right ) y^{\prime \prime }+\left (\left (2 y^{\prime }+4\right ) x +4 y\right ) y^{\prime }+2 y\right )d x &= \int -x^{2}d x\\ 2 y x +y^{2}+\left (2 y x +x^{2}\right ) y^{\prime } = -\frac {x^{3}}{3} + c_{1} \end {align*}

Which is now solved for \(y\).

Entering Exact first order ODE solver. (Form one type)

To solve an ode of the form\begin {equation} M\left ( x,y\right ) +N\left ( x,y\right ) \frac {dy}{dx}=0\tag {A} \end {equation} We assume there exists a function \(\phi \left ( x,y\right ) =c\) where \(c\) is constant, that satisfies the ode. Taking derivative of \(\phi \) w.r.t. \(x\) gives\[ \frac {d}{dx}\phi \left ( x,y\right ) =0 \] Hence\begin {equation} \frac {\partial \phi }{\partial x}+\frac {\partial \phi }{\partial y}\frac {dy}{dx}=0\tag {B} \end {equation} Comparing (A,B) shows that\begin {align*} \frac {\partial \phi }{\partial x} & =M\\ \frac {\partial \phi }{\partial y} & =N \end {align*}

But since \(\frac {\partial ^{2}\phi }{\partial x\partial y}=\frac {\partial ^{2}\phi }{\partial y\partial x}\) then for the above to be valid, we require that\[ \frac {\partial M}{\partial y}=\frac {\partial N}{\partial x}\] If the above condition is satisfied, then the original ode is called exact. We still need to determine \(\phi \left ( x,y\right ) \) but at least we know now that we can do that since the condition \(\frac {\partial ^{2}\phi }{\partial x\partial y}=\frac {\partial ^{2}\phi }{\partial y\partial x}\) is satisfied. If this condition is not satisfied then this method will not work and we have to now look for an integrating factor to force this condition, which might or might not exist. The first step is to write the ODE in standard form to check for exactness, which is \[ M(x,y) \mathop {\mathrm {d}x}+ N(x,y) \mathop {\mathrm {d}y}=0 \tag {1A} \] Therefore \begin {align*} \left (x^{2}+2 y x\right )\mathop {\mathrm {d}y} &= \left (-2 y x -y^{2}-\frac {1}{3} x^{3}+c_{1}\right )\mathop {\mathrm {d}x}\\ \left (2 y x +y^{2}+\frac {1}{3} x^{3}-c_{1}\right )\mathop {\mathrm {d}x} + \left (x^{2}+2 y x\right )\mathop {\mathrm {d}y} &= 0 \tag {2A} \end {align*}

Comparing (1A) and (2A) shows that \begin {align*} M(x,y) &= 2 y x +y^{2}+\frac {1}{3} x^{3}-c_{1}\\ N(x,y) &= x^{2}+2 y x \end {align*}

The next step is to determine if the ODE is is exact or not. The ODE is exact when the following condition is satisfied \[ \frac {\partial M}{\partial y} = \frac {\partial N}{\partial x} \] Using result found above gives \begin {align*} \frac {\partial M}{\partial y} &= \frac {\partial }{\partial y} \left (2 y x +y^{2}+\frac {1}{3} x^{3}-c_{1}\right )\\ &= 2 x +2 y \end {align*}

And \begin {align*} \frac {\partial N}{\partial x} &= \frac {\partial }{\partial x} \left (x^{2}+2 y x\right )\\ &= 2 x +2 y \end {align*}

Since \(\frac {\partial M}{\partial y}= \frac {\partial N}{\partial x}\), then the ODE is exact The following equations are now set up to solve for the function \(\phi \left (x,y\right )\) \begin {align*} \frac {\partial \phi }{\partial x } &= M\tag {1} \\ \frac {\partial \phi }{\partial y } &= N\tag {2} \end {align*}

Integrating (1) w.r.t. \(x\) gives \begin{align*} \int \frac {\partial \phi }{\partial x} \mathop {\mathrm {d}x} &= \int M\mathop {\mathrm {d}x} \\ \int \frac {\partial \phi }{\partial x} \mathop {\mathrm {d}x} &= \int 2 y x +y^{2}+\frac {1}{3} x^{3}-c_{1}\mathop {\mathrm {d}x} \\ \tag{3} \phi &= \frac {x \left (x^{3}+12 y x +12 y^{2}-12 c_{1} \right )}{12}+ f(y) \\ \end{align*} Where \(f(y)\) is used for the constant of integration since \(\phi \) is a function of both \(x\) and \(y\). Taking derivative of equation (3) w.r.t \(y\) gives \begin{align*} \tag{4} \frac {\partial \phi }{\partial y} &= \frac {x \left (12 x +24 y \right )}{12}+f'(y) \\ &=x \left (x +2 y \right )+f'(y) \\ \end{align*} But equation (2) says that \(\frac {\partial \phi }{\partial y} = x^{2}+2 y x\). Therefore equation (4) becomes \begin{equation} \tag{5} x^{2}+2 y x = x \left (x +2 y \right )+f'(y) \end{equation} Solving equation (5) for \( f'(y)\) gives \[ f'(y) = 0 \] Therefore \[ f(y) = c_{2} \] Where \(c_{2}\) is constant of integration. Substituting this result for \(f(y)\) into equation (3) gives \(\phi \) \[ \phi = \frac {x \left (x^{3}+12 y x +12 y^{2}-12 c_{1} \right )}{12}+ c_{2} \] But since \(\phi \) itself is a constant function, then let \(\phi =c_{3}\) where \(c_{3}\) is new constant and combining \(c_{2}\) and \(c_{3}\) constants into new constant \(c_{2}\) gives the solution as \[ c_{2} = \frac {x \left (x^{3}+12 y x +12 y^{2}-12 c_{1} \right )}{12} \]

Summary

The solution(s) found are the following \begin{align*} \tag{1} \frac {x \left (x^{3}+12 y x +12 y^{2}-12 c_{1} \right )}{12} &= c_{2} \\ \end{align*}

Verification of solutions

\[ \frac {x \left (x^{3}+12 y x +12 y^{2}-12 c_{1} \right )}{12} = c_{2} \] Verified OK.

38.8.2 Solving as type second_order_integrable_as_is (not using ABC version)

Writing the ode as \[ \left (2 y x +x^{2}\right ) y^{\prime \prime }+\left (\left (2 y^{\prime }+4\right ) x +4 y\right ) y^{\prime }+2 y = -x^{2} \] Integrating both sides of the ODE w.r.t \(x\) gives \begin {align*} \int \left (\left (2 y x +x^{2}\right ) y^{\prime \prime }+\left (\left (2 y^{\prime }+4\right ) x +4 y\right ) y^{\prime }+2 y\right )d x &= \int -x^{2}d x\\ 2 y x +2 y y^{\prime } x +y^{2}+y^{\prime } x^{2} = -\frac {x^{3}}{3} +c_{1} \end {align*}

Which is now solved for \(y\).

Entering Exact first order ODE solver. (Form one type)

To solve an ode of the form\begin {equation} M\left ( x,y\right ) +N\left ( x,y\right ) \frac {dy}{dx}=0\tag {A} \end {equation} We assume there exists a function \(\phi \left ( x,y\right ) =c\) where \(c\) is constant, that satisfies the ode. Taking derivative of \(\phi \) w.r.t. \(x\) gives\[ \frac {d}{dx}\phi \left ( x,y\right ) =0 \] Hence\begin {equation} \frac {\partial \phi }{\partial x}+\frac {\partial \phi }{\partial y}\frac {dy}{dx}=0\tag {B} \end {equation} Comparing (A,B) shows that\begin {align*} \frac {\partial \phi }{\partial x} & =M\\ \frac {\partial \phi }{\partial y} & =N \end {align*}

But since \(\frac {\partial ^{2}\phi }{\partial x\partial y}=\frac {\partial ^{2}\phi }{\partial y\partial x}\) then for the above to be valid, we require that\[ \frac {\partial M}{\partial y}=\frac {\partial N}{\partial x}\] If the above condition is satisfied, then the original ode is called exact. We still need to determine \(\phi \left ( x,y\right ) \) but at least we know now that we can do that since the condition \(\frac {\partial ^{2}\phi }{\partial x\partial y}=\frac {\partial ^{2}\phi }{\partial y\partial x}\) is satisfied. If this condition is not satisfied then this method will not work and we have to now look for an integrating factor to force this condition, which might or might not exist. The first step is to write the ODE in standard form to check for exactness, which is \[ M(x,y) \mathop {\mathrm {d}x}+ N(x,y) \mathop {\mathrm {d}y}=0 \tag {1A} \] Therefore \begin {align*} \left (x^{2}+2 y x\right )\mathop {\mathrm {d}y} &= \left (-2 y x -y^{2}-\frac {1}{3} x^{3}+c_{1}\right )\mathop {\mathrm {d}x}\\ \left (2 y x +y^{2}+\frac {1}{3} x^{3}-c_{1}\right )\mathop {\mathrm {d}x} + \left (x^{2}+2 y x\right )\mathop {\mathrm {d}y} &= 0 \tag {2A} \end {align*}

Comparing (1A) and (2A) shows that \begin {align*} M(x,y) &= 2 y x +y^{2}+\frac {1}{3} x^{3}-c_{1}\\ N(x,y) &= x^{2}+2 y x \end {align*}

The next step is to determine if the ODE is is exact or not. The ODE is exact when the following condition is satisfied \[ \frac {\partial M}{\partial y} = \frac {\partial N}{\partial x} \] Using result found above gives \begin {align*} \frac {\partial M}{\partial y} &= \frac {\partial }{\partial y} \left (2 y x +y^{2}+\frac {1}{3} x^{3}-c_{1}\right )\\ &= 2 x +2 y \end {align*}

And \begin {align*} \frac {\partial N}{\partial x} &= \frac {\partial }{\partial x} \left (x^{2}+2 y x\right )\\ &= 2 x +2 y \end {align*}

Since \(\frac {\partial M}{\partial y}= \frac {\partial N}{\partial x}\), then the ODE is exact The following equations are now set up to solve for the function \(\phi \left (x,y\right )\) \begin {align*} \frac {\partial \phi }{\partial x } &= M\tag {1} \\ \frac {\partial \phi }{\partial y } &= N\tag {2} \end {align*}

Integrating (1) w.r.t. \(x\) gives \begin{align*} \int \frac {\partial \phi }{\partial x} \mathop {\mathrm {d}x} &= \int M\mathop {\mathrm {d}x} \\ \int \frac {\partial \phi }{\partial x} \mathop {\mathrm {d}x} &= \int 2 y x +y^{2}+\frac {1}{3} x^{3}-c_{1}\mathop {\mathrm {d}x} \\ \tag{3} \phi &= \frac {x \left (x^{3}+12 y x +12 y^{2}-12 c_{1} \right )}{12}+ f(y) \\ \end{align*} Where \(f(y)\) is used for the constant of integration since \(\phi \) is a function of both \(x\) and \(y\). Taking derivative of equation (3) w.r.t \(y\) gives \begin{align*} \tag{4} \frac {\partial \phi }{\partial y} &= \frac {x \left (12 x +24 y \right )}{12}+f'(y) \\ &=x \left (x +2 y \right )+f'(y) \\ \end{align*} But equation (2) says that \(\frac {\partial \phi }{\partial y} = x^{2}+2 y x\). Therefore equation (4) becomes \begin{equation} \tag{5} x^{2}+2 y x = x \left (x +2 y \right )+f'(y) \end{equation} Solving equation (5) for \( f'(y)\) gives \[ f'(y) = 0 \] Therefore \[ f(y) = c_{2} \] Where \(c_{2}\) is constant of integration. Substituting this result for \(f(y)\) into equation (3) gives \(\phi \) \[ \phi = \frac {x \left (x^{3}+12 y x +12 y^{2}-12 c_{1} \right )}{12}+ c_{2} \] But since \(\phi \) itself is a constant function, then let \(\phi =c_{3}\) where \(c_{3}\) is new constant and combining \(c_{2}\) and \(c_{3}\) constants into new constant \(c_{2}\) gives the solution as \[ c_{2} = \frac {x \left (x^{3}+12 y x +12 y^{2}-12 c_{1} \right )}{12} \]

Summary

The solution(s) found are the following \begin{align*} \tag{1} \frac {x \left (x^{3}+12 y x +12 y^{2}-12 c_{1} \right )}{12} &= c_{2} \\ \end{align*}

Verification of solutions

\[ \frac {x \left (x^{3}+12 y x +12 y^{2}-12 c_{1} \right )}{12} = c_{2} \] Verified OK.

Maple trace

`Methods for second order ODEs: 
--- Trying classification methods --- 
trying 2nd order Liouville 
trying 2nd order WeierstrassP 
trying 2nd order JacobiSN 
differential order: 2; trying a linearization to 3rd order 
trying 2nd order ODE linearizable_by_differentiation 
trying 2nd order, 2 integrating factors of the form mu(x,y) 
trying a quadrature 
checking if the LODE has constant coefficients 
checking if the LODE is of Euler type 
<- LODE of Euler type successful 
<- 2nd order, 2 integrating factors of the form mu(x,y) successful`
 

Solution by Maple

Time used: 0.046 (sec). Leaf size: 80

dsolve(x*(x+2*y(x))*diff(y(x),x$2)+2*x*(diff(y(x),x))^2+4*(x+y(x))*diff(y(x),x)+2*y(x)+x^2=0,y(x), singsol=all)
 

\begin{align*} y \left (x \right ) &= \frac {-3 x^{2}+\sqrt {3}\, \sqrt {-x \left (x^{4}-3 x^{3}+12 c_{2} x -12 c_{1} \right )}}{6 x} \\ y \left (x \right ) &= \frac {-3 x^{2}-\sqrt {3}\, \sqrt {-x \left (x^{4}-3 x^{3}+12 c_{2} x -12 c_{1} \right )}}{6 x} \\ \end{align*}

Solution by Mathematica

Time used: 2.35 (sec). Leaf size: 104

DSolve[x*(x+2*y[x])*y''[x]+2*x*(y'[x])^2+4*(x+y[x])*y'[x]+2*y[x]+x^2==0,y[x],x,IncludeSingularSolutions -> True]
 

\begin{align*} y(x)\to \frac {1}{6} \left (-3 x-\sqrt {3} \sqrt {\frac {1}{x^2}} \sqrt {x \left (-x^4+3 x^3+12 c_2 x+12 c_1\right )}\right ) \\ y(x)\to \frac {1}{6} \left (-3 x+\sqrt {3} \sqrt {\frac {1}{x^2}} \sqrt {x \left (-x^4+3 x^3+12 c_2 x+12 c_1\right )}\right ) \\ \end{align*}