particular solution of $y''-2y'+2y = \sin(x)$ I'm trying to solve:
$y''-2y'+2y = \sin(x)$
so, I got $-i$ and $+i$ as solutions for the associated eq. to $y''-2y'+2y = 0$ 
since the coefficient of $x$ is $1$ and so is the coefficient of $i$,
I tought that the particular solution should be $x(A \cdot \sin(x) + B \cdot \cos(x))$
but calculating the ODE with my pc, seems like the particular solution must be $A \cdot \sin(x) + B \cdot \cos(x)$
so what is that I'm getting wrong?
 A: The characteristic equation is
$$x^2-2x+2=0.$$
the roots are
$1+i$ and $1-i $.
they are different from $1.i $, thus
the particular solution will be
$$y_p=A\sin (x)+B\cos (x) $$
A: The solution of the associated characteristic equation is 
$$r_{1,2} = 1 \pm \mathrm{i}$$
for which we note that the product of the roots $r_1 r_2 = 2$ and the sum $r_1 + r_2 = 2$. Therefore, the complete solution to your ODE looks like
$$ y(x) = \mathrm{e}^{x} (A \cos{x} + B \sin{x} ) + y_p(x)$$
where $y_p$ is a particular solution. Note that the rhs of the ODE is $\sin{x}$ which is not a solution to the homogenous equation. Therefore, to compute $y_p$ you may guess solutions of the form $y_p = c_1 \cos{x} + c_2 \sin{x}$ and solve for the constants $c_1$, $c_2$. 
An alternative is to set $y(x) = A(x) \cos{x}$ or $y(x) = B(x) \sin{x}$ and solve for $A$, $B$, unknown functions of $x$. However, this is overkill...
A: By Inverse Operator Rule: When $f(D)y=X$ where X is a function of $x$ or constant then,
Particular Integral, $P.I.=\dfrac{1}{f(D)}X$, Where $D=\dfrac{d}{dx}$.
Now when $X=\sin(ax+b)$, or, $\cos(ax+b)$ then
\begin{align*}
P.I.&=\dfrac{1}{f(D^2)}\sin(ax+b)\  \text{ put }D^2=-a^2,\text{ when }[f(-a^2)\neq0]\\
\end{align*}
Applying this rule in your problem, 
\begin{align}
P.I.&=\frac{1}{D^2-2D+2}\sin x\\
&=\frac{1}{-1-2D+2}\sin x\\
&=\frac{1}{1-2D}\sin x\\
&=\frac{1+2D}{1-4D^2}\sin x\\
&=\frac{1+2D}{1-4(-1)}\sin x\\
&=\frac15\cdot(1+2D)\sin x\\
&=\frac15(\sin x+2D\sin x)\\
\implies P.I.&=\frac15(\sin x+2\cos x)
\end{align}
A: The associated polynomial is:
$$r^2 - 2r + 2 = (r-1)^2 +1$$
So, for the roots we get:
$$(r-1)^2 = -1 \iff r-1 = \pm i  \iff r = 1 \pm i$$
So, you should change your homogeneous equation and particular suggestion accordingly. If you have any problems, let me know and I will elaborate.
