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$$

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
$$
