# What is the connection between the discriminant of a quadratic and the distance formula?

The $x$-coordinate of the center of a parabola $ax^2 + bx + c$ is $$-\frac{b}{2a}$$

If we look at the quadratic formula

$$\frac{-b \pm \sqrt{b^2 - 4ac}}{2a}$$

we can see that it specifies two points at a certain offset from the center

$$-\frac{b}{2a} \pm \frac{\sqrt{b^2 - 4ac}}{2a}$$

This means that $\frac{\sqrt{b^2 - 4ac}}{2a}$ is the (horizontal) distance from the vertex to the roots. If I squint, the two squared-ish quantities being subtracted under a square root sign reminds me of the Euclidean distance formula

$$\sqrt{(x_0 - x_1)^2 + (y_0 - y_1)^2}$$

Is there a connection? If not, is there any intuitive or geometric reason why $\frac{\sqrt{b^2 - 4ac}}{2a}$ should be the horizontal distance from the vertex to the roots?

• Euclidean distance formula is for two dimensional points. Here you have only one dimensional $x$. – Mehdi Jafarnia Jahromi May 3 '15 at 4:23
• Agreed. So is the resemblance a coincidence? – Eli Rose May 3 '15 at 4:24
• In my opinion, completely subjective, yes, it's just a coincidence. (moreover, if you restrict to integer polynomials, $4ac$ need not be a square). – Daniel May 3 '15 at 4:28
• I haven't worked out the details but it may be productive to consider $$ax^2+bx-\frac{p^2}{4a}=0$$ – John Joy May 3 '15 at 10:40
• Hey Eli, your question made me recall a geometric representation of the complex roots of a quadratic in the real plane. Not sure if this can directly relate to your question, but here's a visualization that you may appreciate demonstrations.wolfram.com/… – zahbaz Jun 21 '15 at 20:49

The connection you are looking for is simply Pythagoras theorem!

Imagine an upside down parabola. I ask that it be upside down so that the $y$ coordinate of the center is posiive. I do this just for convinience, my arguments are centainly true for any parabolas with two zeros.

You ask for a relationship between the equation for distance and the quadratic formula. Imagine two lines:

1) One connecting the center and the $x$-axis

2) One connecting the center and the zero.

The thing you have to see here, is that these two lines, when combined with the horizontal distance between the center and the zero, form a right triangle!

The length of line $1$ is simply the $y$ coordinate of the center, while the length of line $2$ (call it $H$) is given by the distance formula: $$H = \sqrt{(x_c-x_0)^2 + (y_c-y_0)^2}$$

And the horizontal distance is connected to these two by Pythagoras: $$y_c^2 + D^2 = H^2 \to D = \sqrt{H^2-y_c^2}$$

Your squinting was almost right. You just forgot that Pythagoras also gives these funny combinations of squares and square roots.

Let's do some algebra: The coordinates of the center are: $$x_c = \frac{-b}{2a} \quad \quad y_c = \frac{b^2(1-2a) + 2ac}{4a}$$

If we take the quadratic formula for granted, the coordinates of a zero are:

$$x_0 = \frac{-b}{2a} + \frac{\sqrt{b^2-4ac}}{2a} \quad \quad y_0 =0$$

We can calculate $H$, but since I'm lazy I'll calculate $H^2$: $$H^2 = (x_c-x_0)^2 + (y_c-y_0)^2$$ $$H^2 = \frac{b^2-4ac}{4a^2} + y_c^2$$

Note I left $y_c$ as is. You'll see why in a second:

The distance you want is:

$$D = \sqrt{H^2-y_c^2} = \sqrt{\frac{b^2-4ac}{4a^2} + y_c^2 - y_c^2} = \frac{\sqrt{b^2-4ac}}{2a}$$

So the link you were missing is the right triangle formed by the center, the zero and the $x$-axis. Note also that the distance formulate is derived from Pythagoras, so in reality the only connection is between Pythagoras and the quadratic formula.

• -1. If I understand correctly, you essentially found $D$ by "taking the quadratic formula for granted," so it is not too surprising that the correct value for $D$ pops out at the end. Repeating the argument with any point whose $x$-coordinate is $-\frac{b}{2a}$ would have yielded the same result as using the center. I also don't think this yields any insight into OP's observation that the quantity inside the square root appears to be a difference of terms. – Samuel Li Aug 31 '18 at 12:22

Suppose that $a\ne 0$ and $b^2-4ac\geq 0$. Let $f(x)=ax^2+bx+c$ and $$x_0= -\frac{b}{2a},\; x_1=\frac{-b+\sqrt{b^2-4ac}}{2a}, \;x_2=\frac{-b-\sqrt{b^2-4ac}}{2a}.$$ It follows that $$y_0=f(x_0)=\frac{-b^2+4ac}{4a},\;y_1=f(x_1)=0, \; y_2=f(x_2)=0.$$ The distances from vertex to roots: $$d_1=\sqrt{(x_1-x_0)^2+(y_1-y_0)^2}=\sqrt{\left(-\frac{b}{2a}-\frac{-b+\sqrt{b^2-4ac}}{2a}\right)^2+\left(\frac{-b^2+4ac}{4a}\right)^2}=\frac{\sqrt{(b^2-4ac)^2+4(b^2-4ac)}}{4|a|}>\frac{\sqrt{b^2-4ac}}{2|a|},$$ $$d_2=\sqrt{(x_2-x_0)^2+(y_2-y_0)^2}=\sqrt{\left(-\frac{b}{2a}-\frac{-b-\sqrt{b^2-4ac}}{2a}\right)^2+\left(\frac{-b^2+4ac}{4a}\right)^2}=\frac{\sqrt{(b^2-4ac)^2+4(b^2-4ac)}}{4|a|}>\frac{\sqrt{b^2-4ac}}{2|a|}.$$

• Sorry, I was being imprecise when I said "distance" -- what I meant was lateral distance, between the x-coordinates only. Certainly the Euclidean distance is greater. It's quite interesting to see $\frac{-b^2 + 4ac}{4a}$ pop out when you put in $-\frac{b}{2a}$, though. Can we turn that into an intuition? – Eli Rose May 3 '15 at 14:30

For the equation $ax^2 + bx + c = 0$ the second coefficients represents the average of the two roots:

$$\frac{1}{2}(r_1 + r_2) = -\frac{b}{2a}$$

Instead of using the quadratic formula directly we can just observe that:

$$(x - r_1)(x - r_2) = x^2 - (r_1 + r_2) + r_1 r_2$$

This also recovers the product mean of the two roots is $r_1 r_2 = \frac{c}{a}$.

In order to get the distance between the two roots we need to estimate the distance $|r_1 - r_2|$:

$$|r_1 - r_2| = \sqrt{(r_1 + r_2)^2 - 4 r_1 r_2} = \sqrt{\frac{b^2}{a^2} - \frac{4c}{a}} = \frac{\sqrt{b^2 - 4ac}}{a}$$

Consider the image below. The roots of $f(x)=ax^2+bx+c$ will lie on the circle in the complex plane whose center is $\dfrac{-b}{2a}.$ In the case where both roots are real numbers, they will lie on the real line at $R_1$ and $R_2.$ In the case where the roots are purely imaginary, they will lie on the vertical axis at $ir_1$ and $-ir_1.$ Now we want to find $d$ the radius of the circle.

To do this, note that the product of the roots of $f(x)=ax^2+bx+c$ is $\dfrac ca.$ So in the case that the roots are purely imaginary, we have $$\frac ca=(ir_1)(-ir_1)=r_1^2,$$ And thus $r_1=\sqrt{\dfrac ca}.$ Note these roots will only occur when $b=0$ and $ac>0.$

Now to find the distance $d,$ we use the Pythagorean Theorem to get

$$d^2=\left(\frac{-b}{2a}\right)^2+\left(\pm i\sqrt{\frac{c}{a}}\right)^2=\frac{b^2}{4a^2}+\frac{-c}{a}=\frac{b^2-4ac}{4a^2},$$ and thus $$d=\frac{\pm\sqrt{b^2-4ac}}{2a}.$$

In the case where the roots are both real, for $b^2>4ac$ we have $$R_1=\frac{-b-\sqrt{b^2-4ac}}{2a},\quad\text{and}\quad R_2=\frac{-b+\sqrt{b^2-4ac}}{2a}.$$

One may struggle or take issue about the above argument, since $d$ is not a distance as traditionally defined in the complex plane. See related question:

Pythagorean Theorem for imaginary numbers

It should be noted that my notion of distance is being done on the hyperbolic space. In both the Euclidean plane and the Hyperbolic plane, the distance between points on the real line is the same. But once we venture off the real line we get different versions of the Pythagorean Theorem.

In Euclidean space, we have $\cos^2t+\sin^2t=1\Longrightarrow a^2+b^2=c^2.$

In Hyperbolic space, we have $\cosh^2t{\color{red}-}\sinh^2t=1\Longrightarrow a^2-b^2=c^2\equiv a^2+(\pm ib)^2=c^2.$

Why do we need to represent our roots on the hyperbolic plane?

Because it allows us to use imaginary numbers as lengths in the Euclidean plane!

Depending on what is meant by ‘connection’.

If we start from the distance formula, we can eventually obtain the said distance $\frac{\sqrt{b^2 - 4ac}}{2a}$. Therefore the answer is yes.

However, hoping to start from the distance expression and trying to convert it to the form of the distance formula is a kind of asking too much.

Regarding the geometric reason:-

We can look at an explanation via sum and product of roots $\alpha, \beta$ where $\alpha$ and $\beta$ have their values given by the said quadratic formula and with a further assumption of $\beta \ge \alpha$.

The distance between these two roots is given by

$\beta – \alpha = \sqrt {(\beta - \alpha)^2} = …$ using sum of roots and product of roots technique ... = $\frac{\sqrt{b^2 - 4ac}}{2a}$

I believe there are more differences than similarities.

• The distance formula needs two squares, you have a square and a product
• You need to add quantities in the distance formula to make it positive definite, not subtract them
• You need at least two dimensions as others noted.

You just squinted too much :)

• Could you explain in more detail? – Salomo May 3 '15 at 10:02

Without loss of generality, we can find the horizontal distance between $x=\dfrac{-b}{2a}$ and $x=\dfrac{-b+\sqrt{b^2-4ac}}{2a}.$ So inputting these coordinates into the distance formula, with both $y-$coordinates equal to zero, we have \begin{align} d&=\sqrt{\left(\dfrac{-b+\sqrt{b^2-4ac}}{2a}-\dfrac{-b}{2a}\right)^2+(0-0)^2}\\ &=\dfrac{\sqrt{b^2-4ac}}{2a} \end{align} This is the horizontal distance from the positive root of $f(x)=ax^2+bx+c$ "to the right" of the point $\left(\dfrac{-b}{2a},0\right).$ So both roots are located this distance left and right of the vertex's $x-$coordinate, giving the roots $x-$coordinates $$\left(\dfrac{-b\pm\sqrt{b^2-4ac}}{2a},0\right).$$

As a side note, the quadratic formula is derived from completing the square as follows: \begin{align} y&=ax^2+bx+c\\ &=a\left(x^2+\frac ba x+\frac ca\right)\\ &=a\left(x^2+\frac ba x+\frac{b^2}{4a^2}+\frac ca-\frac{b^2}{4a^2}\right)\\ &=a\left(x+\frac b{2a}\right)^2+c-\frac{b^2}{4a}. \end{align} Now letting $y=0,$ we get \begin{align} a\left(x+\frac b{2a}\right)^2&=\frac{b^2}{4a}-c\\ \left(x+\frac b{2a}\right)^2&=\frac{b^2}{4a^2}-\frac ca\\ \left(x+\frac b{2a}\right)&=\pm\sqrt{\frac{b^2}{4a^2}-\frac ca}=\pm\sqrt{\frac{b^2-4ac}{4a^2}}=\frac{\pm\sqrt{b^2-4ac}}{2a}\\ x&=\dfrac{-b+\sqrt{b^2-4ac}}{2a}. \end{align}

We have $$f(x)=ax^2+bx+c=a(x+\frac{b}{2a})^2+\frac{4ac-b^2}{4a}$$ with $b^2-4ac\geq 0$ and $a\neq 0$. The vertex of the parabola is $$V\left(-\frac{b}{2a},\frac{4ac-b^2}{4a}\right)$$ and the root(s) are at $$R_1\left(-\frac{b}{2a}+\sqrt{\frac{b^2-4ac}{4a^2}},0\right)~\text{and}~R_2\left(-\frac{b}{2a}-\sqrt{\frac{b^2-4ac}{4a^2}},0\right).$$

1. If $b^2-4ac=0$, then we only have one root at $x=-\frac{b}{a}$. Thus we get the point $V\left(-\frac{b}{2a},0\right)$, which simultaneously is the vertex of the parabola, meaning that the horizontal distance from the vertex to the root is $0$.
2. If $b^2-4ac>0$, then we have two different roots and the vertex of the parabola does not lie on the x-axis. But as we are only interested in the horizontal distance we again look at $V_x\left(-\frac{b}{a},0\right)$. Now we can apply the formula for the eucledian distance to $V_x$ and $R_1$: $$d(V_x,R_1)=\sqrt{\left(-\frac{b}{2a}+\sqrt{\frac{b^2-4ac}{4a^2}}-\left(-\frac{b}{2a}\right)\right)^2+\left(0-0\right)^2}=\sqrt{\frac{b^2-4ac}{4a^2}}.$$ For $V_x$ and $R_2$ we get $$d(V_x,R_2)=\sqrt{\left(-\frac{b}{2a}-\sqrt{\frac{b^2-4ac}{4a^2}}-\left(-\frac{b}{2a}\right)\right)^2+\left(0-0\right)^2}=\sqrt{\left(-\frac{b^2-4ac}{4a^2}\right)^2}=\sqrt{\frac{b^2-4ac}{4a^2}}.$$

So $$d=\sqrt{\frac{b^2-4ac}{4a^2}}$$ is indeed the horizontal distance between the vertex and the roots.

This is also expressed in your formula, as $$-\frac{b}{2a}\pm \sqrt{\frac{b^2-4ac}{4a^2}}$$ only gives you the $x$-coordinate of the roots. As $-\frac{b}{2a}$ is the $x$-coordinate of the vertex, for the roots you only add/subtract $\sqrt{\frac{b^2-4ac}{4a^2}}$, meaning you go "left/right" starting at $V_x$.