67.2.46 problem Problem 18(k)

Internal problem ID [13924]
Book : APPLIED DIFFERENTIAL EQUATIONS The Primary Course by Vladimir A. Dobrushkin. CRC Press 2015
Section : Chapter 4, Second and Higher Order Linear Differential Equations. Problems page 221
Problem number : Problem 18(k)
Date solved : Wednesday, March 05, 2025 at 10:22:24 PM
CAS classification : [[_2nd_order, _linear, _nonhomogeneous]]

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

Maple. Time used: 0.011 (sec). Leaf size: 37
ode:=diff(diff(y(x),x),x)+cot(x)*diff(y(x),x)-csc(x)^2*y(x) = cos(x); 
dsolve(ode,y(x), singsol=all);
 
\[ y = -\cos \left (\frac {x}{2}\right )^{2}+\frac {1}{2}+\frac {\sec \left (\frac {x}{2}\right ) \csc \left (\frac {x}{2}\right ) x}{4}+\tan \left (\frac {x}{2}\right ) c_{1} +\cot \left (\frac {x}{2}\right ) c_{2} \]
Mathematica. Time used: 0.205 (sec). Leaf size: 59
ode=D[y[x],{x,2}]+Cot[x]*D[y[x],x]-Csc[x]^2*y[x]==Cos[x]; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\[ y(x)\to \frac {\int _1^x\cos (K[1]) \cot (K[1]) \sqrt {\sin ^2(K[1])}dK[1]-\cos (x) \left (\sqrt {\sin ^2(x)}+i c_2\right )+c_1}{\sqrt {\sin ^2(x)}} \]
Sympy
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(-y(x)/sin(x)**2 - cos(x) + Derivative(y(x), (x, 2)) + Derivative(y(x), x)/tan(x),0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
NotImplementedError : The given ODE -2*y(x)/sin(2*x) - sin(x) + tan(x)*Derivative(y(x), (x, 2)) + Derivative(y(x), x) cannot be solved by the factorable group method