particular solution guess to $2e^x + e^{-x}$ Why is the guess to the particular solution of $y''-2y'+y = 2e^x + e^{-x}$ equal to $Ax^2*e^x+Be^{-x}$ and not $Ae^x+Be^{-x}$?
 A: This is because $1$ is a double root of the characteristic equation $\lambda^2-2\lambda +1=0$. So $e^{ x}$ and $xe^{x}$ are both solutions of the homogeneous equation, and we have to go to $x^\color{red}{2} e^x$ (next power of $x$) when looking for a particular solution.
A: Given that $y''-2y'+y = 2e^x + e^{-x}\implies (D^2-2D+1)y=2e^x + e^{-x}$, where $D \equiv \frac{d}{dx}$
The trial solution is $m^2-2m+1=0\implies (m-1)^2=0\implies m=1, 1$
Since the trial solution gives repeated roots, so
Complementary function (C.F.) $$y=(Ax+B)e^x$$ where $A, B$ are integrating constants.
Now the Particular Integral (P.I.)$\quad=\frac{1}{D^2-2D+1}(2e^x + e^{-x})$
$=\frac{1}{(1-D)^2}(2e^x + e^{-x})$
$= 2 \frac{x^2}{2}e^{x}+\frac{e^{-x}}{4}$
$=x^2 e^{x}+\frac{e^{-x}}{4}$
So the general solution of the given differential equation is $$y(x)=(Ax+B)e^x+x^2 e^{x}+\frac{e^{-x}}{4}$$


Consider a differential equation of the form $f(D)y=X$
If $X=e^{ax}$, then
$1.$ P.I.$\quad = \frac{1}{f(D)}e^{ax}=\frac{e^{ax}}{f(a)}$, if $f(a)\neq 0$
$2.$ P.I.$\quad =\frac{1}{(D-a)^n}e^{ax}=\frac{x^n}{n!}e^{ax}$

