44.11.14 problem 3

Internal problem ID [9284]
Book : Differential Equations: Theory, Technique, and Practice by George Simmons, Steven Krantz. McGraw-Hill NY. 2007. 1st Edition.
Section : Chapter 2. Second-Order Linear Equations. Section 2.3. THE METHOD OF VARIATION OF PARAMETERS. Page 71
Problem number : 3
Date solved : Tuesday, September 30, 2025 at 06:16:06 PM
CAS classification : [[_2nd_order, _with_linear_symmetries]]

\begin{align*} y^{\prime \prime }-2 y^{\prime }+y&=2 x \end{align*}
Maple. Time used: 0.002 (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.01 (sec). Leaf size: 26
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 e^{-x} \left (2 e^x (x-2)+c_2 x+c_1\right ) \end{align*}
Sympy. Time used: 0.092 (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 \]