78.5.24 problem 4 (m)

Internal problem ID [18096]
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 : Monday, March 31, 2025 at 05:10:00 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.03 (sec). Leaf size: 19
ode=D[y[x],x]+y[x]/x==Sin[x]; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\[ y(x)\to \frac {\sin (x)-x \cos (x)+c_1}{x} \]
Sympy. Time used: 0.264 (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} \]