We can formalize the notion of the probability that a randomly selected quadratic real polynomial has real roots as follows:
Suppose $R > 0$, and suppose the random variables $a, b, c$ are (independently) uniformly distributed over the interval $[-R, R]$. Let $P_2(R)$ denote the probability that the quadratic polynomial $p(x) := ax^2 + bx + c$ has real roots; what is $P_2 := \lim_{R \to \infty} P_2(R)$?
A quadratic polynomial $p(x) := ax^2 + bx + c$ has two real roots iff its discriminant $$\Delta(p) := b^2 - 4ac$$ is positive, so $$P_2(R) = \frac{1}{8 R^3} \iiint_{[-R, R]^3} \chi_{\{\Delta \geq 0\}} \, da \,db \,dc ,$$ where $\chi_{\bullet}$ denotes the characteristic function. Since $\Delta$ is homogeneous in $a, b, c$, the set $\{\Delta \geq 0\}$ is invariant under dilations and so $P_R$ does not depend on $R$; hence $P_2 = P_2(1)$
Using the symmetry of $\Delta$ under the transformations $b \mapsto b$ and $a \leftrightarrow c$, along with the observation that $\Delta > 0$ if $a, c$ have opposite signs, we can evaluate the above integral as \begin{align} P_2 &= \frac{1}{2} + \frac{1}{2} \int_0^1 \int_0^{\min\left\{1, \frac{1}{4c}\right\}} \int_{2 \sqrt{a c}}^1 db \,da \,dc \\ &= \frac{1}{2} + \frac{1}{2} \left( \int_0^{\frac{1}{4}} \int_0^1 \int_{2\sqrt{ac}}^1 db \,da \,dc + \int_{\frac{1}{4}}^1 \int_0^{\frac{1}{4 c}} \int_{2 \sqrt{ac}}^1 db \,da \,dc \right) \\ &= \frac{41}{72} +\frac{\log 2}{12} \\ &= 0.62721\!\ldots . \end{align} (As a sanity check, a Monte Carlo simulation with $10^7$ trials gave a probability that agrees with this value to $\sim \!\!1$ part in $10^4$.)
This raises a natural next question:
What is the probability $P_3$ that a randomly selected real cubic polynomial has all real roots?
We formalize and set up the problem just as the quadratic case: Recall that $q(x) := a x^3 + b x^2 + c x + d$ has all real roots if its discriminant $$\Delta(q) := -27 a^2 d^2+18 a b c d-4 a c^3-4 b^3 d+b^2 c^2$$ is positive. As is true for the discriminant for any degree, $\Delta$ is homogeneous in the coefficients $a, b, c, d$, so the probability is $$P_3 = \frac{1}{16} \iiiint_{[-1, 1]^4} \chi_{\{\Delta \geq 0\}} \,da \,db \,dc \,dd .$$ In principal one can proceed as before, but as $\Delta$ is a (complicated) quartic expression here, the algebra appears wildly more complicated than in the quadratic case. Is there a better way to evaluate $P_3$? (If so, it might hint at a more elegant way to approach the quadratic case.)
A Monte Carlo simulation with $10^6$ trials gives that $P_3 \approx 0.218$.
There are some obvious generalizations, namely: (1) For any positive integer $n$, what is the probability $P_n$ that a polynomial of degree $n$ has all real roots? (2) For any positive integer $n$, what is the probability $P_n'$ that a polynomial of degree $n$ has positive discriminant? Recall that $\Delta(r) > 0$ implies that the number of real roots of $r$ is equal to $r$ modulo $4$, so we only have $P_n = P_n'$ for $n = 2, 3$ but (a moment's thought shows that) for $n \geq 4$ one has $P_n' > P_n$.
Edit As Will Jagy has pointed out, there are good reasons to consider other distributions on the polynomials, and for at least one of these the answer is simpler: If one takes on the space of degree $n$ polynomials the distribution for which the distribution of the $i$th coefficient is normal with mean $0$ and variance $n \choose i$ (which turns out to be natural in a particular way), then Kostlan's extremely interesting paper shows that the expected number of zeros is $\sqrt{n}$, from which we can conclude (for this distribution) that $P_2 = \tfrac{1}{\sqrt{2}} = 0.70710\!\ldots$ and $P_3 = \frac{1}{2}(\sqrt{3} - 1) = 0.36602\!\ldots$.
$x^3 + b_2 x^2 + b_1 x + b_0 = 0$. .....
in two variable coefficients.
– Slumberland Apr 30 '21 at 19:02From this reduced solution, we reintroduce the missing physical freedom to get the general, clarifying our assumptions about the nature of the differentials (our variation procedure) along the way.
Hope that wasn't hopelessly naive. peace
– Slumberland Apr 30 '21 at 19:36