differential equation: $ y''-2y'+y=x\sin x$ Someone can help me to solve this differential equation with method of undetermined coefficient.
$$ y''-2y'+y=x\sin x$$
Thanks
 A: So first you need to get the solution to the homogeneous ODE, and the characteristic equation is $$r^2-2r+1=0=(r-1)^2,$$ so you have two repeated real roots, you know what to do with that from there. Now onto the particular solution. Since we have a $\sin x$ multiplied by a polynomial, we have $$y_p = (Ax+B)\sin x + (Cx+D)\cos x$$
Now from here you have all of the materials needed to solve the problem. Take the derivative of the particular solution twice, sub in, and equate coefficients.
A: As the DE is linear we have
$$
y = y_h + y_p
$$
with
$$
\cases{
y''_h-2y'_h+y_h = 0\\
y''_p-2y'_p+y_p = x\sin x
}
$$
The homogeneous has the solution
$$
y_h(x) = c_1 e^x+c_2 x e^x
$$
now for the particular we propose a solution (variation of constants method) such that
$$
y_p = c_1(x) e^x+c_2(x)x e^x
$$
from $y''_p-2y'_p+y_p = x \sin x$ we obtain
$$
e^x \left(c_1''(x)+x c_2''(x)+2 c_2'(x)\right)-x \sin (x) = 0
$$
now as $c_1(x), c_2(x)$ are independent we equate
$$
\cases{
c''_1(x)e^x = x \sin x\\
xc''_2(x)+2c'_2(x) = 0}
$$
Here as $y_p$ is a particular solution we can specify the integration constants at our profit. Now solving for $c_1(x), c_2(x)$ we have finally
$$
y = y_h + y_p
$$
