3.8 problem 1(h)

3.8.1 Solving as linear ode
3.8.2 Maple step by step solution

Internal problem ID [6164]
Internal file name [OUTPUT/5412_Sunday_June_05_2022_03_36_35_PM_43760870/index.tex]

Book: Differential Equations: Theory, Technique, and Practice by George Simmons, Steven Krantz. McGraw-Hill NY. 2007. 1st Edition.
Section: Chapter 1. What is a differential equation. Section 1.4 First Order Linear Equations. Page 15
Problem number: 1(h).
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 (x^{2}+1\right ) y^{\prime }+2 x y=\cot \left (x \right )} \]

3.8.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 {2 x}{x^{2}+1}\\ q(x) &=\frac {\cot \left (x \right )}{x^{2}+1} \end {align*}

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

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

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

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

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

Summary

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

Figure 66: Slope field plot

Verification of solutions

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

3.8.2 Maple step by step solution

\[ \begin {array}{lll} & {} & \textrm {Let's solve}\hspace {3pt} \\ {} & {} & \left (x^{2}+1\right ) y^{\prime }+2 x y=\cot \left (x \right ) \\ \bullet & {} & \textrm {Highest derivative means the order of the ODE is}\hspace {3pt} 1 \\ {} & {} & y^{\prime } \\ \bullet & {} & \textrm {Isolate the derivative}\hspace {3pt} \\ {} & {} & y^{\prime }=-\frac {2 x y}{x^{2}+1}+\frac {\cot \left (x \right )}{x^{2}+1} \\ \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 {2 x y}{x^{2}+1}=\frac {\cot \left (x \right )}{x^{2}+1} \\ \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 {2 x y}{x^{2}+1}\right )=\frac {\mu \left (x \right ) \cot \left (x \right )}{x^{2}+1} \\ \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 {2 x y}{x^{2}+1}\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 {2 \mu \left (x \right ) x}{x^{2}+1} \\ \bullet & {} & \textrm {Solve to find the integrating factor}\hspace {3pt} \\ {} & {} & \mu \left (x \right )=x^{2}+1 \\ \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 \frac {\mu \left (x \right ) \cot \left (x \right )}{x^{2}+1}d x +c_{1} \\ \bullet & {} & \textrm {Evaluate the integral on the lhs}\hspace {3pt} \\ {} & {} & y \mu \left (x \right )=\int \frac {\mu \left (x \right ) \cot \left (x \right )}{x^{2}+1}d x +c_{1} \\ \bullet & {} & \textrm {Solve for}\hspace {3pt} y \\ {} & {} & y=\frac {\int \frac {\mu \left (x \right ) \cot \left (x \right )}{x^{2}+1}d x +c_{1}}{\mu \left (x \right )} \\ \bullet & {} & \textrm {Substitute}\hspace {3pt} \mu \left (x \right )=x^{2}+1 \\ {} & {} & y=\frac {\int \cot \left (x \right )d x +c_{1}}{x^{2}+1} \\ \bullet & {} & \textrm {Evaluate the integrals on the rhs}\hspace {3pt} \\ {} & {} & y=\frac {\ln \left (\sin \left (x \right )\right )+c_{1}}{x^{2}+1} \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: 17

dsolve((1+x^2)*diff(y(x),x)+2*x*y(x)=cot(x),y(x), singsol=all)
 

\[ y \left (x \right ) = \frac {\ln \left (\sin \left (x \right )\right )+c_{1}}{x^{2}+1} \]

Solution by Mathematica

Time used: 0.06 (sec). Leaf size: 19

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

\[ y(x)\to \frac {\log (\sin (x))+c_1}{x^2+1} \]