2.2.20 Problem 21

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

Internal problem ID [9142]
Book : Second order enumerated odes
Section : section 2
Problem number : 21
Date solved : Friday, April 25, 2025 at 05:57:25 PM
CAS classification : [[_2nd_order, _with_linear_symmetries], [_2nd_order, _linear, `_with_symmetry_[0,F(x)]`]]

Solved as second order ode using change of variable on x method 2

Time used: 0.461 (sec)

Solve

y+cot(x)y+4ycsc(x)2=0

In normal form the ode

(1)y+cot(x)y+4ycsc(x)2=0

Becomes

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

Where

p(x)=cot(x)q(x)=4csc(x)2

Applying change of variables τ=g(x) to (2) gives

(3)d2dτ2y(τ)+p1(ddτy(τ))+q1y(τ)=0

Where τ is the new independent variable, and

(4)p1(τ)=τ(x)+p(x)τ(x)τ(x)2(5)q1(τ)=q(x)τ(x)2

Let p1=0. Eq (4) simplifies to

τ(x)+p(x)τ(x)=0

This ode is solved resulting in

τ=ep(x)dxdx=ecot(x)dxdx=eln(sin(x))dx=csc(x)dx(6)=ln(csc(x)+cot(x))

Using (6) to evaluate q1 from (5) gives

q1(τ)=q(x)τ(x)2=4csc(x)2csc(x)2(7)=4

Substituting the above in (3) and noting that now p1=0 results in

d2dτ2y(τ)+q1y(τ)=0d2dτ2y(τ)+4y(τ)=0

The above ode is now solved for y(τ).This is second order with constant coefficients homogeneous ODE. In standard form the ODE is

Ay(τ)+By(τ)+Cy(τ)=0

Where in the above A=1,B=0,C=4. Let the solution be y=eλτ. Substituting this into the ODE gives

(1)λ2eτλ+4eτλ=0

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

(2)λ2+4=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=4 into the above gives

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

Hence

λ1=+2iλ2=2i

Which simplifies to

λ1=2iλ2=2i

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

y=eατ(c1cos(βτ)+c2sin(βτ))

Which becomes

y=e0(c1cos(2τ)+c2sin(2τ))

Or

y=c1cos(2τ)+c2sin(2τ)

Will add steps showing solving for IC soon.

The above solution is now transformed back to y(x) using (6) which results in

y(x)=c1cos(2ln(csc(x)+cot(x)))c2sin(2ln(csc(x)+cot(x)))

Will add steps showing solving for IC soon.

Summary of solutions found

y(x)=c1cos(2ln(csc(x)+cot(x)))c2sin(2ln(csc(x)+cot(x)))

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

Time used: 0.450 (sec)

Solve

y+cot(x)y+4ycsc(x)2=0

In normal form the ode

(1)y+cot(x)y+4ycsc(x)2=0

Becomes

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

Where

p(x)=cot(x)q(x)=4csc(x)2

Applying change of variables τ=g(x) to (2) results

(3)d2dτ2y(τ)+p1(ddτy(τ))+q1y(τ)=0

Where τ is the new independent variable, and

(4)p1(τ)=τ(x)+p(x)τ(x)τ(x)2(5)q1(τ)=q(x)τ(x)2

Let q1=c2 where c is some constant. Therefore from (5)

τ=1cq(6)=2csc(x)2cτ=2csc(x)2cot(x)ccsc(x)2

Substituting the above into (4) results in

p1(τ)=τ(x)+p(x)τ(x)τ(x)2=2csc(x)2cot(x)ccsc(x)2+cot(x)2csc(x)2c(2csc(x)2c)2=0

Therefore ode (3) now becomes

y(τ)+p1y(τ)+q1y(τ)=0(7)d2dτ2y(τ)+c2y(τ)=0

The above ode is now solved for y(τ). Since the ode is now constant coefficients, it can be easily solved to give

y(τ)=c1cos(cτ)+c2sin(cτ)

Now from (6)

τ=1cqdx=2csc(x)2dxc=2ln(csc(x)cot(x))c

Substituting the above into the solution obtained gives

y=c1cos(2ln(csc(x)cot(x)))+c2sin(2ln(csc(x)cot(x)))

Will add steps showing solving for IC soon.

Summary of solutions found

y=c1cos(2ln(csc(x)cot(x)))+c2sin(2ln(csc(x)cot(x)))

Maple. Time used: 0.002 (sec). Leaf size: 23
ode:=diff(diff(y(x),x),x)+cot(x)*diff(y(x),x)+4*y(x)*csc(x)^2 = 0; 
dsolve(ode,y(x), singsol=all);
 
y=c1(csc(x)+cot(x))2i+c2(csc(x)+cot(x))2i

Maple trace

Methods for second order ODEs: 
--- Trying classification methods --- 
trying a symmetry of the form [xi=0, eta=F(x)] 
<- linear_1 successful
 

Mathematica. Time used: 0.048 (sec). Leaf size: 25
ode=D[y[x],{x,2}]+Cot[x]*D[y[x],x]+4*y[x]*Csc[x]^2==0; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
y(x)c1cos(2arctanh(cos(x)))c2sin(2arctanh(cos(x)))
Sympy
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(4*y(x)/sin(x)**2 + Derivative(y(x), (x, 2)) + Derivative(y(x), x)/tan(x),0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
NotImplementedError : The given ODE 4*y(x)*tan(x)/sin(x)**2 + tan(x)*Derivative(y(x), (x, 2)) + Derivative(y(x), x) cannot be solved by the factorable group method