<s>[INST] difference of recursive equations Lets have two recursive equations:
\begin{align}
f(0) &= 2  \\
f(n+1) &= 3 \cdot f(n) +  8 \cdot n \\ \\
g(0) &= -2 \\
g(n+1) &= 3 \cdot  g(n) + 12
\end{align}
We want a explicit equation for f(x) - g (x).
I firstly tried to do in manually for first $n$ numbers
\begin{array}{|c|c|c|c|}
\hline
n & f(n) & g(n) & f(n) - g(n) \\ \hline
0 & 2 & -2 &    4 \\ \hline
1 & 6  & 6 &    0 \\ \hline
2 & 26  & 30 &  -4 \\ \hline
3 & 94 & 102 &  -8 \\ \hline
4 & 306  & 318 & -12 \\ \hline
\end{array}
We can deduce that $f(n) - g(n) = 4 - 4n$
But now we have to prove it.
Lets extend recursive equation $f(n)$:
$$f(n) = 3^n \cdot f(0) + 8 \cdot (3^{n+1} \cdot 0 + \dots + 3^{0}(n-1))$$
for $g$ we get $$g(n) = 3^n \cdot g(0) + 12 \cdot (3^{n-1} + \dots + 3^0)$$
We can simply check this by induction but I will skip it, so the question won't be so long.
Now lets  put it together:
$$
f(n) - g(n) = 2 \cdot 3^n + 8 * 3^{n-1} \cdot 0 + ... + 3^0 \cdot (n-1) + 2 \cdot 3^n - 4 \cdot 3 \cdot ( 3^{n-1}+ ... + 3^0)= \\
= 4 \cdot 3^n  + 8 \cdot (3^{n-1} \cdot 0 + ... + 3^0(n-1)) - 4 \cdot (3^n + 3^{n-1} + ... + 3^1) = \\
= 8 \cdot (3^{n-1} \cdot 0 + ... + 3^0(n-1)) - 4 \cdot (3^{n-1} + ... + 3^1 + 3^0) + 4 \cdot 3^0 = \\
= 8 \cdot (3^{n-1} \cdot 0 + ... + 3^0(n-1)) - 4 \cdot (3^{n-1} + ... + 3^1 + 3^0) + 4
$$
As we can see, we already got the $4$, so to get $-4n + 4$, the rest of the equation must equal $-4n$. But this is where I don't know how to continue.
How to prove that:
$$8 \cdot (3^{n-1} \cdot 0 + \dots + 3^0(n-1)) - 4 \cdot (3^{n-1} + \dots + 3^1 + 3^0) = -4n$$
All I could do is this:
\begin{align}
&8 \cdot (3^{n-1} \cdot 0 + \dots + 3^0(n-1)) - 4 \cdot (3^{n-1} + \dots + 3^1 + 3^0) = \\
&= 4 \cdot (\frac{0}{2}3^{n-1} + \dots + \frac{1}{2} \cdot (n-1) - 4 * (\frac{2}{2}3^{n-1} + \dots + \frac{2}{2}3^0) = \\
&= 4 \cdot (3^{n-1} \cdot (\frac{0- 2}{2}) + \dots + 3^0 \cdot \frac{(n-1)-1}{2}) = \\
&= 4 \cdot (-\frac{2}{2}3^{n-1} + \dots + \frac{n-2}{2}) 
\end{align}
And I made sum function out of it:
$\sum^{n-1}_{i=0}{\frac{i - 2}{2}\cdot 3^{n-1-i}}$
What to do next? Did I go the wrong direction anywhere?
Thank you for your fast responses.
 [/INST] I think you can just use an induction proof, since you already have an intuition of the result, it is much easier to check :
$$\text{Let : } H_n :"w_n=f(n)-g(n)=4-4n" $$
First, for $n=0$ :
$$w_0=4=4-4\times 0 $$
Hence, $H_0$ is true.
Let $n\in\mathbb{N} $, such that $H_n$ is true, let us show $H_{n+1}$
$$w_{n+1}=3w_n+8n-12=3(4-4n)+8n-12\\
= 12-12n+8n-12=-4n=4-4(n+1) $$
Hence, $H_{n+1} $ is true, so we can conclude that :
$$\forall n \in \mathbb{N}, f(n)-g(n)=4-4n $$
</s>