Problem: Let $P, Q \in \RR[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.

Solution: This is true even with $\RR$ replaced by $\CC$,
and it will be necessary to work in this generality.

\paragraph{First solution using transformations.}
We will prove the claim in the following form:

\begin{claim*}
Assume $P, Q \in \CC[x]$ are relatively prime.
If $\alpha P + \beta Q$ is a square for four different
choices of the ratio $[\alpha : \beta]$
then $P$ and $Q$ must be constant.
\end{claim*}

Call pairs $(P,Q)$ as in the claim \emph{bad};
so we wish to show the only bad pairs are pairs of constant polynomials.
Assume not, and take a bad pair with $\deg P + \deg Q$ minimal.

By a suitable M\"obius transformation,
we may transform $(P,Q)$ so that the four ratios are $[1:0]$,
$[0:1]$, $[1:-1]$ and $[1:-k]$,
so we find there are polynomials $A$ and $B$ such that
\begin{align*}
  A^2 - B^2 &= C^2 \\
  A^2 - k B^2 &= D^2
\end{align*}
where $A^2 = P+\lambda_1 Q$, $B^2 = P+\lambda_2 Q$, say.
Of course $\gcd(A,B) = 1$.

Consequently, we have $C^2 = (A+B)(A-B)$
and $D^2 = (A+\mu B)(A-\mu B)$ where $\mu^2 = k$.
Now $\gcd(A,B) = 1$, so $A+B$, $A-B$, $A+ \mu B$ and $A - \mu B$
are squares; id est $(A,B)$ is bad.
This is a contradiction, since $\deg A + \deg B < \deg P + \deg Q$.

\paragraph{Second solution using derivatives (by Zack Chroman).}
We will assume without loss of generality that $\deg P \neq \deg Q$;
if not, then one can replace $(P,Q)$ with $(P+cQ,Q)$
for a suitable constant $c$.

Then, there exist $\lambda_i \in \CC$ and polynomials $R_i$
for $i=1,2,3,4$ such that
\begin{align*}
  P + \lambda_i Q &= R_i^2 \\
  \implies P' + \lambda_i Q' &= 2 R_i R_i' \\
  \implies R_i &\mid Q'(P+\lambda_i Q) - Q(P' + \lambda_i Q')
  = Q'P - QP'.
\end{align*}
On the other hand by Euclidean algorithm it follows that
$R_i$ are relatively prime to each other.
Therefore
\[ R_1 R_2 R_3 R_4 \mid Q' P - Q P'. \]
However, we have
\begin{align*}
  \sum_1^4 \deg R_i
  &\ge \frac{3\max(\deg P, \deg Q) + \min(\deg P, \deg Q)}{2} \\
  &\ge \deg P + \deg Q > \deg(Q'P - QP').
\end{align*}
This can only occur if $Q'P - QP' = 0$ or $(P/Q)' = 0$
by the quotient rule!
But $P/Q$ can't be constant, the end.

\begin{remark*}
  The result is previously known; see e.g.\
  Lemma 1.6 of \url{https://mathweb.ucsd.edu/~ebelmont/ec-notes.pdf}
  or Exercise 6.5.L(a) of Vakil's notes.
\end{remark*}