72.14.1 problem 1

Internal problem ID [19623]
Book : DIFFERENTIAL EQUATIONS WITH APPLICATIONS AND HISTORICAL NOTES by George F. Simmons. 3rd edition. 2017. CRC press, Boca Raton FL.
Section : Chapter 3. Second order linear equations. Section 19. The Method of Variation of Parameters. Problems at page 135
Problem number : 1
Date solved : Thursday, October 02, 2025 at 04:40:47 PM
CAS classification : [[_2nd_order, _with_linear_symmetries]]

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