74.7.46 problem 46

Internal problem ID [16044]
Book : INTRODUCTORY DIFFERENTIAL EQUATIONS. Martha L. Abell, James P. Braselton. Fourth edition 2014. ElScAe. 2014
Section : Chapter 2. First Order Equations. Exercises 2.5, page 64
Problem number : 46
Date solved : Thursday, March 13, 2025 at 07:36:29 AM
CAS classification : [_separable]

\begin{align*} y^{\prime }-\frac {2 y}{x}&=-x^{2} y \end{align*}

Maple. Time used: 0.001 (sec). Leaf size: 15
ode:=diff(y(x),x)-2*y(x)/x = -x^2*y(x); 
dsolve(ode,y(x), singsol=all);
 
\[ y = c_{1} x^{2} {\mathrm e}^{-\frac {x^{3}}{3}} \]
Mathematica. Time used: 0.05 (sec). Leaf size: 35
ode=D[y[x],x]-(2/x)*y[x]==-x^2*y[x]; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\begin{align*} y(x)\to c_1 \exp \left (\int _1^x\frac {2-K[1]^3}{K[1]}dK[1]\right ) \\ y(x)\to 0 \\ \end{align*}
Sympy. Time used: 0.276 (sec). Leaf size: 14
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(x**2*y(x) + Derivative(y(x), x) - 2*y(x)/x,0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
\[ y{\left (x \right )} = C_{1} x^{2} e^{- \frac {x^{3}}{3}} \]