Finding specific solution for second order nonhomogeneous recurrence equation

85 Views Asked by At

$\ x(n+2)−1/2x(n+1)+1/8x(n)=cos(nπ/2)$

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

There were a question about this exact problem yersterday - Need help finding specific solution for second order nonhomogenous recurrence relation

But I did not understand the answer given, could someone explain what to do step-by-step after I have gotten to:

$\ x(n+2)−1/2x(n+1)+1/8x(n) = \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)\ $

I am stuck...

1

There are 1 best solutions below

2
On BEST ANSWER

Considering each term and simplifying, we have $$ A\cos\frac{(n+2)\pi}2+B\sin\frac{(n+2)\pi}2=-A \cos \left(\frac{\pi n}{2}\right)-B \sin \left(\frac{\pi n}{2}\right)$$ $$ A\cos\frac{(n+1)\pi}2+B\sin\frac{(n+1)\pi}2=B \cos \left(\frac{\pi n}{2}\right)-A \sin \left(\frac{\pi n}{2}\right)$$ $$ A\cos\frac{n\pi}2+B\sin\frac{n\pi}2=A \cos \left(\frac{\pi n}{2}\right)+B \sin \left(\frac{\pi n}{2}\right)$$ Now combine the terms with the appropriate coefficients and, after simplifications, the lhs write $$\frac{1}{8} \left((4 A-7 B) \sin \left(\frac{\pi n}{2}\right)-(7 A+4 B) \cos \left(\frac{\pi n}{2}\right)\right)$$ Compare with the rhs, identify and conclude.

I am sure that you can take from here.