2.2.29 Problem 29

Solved as second order ode using change of variable on y method 1
Maple
Mathematica
Sympy

Internal problem ID [9152]
Book : Second order enumerated odes
Section : section 2
Problem number : 29
Date solved : Sunday, March 30, 2025 at 02:24:04 PM
CAS classification : [_Lienard]

Solved as second order ode using change of variable on y method 1

Time used: 0.306 (sec)

Solve

\begin{align*} \cos \left (x \right )^{2} y^{\prime \prime }-2 \cos \left (x \right ) \sin \left (x \right ) y^{\prime }+y \cos \left (x \right )^{2}&=0 \end{align*}

In 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 )&=-\frac {\sin \left (2 x \right )}{\cos \left (x \right )^{2}}\\ 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 (-\frac {\sin \left (2 x \right )}{\cos \left (x \right )^{2}}\right )'}{2}- \frac {\left (-\frac {\sin \left (2 x \right )}{\cos \left (x \right )^{2}}\right )^2}{4} \\ &= 1 - \frac {\left (-\frac {2 \cos \left (2 x \right )}{\cos \left (x \right )^{2}}-\frac {2 \sin \left (2 x \right ) \sin \left (x \right )}{\cos \left (x \right )^{3}}\right )}{2}- \frac {\left (\frac {\sin \left (2 x \right )^{2}}{\cos \left (x \right )^{4}}\right )}{4} \\ &= 1 - \left (-\frac {\cos \left (2 x \right )}{\cos \left (x \right )^{2}}-\frac {\sin \left (2 x \right ) \sin \left (x \right )}{\cos \left (x \right )^{3}}\right )-\frac {\sin \left (2 x \right )^{2}}{4 \cos \left (x \right )^{4}}\\ &= 2 \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 {-\frac {\sin \left (2 x \right )}{\cos \left (x \right )^{2}}}{2} }\\ &= \sec \left (x \right )\tag {5} \end{align*}

Hence (3) becomes

\begin{align*} y = v \left (x \right ) \sec \left (x \right )\tag {4} \end{align*}

Applying this change of variable to the original ode results in

\begin{align*} \cos \left (x \right ) \left (2 v \left (x \right )+v^{\prime \prime }\left (x \right )\right ) = 0 \end{align*}

Which is now solved for \(v \left (x \right )\).

The above ode can be simplified to

\begin{align*} 2 v \left (x \right )+v^{\prime \prime }\left (x \right ) = 0 \end{align*}

This is second order with constant coefficients homogeneous ODE. In standard form the ODE is

\[ A v''(x) + B v'(x) + C v(x) = 0 \]

Where in the above \(A=1, B=0, C=2\). Let the solution be \(v=e^{\lambda x}\). Substituting this into the ODE gives

\[ \lambda ^{2} {\mathrm e}^{x \lambda }+2 \,{\mathrm e}^{x \lambda } = 0 \tag {1} \]

Since exponential function is never zero, then dividing Eq(2) throughout by \(e^{\lambda x}\) gives

\[ \lambda ^{2}+2 = 0 \tag {2} \]

Equation (2) is the characteristic equation of the ODE. Its roots determine the general solution form.Using the quadratic formula

\[ \lambda _{1,2} = \frac {-B}{2 A} \pm \frac {1}{2 A} \sqrt {B^2 - 4 A C} \]

Substituting \(A=1, B=0, C=2\) into the above gives

\begin{align*} \lambda _{1,2} &= \frac {0}{(2) \left (1\right )} \pm \frac {1}{(2) \left (1\right )} \sqrt {0^2 - (4) \left (1\right )\left (2\right )}\\ &= \pm i \sqrt {2} \end{align*}

Hence

\begin{align*} \lambda _1 &= + i \sqrt {2}\\ \lambda _2 &= - i \sqrt {2} \end{align*}

Which simplifies to

\begin{align*} \lambda _1 &= i \sqrt {2} \\ \lambda _2 &= -i \sqrt {2} \\ \end{align*}

Since roots are complex conjugate of each others, then let the roots be

\[ \lambda _{1,2} = \alpha \pm i \beta \]

Where \(\alpha =0\) and \(\beta =\sqrt {2}\). Therefore the final solution, when using Euler relation, can be written as

\[ v = e^{\alpha x} \left ( c_1 \cos (\beta x) + c_2 \sin (\beta x) \right ) \]

Which becomes

\[ v = e^{0}\left (c_1 \cos \left (\sqrt {2}\, x \right )+c_2 \sin \left (\sqrt {2}\, x \right )\right ) \]

Or

\[ v = c_1 \cos \left (\sqrt {2}\, x \right )+c_2 \sin \left (\sqrt {2}\, x \right ) \]

Will add steps showing solving for IC soon.

Now that \(v\) is known, then

\begin{align*} y \left (x \right )&= v z \left (x \right )\\ &= \left (c_1 \cos \left (\sqrt {2}\, x \right )+c_2 \sin \left (\sqrt {2}\, x \right )\right ) \left (z \left (x \right )\right )\tag {7} \end{align*}

But from (5)

\begin{align*} z \left (x \right )&= \sec \left (x \right ) \end{align*}

Hence (7) becomes

\begin{align*} y \left (x \right ) = \left (c_1 \cos \left (\sqrt {2}\, x \right )+c_2 \sin \left (\sqrt {2}\, x \right )\right ) \sec \left (x \right ) \end{align*}

Will add steps showing solving for IC soon.

Summary of solutions found

\begin{align*} y \left (x \right ) &= \left (c_1 \cos \left (\sqrt {2}\, x \right )+c_2 \sin \left (\sqrt {2}\, x \right )\right ) \sec \left (x \right ) \\ \end{align*}

Maple. Time used: 0.003 (sec). Leaf size: 24
ode:=cos(x)^2*diff(diff(y(x),x),x)-2*cos(x)*sin(x)*diff(y(x),x)+cos(x)^2*y(x) = 0; 
dsolve(ode,y(x), singsol=all);
 
\[ y = \sec \left (x \right ) \left (c_1 \sin \left (\sqrt {2}\, x \right )+c_2 \cos \left (\sqrt {2}\, x \right )\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 
   Group is reducible or imprimitive 
<- Kovacics algorithm successful
 

Mathematica. Time used: 0.062 (sec). Leaf size: 51
ode=Cos[x]^2*D[y[x],{x,2}]-2*Cos[x]*Sin[x]*D[y[x],x]+y[x]*Cos[x]^2==0; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\[ y(x)\to \frac {1}{4} e^{-i \sqrt {2} x} \left (4 c_1-i \sqrt {2} c_2 e^{2 i \sqrt {2} x}\right ) \sec (x) \]
Sympy
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(y(x)*cos(x)**2 - 2*sin(x)*cos(x)*Derivative(y(x), x) + cos(x)**2*Derivative(y(x), (x, 2)),0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
False