Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am trying to help a friend of mine solve

$$ a_n + 5 a_{n-1} + 6 a_{n-2} = 12n - 2(-1)^n$$

Now the homogenous solution is easy to find, and one just needs to solve the equation $r^2 + 5r + 6 = 0$ Which has roots $r=-2$ and $r-3$, so the homogenous solution is

$$A (-2)^n + B (-3)^n$$

Which can be confirmed by putting it into the equation. Now usually I would guess that the particular solution was on the form

$$h_p = (An + B) + C(-1)^n$$

but this is clearly wrong, is there any other way to find the solution of the equation ?

share|cite|improve this question
In fact it is not so simple to guess the form of the particular solution for the inhomogenous term $(-1)^n$ :… – doraemonpaul Oct 1 '12 at 18:28
What's clearly wrong about it? It seems to work for $A=1$, $B=17/12$, and $C=-1$. – mjqxxxx Oct 1 '12 at 19:06
And in what whay is that equal to $12n - 2(-1)^n$ ? – N3buchadnezzar Oct 1 '12 at 19:16
up vote 3 down vote accepted

What you assumed for the particular solution is correct. However, if you do not want to deal with inhomogeneous difference equations and guessing your particular solution, then you can use the following technique to transform it to a homogeneous difference equation. Another efficient technique is the Z-transform technique.

share|cite|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.