26.8.10 problem Exercise 21.13, page 231

Internal problem ID [7094]
Book : Ordinary Differential Equations, By Tenenbaum and Pollard. Dover, NY 1963
Section : Chapter 4. Higher order linear differential equations. Lesson 21. Undetermined Coefficients
Problem number : Exercise 21.13, page 231
Date solved : Tuesday, September 30, 2025 at 04:21:22 PM
CAS classification : [[_2nd_order, _missing_y]]

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