how is this equations "y[u]=(cos(wn)-cosw(u-1))/2" equal to cos(wn+theta), need to know the missing steps.

thanks your help...

To understand how the equation transforms into cos(wn+θ), we can follow these steps:

1. Start with the given equation: y[u] = (cos(wn) - cos(w(u-1)))/2.

2. Use the trigonometric identity: cos(A) - cos(B) = -2sin((A+B)/2)sin((A-B)/2). Applying this identity to the numerator gives:
y[u] = -2sin((wn + w(u-1))/2)sin((wn - w(u-1))/2)/2.

3. Simplify:
y[u] = -sin((wn + w(u-1))/2)sin((wn - w(u-1))/2).

4. Expand the expression within each sine function:
y[u] = -sin((wn/2 + w(u-1)/2))sin((wn/2 - w(u-1)/2)).

5. Apply the sum-to-product trigonometric identity:
sin(A)sin(B) = (cos(A-B) - cos(A+B))/2.

6. Substitute A = wn/2 + w(u-1)/2, and B = wn/2 - w(u-1)/2 into the identity:
y[u] = -(cos((wn/2 - w(u-1)/2) - cos((wn/2 + w(u-1)/2))/2.

7. Simplify further:
y[u] = -(cos(wn - w(u-1))/2 - cos(wn + w(u-1))/2)/2.

8. Rearrange the terms:
y[u] = (cos(wn + w(u-1)) - cos(wn - w(u-1)))/2.

9. Finally, notice that cos(wn + w(u-1)) - cos(wn - w(u-1)) can be written as cos(wn + θ), where θ = w(u-1):
y[u] = cos(wn + θ)/2.

Therefore, the equation y[u] = (cos(wn) - cos(w(u-1)))/2 is equivalent to y[u] = cos(wn + θ)/2.