Prove That No Polynomial Sends $\sin(\theta)$ to $\cos(\theta)$ For All $\theta$ In Some Non-Empty Interval Note: In the context of this question, when I say "polynomial", I mean a single variable polynomial with coefficients in $\mathbb{R}$ and one that has $\mathbb{R}$ as the domain and codomain.
Question: Prove that there exists no polynomial $p$ such that $p(\sin(\theta))=\cos(\theta)\forall\theta\in I,$ where $I$ is some non-empty interval of $\mathbb{R}.$
My Attempt: For the sake of contradiction, let such a polynomial exist. Then, define $g(x):=p(x)^2+x^2-1.$ Since $p$ is a polynomial, it follows that $g$ is too. Now, for all $a\in I, g(\sin(a))=0.$ Since the interval is non-empty, this occurs infinitely many times. By the fundamental theorem of algebra, any polynomial that is zero infinitely many times must be zero identically. Hence, $g(x)=0\forall x\in\mathbb{R}.$ This means that $p(x)=±\sqrt{1-x^2}\forall x\in\mathbb{R}.$ Now, $\sqrt{2}\in\mathbb{R},$ but $p(\sqrt{2})=±i\notin\mathbb{R}.$ This is in contradiction with the fact that the codomain of $p$ is $\mathbb{R}.$ Hence, the initial assumption about the existence of such a polynomial we made must be false. This shows that no such polynomial exists.
Is my argument right? I fear I've made some conceptual error that invalidates my entire proof. Can this statement be proven in a different way?
 A: If $x= \sin t$ and $P(x)= \cos t$ then by the Chain Rule $P'(x) \cos t= -\sin t$ so $P'(x) P(x)=-x$ for some interval of values for $x$. But the degrees of the polynomials on left and right cannot match unless that degree is 1. What happens then?
A: 
By the fundamental theorem of algebra, any polynomial that is zero infinitely many times must be zero identically. Hence, $g(x)=0\forall x\in\mathbb{R}.$ This means that $p(x)=±\sqrt{1-x^2}\forall x\in\mathbb{R}.$ Now, $\sqrt{2}\in\mathbb{R},$ but $p(\sqrt{2})=±i\notin\mathbb{R}.$ This is in contradiction with the fact that the codomain of $p$ is $\mathbb{R}.$

This part of the proof is a little dodgy, and the issue is domains (rather than codomains). You've proven that $g(x) = 0$ for all $x \in \mathbb{R}$ but then you identify $p(x)$ with a function that, regarded as a real function, has domain $[-1, 1]$ (and then you evaluate it outside of its domain), which is... I won't say incorrect, but it's a little awkward and potentially confusing.
I think a cleaner way to argue from here is just to prove that there is no real polynomial $p(x)$ satisfying $p(x)^2 = 1 - x^2$. There are many ways to do this:

*

*$p(x)$ must be a linear polynomial, but then the leading coefficient of $p(x)^2$ must be positive, so can't be $-1$.

*$p(\sqrt{2})^2 = 1 - 2 = -1$ (this is essentially your proof but we avoid the complication mentioned above with domains by keeping the square) which is a contradiction.

*$1 - x^2 = (1 - x)(1 + x)$ is not a square because it has two distinct roots (this argument proves that $p(x)$ can't be a complex polynomial either).

A: Assume WLOG that $I$ is such that $\sin(\theta)$ is either positive or negative for all $\theta \in I$, and that $\cos(\theta)$ is either positive or negative for all $\theta \in I$. So then this partitions into 4 cases:

*

*$\sin(\theta)$ positive for all $\theta \in I$ and $\cos(\theta)$ positive for all $\theta \in I$.


*$\sin(\theta)$ positive for all $\theta \in I$ and $\cos(\theta)$ negative for all $\theta \in I$.


*$\sin(\theta)$ negative for all $\theta \in I$ and $\cos(\theta)$ positive for all $\theta \in I$.


*$\sin(\theta)$ negative for all $\theta \in I$ and $\cos(\theta)$ negative for all $\theta \in I$.
Let us now consider Case 1: $\sin(\theta)$ positive for all $\theta \in I$ and $\cos(\theta)$ positive for all $\theta \in I$. The remaining 3 cases can be handled similarly.
Then for Case 1, let $J$ be the set $\{x:$ there is a $\theta \in I$ such that $\sin(\theta)=x\}$. Then $J$ is a nonempty interval on the reals. Then $\sqrt{1-p^2(x)} = x \ \forall x \in J$, which gives, squaring both sides $1-p^2(x) = x^2 \ \forall x \in J$. Which gives [as $p^2(x)$ is a polynomial and $J$ is infinite cardinality] $p^2(x) = x^2-1$ $\ \forall x \in \mathbb{R}$, which gives deg$(p^2)=$ $2$deg$(p)$ $=$ deg$(x^2-1)$ $=2$, which gives deg$(p)=1$. So then $p$ must be a linear polynomial, which is absurd.
So you were close in your OP.
