what to do next recurrence relation when solving exponential function? find gernal solution of :$a_n = 5a_{n– 1} – 6a_{n –2} + 7^n$
Homogeneous solution:
$$a_n -5a_{n– 1} + 6a_{n –2} = 7^n$$
put $a_n=b^n$:
$$b^n -5b^{n– 1} + 6b^{n –2} =0
\\b^{n-2} (b^2-5b^{} + 6b) =0
\\b^2-5b^{} + 6b =0
\\(b-2)(b-3)=0\\
b=2,3$$
$$a^h_{(n)} = C_1 3^n+ C_2 2^n$$
Particular solution:
Since RHS is exponent so $a^p_{(n)} = da^n$
put $a^p_{(n)}$ in $a_n -5a_{n– 1} + 6a_{n –2} = 7^n$
$$da^n -5da^{n– 1} + 6da^{n –2} =7^n$$
 A: Your computation of the general solution of the homogeneous equation $a_{n}=5a_{n-1}-6a_{n-2}$ is correct. Note that the homogeneous equation does not have $7^n$ on the right. 
We want to find a particular solution of the full equation 
$$a_{n}=5a_{n-1}-6a_{n-2}+7^n.\tag{1}$$ 
We look for a solution of the shape $a_n=(k)7^n$, where $k$ is a constant. Substituting in (1), we get
$$(k)7^n =(5k)7^{n-1}-(6k)7^{n-2}+7^n.$$
Dividing both sides by $7^{n-2}$, we get
$$49k=35k-6k+49.$$
Solve for $k$. We get $k=\frac{49}{20}$.
Thus the general solution of (1) is
$$C_1\cdot 3^n+C_2\cdot 2^n +\frac{1}{20}7^{n+2}.$$
A: Use generating functions... Define $A(z) = \sum_{n \ge 0} a_n z^n$, write the recurrence so there aren't subtractions in indices:
$$
a_{n + 2} = 5 a_{n + 1} - 6 a_n + 49 \cdot 7^n
$$
Multiplply by $z^n$, sum over valid indices ($n \ge 0$), and recognize the resulting sums:
$$
\frac{A(z) - a_0 - a_1 z}{z^2} 
   = 5 \frac{A(z) - a_0}{z} - 6 A(z) + 49 \frac{1}{1 - 7 z}
$$
Solve for $A(z)$, write as partial fractions:
$$
A(z) 
  = \frac{49}{20} \cdot \frac{1}{1 - 7 z}
      + \frac{4 a_1 - 8 a_0 - 49}{4} \cdot \frac{1}{1 - 3 z}
      - \frac{5 a_1 - 15 a_0 - 49}{5} \cdot \frac{1}{1 - 2 z}
$$
Everything in sight is just a geometric series:
$$
a_n
  =  \frac{49}{20} \cdot 7^n
      + \frac{4 a_1 - 8 a_0 - 49}{4} \cdot 3^n
      - \frac{5 a_1 - 15 a_0 - 49}{5} \cdot 2^n
$$
