# How to complete the square of $5 + 4\cos x -4\cos^2 x$?

How to complete the square of the following expression:

$$5 + 4\cos x - 4\cos ^2x$$

Let: $$u = 2\cos x$$

Subbing $u$ into the expression we get:

$$5 + 2u -u^2$$

We are trying to get the above into the following format, where $p$ and $q$ are constants:

$$(u + p)^2 \pm q$$

From here how do I complete the square to achieve the desired format?

My attempt:

By factoring $-1$ out of the expression we get:

$$-(u^2 - 2u - 5)$$

It follows that:

$$-((u - 1)^2 -6)$$

Hence:

$$5 + 2u -u^2 = 6 - (u - 1)^2$$

Or:

$$5 + 4\cos x - 4\cos ^2x = 6 - (2\cos x - 1)^2$$

• Hint: $u^2 - 2u + 1 = (u-1)^2$ – Nitin Oct 28 '16 at 14:11

$$5 + 4\cos x - 4\cos ^2x=-4\cos^2x+4\cos x-1+6=$$ $$=-(4\cos^2x-4\cos x+1)+6=-(2\cos x-1)^2+6$$
$$-u^2+2u+5=-(u^2-2u)+5=-(u^2-2u+1-1)+5=-(u^2-2u+1)+6=-(u-1)^2+6$$