89.5.11 problem 11

Internal problem ID [24361]
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 : 11
Date solved : Thursday, October 02, 2025 at 10:22:08 PM
CAS classification : [_linear]

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