15.6.1 problem 1

Internal problem ID [2958]
Book : Differential Equations by Alfred L. Nelson, Karl W. Folley, Max Coral. 3rd ed. DC heath. Boston. 1964
Section : Exercise 10, page 41
Problem number : 1
Date solved : Tuesday, March 04, 2025 at 03:35:57 PM
CAS classification : [_linear]

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

Maple. Time used: 0.000 (sec). Leaf size: 16
ode:=x*diff(y(x),x)+2*y(x) = x^2; 
dsolve(ode,y(x), singsol=all);
 
\[ y = \frac {x^{4}+4 c_{1}}{4 x^{2}} \]
Mathematica. Time used: 0.03 (sec). Leaf size: 19
ode=x*D[y[x],x]+2*y[x]==x^2; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\[ y(x)\to \frac {x^2}{4}+\frac {c_1}{x^2} \]
Sympy. Time used: 0.170 (sec). Leaf size: 12
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(-x**2 + x*Derivative(y(x), x) + 2*y(x),0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
\[ y{\left (x \right )} = \frac {C_{1} + \frac {x^{4}}{4}}{x^{2}} \]