(2017 USATST) Let $P, Q \in \mathbb{R}[x]$ be relatively prime nonconstant polynomials. Show that there can be at most three real numbers $\lambda$ such that $P + \lambda Q$ is the square of a polynomial.
Assume otherwise, then there exist four $\lambda_1,\lambda_2,\lambda_3,\lambda_4$ such that $P+\lambda_i Q=R_i^2$. Differentiating, we get that $P'+\lambda_i Q'=2R_i R_i'$. Therefore, $R_i$ divides both $P+\lambda_i Q$ and $P'+\lambda_i Q'$, so it divides $$Q*(P'+\lambda_i Q')-Q'*(P+\lambda_i Q)=P' Q-Q'P.$$
Note that since $P$ and $Q$ are coprime, we clearly must also have $(Q,R_i)=(P,R_i)=1$. If $R_1$ and $R_2$ share some root $c$, then $P(c)+\lambda_1 Q(c)=P(c)+\lambda_2 Q(c)=0$. Since $Q(c) \neq 0$, we get $\lambda_1=\lambda_2$, contradiction. Therefore the $R_i$ are pairwise coprime, so by CRT we get $R_1R_2R_3R_4 \mid P' Q-Q'P$
If $P$ and $Q$ have different degrees, then $\deg(P' Q-Q'P) \leq \deg(P)+\deg(Q)-1$, but \begin{align} \deg(R_1 R_2R_3R_4) &= \deg(R_1)+\deg(R_2)+\deg(R_3)+\deg(R_4) \\ &=4 \frac{\max(\deg(P),\deg(Q))}2 \\ &=2 \max(\deg(P),\deg(Q)) \end{align}
This would imply that $P'Q-Q'P=0$ as a polynomial, but invoking the quotient rule(!), we get that $\bigg(\frac{P}Q\bigg)'=0$, which would imply that either $P$ and $Q$ are not relatively prime, or they share a common factor.
If $P$ and $Q$ have the same degree.How to solve it?