3

I'm struggling to solve $$y_n + 5y_{n-1} - 14y_{n-2} = 2^n$$

I've solved the first part: $${y_n}^{(h)} = A(-7)^n + B(2)^n$$

But struggling solving the particular solution.

I tried:

$${y_n}^{(p)} = Mk^n$$

$$Mk^n + 5(Mk^{n-1}) -14(Mk^{n-2}) = 2^n$$ $$\iff k^n(M+5Mk^{-1}-14Mk^{-2}) = 2 ^n$$ $$k = 2$$ $$M + \frac{5M}{2} - \frac{14M}{4} = 1 \iff 0 \ne 1$$ Next I tried with: $${y_n}^{(p)} = Mk^n \cdot n$$ $$Mk^n \cdot n + 5Mk^{n-1}(n - 1) - 14Mk^{n-2}(n-2) = 2^n$$ $$k^n(Mn + 5Mnk^{-1}-5Mk^{-1} -14Mnk^{-2} + 28Mk^{-2}) = 2^n$$ I don't know how to proceed from here. Can you help?

user644361
  • 345
  • 1
  • 8

2 Answers2

3

Your last line is $$k^n(Mn + 5Mnk^{-1}-5Mk^{-1} -14Mnk^{-2} + 28Mk^{-2}) = 2^n$$

As before, you have to take $k=2$.

Your equation can therefore be rewritten as $$ Mn(1+5/2-14/4)-5M/2+28M/4=1. $$ Since $1+5/2-14/4=0$, you see that the coefficient before $Mn$ is $0$ and there remains $-5M/2+28M/4=1$, hence $M=2/9$.

fonfonx
  • 4,282
  • Do we use $-\frac{5M}{2}+\frac{28M}{4} = 1$ because we can't use $1+\frac{5}{2} - \frac{14}{4} = 1$ because $0 \ne 1$? – user644361 Sep 02 '19 at 09:38
  • What do we set $n$ too in the particular solution, $1$? – user644361 Sep 02 '19 at 09:42
  • 1
    Since $1+5/2-14/4=0$, your equation is simply $-5M/2+28M/4=1$ because the term in $n$ vanishes. Then you have to solve this equation in $M$ – fonfonx Sep 02 '19 at 09:44
  • 1
    You do not have to set $n$ in the particular solution. The particular solution you find is $y_n=(2/9)n2^n$. – fonfonx Sep 02 '19 at 09:45
  • 1
    @user644361 $n$ is a variable, it doesn't take a specific value here. For example, your particular solution could be $n2^n$. For the RHS and LHS to be equal, the coefficient of $n$ should be equal. The coefficient of $n$ is zero in the RHS – Shubham Johri Sep 02 '19 at 09:48
1

Using the variation of constants method. Assuming

$$ y_n = A_n(-7)^n+B_n 2^n $$

after substituting into the difference equation we have

$$ 2(-7)^n(7A_n-5A_{n-1}+2A_{n-2})-2^n 7(2B_n+5B_{n-1}-7B_{n-2}-2) = 0 $$

so choosing now

$$ 7A_n-5A_{n-1}+2A_{n-2}=0\\ 2B_n+5B_{n-1}-7B_{n-2}=2 $$

we have after solving

$$ A_n = C_1\left(-\frac 27\right)^n+C_2\\ B_n = -\frac {1}{81}(2-9n)+\left(-\frac 72\right)^n C_3+C_4 $$

then choosing $C_1=C_2=C_3=C_4=0$ we have finally

$$ A_n = 0\\ B_n = -\frac {1}{81}(2-9n) $$

Cesareo
  • 33,252