The Newton-Rhapson is generally specific to 1D. If you want the more general nD case, you need to use the (multivariable) Newton scheme. See e.g. http://fourier.eng.hmc.edu/e176/lectures/NM/node21.html
or of course look up Wikipedia
If you want to just solve your particular problem then try fsolve.
By the way, do you really mean (in the 2nd equation of f(x))
cos(x(2)-x(2))
And is J above the Jacobian? (It's not what I compute!)