$f(x),g(x)$,2 quadratic polynomials:$|f(x)|≥|g(x)|∀x ∈ R$. Find the number of distinct roots of equation $h(x)h''(x)+(h'(x))^2=0$ if $h(x)=f(x)g(x)$

Let $f(x) = a(x-p)(x-q)$, where $a \neq 0, p, q \in \mathbb R$. Then $|g(p)|\leqslant |f(p)|=0 \implies g(p)=0$, so $g(x)= b(x-p)(x-q)$ for some real $b\neq 0$. Thus we have $h(x) = c(x-p)^2(x-q)^2$ for some real $c\neq0$.

The condition $hh''+(h')^2=0$ is the same as $\dfrac{d}{dx} hh' = 0$.

However, note $h(x)$ has two double roots, hence shares those roots with $h'(x)$. The third root of the cubic $h'(x)$ must also then be real, between those two roots $p, q$. Thus in all, $hh'$ is a seventh degree polynomial with roots of multiplicity $3$ at $p, q$, and one root at some $r$ between $p, q$.

This implies the derivative of $hh'$ must have all six roots real, two with multiplicity two at $p, q$, and one each between $p, r$ and $r, q$.

Putting it all together, if $p, q$ are distinct, $hh''+(h')^2=0$ has four distinct roots, two of multiplicity two at $p, q$ and two distinct ones between $p$ and $q$. If $p=q$, then $hh''+(h')^2$ has only one root, which however has multiplicity $6$.


Since $|f(x)|≥|g(x)|$ implies they have common roots, they both are the same polynomial with a different scaling factor. So, let $g(x)=\lambda f(x)$.

$\Rightarrow h(x)=\lambda f^2(x)$

$\Rightarrow h'(x)=2\lambda f(x)f'(x)$

$\Rightarrow h''(x)=2\lambda(f'^2(x)+f(x)f''(x))$

Substituting and simplifying, we get $f^2(x)(f(x)f''(x)+3f'^2(x))=0$

Now let $f(x)=ax^2+bx+c$. As we are given it has real roots, $b^2-4ac>0 \Rightarrow 40b^2-160ac>0$

Finally substitute $f(x)$ in the previous equation we got after simplification to yield $$f^2(x)(14a^2x^2+14abx+3b^2+2ac)=0$$ Sign of the discriminant for this quadratic will tell us the nature of its roots

$D=a^2(196b^2-56(3b^2+2ac))=a^2(b^2-4ac)$

But previously, $b^2-4ac>0$ and since $a^2>0$, hence, $D>0$

Thus the number of real roots of the given equation is $4$ ($2$ from $f^2(x)$ we factored out earlier and $2$ due to the discriminant of the second quadratic factor being $>0$)

EDIT: Since the question asks for distinct roots of the expression and only mentions that the roots of $f(x)$ are real there is a valid possibility that the roots of $f(x)$ are real and equal. In other words, $b^2-4ac=0$. Solving for the roots in this case we see that all $4$ solutions to the final equation are equivalent

Thus, the number of real roots of the given expression is either $4$ or $1$