2.5.3 Problem 3

Solved as second order solved by an integrating factor
Solved as second order ode using change of variable on y method 1
Solved as second order ode using Kovacic algorithm
Maple
Mathematica
Sympy

Internal problem ID [8963]
Book : Own collection of miscellaneous problems
Section : section 5.0
Problem number : 3
Date solved : Friday, April 25, 2025 at 05:27:00 PM
CAS classification : [[_2nd_order, _with_linear_symmetries]]

Solved as second order solved by an integrating factor

Time used: 0.070 (sec)

Solve

y+2cot(x)yy=0

The ode satisfies this form

y+p(x)y+(p(x)+p(x)2)y2=f(x)

Where p(x)=2cot(x). Therefore, there is an integrating factor given by

M(x)=e12pdx=e2cot(x)dx=sin(x)

Multiplying both sides of the ODE by the integrating factor M(x) makes the left side of the ODE a complete differential

(M(x)y)=0(sin(x)y)=0

Integrating once gives

(sin(x)y)=c1

Integrating again gives

(sin(x)y)=c1x+c2

Hence the solution is

y=c1x+c2sin(x)

Or

y=c1xsin(x)+c2sin(x)

Will add steps showing solving for IC soon.

Summary of solutions found

y=c1xsin(x)+c2sin(x)

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

Time used: 0.156 (sec)

Solve

y+2cot(x)yy=0

In normal form the given ode is written as

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

Where

p(x)=2cot(x)q(x)=1

Calculating the Liouville ode invariant Q given by

Q=qp2p24=1(2cot(x))2(2cot(x))24=1(22cot(x)2)2(4cot(x)2)4=1(1cot(x)2)cot(x)2=0

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=e2cot(x)2(5)=csc(x)

Hence (3) becomes

(4)y=v(x)csc(x)

Applying this change of variable to the original ode results in

v(x)csc(x)=0

Which is now solved for v(x).

The above ode can be simplified to

v(x)=0

Integrating twice gives the solution

v=c1x+c2

Will add steps showing solving for IC soon.

Now that v is known, then

y(x)=vz(x)(7)=(c1x+c2)(z(x))

But from (5)

z(x)=csc(x)

Hence (7) becomes

y(x)=(c1x+c2)csc(x)

Will add steps showing solving for IC soon.

Summary of solutions found

y(x)=(c1x+c2)csc(x)

Solved as second order ode using Kovacic algorithm

Time used: 0.080 (sec)

Solve

y+2cot(x)yy=0

Writing the ode as

(1)y+2cot(x)yy=0(2)Ay+By+Cy=0

Comparing (1) and (2) shows that

A=1(3)B=2cot(x)C=1

Applying the Liouville transformation on the dependent variable gives

z(x)=yeB2Adx

Then (2) becomes

(4)z(x)=rz(x)

Where r is given by

(5)r=st=2AB2BA+B24AC4A2

Substituting the values of A,B,C from (3) in the above and simplifying gives

(6)r=01

Comparing the above to (5) shows that

s=0t=1

Therefore eq. (4) becomes

(7)z(x)=0

Equation (7) is now solved. After finding z(x) then y is found using the inverse transformation

y=z(x)eB2Adx

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 . The following table summarizes these cases.

Case

Allowed pole order for r

Allowed value for O()

1

{0,1,2,4,6,8,}

{,6,4,2,0,2,3,4,5,6,}

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

{1,2}

{2,3,4,5,6,7,}

Table 2.116: Necessary conditions for each Kovacic case

The order of r at is the degree of t minus the degree of s. Therefore

O()=deg(t)deg(s)=0=

There are no poles in r. Therefore the set of poles Γ is empty. Since there is no odd order pole larger than 2 and the order at is infinity then the necessary conditions for case one are met. Therefore

L=[1]

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=rz as one solution is

z1(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

y1=z1e12BAdx=z1e122cot(x)1dx=z1eln(sin(x))=z1(csc(x))

Which simplifies to

y1=csc(x)

The second solution y2 to the original ode is found using reduction of order

y2=y1eBAdxy12dx

Substituting gives

y2=y1e2cot(x)1dx(y1)2dx=y1e2ln(sin(x))(y1)2dx=y1(x)

Therefore the solution is

y=c1y1+c2y2=c1(csc(x))+c2(csc(x)(x))

Will add steps showing solving for IC soon.

Summary of solutions found

y=c1csc(x)+c2xcsc(x)
Maple. Time used: 0.002 (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(x)(c2x+c1)

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
 

Mathematica. Time used: 0.033 (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]
 
y(x)(c2x+c1)csc(x)
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