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)?


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: enter image description here

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'$.

  • $\begingroup$ Is there anything mathematically interesting about this question/the plots you generated? $\endgroup$ – theideasmith Apr 21 '16 at 16:25
  • $\begingroup$ And what software dos you use for the visualization? $\endgroup$ – theideasmith Apr 21 '16 at 17:08
  • $\begingroup$ 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. $\endgroup$ – Wolfgang Bangerth Apr 21 '16 at 18:21
  • $\begingroup$ Would you mind sharing the code you used. I'm a novice at this $\endgroup$ – theideasmith Apr 21 '16 at 18:23
  • $\begingroup$ I used the following command: splot [-10:10][-10:10] -y+sqrt(y**2-4*x),-y-sqrt(y**2-4*x). $\endgroup$ – 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.

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.