Express \(cos4 \theta\) in powers of \(cos \theta\)

\begin{align} Let \: z & = (cos 4 \theta + i sin 4 \theta) \quad \quad \enclose{circle}{\color{black}{1}} \\ & Then\ by\ deMoivre's\ Theorem \\ z & =(cos \theta + isin \theta)^4 \quad \quad \enclose{circle}{\color{black}{2}} \\ \\ & Using\ the\ binomial\ expansion\ of\ equation \quad \enclose{circle}{\color{black}{2}}\\ z & = cos^4 \theta +4cos^3\theta \; isin\theta + 6cos^2 \theta \; i^2sin^2 \theta +4cos \theta \;i^3sin^3 \theta + i^4sin^4 \theta \quad \quad \enclose{circle}{\color{black}{3}}\\ & Separating\ real\ and\ imaginary\ parts \\ Re(z) & = cos^4 \theta -6cos^2 \theta sin^2 \theta + sin^4 \theta \\ Im(z) & = 4cos^3\theta\ isin\theta -4cos\theta isin^3\theta \\ \\ & Equating\ real\ parts\ of\ \enclose{circle}{\color{black}{1}}\ and\ \enclose{circle}{\color{black}{3}}\\ cos4\theta & = cos^4\theta - 6cos^2\theta sin^2\theta + sin^4\theta \\ & = cos^4\theta - 6cos^2\theta(1-cos^2\theta)+(1-cos^2\theta)^2 \quad \quad(by\ substitution)\\ & = cos^4\theta -6cos^2\theta +6cos^4\theta +1 -2cos^2\theta + cos^4 \theta \\ & = 8cos^4\theta - 8cos^2 \theta + 1 \end{align}