the modification (multiply-by-x) rule
Sometimes your perfectly sensible trial solution turns out to be one of the homogeneous solutions in disguise. Push the swing exactly at its natural rhythm and the simple 'response of the same shape' guess fails, because that shape produces zero when fed through the operator. The modification rule is the standard repair: when the guess collides with a complementary solution, multiply it by x.
Here is the mechanism. Suppose you want a particular solution for forcing e^(kx), but e^(kx) is already part of y_c (k is a single root of the characteristic equation). Then substituting A e^(kx) gives 0, not the forcing — useless. Multiply the trial by x: use A x e^(kx). If e^(kx) is a DOUBLE root of the characteristic equation (it appears in y_c twice, as e^(kx) and x e^(kx)), one factor of x is not enough; multiply by x^2 and use A x^2 e^(kx). The rule is therefore: multiply the conflicting part of your trial solution by the smallest power of x (x or x^2) needed so that no term of the modified guess remains a homogeneous solution.
Physically this is resonance showing up in the algebra. When you force a system at its own natural frequency, the response does not just oscillate — it grows like x times an oscillation, which is precisely the x e^(kx) or x sin(wx) form the rule produces. The rule is not a trick to memorize blindly; it is the mathematics insisting that resonant forcing gives a qualitatively bigger, growing response. Always check your guess against y_c before substituting so you know whether the rule is needed.
For y'' - 2y' + y = e^(x), the characteristic equation (r - 1)^2 = 0 has r = 1 as a double root, so y_c = c1 e^(x) + c2 x e^(x). The naive guess A e^(x) and even A x e^(x) are already homogeneous; you must take y_p = A x^2 e^(x).
Multiply by x once for a simple collision, by x^2 for a repeated root.
Multiply by the LOWEST power of x that clears the conflict, not a higher one — and only the colliding term needs the factor, not the whole guess if other terms are clean.