38.6.9 problem 9

Internal problem ID [8439]
Book : A First Course in Differential Equations with Modeling Applications by Dennis G. Zill. 12 ed. Metric version. 2024. Cengage learning.
Section : Chapter 2. First order differential equations. Section 2.3 Linear equations. Exercises 2.3 at page 63
Problem number : 9
Date solved : Tuesday, September 30, 2025 at 05:36:47 PM
CAS classification : [_linear]

\begin{align*} x y^{\prime }-y&=x^{2} \sin \left (x \right ) \end{align*}
Maple. Time used: 0.001 (sec). Leaf size: 12
ode:=-y(x)+x*diff(y(x),x) = x^2*sin(x); 
dsolve(ode,y(x), singsol=all);
 
\[ y = \left (-\cos \left (x \right )+c_1 \right ) x \]
Mathematica. Time used: 0.021 (sec). Leaf size: 20
ode=x*D[y[x],x]-y[x]==x^2*Sin[x]; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\begin{align*} y(x)&\to x \left (\int _1^x\sin (K[1])dK[1]+c_1\right ) \end{align*}
Sympy. Time used: 0.189 (sec). Leaf size: 8
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(-x**2*sin(x) + x*Derivative(y(x), x) - y(x),0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
\[ y{\left (x \right )} = x \left (C_{1} - \cos {\left (x \right )}\right ) \]