General Solution of $y'' -2y' +y = e^x$ I am searching for the general Solution of $$y'' -2y' +y = e^x$$
I know that $y = y_{part} + y_{hom}$ and the characteristic polynomial $p(T) = T^2 -2T +1 \stackrel{p(T) =0}\implies a =1  $ is the the only
root and $y_{hom} = C_1\exp(x)+ C_2x\exp(x)$ with $C_1,C_2 \in \mathbb{C}$. But I don't know how to find $y_{part}$.
 A: Hint
Life could be easier starting with $y=z\, e^x$ which makes the equation to be
$$z''=1$$
I am sure that you can take it from here.
A: Hint: Let $y_p=Ax^2e^x$ and substitute in your equation to find $A$.
A: When the function on the RHS is of the form $f(x) =e^{ax}$, we can find the particular integral by using the formula: $$y_p (x) = \frac{1}{F(a)} e^{ax}$$ Here, $F(D) = D^2-2D+1$ and the $a = 1$, so we have $F(a)= F(1)=0$. 
In this case, what we do is: as $(D-1)$ is a factor of $F(D)$ with multiplicity $2$, we get, $$y_p (x) = x^2 \frac{1}{F’’(a)} e^{ax}$$
This gives us: $$y_p(x) = \frac{x^2e^x}{2}$$
A: One must get the idea and proof of the standard technique. We can write the given equation as $$y''-y' - (y'-y) =e^{x} $$ and then put $z=y'-y$ to get $$z'-z=e^{x} $$ Multiplication by $e^{-x} $ gives us $$(e^{-x} z) '=1$$ On integrating we get $$ze^{-x} =x+c$$ so that $$y' - y=z=xe^x+ce^x$$ Again multiplication by $e^{-x} $ gives us $$(ye^{-x}) '=x+c$$ Integrating this we get $$ye^{-x} =\frac{x^2}{2}+cx+d$$ and thus the general solution is $$y=e^x\left(d+cx+\frac{x^2}{2}\right)$$

This is how one solves a general differential equation with constant coefficients. You should also observe that there is no concept of general solution based on characteristic equation and particular integral. Most textbooks offer a completely mechanical procedure to obtain general solution based on nature of roots of characteristic equation and certain forms of particular integral for well known functions appearing on right side of the given differential equation. Frankly speaking I never liked that kind of spoon feeding without any proof. 
