1.64 problem 65

1.64.1 Solving as linear ode
1.64.2 Maple step by step solution

Internal problem ID [3209]
Internal file name [OUTPUT/2701_Sunday_June_05_2022_08_38_59_AM_98974110/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: 65.
ODE order: 1.
ODE degree: 1.

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

Maple gives the following as the ode type

[_linear]

\[ \boxed {\left (1+\cos \left (x \right )\right ) y^{\prime }-\sin \left (x \right ) \left (\sin \left (x \right )+\sin \left (x \right ) \cos \left (x \right )-y\right )=0} \]

1.64.1 Solving as linear ode

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

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

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

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

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

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

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

Summary

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

Figure 96: Slope field plot

Verification of solutions

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

1.64.2 Maple step by step solution

\[ \begin {array}{lll} & {} & \textrm {Let's solve}\hspace {3pt} \\ {} & {} & \left (1+\cos \left (x \right )\right ) y^{\prime }-\sin \left (x \right ) \left (\sin \left (x \right )+\sin \left (x \right ) \cos \left (x \right )-y\right )=0 \\ \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 {\sin \left (x \right ) \left (\sin \left (x \right )+\sin \left (x \right ) \cos \left (x \right )-y\right )}{1+\cos \left (x \right )} \\ \bullet & {} & \textrm {Collect w.r.t.}\hspace {3pt} y\hspace {3pt}\textrm {and simplify}\hspace {3pt} \\ {} & {} & y^{\prime }=-\frac {\sin \left (x \right ) y}{1+\cos \left (x \right )}+\sin \left (x \right )^{2} \\ \bullet & {} & \textrm {Group terms with}\hspace {3pt} y\hspace {3pt}\textrm {on the lhs of the ODE and the rest on the rhs of the ODE}\hspace {3pt} \\ {} & {} & y^{\prime }+\frac {\sin \left (x \right ) y}{1+\cos \left (x \right )}=\sin \left (x \right )^{2} \\ \bullet & {} & \textrm {The ODE is linear; multiply by an integrating factor}\hspace {3pt} \mu \left (x \right ) \\ {} & {} & \mu \left (x \right ) \left (y^{\prime }+\frac {\sin \left (x \right ) y}{1+\cos \left (x \right )}\right )=\mu \left (x \right ) \sin \left (x \right )^{2} \\ \bullet & {} & \textrm {Assume the lhs of the ODE is the total derivative}\hspace {3pt} \frac {d}{d x}\left (y \mu \left (x \right )\right ) \\ {} & {} & \mu \left (x \right ) \left (y^{\prime }+\frac {\sin \left (x \right ) y}{1+\cos \left (x \right )}\right )=y^{\prime } \mu \left (x \right )+y \mu ^{\prime }\left (x \right ) \\ \bullet & {} & \textrm {Isolate}\hspace {3pt} \mu ^{\prime }\left (x \right ) \\ {} & {} & \mu ^{\prime }\left (x \right )=\frac {\mu \left (x \right ) \sin \left (x \right )}{1+\cos \left (x \right )} \\ \bullet & {} & \textrm {Solve to find the integrating factor}\hspace {3pt} \\ {} & {} & \mu \left (x \right )=\frac {1}{1+\cos \left (x \right )} \\ \bullet & {} & \textrm {Integrate both sides with respect to}\hspace {3pt} x \\ {} & {} & \int \left (\frac {d}{d x}\left (y \mu \left (x \right )\right )\right )d x =\int \mu \left (x \right ) \sin \left (x \right )^{2}d x +c_{1} \\ \bullet & {} & \textrm {Evaluate the integral on the lhs}\hspace {3pt} \\ {} & {} & y \mu \left (x \right )=\int \mu \left (x \right ) \sin \left (x \right )^{2}d x +c_{1} \\ \bullet & {} & \textrm {Solve for}\hspace {3pt} y \\ {} & {} & y=\frac {\int \mu \left (x \right ) \sin \left (x \right )^{2}d x +c_{1}}{\mu \left (x \right )} \\ \bullet & {} & \textrm {Substitute}\hspace {3pt} \mu \left (x \right )=\frac {1}{1+\cos \left (x \right )} \\ {} & {} & y=\left (1+\cos \left (x \right )\right ) \left (\int \frac {\sin \left (x \right )^{2}}{1+\cos \left (x \right )}d x +c_{1} \right ) \\ \bullet & {} & \textrm {Evaluate the integrals on the rhs}\hspace {3pt} \\ {} & {} & y=\left (1+\cos \left (x \right )\right ) \left (-\frac {2 \tan \left (\frac {x}{2}\right )}{\tan \left (\frac {x}{2}\right )^{2}+1}+x +c_{1} \right ) \\ \bullet & {} & \textrm {Simplify}\hspace {3pt} \\ {} & {} & y=\left (1+\cos \left (x \right )\right ) \left (c_{1} +x -\sin \left (x \right )\right ) \end {array} \]

Maple trace

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

Solution by Maple

Time used: 0.0 (sec). Leaf size: 16

dsolve((1+cos(x))*diff(y(x),x)=sin(x)*( sin(x)+sin(x)*cos(x)-y(x) ),y(x), singsol=all)
 

\[ y \left (x \right ) = \left (-\sin \left (x \right )+x +c_{1} \right ) \left (\cos \left (x \right )+1\right ) \]

Solution by Mathematica

Time used: 0.096 (sec). Leaf size: 24

DSolve[(1+Cos[x])*y'[x]==Sin[x]*( Sin[x]+Sin[x]*Cos[x]-y[x] ),y[x],x,IncludeSingularSolutions -> True]
 

\[ y(x)\to \cos ^2\left (\frac {x}{2}\right ) (2 x-2 \sin (x)+c_1) \]