72.5.24 problem 4 (m)

Internal problem ID [19453]
Book : DIFFERENTIAL EQUATIONS WITH APPLICATIONS AND HISTORICAL NOTES by George F. Simmons. 3rd edition. 2017. CRC press, Boca Raton FL.
Section : Chapter 2. First order equations. Section 9 (Integrating Factors). Problems at page 80
Problem number : 4 (m)
Date solved : Thursday, October 02, 2025 at 04:28:23 PM
CAS classification : [_linear]

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