89.5.12 problem 12

Internal problem ID [24362]
Book : A short course in Differential Equations. Earl D. Rainville. Second edition. 1958. Macmillan Publisher, NY. CAT 58-5010
Section : Chapter 2. Equations of the first order and first degree. Exercises at page 43
Problem number : 12
Date solved : Thursday, October 02, 2025 at 10:22:11 PM
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.045 (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]
 
\begin{align*} y(x)&\to \frac {-x \cot (x)+c_1 \csc (x)+1}{x} \end{align*}
Sympy. Time used: 0.944 (sec). Leaf size: 27
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(x*y(x)*cot(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} \]