34.11.3 problem 28

Internal problem ID [8024]
Book : Schaums Outline. Theory and problems of Differential Equations, 1st edition. Frank Ayres. McGraw Hill 1952
Section : Chapter 16. Linear equations with constant coefficients (Short methods). Supplemetary problems. Page 107
Problem number : 28
Date solved : Tuesday, September 30, 2025 at 05:14:22 PM
CAS classification : [[_2nd_order, _linear, _nonhomogeneous]]

\begin{align*} y^{\prime \prime }-4 y^{\prime }+4 y&={\mathrm e}^{x}+x \,{\mathrm e}^{2 x} \end{align*}
Maple. Time used: 0.003 (sec). Leaf size: 24
ode:=diff(diff(y(x),x),x)-4*diff(y(x),x)+4*y(x) = exp(x)+x*exp(2*x); 
dsolve(ode,y(x), singsol=all);
 
\[ y = \frac {\left (x^{3}+6 c_1 x +6 c_2 \right ) {\mathrm e}^{2 x}}{6}+{\mathrm e}^{x} \]
Mathematica. Time used: 0.133 (sec). Leaf size: 66
ode=D[y[x],{x,2}]-4*D[y[x],x]+4*y[x]==Exp[x]+x*Exp[2*x]; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\begin{align*} y(x)&\to \frac {1}{2} e^x \left (2 e^x \int _1^x\left (-K[1]-e^{-K[1]}\right ) K[1]dK[1]+e^x x^3+2 x \left (-1+c_2 e^x\right )+2 c_1 e^x\right ) \end{align*}
Sympy. Time used: 0.169 (sec). Leaf size: 20
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(-x*exp(2*x) + 4*y(x) - exp(x) - 4*Derivative(y(x), x) + Derivative(y(x), (x, 2)),0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
\[ y{\left (x \right )} = \left (\left (C_{1} + x \left (C_{2} + \frac {x^{2}}{6}\right )\right ) e^{x} + 1\right ) e^{x} \]