30.4.5 problem 5

Internal problem ID [7488]
Book : Fundamentals of Differential Equations. By Nagle, Saff and Snider. 9th edition. Boston. Pearson 2018.
Section : Chapter 2, First order differential equations. Section 2.5, Special Integrating Factors. Exercises. page 69
Problem number : 5
Date solved : Tuesday, September 30, 2025 at 04:39:25 PM
CAS classification : [_linear]

\begin{align*} x^{2} \sin \left (x \right )+4 y+x y^{\prime }&=0 \end{align*}
Maple. Time used: 0.001 (sec). Leaf size: 40
ode:=x^2*sin(x)+4*y(x)+x*diff(y(x),x) = 0; 
dsolve(ode,y(x), singsol=all);
 
\[ y = \frac {\left (x^{5}-20 x^{3}+120 x \right ) \cos \left (x \right )+\left (-5 x^{4}+60 x^{2}-120\right ) \sin \left (x \right )+c_1}{x^{4}} \]
Mathematica. Time used: 0.034 (sec). Leaf size: 40
ode=( x^2*Sin[x] + 4*y[x]  )+( x )*D[y[x],x]==0; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\begin{align*} y(x)&\to \frac {-5 \left (x^4-12 x^2+24\right ) \sin (x)+x \left (x^4-20 x^2+120\right ) \cos (x)+c_1}{x^4} \end{align*}
Sympy. Time used: 0.421 (sec). Leaf size: 49
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(x**2*sin(x) + x*Derivative(y(x), x) + 4*y(x),0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
\[ y{\left (x \right )} = \frac {C_{1}}{x^{4}} + x \cos {\left (x \right )} - 5 \sin {\left (x \right )} - \frac {20 \cos {\left (x \right )}}{x} + \frac {60 \sin {\left (x \right )}}{x^{2}} + \frac {120 \cos {\left (x \right )}}{x^{3}} - \frac {120 \sin {\left (x \right )}}{x^{4}} \]