# How to choose a good distribution for visualizing phase changes in the nature of the roots of a quadratic equation

I'm not sure if this SE site is the best one for this question, so let me know where it should be moved to if you think it doesn't belong here.

After learning about the quadratic formula, I'm interested in visualizing how the nature of the roots of a quadratic equation, $ax^2+bx+c$ change with respect its discriminant. I'd like to visualize the discrete nature of the roots of a quadratic equation over all combinations of $a, b, c$ in $b^2-4ac$, i.e. whether the roots are complex, equal, unequal, rational, or irrational, etc. I'm not sure I fully grasp the nature of my question itself and how to get a mathematically sound answer to it.

This is interesting to me because it deals with discrete properties emerging from continuous ones. I'm wondering what is the best way of visualizing/answering this – should I do random sampling? where can I read more about problems of this nature (i.e. discrete properties on continuous variables)?

## 2 Answers

Because the polynomial $ax^2+bx+c$ and $x^2+\frac{b}{a}x + \frac{c}{a}$ have the exact same roots, let's first simplify the problem by only considering the roots of the equation $$x^2+b'x + c' = 0$$ where you can think of $a'=\frac{b}{a}, c'=\frac{c}{a}$. This shows that really only two parameters matter. You could then, for example, plot the (real parts of) the two roots in the $z$-direction of a 3d plot, and let the $x$- and $y$-axes be $a'$ and $b'$. Or, if you're interested in the discriminant, you may choose the $x$-axis as $b'^2-4c'$ and the $y$-axis as $b'$, $c'$, or any other quantity independent of the discriminant. You will then get two surfaces for the two roots wherever they are real.

For example, the following plot shows the two roots for all values where the discriminant is non-negative: Along the parabola, the discriminant is zero, and the two roots coincide. You could easily create a similar plot for other choices of the axes as functions of $b',c'$.

• Is there anything mathematically interesting about this question/the plots you generated? – theideasmith Apr 21 '16 at 16:25
• And what software dos you use for the visualization? – theideasmith Apr 21 '16 at 17:08
• This was visualized with just the venerable, old gnuplot program. Whether it's interesting -- I don't know. You should ask an algebraic geometer what they think about this. – Wolfgang Bangerth Apr 21 '16 at 18:21
• Would you mind sharing the code you used. I'm a novice at this – theideasmith Apr 21 '16 at 18:23
• I used the following command: splot [-10:10][-10:10] -y+sqrt(y**2-4*x),-y-sqrt(y**2-4*x). – Wolfgang Bangerth Apr 22 '16 at 11:54

Well, for the visualization of the discrete and real/imaginary character of the roots, you can simply do a 3D plot of $$\frac{-b\pm \sqrt{b^2-4ac}}{2a}$$ against $a$, $b$, and $c$.

This will give you a surface linking parabolas/square roots/hyperbolas on the different ($aOc$), ($aOb$), ... planes where the surface disappears because the roots become imaginary.

You can also do the same kind of experiment for the real and imaginary parts.

I don't understand the

two equal, two unequal part

As for the rational, irrational part, it's a bit old for me, but I think that the solution will be rational only if $\Delta$ can be written as a fraction of squares, but I don't know how you could use that anyway... You might want to ask on Math.

• Is doing this numerically the best way, or can I answer the problem from a purely symbolic standpoint. – theideasmith Apr 18 '16 at 12:48
• I think you might: $b^2-4ac=0$ could be related to a quadric function – Silmathoron Apr 18 '16 at 12:53