85.33.46 problem 46

Internal problem ID [22669]
Book : Applied Differential Equations. By Murray R. Spiegel. 3rd edition. 1980. Pearson. ISBN 978-0130400970
Section : Chapter two. First order and simple higher order ordinary differential equations. A Exercises at page 65
Problem number : 46
Date solved : Thursday, October 02, 2025 at 09:03:29 PM
CAS classification : [_linear]

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

With initial conditions

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