<s>[INST] Parametrization the curve of intersection of sphere $x^2+y^2+z^2=5$ and cylinder $x^2+\left(y-\frac{1}{2}\right)^2=\left(\frac{1}{2}\right)^2$. I've seen similar posts here but none of the answers helped me. I am trying to parametrize a curve of intersection of a (top half $z>0$) sphere $x^2+y^2+z^2=5$ and cylinder $x^2+\left(y-\frac{1}{2}\right)^2=\left(\frac{1}{2}\right)^2$.
I tried $$x=\frac{1}{2}\cos t $$ $$y=\frac{1}{2}+\frac{1}{2}\sin t$$ $$z=\sqrt{5-\left(\frac{1}{2}\cos t\right)^2-\left(\frac{1}{2}+\frac{1}{2}\sin t\right)^2}=\sqrt{\frac{9}{2}-\frac{1}{2}\sin t}$$ for $t \in (0,2\pi)$,  but I don't think it is correct. Even if it was, is there a better (more simple) approach?
Note: I need to find the circulation of a field $F=(y+z,x-z,0)$ over this curve so I need a good parametrizatian so that I was able to integrate it.
 [/INST] Use the fact that the right-circular cylinder of radius $r$ centered at $(h, k)$ in the $xy$-plane can be parametrized by $\mathbf G(t, z) = \langle h + r \cos t, k + r \sin t, z \rangle$ by the Pythagorean Identity, i.e., $\cos^2 t + \sin^2 t = 1.$
Considering that we are in the intersection of the right-circular cylinder $(x - 0)^2 + \bigl(y - \tfrac 1 2 \big)^2 = \tfrac 1 4$ and the sphere $x^2 + y^2 + z^2 = 5,$ both of these equations hold. Using the parametrization $\mathbf G,$ we have that $x = \tfrac 1 2 \cos t$ and $y = \tfrac 1 2 + \tfrac 1 2 \sin t,$ hence plugging these identities into the equation $x^2 + y^2 + z^2 = 5$ gives rise to the equation $\tfrac 1 4 \cos^2 t + \tfrac 1 4 + \sin t + \frac 1 4 \sin^2 t + z^2 = 5.$ Of course, we can now solve for $z$ as a function $z(t)$ of $t.$
Our original parametriation $\mathbf G(t, z)$ can now be viewed as a parametrization $\mathbf G(t) = \langle \tfrac 1 2 \cos t, \tfrac 1 2 + \tfrac 1 2 \sin t, z(t) \rangle.$

One other way to parametrize the intersection of these surfaces is by spherical coordinates $x = \sqrt 5 \sin \phi \cos \theta,$ $y = \sqrt 5 \sin \phi \sin \theta,$ and $z = \sqrt 5 \cos \theta.$ By plugging these identities into the equation of the right-circular cylinder, we obtain the equation $$5 \sin^2 \phi \cos^2 \phi + 5 \sin^2 \phi \sin^2 \theta - \sqrt 5 \sin \phi \sin \theta + \frac 1 4 = \frac 1 4.$$ By the Pythagorean Identity, this simplifies to $5 \sin^2 \phi = \sqrt 5 \sin \phi \sin \theta.$ Considering that $0 \leq \phi \leq \pi,$ and $\sin \phi > 0$ whenever $0 \leq \phi < \pi,$ we can solve for $\sin \theta = \sqrt 5 \sin \phi$ whenever $0 < \phi < \pi.$ But this implies that $\theta = \arcsin(\sqrt 5 \sin \phi),$ and this is not desirable.
</s>