Let $p(z)$ and $q(z)$ ($z$ here is a complex number) both as polynomial so that $$p(z) \sin^2 z + q(z) \cos^2 z = 2. \quad \forall z \in \mathbb{C}$$ Determine the value of $p(1) + q(1)$.
My attempt: First I tried to manipulate the equation by using trigonometric identity to make $\tan z$ appear in it, but seems lead no result. Factorizing also gives no result, I think. So, do you have any idea? Please, help.
As suggested in the comments above, let's try plugging in $z = n\pi$, where $n$ is an arbitrary integer. Then we see that $$ q(n\pi) = 2 $$ for all $n$. Thus $q(z)$ is $2$ at an infinite number of locations. The only finite polynomial function that can satisfy this is $q(z) = 2$.
Similarly, plug in $z = \frac{\pi}{2} + n\pi$ to yield $$ p\left(\frac{\pi}{2} + n\pi\right) = 2 $$ for all integer $n$. By the same argument, $p(z) = 2$. Therefore $p(1) + q(1) = 2 + 2 = 4$.
Edit, to clarify:
We have proven that $q(n\pi) = 2$ for any integer $n$. Since there are an infinite number of integers $n$, this means that we have shown that there are an infinite number of values of $z$ which satisfy $q(z) = 2$. Since any non-constant polynomial $f(z)$ satisfies $$ \lim_{z\rightarrow \pm\infty} f(z) = \pm\infty\, , $$ it can only take any given value a finite number of times. Thus $q(z)$ must be a constant. Since we know that (for instance) $q(0) = 2$, we must have $q(z) = 2$ for all $z$.