# nLab completing the square

Given a field $K$ whose characteristic is not 2, let $p\in K[x]$ be a polynomial over $K$ with value $p = \tfrac{1}{2} a x^2 - b x$. Then

$\tfrac{1}{2} a x^2 - b x = \tfrac{1}{2} a(x - \tfrac{b}{a})^2 - \tfrac{b^2}{2a}$