1.73 problem 76

1.73.1 Solving as bernoulli ode
1.73.2 Maple step by step solution

Internal problem ID [3218]
Internal file name [OUTPUT/2710_Sunday_June_05_2022_08_39_05_AM_50437549/index.tex]

Book: Differential equations for engineers by Wei-Chau XIE, Cambridge Press 2010
Section: Chapter 2. First-Order and Simple Higher-Order Differential Equations. Page 78
Problem number: 76.
ODE order: 1.
ODE degree: 1.

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

Maple gives the following as the ode type

[_Bernoulli]

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

1.73.1 Solving as bernoulli ode

In canonical form, the ODE is \begin {align*} y' &= F(x,y)\\ &= \frac {-y^{2}+\sin \left (x \right )}{x y} \end {align*}

This is a Bernoulli ODE. \[ y' = -\frac {1}{x} y +\frac {\sin \left (x \right )}{x} \frac {1}{y} \tag {1} \] The standard Bernoulli ODE has the form \[ y' = f_0(x)y+f_1(x)y^n \tag {2} \] The first step is to divide the above equation by \(y^n \) which gives \[ \frac {y'}{y^n} = f_0(x) y^{1-n} +f_1(x) \tag {3} \] The next step is use the substitution \(w = y^{1-n}\) in equation (3) which generates a new ODE in \(w \left (x \right )\) which will be linear and can be easily solved using an integrating factor. Backsubstitution then gives the solution \(y(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)&=-\frac {1}{x}\\ f_1(x)&=\frac {\sin \left (x \right )}{x}\\ n &=-1 \end {align*}

Dividing both sides of ODE (1) by \(y^n=\frac {1}{y}\) gives \begin {align*} y'y &= -\frac {y^{2}}{x} +\frac {\sin \left (x \right )}{x} \tag {4} \end {align*}

Let \begin {align*} w &= y^{1-n} \\ &= y^{2} \tag {5} \end {align*}

Taking derivative of equation (5) w.r.t \(x\) gives \begin {align*} w' &= 2 yy' \tag {6} \end {align*}

Substituting equations (5) and (6) into equation (4) gives \begin {align*} \frac {w^{\prime }\left (x \right )}{2}&= -\frac {w \left (x \right )}{x}+\frac {\sin \left (x \right )}{x}\\ w' &= -\frac {2 w}{x}+\frac {2 \sin \left (x \right )}{x} \tag {7} \end {align*}

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

Entering Linear first order ODE solver. In canonical form a linear first order is \begin {align*} w^{\prime }\left (x \right ) + p(x)w \left (x \right ) &= q(x) \end {align*}

Where here \begin {align*} p(x) &=\frac {2}{x}\\ q(x) &=\frac {2 \sin \left (x \right )}{x} \end {align*}

Hence the ode is \begin {align*} w^{\prime }\left (x \right )+\frac {2 w \left (x \right )}{x} = \frac {2 \sin \left (x \right )}{x} \end {align*}

The integrating factor \(\mu \) is \begin{align*} \mu &= {\mathrm e}^{\int \frac {2}{x}d x} \\ &= x^{2} \\ \end{align*} The ode becomes \begin {align*} \frac {\mathop {\mathrm {d}}}{ \mathop {\mathrm {d}x}}\left ( \mu w\right ) &= \left (\mu \right ) \left (\frac {2 \sin \left (x \right )}{x}\right ) \\ \frac {\mathop {\mathrm {d}}}{ \mathop {\mathrm {d}x}} \left (x^{2} w\right ) &= \left (x^{2}\right ) \left (\frac {2 \sin \left (x \right )}{x}\right )\\ \mathrm {d} \left (x^{2} w\right ) &= \left (2 x \sin \left (x \right )\right )\, \mathrm {d} x \end {align*}

Integrating gives \begin {align*} x^{2} w &= \int {2 x \sin \left (x \right )\,\mathrm {d} x}\\ x^{2} w &= 2 \sin \left (x \right )-2 x \cos \left (x \right ) + c_{1} \end {align*}

Dividing both sides by the integrating factor \(\mu =x^{2}\) results in \begin {align*} w \left (x \right ) &= \frac {2 \sin \left (x \right )-2 x \cos \left (x \right )}{x^{2}}+\frac {c_{1}}{x^{2}} \end {align*}

which simplifies to \begin {align*} w \left (x \right ) &= \frac {2 \sin \left (x \right )-2 x \cos \left (x \right )+c_{1}}{x^{2}} \end {align*}

Replacing \(w\) in the above by \(y^{2}\) using equation (5) gives the final solution. \begin {align*} y^{2} = \frac {2 \sin \left (x \right )-2 x \cos \left (x \right )+c_{1}}{x^{2}} \end {align*}

Solving for \(y\) gives \begin {align*} y(x) &=\frac {\sqrt {2 \sin \left (x \right )-2 x \cos \left (x \right )+c_{1}}}{x}\\ y(x) &=-\frac {\sqrt {2 \sin \left (x \right )-2 x \cos \left (x \right )+c_{1}}}{x}\\ \end {align*}

Summary

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

Figure 108: Slope field plot

Verification of solutions

\[ y = \frac {\sqrt {2 \sin \left (x \right )-2 x \cos \left (x \right )+c_{1}}}{x} \] Verified OK.

\[ y = -\frac {\sqrt {2 \sin \left (x \right )-2 x \cos \left (x \right )+c_{1}}}{x} \] Verified OK.

1.73.2 Maple step by step solution

\[ \begin {array}{lll} & {} & \textrm {Let's solve}\hspace {3pt} \\ {} & {} & x y y^{\prime }+y^{2}=\sin \left (x \right ) \\ \bullet & {} & \textrm {Highest derivative means the order of the ODE is}\hspace {3pt} 1 \\ {} & {} & y^{\prime } \\ \bullet & {} & \textrm {Solve for the highest derivative}\hspace {3pt} \\ {} & {} & y^{\prime }=\frac {-y^{2}+\sin \left (x \right )}{x y} \end {array} \]

Maple trace

`Methods for first order ODEs: 
--- Trying classification methods --- 
trying a quadrature 
trying 1st order linear 
trying Bernoulli 
<- Bernoulli successful`
 

Solution by Maple

Time used: 0.047 (sec). Leaf size: 42

dsolve(x*y(x)*diff(y(x),x)+y(x)^2-sin(x)=0,y(x), singsol=all)
 

\begin{align*} y \left (x \right ) &= \frac {\sqrt {2 \sin \left (x \right )-2 x \cos \left (x \right )+c_{1}}}{x} \\ y \left (x \right ) &= -\frac {\sqrt {2 \sin \left (x \right )-2 x \cos \left (x \right )+c_{1}}}{x} \\ \end{align*}

Solution by Mathematica

Time used: 0.367 (sec). Leaf size: 50

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

\begin{align*} y(x)\to -\frac {\sqrt {2 \sin (x)-2 x \cos (x)+c_1}}{x} \\ y(x)\to \frac {\sqrt {2 \sin (x)-2 x \cos (x)+c_1}}{x} \\ \end{align*}