A second degree polynomial function is written under the form of $f(x) = ax^2 + bx + c$. A polynomial function has a couple of defining characteristics. The function is in blue and it has three main points of interest that we'll talk about here:
The roots which correspond to the intersection points between the function (in blue) and the x-axis. There can be 0, 1 or 2 of these points. In this example, there are two of them.
The vertex which corresponds to the point at which the function goes from going down to up (or from going up to going down if the $a$ parameter of the function were negative). It's the point at which the function goes "flat". The derivative of the function is equal to 0 at that point.
The goal: Let's create a formula to find the roots from the values of $a$, $b$, and $c$. Anyone who has studied mathematics has the formula $x = \frac{-b \pm \sqrt{b^2 - 4ac}}{2a}$ engrained in their brain forever, but where does it come from?? We'll try to recreate it now.
A good easy first step is to create a formula that finds the vertex position based on the function parameters. We know that the vertex corresponds to the single "flat" part of the function so:
$f'(x_{vertex}) = 0$
where $f'(x_{vertex}) = 2ax_{vertex} + b$
$\Leftrightarrow 2ax_{vertex} + b = 0$
$\Leftrightarrow 2ax_{vertex} = -b$
$\Leftrightarrow \boxed{x_{vertex} = \frac{-b}{2a}} $
How does finding the vertex help us? Well visually, the second degree polynomial function looks symmetrical around the vertical axis of $x = x_{vertex}$.
If this is true, then:
$f(x_{vertex} + x) = f(x_{vertex} - x)$
We can easily check this:
$f\left(\frac{-b}{2a}+x\right)=a\left(\frac{-b}{2a}+x\right)^2+b\left(\frac{-b}{2a}+x\right)+c$
$=a\left(\frac{b^2}{4a^2}-\frac{bx}{a}+x^2\right)-\frac{b^2}{2a}+bx+c $
$=\frac{ab^2}{4a^2}-bx+ax^2-\frac{2ab^2}{4a^2}+bx+c$
$=\boxed{ax^2+c-\frac{b^2}{4a}}$
Now with $f(x_{vertex}-x)$
$f\left(\frac{-b}{2a}-x\right)=a\left(\frac{-b}{2a}-x\right)^2+b\left(\frac{-b}{2a}-x\right)+c$
$=a\left(\frac{b^2}{4a^2}+\frac{bx}{a}+x^2\right)-\frac{b^2}{2a}-bx+c$
$=\frac{ab^2}{4a^2}+bx+ax^2-\frac{2ab^2}{4a^2}-bx+c$
$=\boxed{ax^2+c-\frac{b^2}{4a}}$
As we can see, $f(x_{vertex} + x)$ is indeed equal to $f(x_{vertex} - x)$ which means that we've got a symmetry around the vertical axis $x = x_{vertex}$
The implications of this symmetry are that we can simply calculate $x_{vertex}$ and add or subtract a difference to get the two roots (if there are two).
For solutions of $f(x) = 0$, we would have:
$\boxed{ x = x_{vertex} \pm Δ}$
Let's look at a simplified case of the second degree polynomial function in which we assume that b = 0.
This means that we're looking for:
$f(x) = 0$
$\Leftrightarrow ax^2 + c = 0$
$\Leftrightarrow ax^2 = -c$
$\Leftrightarrow x^2 = \frac{-c}{a}$
$\Leftrightarrow \boxed{x = \pm \sqrt{\frac{-c}{a}}}$
We can therefor easily solve functions when b = 0.
The value of $b$ translates the parabola but doesn't change its shape. This simply means that given two polynomial functions, if their values of $a$ are equivalent and the $y$ position of their vertices are equal, then their values of Δ are equal.
As we can see, when the $y$ value of the vertex and the $a$ values are the same, the two functions have the same values of Δ (or 2Δ for the distance between both roots).
This means that a couple of elements that we've been looking at are finally coming together. We said earlier that:
$\boxed{ x = x_{vertex} \pm Δ}$
We know how to calculate $x_{vertex}$ so we just need to find how to calculate Δ. We also just saw that Δ was constant for functions that conserve a same value of $a$ and a same value of $y_{vertex}$. We also saw that we could solve $f(x) = 0$ for functions whose values of $b$ are 0. This means that if we find the function that would be equivalent to $f(x)$ in terms of Δ but with $b = 0$, we could finally calculate Δ.
How to find the function that's equivalent to $f(x)$ in terms of Δ? Let's name this function $g(x)$ to avoid confusion.
with $f(x) = ax^2 + bx + c$
we would have $g(x) = ax^2 + 0 + c'$
We know that $f(x_{vertex}) = g(0)$
$f(x_{vertex}) = f(\frac{-b}{2a}) = a\left(\frac{-b}{2a}\right)^2+b\left(\frac{-b}{2a}\right)+c$
$=a\left(\frac{b^2}{4a^2}\right)+\frac{-b^2}{2a}+c$
$=\frac{b^2}{4a}-\frac{2b^2}{4a}+c$
$\boxed{f(x_{vertex}) = c-\frac{b^2}{4a}}$
$g(0) = a(0)^2 + c' = c'$
$f(x_{vertex}) = g(0)$
$\Leftrightarrow c' = c - \frac{b^2}{4a}$
This means that:
$\boxed{g(x) = ax^2 + c -\frac{b^2}{4a}}$
And we can finally solve for this using the equation we found earlier:
$ \boxed{x = \pm \sqrt{\frac{-c}{a}}}$
$Δ = \pm \sqrt{\frac{-c'}{a}}$
$Δ=\pm \sqrt{\frac{-c+\frac{b^2}{4a}}{a}}$
$Δ=\pm \sqrt{-\frac{4ac-b^2}{4a^2}}$
$Δ=\pm \sqrt{\frac{b^2-4ac}{\left(2a\right)^2}}$
$\boxed{Δ=\pm \frac{\sqrt{b^2-4ac}}{2a}}$
And there it is! We've got it! Back to the original function, we can rewrite the whole formula as:
$f(x) = 0$
$\Leftrightarrow x = \frac{-b}{2a}\ \pm \frac{\sqrt{b^2-4ac}}{2a}$
$\Leftrightarrow \boxed{x = \frac{-b\pm \sqrt{b^2-4ac}}{2a}}$