Why is $\nabla \cdot u=0$? (If $u=v\cos(k\cdot x)$) Suppose $k\in \mathbb R^3$ and $v \in \mathbb S^2$ (2D sphere) and $k\cdot v=0$. Let $u=v\cos(k\cdot x)$, then why is $\nabla \cdot u=0$? 
To calculate the divergence, I look at one of the components $\partial_{j} u_{j}$. $$\partial_{j} u_{j}=\partial_{j} v_{j}\cos(k_{j}x_{j})-v_{j}[\partial_{j} k_{j}x_{j}\sin(k_{j}x_{j})+\partial_{j} x_{j}k_{j}\sin(k_{j}x_{j})]$$ I can see the term $k_{j}v_{j}$, which will be zero after summing since $k\cdot v=0$, but I don't know how to treat the rest.

I like to avoid indices altogether whenever possible, and would use the product rule for divergence instead:
$$\nabla \cdot \left[f(x)v(x)\right] = \langle \nabla f(x), v(x)\rangle + f(x) \nabla \cdot v(x).$$
In particular if $v%$ is constant, the second term vanishes and you just get
$$\nabla \cdot u = v \cdot \nabla \cos(k\cdot x) = (v\cdot k) \sin(k\cdot x) = 0.$$
