44.17.18 problem 2(c) solving directly

Internal problem ID [9375]
Book : Differential Equations: Theory, Technique, and Practice by George Simmons, Steven Krantz. McGraw-Hill NY. 2007. 1st Edition.
Section : Chapter 4. Power Series Solutions and Special Functions. Section 4.2. Series Solutions of First-Order Differential Equations Page 162
Problem number : 2(c) solving directly
Date solved : Tuesday, September 30, 2025 at 06:17:56 PM
CAS classification : [_linear]

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