#math/calculus
For a quadratic expression with $a\neq 0$, completing the square uses
$
ax^{2}+bx+c=a\left(x+\frac{b}{2a}\right)^{2}+c-\frac{b^{2}}{4a}.
$
This form reveals the vertex of the graph and gives the quadratic formula. Setting $ax^{2}+bx+c=0$,
$
\begin{aligned}
a\left(x+\frac{b}{2a}\right)^{2}&=\frac{b^{2}-4ac}{4a},\\
x+\frac{b}{2a}&=\pm\frac{\sqrt{b^{2}-4ac}}{2a},\\
x&=\frac{-b\pm\sqrt{b^{2}-4ac}}{2a}.
\end{aligned}
$
The **discriminant** $b^{2}-4ac$ determines the real roots: two when it is positive, one repeated root when it is zero, and none when it is negative.
> [!Practice]
> Marsden & Weinstein, p. 21, exercise 53.