81.6.10 problem 10

Internal problem ID [18622]
Book : A short course on differential equations. By Donald Francis Campbell. Maxmillan company. London. 1907
Section : Chapter V. Homogeneous linear differential equations. Exact equations. Exercises at page 69
Problem number : 10
Date solved : Monday, March 31, 2025 at 05:46:50 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.307 (sec). Leaf size: 27
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 = \left (\int \cos \left (x \right ) \operatorname {arctanh}\left (\sec \left (x \right )\right )d x +\left (c_1 -\sin \left (x \right )\right ) \operatorname {arctanh}\left (\sec \left (x \right )\right )+c_2 \right ) \sin \left (x \right ) \]
Mathematica. Time used: 0.04 (sec). Leaf size: 19
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 \sin (x) (-c_1 \text {arctanh}(\cos (x))+x+c_2) \]
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