7.2.8 problem 9

Internal problem ID [26]
Book : Elementary Differential Equations. By C. Henry Edwards, David E. Penney and David Calvis. 6th edition. 2008
Section : Chapter 1. First order differential equations. Section 1.3. Problems at page 27
Problem number : 9
Date solved : Saturday, March 29, 2025 at 04:26:18 PM
CAS classification : [[_linear, `class A`]]

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

Maple. Time used: 0.001 (sec). Leaf size: 17
ode:=diff(y(x),x) = x^2-y(x)-2; 
dsolve(ode,y(x), singsol=all);
 
\[ y = x^{2}-2 x +{\mathrm e}^{-x} c_1 \]
Mathematica. Time used: 0.112 (sec). Leaf size: 19
ode=D[y[x],x]==x^2-y[x]-2; 
DSolve[ode,y[x],x,IncludeSingularSolutions->True]
 
\[ y(x)\to (x-2) x+c_1 e^{-x} \]
Sympy. Time used: 0.133 (sec). Leaf size: 14
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(-x**2 + y(x) + Derivative(y(x), x) + 2,0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
\[ y{\left (x \right )} = C_{1} e^{- x} + x^{2} - 2 x \]