It seems pretty easy. Go back to calc 101. Maybe 102. WTP?
For example, what is the integral of z*(x^2+y^2), over a unit cylinder. So a cylinder of unit radius, centered at the origin, where lets say the cylinder has base at z==0, and top at z==1. Just making things up, so I have no idea what the solution is. We can trivially do it analytically. (Actually, pencil and paper should suffice too.)
x = r*cos(theta);y = r*sin(theta);
I hope you remembered the differential element has volume r*dr*dtheta*dz. Consider that extra factor of r in there, multiplied by Kernel. That is important.
But can we do it numerically? Again, of course. Make sure you use the dotted operators, for exponentiation and multiplication. Your function needs to be properly vectorized.
x = @(r,theta) r.*cos(theta);
y = @(r,theta) r.*sin(theta);
Kernel = @(r,theta,z) z.*(x(r,theta).^2 + y(r,theta).^2);
That should look very much like pi/4.
A simple Monte Carlo should also work. I'll just use rejection to do the sampling. And I'll sample in the first quadrant only, then multiply by 4.
keep = sqrt(x.^2 + y.^2) <= 1;
4*sum(z.*(x.^2 + y.^2))/n
But is it easy? Easy is difficut to quantity, since easy for one person is not necessarily easy for another.