2.2.7 problem 8

Internal problem ID [667]
Book : Differential equations and linear algebra, 3rd ed., Edwards and Penney
Section : Section 1.3. Slope fields and solution curves. Page 26
Problem number : 8
Date solved : Tuesday, September 30, 2025 at 04:05:12 AM
CAS classification : [[_linear, `class A`]]

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