# Probability of real roots for $x^2 + Bx + C = 0$ [duplicate]

Question: The numbers $B$ and $C$ are chosen at random between $-1$ and $1$, independently of each other. What is the probability that the quadratic equation $$x^2 + Bx + C = 0$$ has real roots? Also, derive a general expression for this probability when B and C are chosen at random from the interval $(-q, q)$ for and $q>0$.

My approach: since we're trying to find the probability of real roots. We should first realize when it has imaginary roots. So, $$B^2 - 4aC < 0$$ $$a = 1$$ $$B^2 < 4C$$ I'm not sure where to go from here. How do I now find the probability of $B$ being greater than $4C$?

## marked as duplicate by grand_chat, Lord Shark the Unknown, user91500, Adrian Keister, MicahSep 1 '18 at 16:08

• Look at the square in the $(B,C)$ plane with vertices $(\pm1,\pm1)$, and work out the area of the pieces the curve $B^2=4C$ divides it into. – Lord Shark the Unknown Aug 31 '18 at 15:40
• By calculating the area defined by this inequality on the $(B,C)$-plane. – MigMit Aug 31 '18 at 15:40
I assume you mean that $$B,\,C\sim U(-1,\,1)$$. We'll get the answer as a function of a fixed value for $$C$$, then average it out. For $$C<0$$ (which has probability $$1/2$$), the result is $$0$$; for $$C> 1/4$$ (which has probability $$3/8$$), the result is $$1$$; for $$0\le C\le\frac{1}{4}$$ (which has probability $$\frac{1}{8}$$), the condition $$-2\sqrt{C}\le B\le 2\sqrt{C}$$ has probability $$4\sqrt{C}$$. So the final result is $$\frac{3}{8}+\frac{1}{8}\int_0^{1/4} 4\sqrt{C}dC=\frac{3}{8}+\frac{1}{3}\bigg(\frac{1}{4}\bigg)^{3/2}=\frac{5}{12}.$$
Edit: the above is the probability of non-real complex roots; the probability of real roots is $$1-\frac{5}{12}=\frac{7}{12}$$.