Having trouble solving this type of question, I can solve it when the equation equates to 0 however when it equates to something like $5(3)^n$ I get stuck. here's the question:
$$(1) \quad u_n - 4u_{n-2} = 5(3)^n \quad with \quad u_0 = 1 \quad and \quad u_1=1$$
I understand how to solve these normally, just this style of question I don't understand
Make an "educated guess" and take an ansatz $u_n=p^n$. Your recurrence relation has the following characteristic equation: $$p^n-4p^{n-2}=0\Longleftrightarrow\left(p+2\right)\left(p-2\right)=0$$ Hence there are two roots, at $p=\pm 2$, and the general part of the solution will look like $u_n=\alpha\cdot 2^n+\beta\cdot (-2)^n$. Now, add a third term to account for the particular solution (the RHS of the recurrence relation). Thus consider: $$u_n=\alpha\cdot 2^n+\beta\cdot (-2)^n+\gamma\cdot 3^n$$ From the recurrence relation, we get: $$u_n-4u_{n-2}=\gamma\cdot 3^n-4\gamma\cdot 3^{n-2}=5\cdot 3^n$$ Solving this last equation yields $\gamma=9$. Now we can use the initial conditions to find a system of two equations for $\alpha$ and $\beta$: $$u_0=1=\alpha+\beta+9$$ $$u_1=1=2\alpha-2\beta+27$$ Which gives us $\alpha=5/2$ and $\beta=-21/2$. Finally, the explicit expression of $u_n$ is: $$u_n=\dfrac{5}{2}\cdot 2^n-\dfrac{21}{2}\cdot (-2)^n+3^{n+2}$$