Now the general form of any second-order difference equation is:
![\[af(n+2)+b f(n+1) +cf(n) = d.\]](https://appassets.softecksblog.in/engineering_mathematics/assets/em2/8_files/image001.webp)
Also, 
 are constants.
If 
, then the equation becomes 
![\[f(n+2)+a f(n+1) +bf(n) = 0.\]](https://appassets.softecksblog.in/engineering_mathematics/assets/em2/8_files/image004.webp)
Then this is an example of second-order homogeneous difference equations.
Now I’ll show how to solve these type of equations.
METHOD
First of all, I’ll choose a general solution to this difference equation. So, let’s say 
Next, I’ll put this value of 
 in the difference equation.
So it will be
![\[kw^{n+2}+akw^{n+1}+bkw^{n} =0.\]](https://appassets.softecksblog.in/engineering_mathematics/assets/em2/8_files/image007.webp)
Here 
 is the common term.
So I can take it out.
Thus the equation will be
![\[kw^{n}(w^2+aw+b) = 0.\]](https://appassets.softecksblog.in/engineering_mathematics/assets/em2/8_files/image009.webp)
Since 
 cannot be 
, 
 can be 
.
Therefore what I get is
![\[(w^2+aw+b) = 0.\]](https://appassets.softecksblog.in/engineering_mathematics/assets/em2/8_files/image012.webp)
Now, this is the characteristic equation of this difference equation.
Next, I have to solve this equation to get the values of 
.
Since 
 has the power 
, I’ll get two values of 
.
So let’s choose 
 and 
.
Then the general solution of the difference equation will be
![\[f(n) = A \times m_1^{n} + B \times m_2^{n}.\]](https://appassets.softecksblog.in/engineering_mathematics/assets/em2/8_files/image017.webp)
Now that’s how it works.
EXAMPLE
According to Stroud and Booth (2013)* “Solve the following difference equation: 
 where 
 and 
.”
SOLUTION
Now here the given difference equation is
![\[ \boxed{f(n+2)+5f(n+1)+6f(n) = 0,~~~~~f (0) = 0, f(1) = 1.} \]](https://appassets.softecksblog.in/engineering_mathematics/assets/em2/8_files/image021.webp)
First of all, I’ll choose the general solution of this equation as
![\[f(n) = kw^n.\]](https://appassets.softecksblog.in/engineering_mathematics/assets/em2/8_files/image022.webp)
Now I’ll find out the characteristic equation of this difference equation.
STEP 1
So, for that I’ll put 
 in the difference equation to get
![\[kw^{n+2}+5kw^{n+1}+6kw^{n} = 0.\]](https://appassets.softecksblog.in/engineering_mathematics/assets/em2/8_files/image024.webp)
Now I can take out 
 as a common term. Therefore the new equation will be
![\[kw^n(w^2+5w+6) = 0.\]](https://appassets.softecksblog.in/engineering_mathematics/assets/em2/8_files/image026.webp)
Since 
 cannot be 
, 
 can be 
.
Therefore what I get is
![\[(w^2+5w+6) = 0.\]](https://appassets.softecksblog.in/engineering_mathematics/assets/em2/8_files/image028.webp)
So the characteristic equation of this difference equation will be
![\[ \boxed{w^2+5w+6 = 0.} \]](https://appassets.softecksblog.in/engineering_mathematics/assets/em2/8_files/image029.webp)
Next, I’ll solve this equation to get the general solution of the difference equation.
STEP 2
So I can factorise this characteristic equation as
![\[(w+2)(w+3) = 0.\]](https://appassets.softecksblog.in/engineering_mathematics/assets/em2/8_files/image030.webp)
Thus the values of 
 will be 
.
Hence the general solution of the difference equation is
(1) 
Now I’ll get the values of 
 and 
.
So I’ll substitute 
 in the equation (1) to get
![\[f(0) = A \times (-2)^{0}+B\times (-3)^{0}.\]](https://appassets.softecksblog.in/engineering_mathematics/assets/em2/8_files/image036.webp)
Now I already know that 
.
So this equation will be
![\[0 = A \times 1 + B \times 1.\]](https://appassets.softecksblog.in/engineering_mathematics/assets/em2/8_files/image038.webp)
(2) 
Next, I’ll substitute 
 in the equation (1) to get
![\[f(1) = A \times (-2)^{1}+B\times (-3)^{1}.\]](https://appassets.softecksblog.in/engineering_mathematics/assets/em2/8_files/image041.webp)
Now I already know that 
.
So this equation will be
![\[1 = A \times (-2) + B \times (-3).\]](https://appassets.softecksblog.in/engineering_mathematics/assets/em2/8_files/image043.webp)
(3) 
As I can see from equation (2), 
.
Next, I’ll put back 
 in equation (3).
Thus it will be
![\[-2 (-B) -3 B = 1.\]](https://appassets.softecksblog.in/engineering_mathematics/assets/em2/8_files/image046.webp)
So this gives 
 which means
![\[B = -1.\]](https://appassets.softecksblog.in/engineering_mathematics/assets/em2/8_files/image048.webp)
Hence the value of 
 will be
![\[A = 1.\]](https://appassets.softecksblog.in/engineering_mathematics/assets/em2/8_files/image049.webp)
Now I’ll substitute 
 in the equation (1) to get
![\[f (n) = 1 \times (-2)^{n}+(-1)\times (-3)^{n}.\]](https://appassets.softecksblog.in/engineering_mathematics/assets/em2/8_files/image051.webp)
So this means
![\[f (n) = (-2)^{n}- (-3)^{n}\]](https://appassets.softecksblog.in/engineering_mathematics/assets/em2/8_files/image052.webp)
is the general solution of the difference equation.
Hence I can conclude that this is the answer to this example.