68.5.17 problem 17

Internal problem ID [17268]
Book : INTRODUCTORY DIFFERENTIAL EQUATIONS. Martha L. Abell, James P. Braselton. Fourth edition 2014. ElScAe. 2014
Section : Chapter 2. First Order Equations. Exercises 2.3, page 49
Problem number : 17
Date solved : Thursday, October 02, 2025 at 02:00:28 PM
CAS classification : [_linear]

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