77.5.1 problem 1

Internal problem ID [20381]
Book : A Text book for differentional equations for postgraduate students by Ray and Chaturvedi. First edition, 1958. BHASKAR press. INDIA
Section : Chapter II. Equations of first order and first degree. Exercise II (D) at page 16
Problem number : 1
Date solved : Thursday, October 02, 2025 at 05:49:32 PM
CAS classification : [_linear]

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