Find the analytic solution to this second order inhomogenous difference equation

317 Views Asked by At

Find the analytic solution of:

$$Y_{n+1} = Y_{n-1} + 2h[−4Y_n + 3e^{−h~n}]$$

where $h$ is a constant. I have found a solution but am unsure if it is correct.

I was wondering what is the best method to solve difference equations like this and what is the solution to the one above?

As I could not find anywhere online which had a good explanation of how to solve difference equations like this I thought it would be a good idea to create a question.

Here is what I tried:

To find the analytic solution of the linear second order in-homogenous difference equation (2) the solution to the homogenous equation must first be found.

$$Y_{n+1}= Y_{n-1}+2h[-4Y_n+3e^{−h~n}]$$ (2)

Rearranging equation (2) gives the in-homogenous form (3):

$$Y_{n+1}- Y_{n-1}+8hY_n=6he^{−h~n}$$ (3)

Removing the right hand side forcing term leaves the homogenous form (4):

$$Y_{n+1} - Y_{n-1} +8hY_n=0$$ (4) Trying a solution in the form $$Y_n=Am^n$$ creates the auxillary equation (5) which can then be solved to find the two different values of m (6) and hence the complementary function (7).

$$m^2+8m-1=0$$ (5) $$m= -4h ± √(16h^2+1)$$ (6) $$Y_c= A_1 (-4h+√(16h^2+1))^n + A_2 (-4h-√(16h^2+1))^n$$ (7)

The particular integral (8) is then found by trying a solution in the form $$Y_p=Be^{−h~n}$$, where B is a constant, giving the general solution (9).

$$Y_p=(6he^{−h~n})/(8h+ e^{−h} - e^h )$$ (8)

$$Y_n= A_1 (-4h+√(16h^2+1))^n+ A_2 (-4h-√(16h^2+1))^n+ (6he^{−h~n})/(8h+ e^{−h}- e^h )$$(9)

I'm not sure how to find the constants A1 and A2 when given the conditions: $$Y_0 = 0$$ and $$Y_1 = 3h$$ ???