variant 1
S = ...;
g = ...;
As = ...;
Zv = ...;
rho = ...;
Az = ...;
out = fzero(@(Zd)S-g/As.*quad(@(Z)(Z-Zv).*rho.*Az,0,Zd),0);
please read doc fzero and doc quad
variant 2
syms S g As Z Zv rho Az Zd real
out1 = solve(S-g/As*int((Z-Zv)*rho*Az,Z,0,Zd),Zd)