15.8.24 problem 25

Internal problem ID [3027]
Book : Differential Equations by Alfred L. Nelson, Karl W. Folley, Max Coral. 3rd ed. DC heath. Boston. 1964
Section : Exercise 12, page 46
Problem number : 25
Date solved : Tuesday, March 04, 2025 at 03:45:40 PM
CAS classification : [_linear]

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

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