How to solve recurrence relation $x_{n+1} + 2x_n = 3^n$ when $x_0 = 0$

80 Views Asked by At

I've taken these steps:

The defining equation is $r^{n+1} + 2r^n = 0$ Which we can then rewrite as $r + 2 = 0$

And we get that $r = -2$

Assuming that $x_n = x_n^h + x_n^p$

Then the homogenous solutions $x_n^h$ are $A(-2)^n$

And to find $x_n^p$ we assume that it can be written as something multiplied with $3^n$. Or $c \cdot 3^n$

If we put $c \cdot 3^n$ into the equation we get that $c3^{n+1} + 2c3^n = 3^n$

And then dividing by $3^n$ we get $c3^1 + 2c = 1$.

Therefore $5c = 1$ and $c = \frac{1}{5}$

We then put this into $x_n = x_n^h + x_n^p$.

And get that $x_n = A(-2)^n + \frac{1}{5}3^n$

And with $x_0 = 0$ we get that $x_n = A(-2)^0 + \frac{1}{5}3^0 = 0$ Which can be written as $A + \frac{1}{5} = 0$

We then get that $A = -\frac{4}{5}$

And that the final equation is $x_n = -\frac{4}{5}(-2)^n + \frac{1}{5}3^n$

I'm unsure if this is the right answer, please give me feedback.

Thanks.

1

There are 1 best solutions below

3
On BEST ANSWER

This is almost correct. The only detail that you are missing is that $A+\frac15=0\implies A=-\frac15$. When I have time, I will edit this answer to prove that your solution satisfies the recurrence.