Difference equations

Cristiano

New member
Joined
Oct 18, 2014
Messages
4
Hi everyone!

I have two difference equations, which I just can't solve. I hardly even get the method, so if you could help me with the steps, I would be grateful.

I. y[n+2]-(1/3)y[n+1]=sin(n)
II. y[n+2]+3y[n+1]-4y[n]=n-1






 
Hi everyone!

I have two difference equations, which I just can't solve. I hardly even get the method, so if you could help me with the steps, I would be grateful.

I. y[n+2]-(1/3)y[n+1]=sin(n)
II. y[n+2]+3y[n+1]-4y[n]=n-1
I'm not quite sure what you mean, is y[n] the functional value at n or is it meant to be multiplication, i.e. y * n? Just exactly how is the problem stated?
 
I meant y[n] the functional value at n . And to be strict, the 2 equations are two different problems.
 
The standard methods for solving difference equations are very similar to the methods for solving differential equations. Both equations here are "linear non-homogeneous equations with constant coefficients". We can solve them by first solving the "associated homogeneous equation" for the general solution, then add one solution to the entire equation.

The "associated homogenous equation" for the second equation is \(\displaystyle y[n+ 2]+ 3y[n+1]- 4y[n]= 0\). We know from experience that exponential satisfy such equations so we try a solution of the form \(\displaystyle y[n]= a^n\) for some n. Then \(\displaystyle y[n+1]= a^{n+1}= (a)(a^n)\) and \(\displaystyle y[n+2]= a^{n+2}= (a^2)(a^n)\). Putting those into the equation, \(\displaystyle y[n+2]+ 3y[n+1]- 4y[n]= (a^2)(a^n)+ 3(a)(a^n)- 4a^n= 0\). Dividing through by \(\displaystyle a^n\), we get the "characteristic equation" \(\displaystyle a^2+ 3a- 4= (a+ 4)(a- 1)= 0\) so \(\displaystyle a= 1\) or \(\displaystyle a= -4\). That is, \(\displaystyle C(1)^n+ D(-4)^n= C+ D(-4)^n\) is the general solution to the homogeneous equation. Now we look for a single function that will satisfy the entire equation. Since the right side, n- 1, is linear, we cross our fingers and try a linear solution. That, try y[n]= An+ B for constants, A and B.

However, I just did that and was unable to get a solution! I should have realized that wouldn't work because a= 1 was a root of the characteristic equation so that \(\displaystyle 1^n\) and polynomial multiples of that can be solutions to the associated homogeneous equation. Instead try \(\displaystyle y[n]= An^2+ Bn\)! Then \(\displaystyle y[n+2]= A(n+ 2)^2+ B(n+2)= An^2+ (4A+ B)n+ (4A+ 2B)\) and \(\displaystyle y[n+ 1]= A(n+1)^2+ B(n+1)= An^2+ 2An+ A+ Bn+ B= An^2+ (2A+ B)n+ (A+ B)\). So the equation becomes \(\displaystyle y[n+2]+ 3y[n+1]- 4y[n]= An^2+ (4A+ B)n+ (4A+ 2B)+ 3An^2+ (6A+ 3B)n+ (3A+ 3B)- 4An^2- 4Bn= (A+ 3A- 4A)n^2+ (4A+ B+ 6A+ 3B- 4B)n+ (4A+ 2B+ 3A+ 3B)= (10A)n+ (7A+ 6B)= n- 1\). (The fact that the \(\displaystyle n^2\) terms cancel is the result of 1 being a root of the characteristic equation.)

So we must have \(\displaystyle 10a= 1\) and \(\displaystyle 7A- 6B= -1\). Obviously, we must have \(\displaystyle a= \frac{1}{10}\) and then \(\displaystyle \frac{7}{10}- 6B= 1\) so \(\displaystyle 6B= 1- \frac{7}{10}= \frac{3}{10}\) and \(\displaystyle B= \frac{1}{20}\). That is, \(\displaystyle y[n]= \frac{1}{10}n^2+ \frac{1}{20}n\) satisfies the entire equation.

All of that tells us that the general solution to the equation \(\displaystyle y[n+2]+ 3y[n+1]- 4y[n]= n- 1\) is \(\displaystyle y[n]= C(-1)^n+ D(4^n)+ \frac{1}{10}n^2+ \frac{1}{20}n\).
 
Last edited:
Thank You!
Your answer was great, I understand it now. But what can I do with sin (n)? I tried with the same method, but I can't get a special solution for the equation.
 
You are the one who is, presumably, taking the course! Do you not know anything at all about this? Try a solution of the form y[n]= A sin[n]+ B cos[n].
You will need to use the "sum formulas" sin(x+ y)= sin(x)cos(y)+ cos(x)sin(y) and cos(x+ y)= cos(x)cos(y)- sin(x)sin(y). So, for example, sin(n+1)= cos(1)sin(n)+ sin(1)cos(n) and cos(n+1)= cos(1)cos(n)- sin(1)sin(n).
 
You are right, I know nothing about this, because I was sick last week, I couldn't go to the course, I only know that they were talking about these kind of equations, nothing else. Thank You for your answer though, I know this is not an ideal situation.
 
Top