2.5.3 Problem 3
Internal
problem
ID
[10238]
Book
:
Own
collection
of
miscellaneous
problems
Section
:
section
5.0
Problem
number
:
3
Date
solved
:
Monday, December 08, 2025 at 07:53:03 PM
CAS
classification
:
[[_2nd_order, _with_linear_symmetries]]
2.5.3.1 second order ode solved by an integrating factor
0.100 (sec)
\begin{align*}
y^{\prime \prime }+2 \cot \left (x \right ) y^{\prime }-y&=0 \\
\end{align*}
Entering second order ode solved by an integrating factor solverThe ode satisfies this form \[ y^{\prime \prime }+p \left (x \right ) y^{\prime }+\frac {\left (p \left (x \right )^{2}+p^{\prime }\left (x \right )\right ) y}{2} = f \left (x \right ) \]
Where \( p(x) = 2 \cot \left (x \right )\). Therefore, there is an integrating factor given by \begin{align*} M(x) &= e^{\frac {1}{2} \int p \, dx} \\ &= e^{ \int 2 \cot \left (x \right ) \, dx} \\ &= \sin \left (x \right ) \end{align*}
Multiplying both sides of the ODE by the integrating factor \(M(x)\) makes the left side of the ODE a
complete differential
\begin{align*}
\left ( M(x) y \right )'' &= 0 \\
\left ( \sin \left (x \right ) y \right )'' &= 0 \\
\end{align*}
Integrating once gives \[ \left ( \sin \left (x \right ) y \right )' = c_1 \]
Integrating again gives \[ \left ( \sin \left (x \right ) y \right ) = c_1 x +c_2 \]
Hence the solution is \begin{align*}
y &= \frac {c_1 x +c_2}{\sin \left (x \right )} \\
\end{align*}
Or
\[
y = \frac {c_1 x}{\sin \left (x \right )}+\frac {c_2}{\sin \left (x \right )}
\]
Summary of solutions found
\begin{align*}
y &= \frac {c_1 x}{\sin \left (x \right )}+\frac {c_2}{\sin \left (x \right )} \\
\end{align*}
2.5.3.2 second order change of variable on y method 1
0.126 (sec)
\begin{align*}
y^{\prime \prime }+2 \cot \left (x \right ) y^{\prime }-y&=0 \\
\end{align*}
Entering second order change of variable on \(y\) method 1 solverIn normal form the given ode is
written as \begin{align*} y^{\prime \prime }+p \left (x \right ) y^{\prime }+q \left (x \right ) y&=0 \tag {2} \end{align*}
Where
\begin{align*} p \left (x \right )&=2 \cot \left (x \right )\\ q \left (x \right )&=-1 \end{align*}
Calculating the Liouville ode invariant \(Q\) given by
\begin{align*} Q &= q - \frac {p'}{2}- \frac {p^2}{4} \\ &= -1 - \frac {\left (2 \cot \left (x \right )\right )'}{2}- \frac {\left (2 \cot \left (x \right )\right )^2}{4} \\ &= -1 - \frac {\left (-2-2 \cot \left (x \right )^{2}\right )}{2}- \frac {\left (4 \cot \left (x \right )^{2}\right )}{4} \\ &= -1 - \left (-1-\cot \left (x \right )^{2}\right )-\cot \left (x \right )^{2}\\ &= 0 \end{align*}
Since the Liouville ode invariant does not depend on the independent variable \(x\) then the
transformation
\begin{align*} y = v \left (x \right ) z \left (x \right )\tag {3} \end{align*}
is used to change the original ode to a constant coefficients ode in \(v\). In (3) the term \(z \left (x \right )\) is given by
\begin{align*} z \left (x \right )&={\mathrm e}^{-\int \frac {p \left (x \right )}{2}d x}\\ &= e^{-\int \frac {2 \cot \left (x \right )}{2} }\\ &= \csc \left (x \right )\tag {5} \end{align*}
Hence (3) becomes
\begin{align*} y = v \left (x \right ) \csc \left (x \right )\tag {4} \end{align*}
Applying this change of variable to the original ode results in
\begin{align*} v^{\prime \prime }\left (x \right ) \csc \left (x \right ) = 0 \end{align*}
Which is now solved for \(v \left (x \right )\).
The above ode simplifies to
\begin{align*} v^{\prime \prime }\left (x \right ) = 0 \end{align*}
Entering second order ode quadrature solverIntegrating twice gives the solution
\[ v \left (x \right )= c_1 x + c_2 \]
Now that \(v \left (x \right )\) is
known, then \begin{align*} y&= v \left (x \right ) z \left (x \right )\\ &= \left (c_1 x +c_2\right ) \left (z \left (x \right )\right )\tag {7} \end{align*}
But from (5)
\begin{align*} z \left (x \right )&= \csc \left (x \right ) \end{align*}
Hence (7) becomes
\begin{align*} y = \left (c_1 x +c_2 \right ) \csc \left (x \right ) \end{align*}
Summary of solutions found
\begin{align*}
y &= \left (c_1 x +c_2 \right ) \csc \left (x \right ) \\
\end{align*}
2.5.3.3 second order kovacic
0.082 (sec)
\begin{align*}
y^{\prime \prime }+2 \cot \left (x \right ) y^{\prime }-y&=0 \\
\end{align*}
Entering kovacic solverWriting the ode as \begin{align*} y^{\prime \prime }+2 \cot \left (x \right ) y^{\prime }-y &= 0 \tag {1} \\ A y^{\prime \prime } + B y^{\prime } + C y &= 0 \tag {2} \end{align*}
Comparing (1) and (2) shows that
\begin{align*} A &= 1 \\ B &= 2 \cot \left (x \right )\tag {3} \\ C &= -1 \end{align*}
Applying the Liouville transformation on the dependent variable gives
\begin{align*} z(x) &= y e^{\int \frac {B}{2 A} \,dx} \end{align*}
Then (2) becomes
\begin{align*} z''(x) = r z(x)\tag {4} \end{align*}
Where \(r\) is given by
\begin{align*} r &= \frac {s}{t}\tag {5} \\ &= \frac {2 A B' - 2 B A' + B^2 - 4 A C}{4 A^2} \end{align*}
Substituting the values of \(A,B,C\) from (3) in the above and simplifying gives
\begin{align*} r &= \frac {0}{1}\tag {6} \end{align*}
Comparing the above to (5) shows that
\begin{align*} s &= 0\\ t &= 1 \end{align*}
Therefore eq. (4) becomes
\begin{align*} z''(x) &= 0 \tag {7} \end{align*}
Equation (7) is now solved. After finding \(z(x)\) then \(y\) is found using the inverse transformation
\begin{align*} y &= z \left (x \right ) e^{-\int \frac {B}{2 A} \,dx} \end{align*}
The first step is to determine the case of Kovacic algorithm this ode belongs to. There are 3 cases
depending on the order of poles of \(r\) and the order of \(r\) at \(\infty \). The following table summarizes these
cases.
| | |
| Case |
Allowed pole order for \(r\) |
Allowed value for \(\mathcal {O}(\infty )\) |
| | |
| 1 |
\(\left \{ 0,1,2,4,6,8,\cdots \right \} \) |
\(\left \{ \cdots ,-6,-4,-2,0,2,3,4,5,6,\cdots \right \} \) |
| | |
|
2
|
Need to have at least one pole
that is either order \(2\) or odd order
greater than \(2\). Any other pole order
is allowed as long as the above
condition is satisfied. Hence the
following set of pole orders are all
allowed. \(\{1,2\}\),\(\{1,3\}\),\(\{2\}\),\(\{3\}\),\(\{3,4\}\),\(\{1,2,5\}\). |
no condition |
| | |
| 3 |
\(\left \{ 1,2\right \} \) |
\(\left \{ 2,3,4,5,6,7,\cdots \right \} \) |
| | |
Table 2.119: Necessary conditions for each Kovacic case
The order of \(r\) at \(\infty \) is the degree of \(t\) minus the degree of \(s\). Therefore
\begin{align*} O\left (\infty \right ) &= \text {deg}(t) - \text {deg}(s) \\ &= 0 - -\infty \\ &= \infty \end{align*}
There are no poles in \(r\). Therefore the set of poles \(\Gamma \) is empty. Since there is no odd order pole
larger than \(2\) and the order at \(\infty \) is \(infinity\) then the necessary conditions for case one are met. Therefore
\begin{align*} L &= [1] \end{align*}
Since \(r = 0\) is not a function of \(x\), then there is no need run Kovacic algorithm to obtain a solution for
transformed ode \(z''=r z\) as one solution is
\[ z_1(x) = 1 \]
Using the above, the solution for the original ode can now be
found. The first solution to the original ode in \(y\) is found from \begin{align*}
y_1 &= z_1 e^{ \int -\frac {1}{2} \frac {B}{A} \,dx} \\
&= z_1 e^{ -\int \frac {1}{2} \frac {2 \cot \left (x \right )}{1} \,dx} \\
&= z_1 e^{-\ln \left (\sin \left (x \right )\right )} \\
&= z_1 \left (\csc \left (x \right )\right ) \\
\end{align*}
Which simplifies to \[
y_1 = \csc \left (x \right )
\]
The second
solution \(y_2\) to the original ode is found using reduction of order \[ y_2 = y_1 \int \frac { e^{\int -\frac {B}{A} \,dx}}{y_1^2} \,dx \]
Substituting gives \begin{align*}
y_2 &= y_1 \int \frac { e^{\int -\frac {2 \cot \left (x \right )}{1} \,dx}}{\left (y_1\right )^2} \,dx \\
&= y_1 \int \frac { e^{-2 \ln \left (\sin \left (x \right )\right )}}{\left (y_1\right )^2} \,dx \\
&= y_1 \left (x\right ) \\
\end{align*}
Therefore the
solution is
\begin{align*}
y &= c_1 y_1 + c_2 y_2 \\
&= c_1 \left (\csc \left (x \right )\right ) + c_2 \left (\csc \left (x \right )\left (x\right )\right ) \\
\end{align*}
Summary of solutions found
\begin{align*}
y &= c_1 \csc \left (x \right )+c_2 x \csc \left (x \right ) \\
\end{align*}
0.355 (sec)
\begin{align*}
y^{\prime \prime }+2 \cot \left (x \right ) y^{\prime }-y&=0 \\
\end{align*}
Applying change of variable \(x = \arccos \left (\tau \right )\) to the above ode results in the following new ode
\[
\left (-\tau ^{2}+1\right ) \left (\frac {d^{2}}{d \tau ^{2}}y \left (\tau \right )\right )-3 \left (\frac {d}{d \tau }y \left (\tau \right )\right ) \tau -y \left (\tau \right ) = 0
\]
Which
is now solved for \(y \left (\tau \right )\). Entering second order linear exact ode solverAn ode of the form
\begin{align*} p \left (\tau \right ) \left (\frac {d^{2}}{d \tau ^{2}}y \left (\tau \right )\right )+q \left (\tau \right ) \left (\frac {d}{d \tau }y \left (\tau \right )\right )+r \left (\tau \right ) y \left (\tau \right )&=s \left (\tau \right ) \end{align*}
is exact if
\begin{align*} p''(\tau ) - q'(\tau ) + r(\tau ) &= 0 \tag {1} \end{align*}
For the given ode we have
\begin{align*} p(x) &= -\tau ^{2}+1\\ q(x) &= -3 \tau \\ r(x) &= -1\\ s(x) &= 0 \end{align*}
Hence
\begin{align*} p''(x) &= -2\\ q'(x) &= -3 \end{align*}
Therefore (1) becomes
\begin{align*} -2- \left (-3\right ) + \left (-1\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 (\tau \right ) \left (\frac {d}{d \tau }y \left (\tau \right )\right )+\left (q \left (\tau \right )-\frac {d}{d \tau }p \left (\tau \right )\right ) y \left (\tau \right )\right )' &= s(x) \end{align*}
Integrating gives
\begin{align*} p \left (\tau \right ) \left (\frac {d}{d \tau }y \left (\tau \right )\right )+\left (q \left (\tau \right )-\frac {d}{d \tau }p \left (\tau \right )\right ) y \left (\tau \right )&=\int {s \left (\tau \right )\, d\tau } \end{align*}
Substituting the above values for \(p,q,r,s\) gives
\begin{align*} \left (-\tau ^{2}+1\right ) \left (\frac {d}{d \tau }y \left (\tau \right )\right )-y \left (\tau \right ) \tau &=c_1 \end{align*}
We now have a first order ode to solve which is
\begin{align*} \left (-\tau ^{2}+1\right ) \left (\frac {d}{d \tau }y \left (\tau \right )\right )-y \left (\tau \right ) \tau = c_1 \end{align*}
Entering first order ode linear solverIn canonical form a linear first order is
\begin{align*} \frac {d}{d \tau }y \left (\tau \right ) + q(\tau )y \left (\tau \right ) &= p(\tau ) \end{align*}
Comparing the above to the given ode shows that
\begin{align*} q(\tau ) &=\frac {\tau }{\tau ^{2}-1}\\ p(\tau ) &=-\frac {c_1}{\tau ^{2}-1} \end{align*}
The integrating factor \(\mu \) is
\begin{align*} \mu &= e^{\int {q\,d\tau }}\\ &= {\mathrm e}^{\int \frac {\tau }{\tau ^{2}-1}d \tau }\\ &= \sqrt {\tau ^{2}-1} \end{align*}
The ode becomes
\begin{align*}
\frac {\mathop {\mathrm {d}}}{ \mathop {\mathrm {d}\tau }}\left ( \mu y\right ) &= \mu p \\
\frac {\mathop {\mathrm {d}}}{ \mathop {\mathrm {d}\tau }}\left ( \mu y\right ) &= \left (\mu \right ) \left (-\frac {c_1}{\tau ^{2}-1}\right ) \\
\frac {\mathop {\mathrm {d}}}{ \mathop {\mathrm {d}\tau }} \left (y \sqrt {\tau ^{2}-1}\right ) &= \left (\sqrt {\tau ^{2}-1}\right ) \left (-\frac {c_1}{\tau ^{2}-1}\right ) \\
\mathrm {d} \left (y \sqrt {\tau ^{2}-1}\right ) &= \left (-\frac {c_1}{\sqrt {\tau ^{2}-1}}\right )\, \mathrm {d} \tau \\
\end{align*}
Integrating gives \begin{align*} y \sqrt {\tau ^{2}-1}&= \int {-\frac {c_1}{\sqrt {\tau ^{2}-1}} \,d\tau } \\ &=-c_1 \ln \left (\tau +\sqrt {\tau ^{2}-1}\right ) + c_2 \end{align*}
Dividing throughout by the integrating factor \(\sqrt {\tau ^{2}-1}\) gives the final solution
\[ y \left (\tau \right ) = \frac {-c_1 \ln \left (\tau +\sqrt {\tau ^{2}-1}\right )+c_2}{\sqrt {\tau ^{2}-1}} \]
Applying change of
variable \(\tau = \cos \left (x \right )\) to the solutions above gives \begin{align*}
y &= \frac {-c_1 \ln \left (\cos \left (x \right )+\sqrt {\cos \left (x \right )^{2}-1}\right )+c_2}{\sqrt {\cos \left (x \right )^{2}-1}} \\
\end{align*}
2.5.3.5 ✓ Maple. Time used: 0.001 (sec). Leaf size: 12
ode:=diff(diff(y(x),x),x)+2*cot(x)*diff(y(x),x)-y(x) = 0;
dsolve(ode,y(x), singsol=all);
\[
y = \csc \left (x \right ) \left (c_2 x +c_1 \right )
\]
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
-> Trying a Liouvillian solution using Kovacics algorithm
A Liouvillian solution exists
Reducible group (found an exponential solution)
<- Kovacics algorithm successful
2.5.3.6 ✓ Mathematica. Time used: 0.02 (sec). Leaf size: 15
ode=D[y[x],{x,2}]+2*Cot[x]*D[y[x],x]-y[x]==0;
ic={};
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
\begin{align*} y(x)&\to (c_2 x+c_1) \csc (x) \end{align*}
2.5.3.7 ✗ Sympy
from sympy import *
x = symbols("x")
y = Function("y")
ode = Eq(-y(x) + Derivative(y(x), (x, 2)) + 2*Derivative(y(x), x)/tan(x),0)
ics = {}
dsolve(ode,func=y(x),ics=ics)
NotImplementedError : The given ODE -(y(x) - Derivative(y(x), (x, 2)))*tan(x)/2 + Derivative(y(x), x) cannot be solved by the factorable group method