The Key Idea is that is a scalar and is a vector.

This gives in Cartesian coordinates

Now we just need to take the curl so we get

Note that this is using first principles there are product rules for the divergence, gradient, curl ect.

http://en.wikipedia.org/wiki/Vector_...ifferentiation

But you should know how to work them this way as well.