# Let `x^2+y^2+z^2=R^2` be a ball in `RR^3`. The density of the ball is given by `f(x,y,z)= sqrt(y^2+z^2)`. Compute the mass of the ball using a surface integral.

The mass is `pi^2/2 R^3` .

The surface integral is `int int_S f ( x , y , z ) dS , ` where `z = g ( x , y ) ` is the formula for the surface and `dS ` is the differential for the surface `S .`

The formula for the surface integral is

`int int_D f ( x , y , g ( x , y ) ) sqrt ( 1 + ( ( del g ) / ( del x ) )^2 + ( ( del g ) / ( del y ) )^2 ) dA ,`

where `dA ` is the usual plane differential `dx dy ` over the region `D ` on the `xy`-plane.

Here, `f ( x , y , z ) = sqrt (y^2 + z^2 ) ` and `g ( x , y ) = sqrt ( R^2 - x^2 - y^2 ) .`

Because of this, `D ` is the circle `x^2 + y^2 lt= R^2 , ` `(del g)/(del x) = - x / sqrt ( R^2 - x^2 - y^2 ) ` and `(del g)/(del y) = - y / sqrt ( R^2 - x^2 - y^2 ) . ` Also, `f (x , y , g ( x , y ) ) = sqrt ( R^2 - x^2 ) .`

This way, the function under the plane integral is `sqrt ( R^2 - x^2 ) * R / sqrt ( R^2 - x^2 - y^2 ) ` and the integral itself is

`int_(-R)^R dx ( int_(-sqrt(R^2-x^2))^(sqrt(R^2-x^2)) dy ((R sqrt(R^2-x^2))/sqrt(R^2-x^2-y^2)) )` `= int_(-R)^R dx (R sqrt(R^2-x^2) int_(-sqrt(R^2-x^2))^(sqrt(R^2-x^2)) (dy)/sqrt(R^2-x^2-y^2)) .`

The integral `dy ` is equal to `pi , ` so we obtain

`pi R int_(-R)^R sqrt(R^2-x^2) dx = pi R pi / 2 R^2 = pi^2/2 R^3 .`