Solving a second order difference equation with complex roots

TomiSlav

New member
Joined
May 11, 2022
Messages
4
Hello everyone. So, I was presented with a difference equation:[imath]y(n) + 5y(n-1)+14y(n-2) = (-6)^((n-1))[/imath]

with the initial conditions:
[imath]y(-2) = -2 , y(-1)= -1[/imath]
where I'm supposed to find the homogenous solution [imath]y_h[/imath] , particular solution [imath]y_p[/imath] and the total solution being [imath]y_t = y_h + y_p[/imath] with initial conditions included.
Since the characteristic equation of the difference equation for deriving the homogenous part of the solution is:
[imath]q^n +5q^(n-1) + 14q^(n-2) = 0[/imath]

By factoring out [imath]q^(n-2)[/imath] i get:
[imath]q^2 + 5q + 14 = 0[/imath]

Where the solutions of a quadratic equation are:
[imath]q_1 = (-5+sqrt(31)i)/2[/imath]
q_2 = (-5-sqrt(31)i)/2

By finding the module and the angle of the two solution, I wrote them in an exponential form. Now this is where things get ugly for me, module of both solutions is sqrt(14), but by calculating the angle in the form of phi = arctan(Im/Re) you get 0.839 and -0.839 radians, which is ugly to deal with in the first place.

The two solutions in the end become:
q_1 = sqrt(14)e^(-0.839i)
q_2 = sqrt(14)e^(0.839i)

If you plug that into a general solution of a homogenous differential equation:
y = C_1*(q_1)^n + C_2*(q_2)^n

And you get the following
y = sqrt(14)^n*(C_1*e^(-0.839*n*i)+C_2*e^(0.839*n*i))

Where you can write it in cos + i*sin form etc.
But my question is, how am i supposed to find the total solution to this equation, considering i still have to find the particular solution, and then plug into initial conditions, while one of my solutions is complex? I've only found a few solutions in my textbook where you have an equation similar to this one, with complex roots, but with much more logical numbers, where you get the root solution in the form of e^(-j*(pi/3)),but sadly it only shows how to find the homogenous solution and write it in cos+i*sin form, doesn't show the full procedure. Some help would be appreciated.

Edit: I'm sorry in advance if my text looks messy, I am not sure how to write it with some type of math code in here, I am willing to take a photo of my solution paper if needed.
 
Last edited:
Hello everyone. So, I was presented with a difference equation:[imath]y(n) + 5y(n-1)+14y(n-2) = (-6)^((n-1))[/imath]

with the initial conditions:
[imath]y(-2) = -2 , y(-1)= -1[/imath]
where I'm supposed to find the homogenous solution [imath]y_h[/imath] , particular solution [imath]y_p[/imath] and the total solution being [imath]y_t = y_h + y_p[/imath] with initial conditions included.
Since the characteristic equation of the difference equation for deriving the homogenous part of the solution is:
[imath]q^n +5q^(n-1) + 14q^(n-2) = 0[/imath]

By factoring out [imath]q^(n-2)[/imath] i get:
[imath]q^2 + 5q + 14 = 0[/imath]

Where the solutions of a quadratic equation are:
[imath]q_1 = (-5+sqrt(31)i)/2[/imath]
q_2 = (-5-sqrt(31)i)/2

By finding the module and the angle of the two solution, I wrote them in an exponential form. Now this is where things get ugly for me, module of both solutions is sqrt(14), but by calculating the angle in the form of phi = arctan(Im/Re) you get 0.839 and -0.839 radians, which is ugly to deal with in the first place.

The two solutions in the end become:
q_1 = sqrt(14)e^(-0.839i)
q_2 = sqrt(14)e^(0.839i)

If you plug that into a general solution of a homogenous differential equation:
y = C_1*(q_1)^n + C_2*(q_2)^n

And you get the following
y = sqrt(14)^n*(C_1*e^(-0.839*n*i)+C_2*e^(0.839*n*i))

Where you can write it in cos + i*sin form etc.
But my question is, how am i supposed to find the total solution to this equation, considering i still have to find the particular solution, and then plug into initial conditions, while one of my solutions is complex? I've only found a few solutions in my textbook where you have an equation similar to this one, with complex roots, but with much more logical numbers, where you get the root solution in the form of e^(-j*(pi/3)),but sadly it only shows how to find the homogenous solution and write it in cos+i*sin form, doesn't show the full procedure. Some help would be appreciated.

Edit: I'm sorry in advance if my text looks messy, I am not sure how to write it with some type of math code in here, I am willing to take a photo of my solution paper if needed.
A couple of comments.

First, LaTeX: When you exponentiate use { } around the exponents. So (-6)^{n - 1} becomes [imath](-6)^{n - 1}[/imath].

Okay. For your homogeneous solution I'd just leave it in rectangular form. That's as nice as it's going to get. So
[imath]y_h(n) = C_1 \left ( \dfrac{-5 + i \sqrt{31}}{2} \right )^n + C_2 \left ( \dfrac{-5 - i \sqrt{31}}{2} \right )^n[/imath]

For your particular solution try [imath]y_p(n) = C_3 (-6)^{n-1}[/imath]

-Dan
 
Top