78.6.7 problem 2 (g)

Internal problem ID [18096]
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 (g)
Date solved : Thursday, March 13, 2025 at 11:36:03 AM
CAS classification : [_linear]

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

Maple. Time used: 0.001 (sec). Leaf size: 19
ode:=y(x)-x+x*y(x)*cot(x)+x*diff(y(x),x) = 0; 
dsolve(ode,y(x), singsol=all);
 
\[ y = \frac {1-\cot \left (x \right ) x +c_1 \csc \left (x \right )}{x} \]
Mathematica. Time used: 0.059 (sec). Leaf size: 21
ode=y[x]-x+x*y[x]*Cot[x]+x*D[y[x],x]==0; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\[ y(x)\to \frac {-x \cot (x)+c_1 \csc (x)+1}{x} \]
Sympy. Time used: 0.599 (sec). Leaf size: 27
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(x*y(x)/tan(x) + x*Derivative(y(x), x) - x + y(x),0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
\[ y{\left (x \right )} = \frac {C_{1} \sqrt {\frac {1}{\cos ^{2}{\left (x \right )}}}}{x \tan {\left (x \right )}} - \frac {1}{\tan {\left (x \right )}} + \frac {1}{x} \]