6.1.2 problem 2(b)

Internal problem ID [1520]
Book : Elementary differential equations with boundary value problems. William F. Trench. Brooks/Cole 2001
Section : Chapter 1, Introduction. Section 1.2 Page 14
Problem number : 2(b)
Date solved : Tuesday, September 30, 2025 at 04:35:12 AM
CAS classification : [_linear]

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