2.10 problem 11

2.10.1 Solved as second order missing y ode
2.10.2 Solved as second nonlinear ode solved by Mainardi Lioville method
2.10.3 Maple step by step solution
2.10.4 Maple trace
2.10.5 Maple dsolve solution
2.10.6 Mathematica DSolve solution

Internal problem ID [8099]
Book : Second order enumerated odes
Section : section 2
Problem number : 11
Date solved : Monday, October 21, 2024 at 04:52:13 PM
CAS classification : [[_2nd_order, _missing_y], _Liouville, [_2nd_order, _reducible, _mu_xy]]

Solve

\begin{align*} y^{\prime \prime }+\sin \left (x \right ) y^{\prime }+{y^{\prime }}^{2}&=0 \end{align*}

2.10.1 Solved as second order missing y ode

Time used: 0.718 (sec)

This is second order ode with missing dependent variable \(y\). Let

\begin{align*} p(x) &= y^{\prime } \end{align*}

Then

\begin{align*} p'(x) &= y^{\prime \prime } \end{align*}

Hence the ode becomes

\begin{align*} p^{\prime }\left (x \right )+\sin \left (x \right ) p \left (x \right )+p \left (x \right )^{2} = 0 \end{align*}

Which is now solve for \(p(x)\) as first order ode.

In canonical form, the ODE is

\begin{align*} p' &= F(x,p)\\ &= -\sin \left (x \right ) p -p^{2} \end{align*}

This is a Bernoulli ODE.

\[ p' = \left (-\sin \left (x \right )\right ) p \left (x \right ) + \left (-1\right )p^{2} \tag {1} \]

The standard Bernoulli ODE has the form

\[ p' = f_0(x)p+f_1(x)p^n \tag {2} \]

Comparing this to (1) shows that

\begin{align*} f_0 &=-\sin \left (x \right )\\ f_1 &=-1 \end{align*}

The first step is to divide the above equation by \(p^n \) which gives

\[ \frac {p'}{p^n} = f_0(x) p^{1-n} +f_1(x) \tag {3} \]

The next step is use the substitution \(v = p^{1-n}\) in equation (3) which generates a new ODE in \(v \left (x \right )\) which will be linear and can be easily solved using an integrating factor. Backsubstitution then gives the solution \(p(x)\) which is what we want.

This method is now applied to the ODE at hand. Comparing the ODE (1) With (2) Shows that

\begin{align*} f_0(x)&=-\sin \left (x \right )\\ f_1(x)&=-1\\ n &=2 \end{align*}

Dividing both sides of ODE (1) by \(p^n=p^{2}\) gives

\begin{align*} p'\frac {1}{p^{2}} &= -\frac {\sin \left (x \right )}{p} -1 \tag {4} \end{align*}

Let

\begin{align*} v &= p^{1-n} \\ &= \frac {1}{p} \tag {5} \end{align*}

Taking derivative of equation (5) w.r.t \(x\) gives

\begin{align*} v' &= -\frac {1}{p^{2}}p' \tag {6} \end{align*}

Substituting equations (5) and (6) into equation (4) gives

\begin{align*} -v^{\prime }\left (x \right )&= -\sin \left (x \right ) v \left (x \right )-1\\ v' &= \sin \left (x \right ) v +1 \tag {7} \end{align*}

The above now is a linear ODE in \(v \left (x \right )\) which is now solved.

In canonical form a linear first order is

\begin{align*} v^{\prime }\left (x \right ) + q(x)v \left (x \right ) &= p(x) \end{align*}

Comparing the above to the given ode shows that

\begin{align*} q(x) &=-\sin \left (x \right )\\ p(x) &=1 \end{align*}

The integrating factor \(\mu \) is

\begin{align*} \mu &= e^{\int {q\,dx}}\\ &= {\mathrm e}^{\int -\sin \left (x \right )d x}\\ &= {\mathrm e}^{\cos \left (x \right )} \end{align*}

The ode becomes

\begin{align*} \frac {\mathop {\mathrm {d}}}{ \mathop {\mathrm {d}x}}\left ( \mu v\right ) &= \mu \\ \frac {\mathop {\mathrm {d}}}{ \mathop {\mathrm {d}x}} \left (v \,{\mathrm e}^{\cos \left (x \right )}\right ) &= {\mathrm e}^{\cos \left (x \right )}\\ \mathrm {d} \left (v \,{\mathrm e}^{\cos \left (x \right )}\right ) &= {\mathrm e}^{\cos \left (x \right )}\mathrm {d} x \end{align*}

Integrating gives

\begin{align*} v \,{\mathrm e}^{\cos \left (x \right )}&= \int {{\mathrm e}^{\cos \left (x \right )} \,dx} \\ &=\int {\mathrm e}^{\cos \left (x \right )}d x + c_1 \end{align*}

Dividing throughout by the integrating factor \({\mathrm e}^{\cos \left (x \right )}\) gives the final solution

\[ v \left (x \right ) = {\mathrm e}^{-\cos \left (x \right )} \left (\int {\mathrm e}^{\cos \left (x \right )}d x +c_1 \right ) \]

The substitution \(v = p^{1-n}\) is now used to convert the above solution back to \(p \left (x \right )\) which results in

\[ \frac {1}{p \left (x \right )} = {\mathrm e}^{-\cos \left (x \right )} \left (\int {\mathrm e}^{\cos \left (x \right )}d x +c_1 \right ) \]

Solving for \(p \left (x \right )\) from the above solution(s) gives (after possible removing of solutions that do not verify)

\begin{align*} p \left (x \right ) = \frac {{\mathrm e}^{\cos \left (x \right )}}{\int {\mathrm e}^{\cos \left (x \right )}d x +c_1} \end{align*}

For solution (1) found earlier, since \(p=y^{\prime }\) then we now have a new first order ode to solve which is

\begin{align*} y^{\prime } = \frac {{\mathrm e}^{\cos \left (x \right )}}{\int {\mathrm e}^{\cos \left (x \right )}d x +c_1} \end{align*}

Since the ode has the form \(y^{\prime }=f(x)\), then we only need to integrate \(f(x)\).

\begin{align*} \int {dy} &= \int {\frac {{\mathrm e}^{\cos \left (x \right )}}{\int {\mathrm e}^{\cos \left (x \right )}d x +c_1}\, dx}\\ y &= \ln \left (\int {\mathrm e}^{\cos \left (x \right )}d x +c_1 \right ) + c_2 \end{align*}
\begin{align*} y&= \int \frac {{\mathrm e}^{\cos \left (x \right )}}{\int {\mathrm e}^{\cos \left (x \right )}d x +c_1}d x +c_2 \end{align*}

Will add steps showing solving for IC soon.

2.10.2 Solved as second nonlinear ode solved by Mainardi Lioville method

Time used: 0.245 (sec)

The ode has the Liouville form given by

\begin{align*} y^{\prime \prime }+ f(x) y^{\prime } + g(y) {y^{\prime }}^{2} &= 0 \tag {1A} \end{align*}

Where in this problem

\begin{align*} f(x) &= \sin \left (x \right )\\ g(y) &= 1 \end{align*}

Dividing through by \(y^{\prime }\) then Eq (1A) becomes

\begin{align*} \frac {y^{\prime \prime }}{y^{\prime }}+ f + g y^{\prime } &= 0 \tag {2A} \end{align*}

But the first term in Eq (2A) can be written as

\begin{align*} \frac {y^{\prime \prime }}{y^{\prime }}&= \frac {d}{dx} \ln \left ( y^{\prime } \right )\tag {3A} \end{align*}

And the last term in Eq (2A) can be written as

\begin{align*} g \frac {dy}{dx}&= \left ( \frac {d}{dy} \int g d y\right ) \frac {dy}{dx} \\ &= \frac {d}{dx} \int g d y\tag {4A} \end{align*}

Substituting (3A,4A) back into (2A) gives

\begin{align*} \frac {d}{dx} \ln \left ( y^{\prime } \right ) + \frac {d}{dx} \int g d y &= -f \tag {5A} \end{align*}

Integrating the above w.r.t. \(x\) gives

\begin{align*} \ln \left ( y^{\prime } \right ) + \int g d y &= - \int f d x + c_1 \end{align*}

Where \(c_1\) is arbitrary constant. Taking the exponential of the above gives

\begin{align*} y^{\prime } &= c_2 e^{\int -g d y}\, e^{\int -f d x}\tag {6A} \end{align*}

Where \(c_2\) is a new arbitrary constant. But since \(g=1\) and \(f=\sin \left (x \right )\), then

\begin{align*} \int -g d y &= \int \left (-1\right )d y\\ &= -y\\ \int -f d x &= \int -\sin \left (x \right )d x\\ &= \cos \left (x \right ) \end{align*}

Substituting the above into Eq(6A) gives

\[ y^{\prime } = c_2 \,{\mathrm e}^{-y} {\mathrm e}^{\cos \left (x \right )} \]

Which is now solved as first order separable ode. The ode \(y^{\prime } = c_2 \,{\mathrm e}^{-y} {\mathrm e}^{\cos \left (x \right )}\) is separable as it can be written as

\begin{align*} y^{\prime }&= c_2 \,{\mathrm e}^{-y} {\mathrm e}^{\cos \left (x \right )}\\ &= f(x) g(y) \end{align*}

Where

\begin{align*} f(x) &= {\mathrm e}^{\cos \left (x \right )} c_2\\ g(y) &= {\mathrm e}^{-y} \end{align*}

Integrating gives

\begin{align*} \int { \frac {1}{g(y)} \,dy} &= \int { f(x) \,dx}\\ \int { {\mathrm e}^{y}\,dy} &= \int { {\mathrm e}^{\cos \left (x \right )} c_2 \,dx}\\ {\mathrm e}^{y}&=\int {\mathrm e}^{\cos \left (x \right )} c_2 d x +2 c_3 \end{align*}

Solving for \(y\) from the above solution(s) gives (after possible removing of solutions that do not verify)

\begin{align*} y = \ln \left (c_2 \left (\int {\mathrm e}^{\cos \left (x \right )}d x \right )+2 c_3 \right ) \end{align*}

Will add steps showing solving for IC soon.

2.10.3 Maple step by step solution

2.10.4 Maple trace
Methods for second order ODEs:
 
2.10.5 Maple dsolve solution

Solving time : 0.005 (sec)
Leaf size : 14

dsolve(diff(diff(y(x),x),x)+sin(x)*diff(y(x),x)+diff(y(x),x)^2 = 0, 
       y(x),singsol=all)
 
\[ y = \ln \left (c_1 \left (\int {\mathrm e}^{\cos \left (x \right )}d x \right )+c_2 \right ) \]
2.10.6 Mathematica DSolve solution

Solving time : 60.135 (sec)
Leaf size : 43

DSolve[{D[y[x],{x,2}]+Sin[x]*D[y[x],x]+(D[y[x],x])^2==0,{}}, 
       y[x],x,IncludeSingularSolutions->True]
 
\[ y(x)\to \int _1^x\frac {e^{\cos (K[2])}}{c_1-\int _1^{K[2]}-e^{\cos (K[1])}dK[1]}dK[2]+c_2 \]