Probably simple factoring problem I came across this in a friend's 12th grade math homework and couldn't solve it.  I want to factor the following trinomial:
$$3x^2  -8x + 1.$$  
How to solve this is far from immediately clear to me, but it is surely very easy.  How is it done?

A standard way of factorizing, when it is hard to guess the factors, is by completing the square.
\begin{align}
3x^2 - 8x + 1 & = 3 \left(x^2 - \dfrac83x + \dfrac13 \right)\\
& (\text{Pull out the coefficient of $x^2$})\\
& = 3 \left(x^2 - 2 \cdot \dfrac43 \cdot x + \dfrac13 \right)\\
& (\text{Multiply and divide by $2$ the coefficient of $x$})\\
& = 3 \left(x^2 - 2 \cdot \dfrac43 \cdot x + \left(\dfrac43 \right)^2 - \left(\dfrac43 \right)^2 + \dfrac13 \right)\\
& (\text{Add and subtract the square of half the coefficient of $x$})\\
& = 3 \left(\left(x - \dfrac43 \right)^2 - \left(\dfrac43 \right)^2 + \dfrac13 \right)\\
& (\text{Complete the square})\\
& = 3 \left(\left(x - \dfrac43 \right)^2 - \dfrac{16}9 + \dfrac13 \right)\\
& = 3 \left(\left(x - \dfrac43 \right)^2 - \dfrac{16}9 + \dfrac39 \right)\\
& = 3 \left(\left(x - \dfrac43 \right)^2 - \dfrac{13}9\right)\\
& = 3 \left(\left(x - \dfrac43 \right)^2 - \left(\dfrac{\sqrt{13}}3 \right)^2\right)\\
& = 3 \left(x - \dfrac43 + \dfrac{\sqrt{13}}3\right) \left(x - \dfrac43 - \dfrac{\sqrt{13}}3\right)\\
& (\text{Use $a^2 - b^2 = (a+b)(a-b)$ to factorize})
\end{align}
The same idea works in general.
\begin{align}
ax^2 + bx + c & = a \left( x^2 + \dfrac{b}ax + \dfrac{c}a\right)\\
& = a \left( x^2 + 2 \cdot \dfrac{b}{2a} \cdot x + \dfrac{c}a\right)\\
& = a \left( x^2 + 2 \cdot \dfrac{b}{2a} \cdot x + \left( \dfrac{b}{2a}\right)^2 - \left( \dfrac{b}{2a}\right)^2 + \dfrac{c}a\right)\\
& = a \left( \left( x + \dfrac{b}{2a}\right)^2 - \left( \dfrac{b}{2a}\right)^2 + \dfrac{c}a\right)\\
& = a \left( \left( x + \dfrac{b}{2a}\right)^2 - \dfrac{b^2}{4a^2} + \dfrac{c}a\right)\\
& = a \left( \left( x + \dfrac{b}{2a}\right)^2 - \left(\dfrac{b^2-4ac}{4a^2} \right)\right)\\
& = a \left( \left( x + \dfrac{b}{2a}\right)^2 - \left(\dfrac{\sqrt{b^2-4ac}}{2a} \right)^2\right)\\
& = a \left( x + \dfrac{b}{2a} + \dfrac{\sqrt{b^2-4ac}}{2a}\right) \left( x + \dfrac{b}{2a} - \dfrac{\sqrt{b^2-4ac}}{2a}\right)\\
\end{align}
