How do you solve this nonhomogeneous recurrence?

67 Views Asked by At

Im having some troubles with solving the following nonhomogeneous recurrence, i will only post the non-homogenous part of the recurrence as that is the part i dont understand: $4^n * \cos(\pi*n)$,

The homogenous part of the recurrence is $A*(-4)^n$

Now i did some solving myself and got to the following form for the particual part of the recurrence and was wondering if it is correct or not.

$ 4^n*( B*\sin(\pi n) + C*\cos(\pi n))$

Edit Adding Whole equation

$a_{n+1} + 4a_n = 4^n * cos(\pi n)$

1

There are 1 best solutions below

0
On BEST ANSWER

If you aren't afraid of complex numbers, you see that you can write your recurrence as:

$\begin{align*} a_{n + 1} + 4 a_n &= \frac{\exp(n \pi i) + \exp(-n \pi i)}{2} \end{align*}$

The forcing function is now a sum of powers, and the solution routine. Translate back into trigonometric functions at the end.