2.1.2 problem 2

Internal problem ID [652]
Book : Differential equations and linear algebra, 3rd ed., Edwards and Penney
Section : Section 1.2. Integrals as general and particular solutions. Page 16
Problem number : 2
Date solved : Tuesday, September 30, 2025 at 04:05:00 AM
CAS classification : [_quadrature]

\begin{align*} y^{\prime }&=\left (-2+x \right )^{2} \end{align*}

With initial conditions

\begin{align*} y \left (2\right )&=1 \\ \end{align*}
Maple. Time used: 0.024 (sec). Leaf size: 13
ode:=diff(y(x),x) = (-2+x)^2; 
ic:=[y(2) = 1]; 
dsolve([ode,op(ic)],y(x), singsol=all);
 
\[ y = \frac {\left (-2+x \right )^{3}}{3}+1 \]
Mathematica. Time used: 0.002 (sec). Leaf size: 22
ode=D[y[x],x]==(-2+x)^2; 
ic=y[2]==1; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\begin{align*} y(x)&\to \frac {1}{3} \left (x^3-6 x^2+12 x-5\right ) \end{align*}
Sympy. Time used: 0.108 (sec). Leaf size: 19
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(-(x - 2)**2 + Derivative(y(x), x),0) 
ics = {y(2): 1} 
dsolve(ode,func=y(x),ics=ics)
 
\[ y{\left (x \right )} = \frac {x^{3}}{3} - 2 x^{2} + 4 x - \frac {5}{3} \]