29.8.26 problem 26

Internal problem ID [7368]
Book : Mathematical Methods in the Physical Sciences. third edition. Mary L. Boas. John Wiley. 2006
Section : Chapter 8, Ordinary differential equations. Section 13. Miscellaneous problems. page 466
Problem number : 26
Date solved : Tuesday, September 30, 2025 at 04:29:55 PM
CAS classification : [_linear]

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

With initial conditions

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