How can one prove that if discriminant of a quadratic function is zero, then it is perfect square

algebra-precalculusquadratic-formsreal-analysissolution-verification

Let $f(x)=ax^2+bx+c, \ a \neq 0$. The expression $\Delta=b^2-4ac$ is usually called discriminant. Literature, e.g. Bostock and Chandler (2004), states that if $\Delta=0$, then $f(x)$ is a perfect square.

My attempt

Suppose $\Delta=0$, then $b=2\sqrt{a} \sqrt{c}$
Thus $f(x)=ax^2\pm 2\sqrt{a} \sqrt{c}x+c=(\sqrt{a}x \pm \sqrt{c})^2$

which is a perfect square indeed.

However, by just remembering theory, I read that it should be $f(x)=a \left(x+\frac{b}{2a} \right)^2$

Is this proof correct? Is there a contradiction?

Best Answer

First, from your result, note that you may factor out $\sqrt a$:

$$\begin{align*} f(x) &= (\sqrt a x + \sqrt c)^2 \\ &= (\sqrt a x + \sqrt c)(\sqrt a x + \sqrt c) \\ &= \sqrt a \sqrt a \left( x + \frac{\sqrt c}{\sqrt a} \right)\left( x + \frac{\sqrt c}{\sqrt a} \right)\\ &= a \left( x + \frac{\sqrt c}{\sqrt a} \right)^2 \end{align*}$$

Now, you know that $b = 2 \sqrt a \sqrt c$, so, dividing both sides by $2a$,

$$\frac{b}{2\sqrt a \sqrt a} = \frac{2 \sqrt a \sqrt c}{2\sqrt a \sqrt a} \implies \frac{b}{2a}= \frac{\sqrt c}{\sqrt a} $$

Hence,

$$f(x) = a \left( x + \frac{b}{2a} \right)^2$$

as desired.


Notes: Strictly speaking, since $\sqrt{b^2} = |b|$, not $b$ itself, we only know that

$$b = \pm 2 \sqrt a \sqrt c$$

The negative case gives the factorization

$$f(x) = a \left( x - \frac{b}{2a} \right)^2$$

Strictly speaking, we shouldn't be playing so fast-and-loose with the multiplicativity of roots, either. Sure, $\sqrt{ab} = \sqrt a \sqrt b$ for $a,b \ge 0$, but obviously (making certain assumptions on what the square root of a negative even means, beyond the scope of the post)

$$-1 = \sqrt{-1} \sqrt{-1} \ne \sqrt{(-1)^2} = 1$$

so you may need to consider several (tedious but mostly identical) cases depending on the signs of $a,c$.

The above answer does not account for these technicalities, so be mindful. (That is, the above answer is making assumptions on the sign of $a,c$.)