To solve the recurrence relation:
[
a_n = -5a_{n-1} + 6a_{n-2} + n \cdot 4^{n}, \quad \text{with} \quad a_0 = 0, \quad a_1 = 2
]
we'll follow these steps:
- Solve the Homogeneous Recurrence Relation
- Find a Particular Solution for the Nonhomogeneous Part
- Combine Solutions and Apply Initial Conditions
Let's go through each step in detail.
1. Solving the Homogeneous Recurrence Relation
First, consider the homogeneous version of the given recurrence relation by ignoring the nonhomogeneous term ( n \cdot 4^{n} ):
[
a_n^{(h)} = -5a_{n-1}^{(h)} + 6a_{n-2}^{(h)}
]
To solve this, we assume a solution of the form ( a_n^{(h)} = r^n ). Substituting into the recurrence gives:
[
r^n = -5r^{n-1} + 6r^{n-2}
]
Divide both sides by ( r^{n-2} ) (assuming ( r \neq 0 )):
[
r^2 = -5r + 6
]
Rearranging:
[
r^2 + 5r - 6 = 0
]
Solving the characteristic equation:
[
r = \frac{-5 \pm \sqrt{25 + 24}}{2} = \frac{-5 \pm \sqrt{49}}{2} = \frac{-5 \pm 7}{2}
]
So, the roots are:
[
r_1 = \frac{2}{2} = 1, \quad r_2 = \frac{-12}{2} = -6
]
Homogeneous Solution:
[
a_n^{(h)} = C_1 \cdot 1^n + C_2 \cdot (-6)^n = C_1 + C_2 \cdot (-6)^n
]
2. Finding a Particular Solution for the Nonhomogeneous Part
The nonhomogeneous part of the recurrence is ( n \cdot 4^n ). We seek a particular solution ( a_n^{(p)} ) of the form:
[
a_n^{(p)} = (A n + B) 4^n
]
where ( A ) and ( B ) are constants to be determined.
Substituting ( a_n^{(p)} ) into the recurrence:
[
(A n + B)4^n = -5(A (n-1) + B)4^{n-1} + 6(A(n-2) + B)4^{n-2} + n4^n
]
To simplify, divide both sides by ( 4^{n-2} ):
[
(A n + B)4^{2} = -5(A(n-1) + B)4^{1} + 6(A(n-2) + B) + n4^{2}
]
Simplify the powers of 4:
[
16(A n + B) = -20(A(n-1) + B) + 6(A(n-2) + B) + 16n
]
Expand all terms:
[
16An + 16B = -20An + 20A - 20B + 6An - 12A + 6B + 16n
]
Combine like terms:
[
16An + 16B = (-20A + 6A) n + (20A - 12A) + (-20B + 6B) + 16n
]
[
16An + 16B = (-14A) n + 8A - 14B + 16n
]
Now, equate coefficients of like terms on both sides:
-
For ( n ) terms:
[
16A = -14A + 16
]
[
30A = 16 \quad \Rightarrow \quad A = \frac{16}{30} = \frac{8}{15}
]
-
For constant terms:
[
16B = 8A - 14B
]
[
16B + 14B = 8A
]
[
30B = 8 \cdot \frac{8}{15} = \frac{64}{15} \quad \Rightarrow \quad B = \frac{64}{450} = \frac{32}{225}
]
Particular Solution:
[
a_n^{(p)} = \left( \frac{8}{15}n + \frac{32}{225} \right) 4^n
]
3. Combining Solutions and Applying Initial Conditions
The general solution to the recurrence relation is the sum of the homogeneous and particular solutions:
[
a_n = a_n^{(h)} + a_n^{(p)} = C_1 + C_2 (-6)^n + \left( \frac{8}{15}n + \frac{32}{225} \right) 4^n
]
Now, apply the initial conditions to solve for ( C_1 ) and ( C_2 ).
Using ( a_0 = 0 ):
[
0 = C_1 + C_2 (-6)^0 + \left( \frac{8}{15} \cdot 0 + \frac{32}{225} \right) 4^0
]
[
0 = C_1 + C_2 + \frac{32}{225}
]
[
C_1 + C_2 = -\frac{32}{225} \quad \text{(Equation 1)}
]
Using ( a_1 = 2 ):
[
2 = C_1 + C_2 (-6)^1 + \left( \frac{8}{15} \cdot 1 + \frac{32}{225} \right) 4^1
]
[
2 = C_1 - 6C_2 + \left( \frac{8}{15} + \frac{32}{225} \right) 4
]
First, simplify the coefficient of ( 4 ):
[
\frac{8}{15} + \frac{32}{225} = \frac{120}{225} + \frac{32}{225} = \frac{152}{225}
]
[
\left( \frac{152}{225} \right) 4 = \frac{608}{225}
]
So,
[
2 = C_1 - 6C_2 + \frac{608}{225}
]
[
C_1 - 6C_2 = 2 - \frac{608}{225} = \frac{450}{225} - \frac{608}{225} = -\frac{158}{225} \quad \text{(Equation 2)}
]
Solving Equations 1 and 2:
From Equation 1:
[
C_1 = -\frac{32}{225} - C_2
]
Substitute into Equation 2:
[
\left( -\frac{32}{225} - C_2 \right) - 6C_2 = -\frac{158}{225}
]
[
-\frac{32}{225} - 7C_2 = -\frac{158}{225}
]
[
-7C_2 = -\frac{158}{225} + \frac{32}{225} = -\frac{126}{225} = -\frac{14}{25}
]
[
C_2 = \frac{14}{25 \cdot 7} = \frac{14}{175} = \frac{2}{25}
]
Now, find ( C_1 ):
[
C_1 = -\frac{32}{225} - \frac{2}{25} = -\frac{32}{225} - \frac{18}{225} = -\frac{50}{225} = -\frac{2}{9}
]
Final General Solution:
[
a_n = -\frac{2}{9} + \frac{2}{25} (-6)^n + \left( \frac{8}{15}n + \frac{32}{225} \right) 4^n
]
This can be rewritten for clarity:
[
a_n = \frac{2}{25} (-6)^n - \frac{2}{9} + \left( \frac{8}{15}n + \frac{32}{225} \right) 4^n
]
Verification with Initial Conditions
To ensure our solution is correct, let's verify it with the given initial conditions.
-
For ( n = 0 ):
[
a_0 = \frac{2}{25} (-6)^0 - \frac{2}{9} + \left( \frac{8}{15} \cdot 0 + \frac{32}{225} \right) 4^0 = \frac{2}{25} - \frac{2}{9} + \frac{32}{225}
]
[
= \frac{18}{225} - \frac{50}{225} + \frac{32}{225} = 0 \quad \text{(As expected)}
]
-
For ( n = 1 ):
[
a_1 = \frac{2}{25} (-6)^1 - \frac{2}{9} + \left( \frac{8}{15} \cdot 1 + \frac{32}{225} \right) 4^1
]
[
= \frac{-12}{25} - \frac{2}{9} + \left( \frac{8}{15} + \frac{32}{225} \right) \cdot 4
]
[
= -\frac{108}{225} - \frac{50}{225} + \frac{152}{225} \cdot 4 \cdot \frac{4}{1}
]
[
= -\frac{158}{225} + \frac{608}{225} = \frac{450}{225} = 2 \quad \text{(As expected)}
]
Thus, the solution satisfies the initial conditions.
Final Answer
The closed-form solution to the recurrence relation is:
[
a_n = -\frac{2}{9} + \frac{2}{25} (-6)^n + \left( \frac{8}{15}n + \frac{32}{225} \right) 4^n
]
Alternatively, it can be expressed as:
[
a_n = \frac{2}{25} (-6)^n - \frac{2}{9} + \left( \frac{8}{15}n + \frac{32}{225} \right) 4^n
]
This formula allows you to compute ( a_n ) for any integer ( n \geq 0 ).