%% DIVERGENCE

syms x y z

field = [x^2  y^2  z^2];
vars = [x y z];

div = divergence(field,vars)

%% GRADIENT

f = x^2 + y^2 + z^2;
grad = divergence(gradient(f,vars),vars)
%% CURL

curl = divergence(curl(field,vars),vars)