TITLE: Where did $-4x$ come from?
QUESTION [5 upvotes]: I'm going over my quadratic equations for the ACT and I came across this quadratic:
$$(x – 2)^2  – 12$$
My teacher said we could have factored it out into this:
$$x^2 – 4x – 8$$
But I just don't understand where he got the $-4x$! Help?

REPLY [32 votes]: Same as others but with some colors
$(x-2)^2=\color{red}{(x-2)}\color{blue}{(x-2)}$
$\color{red}{(x-2)}\color{blue}{(x-2)}=\color{red}x\color{blue}{(x-2)}\color{red}{-2}\color{blue}{(x-2)}$
$\hspace{65 pt}=\underbrace{\color{red}x\times \color{blue}x}\hspace{5 pt}+\underbrace{\color{red}x \times \color{blue}{-2}}\hspace{5 pt}\underbrace{\color{red}{-2} \times \color{blue}x}\hspace{5 pt}\underbrace{ \color{red}{-2} \times \color{blue}{-2}}$
  $\hspace{70 pt}=x^2 \hspace{25 pt}-2x\hspace{15 pt}-2x\hspace{15 pt}+4$
$\hspace{65 pt}=x^2-4x+4$