0

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

polyx
  • 25
  • The next step is to simplify the cosine terms, see my answer to the question you referred to. Then do something similar for the sine terms. – David Nov 02 '14 at 12:30
  • You linked to the same question I did in the post, I get the simplification part, but I did not understand how to find the values of A and B afterwards. This - "Then equate coefficients of LHS and RHS." does not tell me much – polyx Nov 02 '14 at 12:34
  • "Equate coefficients" means that all the coefficients of $\cos(n\pi/2)$ on the LHS must add up to the coefficient of $\cos(n\pi/2)$ on the RHS, which is $1$. Similarly, all the $\sin(n\pi/2)$ coefficients must add up to $0$. This gives you two equations in two unknowns and you can solve them to find $A$ and $B$. – David Nov 02 '14 at 12:38

1 Answers1

0

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.

  • I feel bad for asking, but I dont think I can follow how to do next steps, I missed about 2 weeks worth of lectures so I am kind of clueless, and book gives only very simplistic examples... – polyx Nov 02 '14 at 13:58
  • If you compare lhs to rhs, I suppose that $4A-7B=0$ since there is no $\sin(.)$ and that $-(7A+4B)=8$. Is that clear ? If not, just post. – Claude Leibovici Nov 02 '14 at 14:03