A problem about the area element in the Stokes' Theorem
Given a vector field $F(x,y,z) = x^2 \hat i + 2x \hat{j} + z^2 \hat{k} $ and a curve $C: \text{the ellipse } 4x^2 + y^2 = 4 \text{ in the } xy- \text{plane}$, I want to find $$\oint_{C} \vec F \cdot dr = \int\int_{S} \nabla \times \vec F \cdot \hat n d\sigma $$ via Stokes' Theorem. Here, $S$ is the surface on the $xy$-plane bounded by the curve $C$ above. I found $$\nabla \times \vec F = 2 \hat{k}$$ and I take $\hat n = \hat k$ as the surface is lying on the $xy$-plane. Thus, I end up with $$\oint_{C} \vec F \cdot dr = \int\int_{S} \nabla \times \vec F \cdot \hat n d\sigma =\int\int_{S} 2 d\sigma = 2(\text{area of the ellipse}) = 4 \pi. $$ However, for the surface area element, we should have $$d \sigma = \frac{\mid \nabla f|}{|\nabla f \cdot \hat k |} $$ where $f$ is the level surface that comes from the the surface $4x^2 + y^2 = 4 $ in the $xy$-plane. So, if I let $f(x,y,z)=4x^2 +y^2 -4$ for example, I end up with $\nabla f \cdot \hat k = 0$ such that I cannot write $d\sigma$. What do I do wrong?
In this statement from Stokes' theorem, $d\sigma$ is the differential for area of the region of integration $S$. When using the formula for projection onto the $x$-$y$ plane
$$ d\sigma = \frac{|\nabla f|}{|\nabla f \cdot \hat{k}|}\, dx\, dy, $$
function $f$ is the function whose level curves define that region $S$. The level curve from $f(x,y,z) = 4x^2+y^2-4$ gives the boundary ellipse $C$, and does not hold in the interior of $S$. $S$ is a piece of the $x$-$y$ plane, so the appropriate $f$ is $f(x,y,z)=z$. This gives $d\sigma = dx\, dy$. Not really a surprise: since $S$ is already in the $x$-$y$ plane, projecting it onto the $x$-$y$ plane is trivial.
A side note: When using this method projecting onto the $x$-$y$ plane and a formula $f$ whose level curve describes the surface of integration $S$, we also have
$$ \hat{n} = \frac{\pm \nabla f}{|\nabla f|} $$
provided $\nabla f \neq 0$ everywhere on $S$, and choosing the sign so that $\hat{n}$ always has a positive $z$ component. So it can often be helpful to evaluate the theorem as
$$ \oint_C \vec F \cdot d \vec r = \int_S \nabla \times F \cdot \frac{\pm \nabla f}{|\nabla f \cdot \hat{k}|}\, dx\, dy $$
and skip evaluating the canceled $|\nabla f|$ factor.