24.1.14 problem 3(c)

Internal problem ID [4203]
Book : Elementary Differential equations, Chaundy, 1969
Section : Exercises 3, page 60
Problem number : 3(c)
Date solved : Sunday, March 30, 2025 at 02:42:37 AM
CAS classification : [_linear]

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

Maple. Time used: 0.001 (sec). Leaf size: 19
ode:=tan(x)*diff(y(x),x)+y(x) = cot(x); 
dsolve(ode,y(x), singsol=all);
 
\[ y = \left (\cos \left (x \right )+\ln \left (\csc \left (x \right )-\cot \left (x \right )\right )+c_1 \right ) \csc \left (x \right ) \]
Mathematica. Time used: 0.066 (sec). Leaf size: 29
ode=Tan[x]*D[y[x],x]+y[x]==Cot[x]; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\[ y(x)\to \csc (x) \left (\cos (x)+\log \left (\sin \left (\frac {x}{2}\right )\right )-\log \left (\cos \left (\frac {x}{2}\right )\right )+c_1\right ) \]
Sympy. Time used: 1.070 (sec). Leaf size: 27
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(y(x) + tan(x)*Derivative(y(x), x) - 1/tan(x),0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
\[ y{\left (x \right )} = \frac {C_{1} + \frac {\log {\left (\cos {\left (x \right )} - 1 \right )}}{2} - \frac {\log {\left (\cos {\left (x \right )} + 1 \right )}}{2} + \cos {\left (x \right )}}{\sin {\left (x \right )}} \]