29.1.16 problem 15

Internal problem ID [4623]
Book : Ordinary differential equations and their solutions. By George Moseley Murphy. 1960
Section : Various 1
Problem number : 15
Date solved : Sunday, March 30, 2025 at 03:30:52 AM
CAS classification : [_linear]

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

Maple. Time used: 0.002 (sec). Leaf size: 14
ode:=diff(y(x),x) = x*csc(x)-y(x)*cot(x); 
dsolve(ode,y(x), singsol=all);
 
\[ y = \left (\frac {x^{2}}{2}+c_1 \right ) \csc \left (x \right ) \]
Mathematica. Time used: 0.038 (sec). Leaf size: 19
ode=D[y[x],x]==x*Csc[x]-y[x]*Cot[x]; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\[ y(x)\to \frac {1}{2} \left (x^2+2 c_1\right ) \csc (x) \]
Sympy. Time used: 0.783 (sec). Leaf size: 12
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(-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} + \frac {x^{2}}{2}}{\sin {\left (x \right )}} \]