Solving a 2nd order ODE Consider
$x''-2x'+x= te^t$
Determine the solution with initial values $x(1) = e,$  $x'(1) = 0.$
I know this looks like and probably is a very easy question, but i'm not getting the right answer when i try and solve putting into quadratic form. Could someone please demonstrate or show me a different method? 
Many thanks :)
 A: This is actually a tricky problem because the right-hand side is a solution of the left-hand side set to zero (the homogeneous solution).  
The homogeneous solution $x^{(H)}$ is 
$$x^{(H)}(t) = A e^{t} + B t e^{t}$$
This is because the characteristic equation has $1$ as a double solution, so we have to put a secular component $t$ onto one of the solutions.
This makes finding the particular solution $x^{(P)}$ difficult because it is a solution to the homogeneous equation.  The way around this is to assume that
$$x^{(P)} = C t^3 e^{t}$$
and solve for $C$:
$$6 C t e^{t} = t e^{t} \implies C = \frac{1}{6}$$
Then solve for $A$ and $B$ using the initial conditions.
A: First we solve the complementary homogeneous equation $x'' - 2x'+x=0$ by presuming a solution of the form $x=e^{rt}$ to yield:
$$e^{rt}\left(r^2-2r+1\right)=0\\(r-1)^2=0$$
So we have repeated roots of our characteristic polynomial yielding a complementary solution $x=c_1e^{t}+c_2te^{t}$.
Recognize that the right hand side of our nonhomogeneous part is not linearly independent to our general solution; we can assume a sufficiently large power of $x$, however, in our particular solution to remedy this.
A: $\newcommand{\bbx}[1]{\,\bbox[15px,border:1px groove navy]{\displaystyle{#1}}\,}
 \newcommand{\braces}[1]{\left\lbrace\,{#1}\,\right\rbrace}
 \newcommand{\bracks}[1]{\left\lbrack\,{#1}\,\right\rbrack}
 \newcommand{\dd}{\mathrm{d}}
 \newcommand{\ds}[1]{\displaystyle{#1}}
 \newcommand{\expo}[1]{\,\mathrm{e}^{#1}\,}
 \newcommand{\ic}{\mathrm{i}}
 \newcommand{\mc}[1]{\mathcal{#1}}
 \newcommand{\mrm}[1]{\mathrm{#1}}
 \newcommand{\on}[1]{\operatorname{#1}}
 \newcommand{\pars}[1]{\left(\,{#1}\,\right)}
 \newcommand{\partiald}[3][]{\frac{\partial^{#1} #2}{\partial #3^{#1}}}
 \newcommand{\root}[2][]{\,\sqrt[#1]{\,{#2}\,}\,}
 \newcommand{\totald}[3][]{\frac{\mathrm{d}^{#1} #2}{\mathrm{d} #3^{#1}}}
 \newcommand{\verts}[1]{\left\vert\,{#1}\,\right\vert}$
$\ds{\bbox[5px,#ffd]{\on{x}''\pars{t} -2\on{x}'\pars{t} + \on{x}\pars{t} = t\expo{t}}\,,\qquad
\begin{array}{c}
\mbox{Initial Conditions}
\\
\left\{\begin{array}{rcl}
\ds{\on{x}\pars{1}} & \ds{=} & \ds{\expo{}}
\\[1mm]
\ds{\on{x}'\pars{1}} & \ds{=} & \ds{0}
\end{array}\right.\end{array}}$


*

*$\ds{\pars{\totald{}{t} - 1}\
\overbrace{\pars{\totald{}{t} - 1}
\on{x}\pars{t}}^{\ds{\on{y}\pars{t}}}\ =\ t\expo{t}}$

\begin{align}
&\totald{\bracks{\expo{-t}\on{y}\pars{t}}}{t} = t
\\[2mm]
&\expo{-t}\on{y}\pars{t} = {1 \over 2}\,t^{2} + a \implies
\on{y}\pars{t} =
{1 \over 2}\,t^{2}\expo{t} + a\expo{t}\,\quad a = \mbox{constant} 
\end{align}


*

*$\ds{\pars{\totald{}{t} - 1}\on{x}\pars{t} =
{1 \over 2}\,t^{2}\expo{t} + a\expo{t}}$

\begin{align}
&\totald{\bracks{\expo{-t}\on{x}\pars{t}}}{t} =
{1 \over 2}\,t^{2} + a
\\[2mm] &\
\expo{-t}\on{x}\pars{t} = {1 \over 6}\,t^{3} + at + b\,,\quad b = \mbox{constant}
\\[2mm] &\
\on{x}\pars{t} = \pars{{1 \over 6}\,t^{3} + at + b}\expo{t}
\\[2mm] &\
\left\{\begin{array}{rcrcl}
\ds{\expo{}a} & \ds{+} & \ds{\expo{}b} & \ds{=} &
\ds{{5 \over 6}\,\expo{}}
\\[1mm]
\ds{2\expo{}a} & \ds{+} & \ds{\expo{}b} & \ds{=} &
\ds{-\,{2 \over 3}\,\expo{}}
\end{array}\right.
\\[2mm] &\ \implies a = -\,{3 \over 2}\ \mbox{and}\
b = {7 \over 3}
\\[5mm] &\
\bbx{\on{x}\pars{t} = {1 \over 6}\pars{t^{3} -
9t + 14}\expo{t}} \\ &
\end{align}
