29.7.28 problem 203

Internal problem ID [4803]
Book : Ordinary differential equations and their solutions. By George Moseley Murphy. 1960
Section : Various 7
Problem number : 203
Date solved : Sunday, March 30, 2025 at 03:58:37 AM
CAS classification : [_separable]

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

Maple. Time used: 0.010 (sec). Leaf size: 22
ode:=x*diff(y(x),x) = y(x)-cot(y(x))^2; 
dsolve(ode,y(x), singsol=all);
 
\[ \ln \left (x \right )+c_1 +\int _{}^{y}\frac {1}{\cot \left (\textit {\_a} \right )^{2}-\textit {\_a}}d \textit {\_a} = 0 \]
Mathematica. Time used: 3.298 (sec). Leaf size: 49
ode=x D[y[x],x]==y[x]-x Cot[y[x]]^2/x; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\[ y(x)\to \text {InverseFunction}\left [\int _1^{\text {$\#$1}}\frac {\cos (2 K[1])-1}{K[1] \cos (2 K[1])+\cos (2 K[1])-K[1]+1}dK[1]\&\right ][\log (x)+c_1] \]
Sympy. Time used: 0.510 (sec). Leaf size: 20
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(x*Derivative(y(x), x) - y(x) + tan(y(x))**(-2),0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
\[ \int \limits ^{y{\left (x \right )}} \frac {\tan ^{2}{\left (y \right )}}{y \tan ^{2}{\left (y \right )} - 1}\, dy = C_{1} + \log {\left (x \right )} \]