23.1.345 problem 331

Internal problem ID [4952]
Book : Ordinary differential equations and their solutions. By George Moseley Murphy. 1960
Section : Part II. Chapter 1. THE DIFFERENTIAL EQUATION IS OF FIRST ORDER AND OF FIRST DEGREE, page 223
Problem number : 331
Date solved : Tuesday, September 30, 2025 at 09:04:09 AM
CAS classification : [_linear]

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