Suppose $Y\_1, Y\_2$ are independent real-valued random variables and whose distributions have a density with respect to the Lebesgue measure. Assume that all moments $\mathbb{E}Y\_1^a, \mathbb{E}Y\_2^b$ exist and are finite. Let $p(y\_1,y\_2)$ be any polynomial whose degree with respect to $y\_1$ is positive. 


Is it true that the random variables $p(Y\_1,Y\_2)$ and $Y\_1$ cannot be independent?


For instance, if $p(y\_1,y\_2) = y\_1y\_2,$ and if $Z:=p(Y\_1,Y\_2) = Y\_1Y\_2,$ then independence of $Z$ and $Y\_1$ would imply that $\mathbb{E}Z^2Y\_1^2 = \mathbb{E}Z^2\mathbb{E}Y\_1^2$ and independence of $Y\_1$ and $Y\_2$ gives $\mathbb{E}Y\_1^4.\mathbb{E}Y\_2^2 = (\mathbb{E}Y\_1^2)^2\mathbb{E}Y\_2^2.$ Since $Y\_2$ has a density, we have $\mathbb{E}Y\_2^2>0$ and so, we get $\mathsf{Var}(Y\_1^2) = 0.$ This implies $|Y\_1|$ is a constant which is impossible for a continuous-valued random variable $Y\_1$ possessing a density. This produces a contradiction and hence, $Z$ and $Y\_1$ cannot be independent.



On polynomial functions of random variables and independence
Your argument can be extended to any polynomial.


Let $q(y\_1,y\_2)=(p(y\_1,y\_2))^2$. Then the leading coefficient in $q$, as a polynomial in $y\_1$ is a polynomial $r(y\_2)$ which is a square. Since $Y\_2$ is not supported on $r^{-1}(0)$ (which is finite), we have $\mathbb{E}\_{Y\_2}[r(Y\_2)]>0$.


In particular, this means that the expectation
$$f(y)=\mathbb{E}\_{Y\_2}[q(y,Y\_2)]$$
is a nonconstant polynomial in $y$. Hence, $f(Y\_1)$ can be a constant random variable only if $Y\_1$ is supported on a finite set, namely $f^{-1}(c)$ for some $c$.


