67.2.46 problem Problem 18(k)

Internal problem ID [13932]
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 : Monday, March 31, 2025 at 08:18:30 AM
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.009 (sec). Leaf size: 30
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 = \frac {\left (\left (-2 c_1 +2 c_2 -\sin \left (x \right )\right ) \cos \left (x \right )+x +2 c_1 +2 c_2 \right ) \csc \left (x \right )}{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