85.21.4 problem 1 (d)

Internal problem ID [22567]
Book : Applied Differential Equations. By Murray R. Spiegel. 3rd edition. 1980. Pearson. ISBN 978-0130400970
Section : Chapter two. First order and simple higher order ordinary differential equations. A Exercises at page 55
Problem number : 1 (d)
Date solved : Thursday, October 02, 2025 at 08:51:44 PM
CAS classification : [_linear]

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