difference of recursive equations

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


$$d(n+1)=3d(n)+8n-12,\\d(0)=4.$$

The homogeneous solution is

$$d_h(n)=3^nd_h(0).$$

Plugging the initial condition,

$$3^0d_h(0)=3\cdot4+8\cdot0-12=0.$$

Then with the ansatz $d_a(n)=an+b,$

$$an+a+b=3an+3b+8n-12$$ or by identification,$$d_a(n)=4-4n=d(n).$$


There is no need for induction, use a straight proof.

The equation is

$$f(n+1)-g(n+1)=3(f(n)-g(n))+8n-12$$ with $$f(0)-g(0)=4$$ and it does verify the solution

$$f(n)-g(n)=4-4n$$ as is shown by substitution,

$$4-4(n+1)=3(4-4n)+8n-12,$$ equivalent to $$-4n=-4n.$$

Furthermore, $$4=4-4\cdot 0.$$

Tags:

Recursion