Need help finding specific solution for second order nonhomogenous recurrence relation

47 Views Asked by At

$x(n+2)-\frac{1}2x(n+1)+\frac{1}8x(n)=\cos(n\pi/2)$

Guess a solution -- $Acos(n\pi/2)+Bsin(n\pi/2)$ where A and B are constants

How do I go about this?

Any help is appreciated

1

There are 1 best solutions below

0
On

Using the solution you have guessed and substituting into the LHS gives $$\Bigl(A\cos\frac{(n+2)\pi}2+B\sin\frac{(n+2)\pi}2\Bigr) -\frac12\Bigl(A\cos\frac{(n+1)\pi}2+B\sin\frac{(n+1)\pi}2\Bigr) +\frac18\Bigl(A\cos\frac{n\pi}2+B\sin\frac{n\pi}2\Bigr)\ .$$ Now use trig properties to simplify, for example $$\cos\frac{(n+2)\pi}2=\cos\Bigl(\frac{n\pi}2+\pi\Bigr)=-\cos\frac{n\pi}2$$ and $$\cos\frac{(n+1)\pi}2=\cos\Bigl(\frac{n\pi}2+\frac\pi2\Bigr)=-\sin\frac{n\pi}2\ .$$ Then equate coefficients of LHS and RHS.