# Difference equation with trigonometric term

Trying to find the general solution to this homogeneous difference equation:

$$y_k - 2\cos\theta y_{k-1} + y_{k-2} = 0.$$

The characteristic equation is

$$\lambda^2 - 2\cos\theta \lambda + 1 = 0.$$

Not sure how to factor this, but tried

$$(\lambda - \cos\theta)(\lambda - \cos\theta) = 0$$

but I am stuck as to how to get $\cos^2\theta = 1$ using trigonometric identities.

By using the quadratic formula I get a discriminant of

$$4(\cos^2\theta - 1)$$

and I am stuck on how to simplify this to get the general solution.

Any help is appreciated. This is not for homework, but self study.

-

To solve the difference equation $y(k) - [2\cos(θ)]y(k-1) + y(k-2) = 0$, assume the solution has the form $y(k)=\lambda^k$ , then you substitute back in the difference equation which gives the equation

$$λ^2 - 2\cos(θ)λ + 1=0$$ $$\Rightarrow \lambda_1 = \frac{2\cos(\theta)+\sqrt{4\cos(\theta)^2-4}}{2} \,, \lambda_2 = \frac{2\cos(\theta)-\sqrt{4\cos(\theta)^2-4}}{2}$$

Note that,

$$\sqrt{4\cos(\theta)^2-4} = 2\sqrt{\cos^2(\theta)-1}=2 \sqrt{-1}\sqrt{1-\cos^2(\theta)}= 2 i\sin(\theta)\,.$$ So, the roots are

$$\lambda_1= \cos(\theta)+i\sin(\theta)\,, \lambda_1= \cos(\theta)-i\sin(\theta)\,.$$

The general solution can be written as

$$y(k)=c_1{\lambda_1}^k + c_2 {\lambda_2}^k \,.$$

-