12.11 problem 330

12.11.1 Solving as homogeneousTypeD2 ode
12.11.2 Solving as riccati ode
12.11.3 Maple step by step solution

Internal problem ID [3586]
Internal file name [OUTPUT/3079_Sunday_June_05_2022_08_51_30_AM_62796987/index.tex]

Book: Ordinary differential equations and their solutions. By George Moseley Murphy. 1960
Section: Various 12
Problem number: 330.
ODE order: 1.
ODE degree: 1.

The type(s) of ODE detected by this program : "riccati", "homogeneousTypeD2"

Maple gives the following as the ode type

[[_homogeneous, `class D`], _Riccati]

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

12.11.1 Solving as homogeneousTypeD2 ode

Using the change of variables \(y = u \left (x \right ) x\) on the above ode results in new ode in \(u \left (x \right )\) \begin {align*} 2 \left (u^{\prime }\left (x \right ) x +u \left (x \right )\right ) x^{2}-2 u \left (x \right ) x^{2}-\left (-\cot \left (x \right ) x +1\right ) \left (x^{2}-u \left (x \right )^{2} x^{2}\right ) = 0 \end {align*}

In canonical form the ODE is \begin {align*} u' &= F(x,u)\\ &= f( x) g(u)\\ &= \frac {\left (\cot \left (x \right ) x -1\right ) \left (\frac {u^{2}}{2}-\frac {1}{2}\right )}{x} \end {align*}

Where \(f(x)=\frac {\cot \left (x \right ) x -1}{x}\) and \(g(u)=\frac {u^{2}}{2}-\frac {1}{2}\). Integrating both sides gives \begin{align*} \frac {1}{\frac {u^{2}}{2}-\frac {1}{2}} \,du &= \frac {\cot \left (x \right ) x -1}{x} \,d x \\ \int { \frac {1}{\frac {u^{2}}{2}-\frac {1}{2}} \,du} &= \int {\frac {\cot \left (x \right ) x -1}{x} \,d x} \\ -2 \,\operatorname {arctanh}\left (u \right )&=\ln \left (\sin \left (x \right )\right )-\ln \left (x \right )+c_{2} \\ \end{align*} The solution is \[ -2 \,\operatorname {arctanh}\left (u \left (x \right )\right )-\ln \left (\sin \left (x \right )\right )+\ln \left (x \right )-c_{2} = 0 \] Replacing \(u(x)\) in the above solution by \(\frac {y}{x}\) results in the solution for \(y\) in implicit form \begin {align*} -2 \,\operatorname {arctanh}\left (\frac {y}{x}\right )-\ln \left (\sin \left (x \right )\right )+\ln \left (x \right )-c_{2} = 0\\ -2 \,\operatorname {arctanh}\left (\frac {y}{x}\right )-\ln \left (\sin \left (x \right )\right )+\ln \left (x \right )-c_{2} = 0 \end {align*}

Summary

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

Figure 482: Slope field plot

Verification of solutions

\[ -2 \,\operatorname {arctanh}\left (\frac {y}{x}\right )-\ln \left (\sin \left (x \right )\right )+\ln \left (x \right )-c_{2} = 0 \] Verified OK.

12.11.2 Solving as riccati ode

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

This is a Riccati ODE. Comparing the ODE to solve \[ y' = -\frac {\cot \left (x \right ) x}{2}+\frac {\cot \left (x \right ) y^{2}}{2 x}+\frac {1}{2}+\frac {y}{x}-\frac {y^{2}}{2 x^{2}} \] With Riccati ODE standard form \[ y' = f_0(x)+ f_1(x)y+f_2(x)y^{2} \] Shows that \(f_0(x)=\frac {-\cot \left (x \right ) x^{3}+x^{2}}{2 x^{2}}\), \(f_1(x)=\frac {1}{x}\) and \(f_2(x)=\frac {\cot \left (x \right ) x -1}{2 x^{2}}\). Let \begin {align*} y &= \frac {-u'}{f_2 u} \\ &= \frac {-u'}{\frac {\left (\cot \left (x \right ) x -1\right ) u}{2 x^{2}}} \tag {1} \end {align*}

Using the above substitution in the given ODE results (after some simplification)in a second order ODE to solve for \(u(x)\) which is \begin {align*} f_2 u''(x) -\left ( f_2' + f_1 f_2 \right ) u'(x) + f_2^2 f_0 u(x) &= 0 \tag {2} \end {align*}

But \begin {align*} f_2' &=\frac {\left (-1-\cot \left (x \right )^{2}\right ) x +\cot \left (x \right )}{2 x^{2}}-\frac {\cot \left (x \right ) x -1}{x^{3}}\\ f_1 f_2 &=\frac {\cot \left (x \right ) x -1}{2 x^{3}}\\ f_2^2 f_0 &=\frac {\left (\cot \left (x \right ) x -1\right )^{2} \left (-\cot \left (x \right ) x^{3}+x^{2}\right )}{8 x^{6}} \end {align*}

Substituting the above terms back in equation (2) gives \begin {align*} \frac {\left (\cot \left (x \right ) x -1\right ) u^{\prime \prime }\left (x \right )}{2 x^{2}}-\left (\frac {\left (-1-\cot \left (x \right )^{2}\right ) x +\cot \left (x \right )}{2 x^{2}}-\frac {\cot \left (x \right ) x -1}{2 x^{3}}\right ) u^{\prime }\left (x \right )+\frac {\left (\cot \left (x \right ) x -1\right )^{2} \left (-\cot \left (x \right ) x^{3}+x^{2}\right ) u \left (x \right )}{8 x^{6}} &=0 \end {align*}

Solving the above ODE (this ode solved using Maple, not this program), gives

\[ u \left (x \right ) = c_{1} \sinh \left (-\frac {\ln \left (\sin \left (x \right )\right )}{2}+\frac {\ln \left (x \right )}{2}\right )+c_{2} \cosh \left (-\frac {\ln \left (\sin \left (x \right )\right )}{2}+\frac {\ln \left (x \right )}{2}\right ) \] The above shows that \[ u^{\prime }\left (x \right ) = \left (\frac {c_{1} \cosh \left (-\frac {\ln \left (\sin \left (x \right )\right )}{2}+\frac {\ln \left (x \right )}{2}\right )}{2}+\frac {c_{2} \sinh \left (-\frac {\ln \left (\sin \left (x \right )\right )}{2}+\frac {\ln \left (x \right )}{2}\right )}{2}\right ) \left (-\cot \left (x \right )+\frac {1}{x}\right ) \] Using the above in (1) gives the solution \[ y = -\frac {2 \left (\frac {c_{1} \cosh \left (-\frac {\ln \left (\sin \left (x \right )\right )}{2}+\frac {\ln \left (x \right )}{2}\right )}{2}+\frac {c_{2} \sinh \left (-\frac {\ln \left (\sin \left (x \right )\right )}{2}+\frac {\ln \left (x \right )}{2}\right )}{2}\right ) \left (-\cot \left (x \right )+\frac {1}{x}\right ) x^{2}}{\left (\cot \left (x \right ) x -1\right ) \left (c_{1} \sinh \left (-\frac {\ln \left (\sin \left (x \right )\right )}{2}+\frac {\ln \left (x \right )}{2}\right )+c_{2} \cosh \left (-\frac {\ln \left (\sin \left (x \right )\right )}{2}+\frac {\ln \left (x \right )}{2}\right )\right )} \] Dividing both numerator and denominator by \(c_{1}\) gives, after renaming the constant \(\frac {c_{2}}{c_{1}}=c_{3}\) the following solution

\[ y = \frac {\left (c_{3} \cosh \left (-\frac {\ln \left (\sin \left (x \right )\right )}{2}+\frac {\ln \left (x \right )}{2}\right )+\sinh \left (-\frac {\ln \left (\sin \left (x \right )\right )}{2}+\frac {\ln \left (x \right )}{2}\right )\right ) x}{c_{3} \sinh \left (-\frac {\ln \left (\sin \left (x \right )\right )}{2}+\frac {\ln \left (x \right )}{2}\right )+\cosh \left (-\frac {\ln \left (\sin \left (x \right )\right )}{2}+\frac {\ln \left (x \right )}{2}\right )} \]

Summary

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

Figure 483: Slope field plot

Verification of solutions

\[ y = \frac {\left (c_{3} \cosh \left (-\frac {\ln \left (\sin \left (x \right )\right )}{2}+\frac {\ln \left (x \right )}{2}\right )+\sinh \left (-\frac {\ln \left (\sin \left (x \right )\right )}{2}+\frac {\ln \left (x \right )}{2}\right )\right ) x}{c_{3} \sinh \left (-\frac {\ln \left (\sin \left (x \right )\right )}{2}+\frac {\ln \left (x \right )}{2}\right )+\cosh \left (-\frac {\ln \left (\sin \left (x \right )\right )}{2}+\frac {\ln \left (x \right )}{2}\right )} \] Verified OK.

12.11.3 Maple step by step solution

\[ \begin {array}{lll} & {} & \textrm {Let's solve}\hspace {3pt} \\ {} & {} & 2 y^{\prime } x^{2}-2 y x -\left (-\cot \left (x \right ) x +1\right ) \left (x^{2}-y^{2}\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 {2 y x +\left (-\cot \left (x \right ) x +1\right ) \left (x^{2}-y^{2}\right )}{2 x^{2}} \end {array} \]

Maple trace

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

Solution by Maple

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

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

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

Solution by Mathematica

Time used: 1.1 (sec). Leaf size: 44

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

\begin{align*} y(x)\to \frac {x \left (x-e^{2 c_1} \sin (x)\right )}{x+e^{2 c_1} \sin (x)} \\ y(x)\to -x \\ y(x)\to x \\ \end{align*}