Let $p(x)$ be a monic cubic polynomial with three distinct real roots. How many real roots does $\big(p'(x)\big)^2 - 2\,p(x)\,p''(x)$ have? So I came across this problem 

Let $p(x)$ be a monic polynomial of degree $3$ with three distinct real roots. How many real roots does the polynomial $\big(p'(x)\big)^2 - 2\,p(x)\,p''(x)$ have?

If you let the given expression equal $f(x)$ and take its derivative, you get that $f'(x)=-12\,p(x)$ This means that the roots of $p(x)$ are where the extrema of $f(x)$ are. You can also figure out that the leading coefficient of $p(x)$ is $-3$ so for positively large and negatively large values of $x$, $f(x)$ is negative.
From here, how do I figure out what is going on in between and how many real roots there are?
For those who want to know, this problem is from the Swedish Mathematical Olympiad in 1988.
 A: First, note that  $f(x):=\big(p'(x)\big)^2-2\,p(x)\,p''(x)$ is a polynomial of degree $4$ whose leading coefficient is $3^2-2\cdot 1\cdot 6=-3<0$.  That is, $$\lim_{x\to-\infty}\,f(x)=-\infty\text{ and }\lim_{x\to+\infty}\,f(x)=-\infty\,.\tag{*}$$
If $c_1$, $c_2$, and $c_3$ are the three distinct real roots of $p(x)$, say $c_1<c_2<c_3$, then $$f\left(c_i\right)=\big(p'(c_i)\big)^2>0\,,$$
as $p'(c_i)\neq 0$ for $i=1,2,3$ (because $p$ has no double roots).  This result, together with (*) and continuity of $f$, implies that the polynomial $f(x)$ has at least two real roots (one root in the interval $(-\infty,c_1)$ and another root in the interval $(c_3,+\infty)$).
It can be easily seen that $p'''(x)=3!=6$, so $$f'(x)=-2\,p(x)\,p'''(x)=-12\,p(x)\,.$$  Thus, the roots of $f'(x)$ are precisely $c_1$, $c_2$, and $c_3$ (these are simple roots).  Hence, in each of the four intervals $(-\infty,c_1)$, $(c_1,c_2)$, $(c_2,c_3)$, and $(c_3,+\infty)$, $f(x)$ has at most one root.  Thus, the two roots of $f(x)$ we have found thus far are the only two roots outside the interval $[c_1,c_3]$.  We claim that $f(x)$ has no other roots by showing that $f(x)>0$ for all $x\in[c_1,c_3]$.
Let $\beta$ be the unique root of the linear polynomial $p''(x)$ (that is, $x=\beta$ is the inflection point of $p(x)$).  Then, trivially, $\beta\in (c_1,c_3)$.  Observe that $p(x)>0$ for $x\in(c_1,c_2)$ and $p(x)<0$ for $x\in (c_2,c_3)$.
Case I: $\beta\leq c_2$.  Obviously, we have $p''(x)<0$ for $x\in(c_1,\beta)$, and $p''(x)>0$ for $x\in (c_2,c_3)$, so that $$p(x)\,p''(x)<0\text{ for }x\in(c_1,\beta)\cup(c_2,c_3)\,.$$
This shows that
$$f(x)=\big(p'(x)\big)^2-2\,p(x)\,p''(x)>0\text{ when }x\in(c_1,\beta)\cup(c_2,c_3)\,.$$
Now, we look at $x\in[\beta,c_2]$.  Since $$f'(x)=-12\,p(x)\leq 0\text{ for }x\in[\beta,c_2]\,,$$
we conclude that
$$f(c_2)-f(x)=\int_x^{c_2}\,f'(t)\,\text{d}t\leq 0\text{ for }x\in[\beta,c_2]\,,$$
so
$$f(x)\geq f(c_2)>0\text{ for }x\in[\beta,c_2]\,.$$
Case II: $\beta> c_2$.  Obviously, we have $p''(x)<0$ for $x\in(c_1,c_2)$, and $p''(x)>0$ for $x\in (\beta,c_3)$, so that $$p(x)\,p''(x)<0\text{ for }x\in(c_1,c_2)\cup(\beta,c_3)\,.$$
This shows that
$$f(x)=\big(p'(x)\big)^2-2\,p(x)\,p''(x)>0\text{ when }x\in(c_1,c_2)\cup(\beta,c_3)\,.$$
Now, we look at $x\in[c_2,\beta]$.  Since $$f'(x)=-12\,p(x)\geq 0\text{ for }x\in[c_2,\beta]\,,$$
we conclude that
$$f(x)-f(c_2)=\int^x_{c_2}\,f'(t)\,\text{d}t\geq 0\text{ for }x\in[c_2,\beta]\,,$$
so
$$f(x)\geq f(c_2)>0\text{ for }x\in[c_2,\beta]\,.$$
Ergo, $f(x)>0$ for all $x\in[c_1,c_3]$.  As a result, the polynomial $f(x)$ has exactly two real roots.

P.S. In fact, if $p(x)$ has a unique simple real root, then $f(x)$ also has exactly two real roots.  On the other hand, if $p(x)$ has two distinct real roots $a$ and $b$, with $a$ being a root of order $2$, then $a$ is a real root of $f(x)$, which is also a root of order $2$, and there is another root of $f(x)$, namely, $x=\dfrac{4b-a}{3}$.  Similarly, when $p(x)$ has a real root $\gamma$ of order $3$, $\gamma$ is a real root of $f(x)$ of order $4$.  Consequently, for a (not necessarily monic) cubic polynomial $p(x)\in\mathbb{R}[x]$, the quartic polynomial $f(x)=\big(p'(x)\big)^2-2\,p(x)\,p''(x)$ has exactly two real roots (counting multiplicities) if and only if $p(x)$ has no repeated roots.
