72.6.5 problem 2 (e)

Internal problem ID [19459]
Book : DIFFERENTIAL EQUATIONS WITH APPLICATIONS AND HISTORICAL NOTES by George F. Simmons. 3rd edition. 2017. CRC press, Boca Raton FL.
Section : Chapter 2. First order equations. Section 10 (Linear equations). Problems at page 82
Problem number : 2 (e)
Date solved : Thursday, October 02, 2025 at 04:28:38 PM
CAS classification : [_linear]

\begin{align*} y^{\prime }+y \cot \left (x \right )&=2 x \csc \left (x \right ) \end{align*}
Maple. Time used: 0.001 (sec). Leaf size: 12
ode:=diff(y(x),x)+y(x)*cot(x) = 2*x*csc(x); 
dsolve(ode,y(x), singsol=all);
 
\[ y = \left (x^{2}+c_1 \right ) \csc \left (x \right ) \]
Mathematica. Time used: 0.022 (sec). Leaf size: 14
ode=D[y[x],x]+y[x]*Cot[x]==2*x*Csc[x]; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\begin{align*} y(x)&\to \left (x^2+c_1\right ) \csc (x) \end{align*}
Sympy. Time used: 0.478 (sec). Leaf size: 10
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(-2*x/sin(x) + y(x)/tan(x) + Derivative(y(x), x),0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
\[ y{\left (x \right )} = \frac {C_{1} + x^{2}}{\sin {\left (x \right )}} \]