7.2.7 problem 8

Internal problem ID [25]
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 : 8
Date solved : Tuesday, March 04, 2025 at 10:38:55 AM
CAS classification : [[_linear, `class A`]]

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

Maple. Time used: 0.000 (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+c_1 \,{\mathrm e}^{-x} \]
Mathematica. Time used: 0.049 (sec). Leaf size: 21
ode=D[y[x],x]==x^2-y[x]; 
DSolve[ode,y[x],x,IncludeSingularSolutions->True]
 
\[ y(x)\to x^2-2 x+c_1 e^{-x}+2 \]
Sympy. Time used: 0.137 (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 \]