Q:

Can anyone help me to solve this recurrence? Thanks a lot![tex]S(n)=S(n-1)+6S(n-2)+2^n[/tex][tex]S(0)=2, S(1)=4[/tex]

Accepted Solution

A:
Answer:S(n) = -(2ⁿ) + 3/5 (-2)ⁿ + 12/5 (3)ⁿStep-by-step explanation:Rearrange:S(n) − S(n−1) − 6S(n−2) = 2ⁿSince the non-homogenous term on the right side is 2ⁿ, we can guess that S(n) has the form a(2ⁿ) + b.Substitute:a(2ⁿ) + b − (a(2ⁿ⁻¹) + b) − 6(a(2ⁿ⁻²) + b) = 2ⁿa(2ⁿ) + b − a(2ⁿ⁻¹) − b − 6a(2ⁿ⁻²) − 6b = 2ⁿa(2ⁿ) − a(2ⁿ⁻¹) − 6a(2ⁿ⁻²) − 6b = 2ⁿa(2ⁿ) − 1/2 a(2ⁿ) − 6/4 a(2ⁿ) − 6b = 2ⁿ(a − 1/2 a − 3/2 a − 1) (2ⁿ) − 6b = 0(-a − 1) (2ⁿ) − 6b = 0Matching the coefficients:a = -1, b = 0So the general solution is: S(n) = -(2ⁿ).To find the particular solution, let's first write the characteristic equation:s² − s − 6 = 0(s + 2) (s − 3) = 0s = -2, 3So the particular solutions are c(-2)ⁿ and d(3)ⁿ.The whole solution is the sum of the general and particular solutions:S(n) = -(2ⁿ) + c(-2)ⁿ + d(3)ⁿUse the initial conditions to find the coefficients:S(0) = 2 = -(2⁰) + c(-2)⁰ + d(3)⁰2 = -1 + c + d3 = c + dS(1) = 4 = -(2¹) + c(-2)¹ + d(3)¹4 = -2 − 2c + 3d6 = 3d − 2cSolving the system of equations:6 = 3(3 − c) − 2c6 = 9 − 3c − 2c5c = 3c = 3/5d = 12/5Therefore:S(n) = -(2ⁿ) + 3/5 (-2)ⁿ + 12/5 (3)ⁿLet's check by finding S(2) using both equations.S(n) = S(n−1) + 6S(n−2) + 2ⁿS(2) = S(1) + 6S(0) + 2²S(2) = 4 + 6(2) + 4S(2) = 20S(n) = -(2ⁿ) + 3/5 (-2)ⁿ + 12/5 (3)ⁿS(2) = -(2²) + 3/5 (-2)² + 12/5 (3)²S(2) = -4 + 3/5 (4) + 12/5 (9)S(2) = -4 + 12/5 + 108/5S(2) = 20Looks like it works!