73.4.16 problem 5.2 (f)

Internal problem ID [15027]
Book : Ordinary Differential Equations. An introduction to the fundamentals. Kenneth B. Howell. second edition. CRC Press. FL, USA. 2020
Section : Chapter 5. LINEAR FIRST ORDER EQUATIONS. Additional exercises. page 103
Problem number : 5.2 (f)
Date solved : Monday, March 31, 2025 at 01:13:14 PM
CAS classification : [_linear]

\begin{align*} x^{2} y^{\prime }+2 x y&=\sin \left (x \right ) \end{align*}

Maple. Time used: 0.001 (sec). Leaf size: 14
ode:=x^2*diff(y(x),x)+2*x*y(x) = sin(x); 
dsolve(ode,y(x), singsol=all);
 
\[ y = \frac {-\cos \left (x \right )+c_1}{x^{2}} \]
Mathematica. Time used: 0.034 (sec). Leaf size: 22
ode=x^2*D[y[x],x]+2*x*y[x]==Sin[x]; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\[ y(x)\to \frac {\int _1^x\sin (K[1])dK[1]+c_1}{x^2} \]
Sympy. Time used: 0.379 (sec). Leaf size: 10
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(x**2*Derivative(y(x), x) + 2*x*y(x) - sin(x),0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
\[ y{\left (x \right )} = \frac {C_{1} - \cos {\left (x \right )}}{x^{2}} \]