Hey there,
Let me see if I understand what you're saying.
So you say that for the differential equation you gave:
y" - 2y' = x + e2
You found your homogeneous solution:
yh = C1 + C2e2x
And your particular solution:
yp = Ax + B + Cex
I think you might have made a mistake in there somewhere, because I am not sure exactly where you got your Ce^x term in your particular solution. If you plug your particular solution back into your original differential equation, you should find out that:
Cex - 2Cex -2A = x + 2e2
Which becomes:
-Cex-2A = x + 2e2
This indicates that there is an error in your particular solution because there is no term on the left-hand side of the above equation that can deal with the x-term on the right hand side of the equation. Additionally, this also indicates that your coefficient for e
x is 0.
What you should have gotten for your particular solution for this equation is:
yp = Ax2 + Bx + C;
But besides the point, for your original question, say that you have this equation:
y" - 2y' = e2x + x
So you find:
yh = A + Be2x and
yp = Fx2 + Cx + G + De2x.
Your particular and homogeneous solutions overlap by that term e
x. What happens next is a little tricky. When we add the homogeneous and particular solutions together, we don't altogether "drop" any of the e
x solutions. What we do is we replace the term De
x with Dxe
x so that the particular solution now looks like y
p = x + Dxe
x. This seems even more random, but a helpful thing to notice is that the term De
x is already part of the homogeneous solution, which means the term will cancel to 0 once it is applied back into our differential equation:
(Fx2 + Cx + G + De2x)" - 2(Fx2 + Cx + G + De2x)' = x + e2x
2F + 4De2x - 4Fx - 2C - 4De2x = x + e2x
4Fx - 2C + 2F + 4De2x - 4De2x = x + e2x
4Fx - 2C + 2F = x + e2x
Now, we can solve for the x-term, but our De
x term has disappeared! That is part of the reason why we replace De
2x with Dxe
2x in our particular solution. To understand the actual reason why we do this, if you have taken linear algebra before, what you can do is think of the differential equation as a matrix equation, so you can represent this differential equation as Ax = b, where A is an mxn matrix, x is a 1xm vector, and b is a 1xn vector that is in the column space of A. If our differential equation is homogeneous, it turns out that b is equal to the zero vector, and so the vector x exists only in the nullspace of A, which is basically a collection of ALL the vectors that return the zero vector if multiplied with A. The nullspace is analogous to our homogeneous solution, which is a collection of ALL the solutions that return zero if applied to our differential equation. If our differential equation is non-homogeneous, however, then b is not equivalent to the zero vector, and so we have to find some vector x that is NOT in the nullspace in order to properly equate the expression Ax = b. As we found out in the above example, our homogeneous solution contained the term De
2x, which put it in the "nullspace" of the matrix associated with this differential equation. When we tried to guess a particular solution, we found that one of its terms was also De
2x, but as was just pointed out, this term is already located in the nullspace, and so to remove it from the nullspace, we multiply it by x in order to make it distinct from the homogeneous solution.
Of course, this explanation is MUCH more complicated and fascinating than what I could express here. Try to look up math books that will combine linear algebra with linear differential equations because they do a great job of explaining this in much better detail. This book could also help you, it's a math textbook all about differential equations:
http://tutorial.math.lamar.edu/pdf/DE/DE_Complete.pdf
I hope this helped, and good luck.