35.8.26 problem 26

Internal problem ID [6233]
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 : Sunday, March 30, 2025 at 10:44:12 AM
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.021 (sec). Leaf size: 9
ode:=-y(x)+x*diff(y(x),x) = x^2; 
ic:=y(2) = 6; 
dsolve([ode,ic],y(x), singsol=all);
 
\[ y = \left (x +1\right ) x \]
Mathematica. Time used: 0.029 (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]
 
\[ y(x)\to x (x+1) \]
Sympy. Time used: 0.221 (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 ) \]