38.12 problem Ex 12

38.12.1 Solving as second order integrable as is ode
38.12.2 Solving as type second_order_integrable_as_is (not using ABC version)
38.12.3 Solving as exact linear second order ode ode

Internal problem ID [11346]
Internal file name [OUTPUT/10333_Friday_January_27_2023_02_37_12_AM_61649637/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 12.
ODE order: 2.
ODE degree: 1.

The type(s) of ODE detected by this program : "exact linear second order ode", "second_order_integrable_as_is"

Maple gives the following as the ode type

[[_2nd_order, _exact, _linear, _homogeneous]]

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

38.12.1 Solving as second order integrable as is ode

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

Which is now solved for \(y\).

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 \cos \left (x \right )}{\sin \left (x \right )}\\ q(x) &=\frac {c_{1}}{\sin \left (x \right )} \end {align*}

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

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

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

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

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

Summary

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

Verification of solutions

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

38.12.2 Solving as type second_order_integrable_as_is (not using ABC version)

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

Which is now solved for \(y\).

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 \cos \left (x \right )}{\sin \left (x \right )}\\ q(x) &=\frac {c_{1}}{\sin \left (x \right )} \end {align*}

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

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

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

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

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

Summary

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

Verification of solutions

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

38.12.3 Solving as exact linear second order ode ode

An ode of the form \begin {align*} p \left (x \right ) y^{\prime \prime }+q \left (x \right ) y^{\prime }+r \left (x \right ) y&=s \left (x \right ) \end {align*}

is exact if \begin {align*} p''(x) - q'(x) + r(x) &= 0 \tag {1} \end {align*}

For the given ode we have \begin {align*} p(x) &= \sin \left (x \right )\\ q(x) &= -\cos \left (x \right )\\ r(x) &= 2 \sin \left (x \right )\\ s(x) &= 0 \end {align*}

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

Therefore (1) becomes \begin {align*} -\sin \left (x \right )- \left (\sin \left (x \right )\right ) + \left (2 \sin \left (x \right )\right )&=0 \end {align*}

Hence the ode is exact. Since we now know the ode is exact, it can be written as \begin {align*} \left (p \left (x \right ) y^{\prime }+\left (q \left (x \right )-p^{\prime }\left (x \right )\right ) y\right )' &= s(x) \end {align*}

Integrating gives \begin {align*} p \left (x \right ) y^{\prime }+\left (q \left (x \right )-p^{\prime }\left (x \right )\right ) y&=\int {s \left (x \right )\, dx} \end {align*}

Substituting the above values for \(p,q,r,s\) gives \begin {align*} -2 \cos \left (x \right ) y+\sin \left (x \right ) y^{\prime }&=c_{1} \end {align*}

We now have a first order ode to solve which is \begin {align*} -2 \cos \left (x \right ) y+\sin \left (x \right ) y^{\prime } = c_{1} \end {align*}

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 \cos \left (x \right )}{\sin \left (x \right )}\\ q(x) &=\frac {c_{1}}{\sin \left (x \right )} \end {align*}

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

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

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

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

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

Summary

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

Verification of solutions

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

Maple trace

`Methods for second order ODEs: 
--- Trying classification methods --- 
trying a symmetry of the form [xi=0, eta=F(x)] 
checking if the LODE is missing y 
-> Heun: Equivalence to the GHE or one of its 4 confluent cases under a power @ Moebius 
-> trying a solution of the form r0(x) * Y + r1(x) * Y where Y = exp(int(r(x), dx)) * 2F1([a1, a2], [b1], f) 
-> Trying changes of variables to rationalize or make the ODE simpler 
   trying a quadrature 
   checking if the LODE has constant coefficients 
   checking if the LODE is of Euler type 
   trying a symmetry of the form [xi=0, eta=F(x)] 
   <- linear_1 successful 
   Change of variables used: 
      [x = arccos(t)] 
   Linear ODE actually solved: 
      2*u(t)+(-t^2+1)*diff(diff(u(t),t),t) = 0 
<- change of variables successful`
 

Solution by Maple

Time used: 0.14 (sec). Leaf size: 39

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

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

Solution by Mathematica

Time used: 0.235 (sec). Leaf size: 45

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

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