30.2.1 problem 1

Internal problem ID [7429]
Book : Fundamentals of Differential Equations. By Nagle, Saff and Snider. 9th edition. Boston. Pearson 2018.
Section : Chapter 2, First order differential equations. Section 2.3, Linear equations. Exercises. page 54
Problem number : 1
Date solved : Tuesday, September 30, 2025 at 04:32:38 PM
CAS classification : [_linear]

\begin{align*} x^{2} y^{\prime }+\sin \left (x \right )-y&=0 \end{align*}
Maple. Time used: 0.002 (sec). Leaf size: 27
ode:=x^2*diff(y(x),x)+sin(x)-y(x) = 0; 
dsolve(ode,y(x), singsol=all);
 
\[ y = \left (-\int \frac {\sin \left (x \right ) {\mathrm e}^{\frac {1}{x}}}{x^{2}}d x +c_1 \right ) {\mathrm e}^{-\frac {1}{x}} \]
Mathematica. Time used: 0.048 (sec). Leaf size: 38
ode=x^2*D[y[x],x]+Sin[x]-y[x]==0; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\begin{align*} y(x)&\to e^{-1/x} \left (\int _1^x-\frac {e^{\frac {1}{K[1]}} \sin (K[1])}{K[1]^2}dK[1]+c_1\right ) \end{align*}
Sympy. Time used: 5.241 (sec). Leaf size: 27
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(x**2*Derivative(y(x), x) - y(x) + sin(x),0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
\[ - \int \frac {y{\left (x \right )} e^{\frac {1}{x}}}{x^{2}}\, dx + \int \frac {e^{\frac {1}{x}} \sin {\left (x \right )}}{x^{2}}\, dx = C_{1} \]