2.2.29 Problem 29

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

Internal problem ID [9151]
Book : Second order enumerated odes
Section : section 2
Problem number : 29
Date solved : Friday, April 25, 2025 at 05:58:10 PM
CAS classification : [_Lienard]

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

Time used: 0.350 (sec)

Solve

cos(x)2y2cos(x)sin(x)y+ycos(x)2=0

In normal form the given ode is written as

(2)y+p(x)y+q(x)y=0

Where

p(x)=sin(2x)cos(x)2q(x)=1

Calculating the Liouville ode invariant Q given by

Q=qp2p24=1(sin(2x)cos(x)2)2(sin(2x)cos(x)2)24=1(2cos(2x)cos(x)22sin(2x)sin(x)cos(x)3)2(sin(2x)2cos(x)4)4=1(cos(2x)cos(x)2sin(2x)sin(x)cos(x)3)sin(2x)24cos(x)4=2

Since the Liouville ode invariant does not depend on the independent variable x then the transformation

(3)y=v(x)z(x)

is used to change the original ode to a constant coefficients ode in v. In (3) the term z(x) is given by

z(x)=ep(x)2dx=esin(2x)cos(x)22(5)=sec(x)

Hence (3) becomes

(4)y=v(x)sec(x)

Applying this change of variable to the original ode results in

cos(x)(2v(x)+v(x))=0

Which is now solved for v(x).

The above ode can be simplified to

2v(x)+v(x)=0

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

Av(x)+Bv(x)+Cv(x)=0

Where in the above A=1,B=0,C=2. Let the solution be v=eλx. Substituting this into the ODE gives

(1)λ2exλ+2exλ=0

Since exponential function is never zero, then dividing Eq(2) throughout by eλx gives

(2)λ2+2=0

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

λ1,2=B2A±12AB24AC

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

λ1,2=0(2)(1)±1(2)(1)02(4)(1)(2)=±i2

Hence

λ1=+i2λ2=i2

Which simplifies to

λ1=i2λ2=i2

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

λ1,2=α±iβ

Where α=0 and β=2. Therefore the final solution, when using Euler relation, can be written as

v=eαx(c1cos(βx)+c2sin(βx))

Which becomes

v=e0(c1cos(2x)+c2sin(2x))

Or

v=c1cos(2x)+c2sin(2x)

Will add steps showing solving for IC soon.

Now that v is known, then

y(x)=vz(x)(7)=(c1cos(2x)+c2sin(2x))(z(x))

But from (5)

z(x)=sec(x)

Hence (7) becomes

y(x)=(c1cos(2x)+c2sin(2x))sec(x)

Will add steps showing solving for IC soon.

Summary of solutions found

y(x)=(c1cos(2x)+c2sin(2x))sec(x)

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(x)(c1sin(2x)+c2cos(2x))

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)14ei2x(4c1i2c2e2i2x)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