# Second-order non-homogeneous linear differential equation

1. Aug 7, 2011

### properman

So I learned about these equations in my math class this spring, and it has been bothering me for some time that you are able to merely drop the offending term when there is overlap in the solutions. A quick example might help, seeing as I don't really know the true terms.

When finding the general solution for y''-2y'=x+2e^2 you end up with an overlap in yh and yp of Ce^x, and so when bringing it together you just ignore one of them.

Why is this a legitimate thing to do? Why does it not violate any rules?

I tried to figure it out myself using the above equation and multiplying the two equations through by x, resulting in xyh+xyp=(C1x+C2xe^2x)+(Ax^2+Bx+Cxe^x). Not to bore you with the particulars, but it resulted in x=x, which of course tells me nothing.

2. Aug 7, 2011

### psktam

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

yh = C1 + C2e2x

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 ex 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 ex. What happens next is a little tricky. When we add the homogeneous and particular solutions together, we don't altogether "drop" any of the ex solutions. What we do is we replace the term Dex with Dxex so that the particular solution now looks like yp = x + Dxex. This seems even more random, but a helpful thing to notice is that the term Dex 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 Dex term has disappeared! That is part of the reason why we replace De2x with Dxe2x 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 De2x, 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 De2x, 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.

Last edited by a moderator: Apr 26, 2017
3. Aug 8, 2011

### properman

oh shoot, I messed up writing it. it should actually be y'' - 2y' = x + 2e^x

4. Aug 8, 2011

### psktam

Hm,

Then in that case, yeah, your particular solution is right. Note, though, that when you add the particular and homogeneous solutions together, you do NOT get rid of either of the exponential forms. One is ex and the other is e2x, so in this case, your full solution should take the form:

y = C1 + C2e2x + Ax + B + Cex

and since C1 + B is just another constant, we can simply rewrite the above expression as:

y = D + C2e2x + Ax + Cex