Suppose $\theta(x,y)$ be a smooth function on a connected domain, taking values in $(0,2\pi]$, and define $ c=\cos(\theta),s=\sin(\theta). $ Suppose that the function $f(x,y)=sc+ic^2$ is holomorphic.
I have a proof that $\theta$ must be constant. I wonder whether there are other, perhaps easier or more conceptual proofs.
My proof:
The Cauchy–Riemann equations imply that $u=sc,v=c^2$ are harmonic functions. A short computation then gives $$ 0=-\Delta v=2\cos(2\theta)(\theta_x^2+\theta_y^2)+\sin(2\theta)\Delta\theta, $$ $$ 0=\Delta u=-2\sin(2\theta)(\theta_x^2+\theta_y^2)+\cos(2\theta)\Delta\theta, $$ or equivalently $$ \begin{pmatrix} 2\cos(2\theta) & \sin(2\theta) \\\ -2\sin(2\theta) & \cos(2\theta) \end{pmatrix}\begin{pmatrix} \theta_x^2+\theta_y^2 \\\ \Delta\theta \end{pmatrix}=0. $$ The invertibility of the matrix implies that $\theta_x=\theta_y=0$, so $\theta$ is constant.
The function $sc +ic^2$ maps $(0,2\pi]$ onto a circle. The range of a nonconstant holomorphic function on a connected domain is open in the plane. It follows that your $f$ is constant, which implies $\theta$ is constant.