I want to compute the Z-transform of the below signal function.
$$x[n]=\cos(\omega n)u[n]$$
$$Z[x[n]]=\sum_{n=-\infty}^{+\infty}\cos(\omega n )u[n] \cdot z^{-n}$$
$$=\sum_{n=0}^{+\infty}\cos(\omega n )u[n] \cdot z^{-n}$$
$$=\sum_{n=0}^{+\infty}\cos(\omega n )\cdot z^{-n}$$
Since below equation is held,
$$\cos(\omega n )=\frac{\exp(j \omega n) +\exp(-j \omega n) }{2}$$
$$Z[x[n]]=\frac{1}{2}\left(\frac{1}{1-\exp(j\omega z^{-1})}+\frac{1}{1-\exp(-j\omega z^{-1})}\right)\tag{1}$$
$$=\frac{\left(1-\cos(\omega)z^{-1}\right)}{1-2\cos(\omega)z^{-1}+z^{-2}}\tag{2}$$
Currently I can't get how the Eq (1) and (2) comes from. And where the variable $n$ gone?
Can anyone give me some hint(s)?So that I can deduce it in my own.
$$\sum_{n=0}^\infty \cos(\omega n)\cdot z^{-n}=\sum_{n=0}^\infty \big(\frac{e^{j\omega n}+e^{-j\omega n}}{2}\big)z^{-n}=\frac{1}{2}\big(\sum_{n=0}^\infty \big(\frac{e^{j\omega }}{z}\big)^n+\sum_{n=0}^\infty \frac{1}{(e^{j\omega }z)^n}\big)$$ $$=\frac{1}{2}\Big(\frac{1}{1-\frac{e^{j\omega }}{z}}+\frac{1}{1-\frac{1}{e^{j\omega }z}} \Big)$$
The key is recognizing the geometric series