TITLE: How to solve this 2017 USATST problem at last problem
QUESTION [8 upvotes]: (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?

REPLY [4 votes]: You can assume that $P,Q$ have different degrees: if they have the same
degree then there is some $c$ such that $\deg(P-cQ) < \deg P$, so
you can write $P + \lambda_i Q = (P-cQ) + (\lambda_i + c) Q$
and proceed as in your solution with $P$ replaced by $P-cQ$.
You must still contend with the possibility that $P$ has smaller degree
but one of the $\lambda_i$ is zero.  This makes the corresponding $R_i$
degree smaller as well.  Fortunately $\deg (P'Q - PQ')$ then drops as well
and the argument still goes through.
One can prove more: it's not even possible for 
$\prod_{i=1}^4 (P+\lambda_i Q)$ to be a square
with pairwise distinct $\lambda_i$ unless $P=cQ$ (or $Q=0$).
Indeed if $R^2 = \prod_{i=1}^4 (P+\lambda_i Q)$ 
then we have a map from the projective line to the elliptic curve
$r^2 = \prod_{i=1}^4 (p+\lambda_i q)$, and such a map must be constant,
so $P:Q$ is constant.  This kind of argument may be out of bounds for USATST,
but it should be possible to unwind it to something like the argument you gave
(one proof of the result about maps from ${\bf P}^1$ to an elliptic curve
uses the Riemann-Hurwitz formula, which can be proved using degrees of
differentials, which comes down to the degree of the numerator of $(P/Q)'$).