Write the equation as
(∗) P(D)y = x2sin(2x),
where P(D) = D2 − 3D + 2. Note that x2sin(2x) is the imaginary part of x2e2ix. Thus, to solve (∗), we want to solve the complex equation
(♥) P(D)y = x2e2ix, and then take the imaginary part of the solution. To solve equation (♥), we move the exponential to the left side are write the equation as
e−2ixP(D)y = x2.
By the shifting rule, this is equivalent to P(D + 2i)[e−2ixy] = x2.
We set z = e2ixy and calculate
P(D + 2i) = (D + 2i)2 − 3(D + 2i) + 2
= D2 + 4iD − 4 − 3D − 6i + 2
= D2 + (−3 + 4i)D + (−2 − 6i).
Thus, the equation for z is
(D2 + (−3 + 4i)D + (−2 − 6i))z = x2
Since the right-hand side is a polynomial of degree 2, we try a polynomial of degree 2, z = Ax2 + Bx + C. Plugging into the equations and collecting coefficients yields
(− 2 − 6i)Ax2 + ((− 6 + 8i)A + (− 2 − 6i)B)x + (2A + (− 3 + 4i)B +(− 2 − 6i)C) = x2,
so we get the equations
(−2 − 6i)A = 1
(−6 + 8i)A + (−2 − 6i)B = 0
2A + (−3 + 4i)B + (−2 − 6i)C = 0
(use the calculator!) The solutions are

