# Volume under a surface

## Homework Statement

calculating volume under a surface, defined by implicit function f(x, y, z)=0 (in cartesian coordinates, strictly not in polar). Because the function that i need to integrate is quite complicated and there would be no obvious way to double check the result i first tried to calculate volume under sphere, but i get the wrong result.

## Homework Equations

so let it be $$f(x, y, z)=x^2+y^2+z^2-1$$

## The Attempt at a Solution

$$V=8*\int dxdydz$$
where dz is integrated from 0 to $$\sqrt{1-x^2-y^2}$$, dy from 0 to 1 and the same with dx. The multiplication factor 8 is added to get the whole volume.
I use Mathematica for solving the equation and get $$\frac{2}{3}(2\pi - i*(-4 + \log{16}))$$

what am I doing wrong?

Related Calculus and Beyond Homework Help News on Phys.org
Mark44
Mentor

## Homework Statement

calculating volume under a surface, defined by implicit function f(x, y, z)=0 (in cartesian coordinates, strictly not in polar). Because the function that i need to integrate is quite complicated and there would be no obvious way to double check the result i first tried to calculate volume under sphere, but i get the wrong result.

## Homework Equations

so let it be $$f(x, y, z)=x^2+y^2+z^2-1$$

## The Attempt at a Solution

$$V=8*\int dxdydz$$
where dz is integrated from 0 to $$\sqrt{1-x^2-y^2}$$, dy from 0 to 1 and the same with dx. The multiplication factor 8 is added to get the whole volume.
I use Mathematica for solving the equation and get $$\frac{2}{3}(2\pi - i*(-4 + \log{16}))$$

what am I doing wrong?
This should work for you.
$$8 \int_{x = 0}^1 \int_{y = 0}^{\sqrt{1 - x^2}} \int_{z = 0}^{\sqrt{1 - x^2 - y^2}} dz~dy~dx$$

The first (inner) integration calculates the volume of a stack of small cubes, from the x-y plane up to the surface. The middle integration makes a wall of those stacks, going from y = 0 to the circle in the x-y plane. The final (outer) integration integrates those walls to give the volume of 1/8 of the sphere.

Char. Limit
Gold Member
Wouldn't it be easier, since you're integrating a sphere, to use spherical coordinates?

Thanks, Mark.

@Char. Limit
Yes, it would be easier in this case, but not in general (sphere served only as an example)

I'd have one more question regarding this sphere example - how could I rigorously calculate the surface area?
If I got the formula correctly, this could be done with:
http://en.wikipedia.org/wiki/Area - general formula (bottom of the page)

again in the case of sphere: $$f(x, y)=R^{2}-x^{2}-y^{2}$$
and the boarders are determined by $$x^{2}+y^{2}=R^{2}$$

but I still don't get the predicted result - $$4\pi R^2$$

I could really use some help again:)

Mark44
Mentor
I'd have one more question regarding this sphere example - how could I rigorously calculate the surface area?
If I got the formula correctly, this could be done with:
http://en.wikipedia.org/wiki/Area - general formula (bottom of the page)

again in the case of sphere: $$f(x, y)=R^{2}-x^{2}-y^{2}$$
The graph of this function is not a sphere - it's a paraboloid. For a sphere of radius R, centered at (0, 0, 0), the equation is x2 + y2 + z2 = R2.

If you solve for z, you get
$$z = \pm \sqrt{R^2 - x^2 - y^2}$$

If you define f(x, y) to be the positive square root of the above, you get a function whose graph is the upper hemisphere.
and the boarders are determined by $$x^{2}+y^{2}=R^{2}$$
I think you mean borders
but I still don't get the predicted result - $$4\pi R^2$$

I could really use some help again:)

back again (thanks Mark44 for fas reply), but I still have questions.
Let's say that I have a surface defined by $$x^2+y^2=f(z)$$ or rewritten $$x=\pm\sqrt{f(z)-y^2}=f(z, y)$$.
The formula for surface area is in this case: $$P=\int\int\sqrt{ (\frac{\partial f(y, z)}{\partial y})^2+(\frac{\partial f(y, z)}{\partial z})^2 +1 } dy dz$$,
where we first integrate $$dy$$ from $$y=\pm\sqrt{f(z)}$$.
The borders ( for $$dz$$ are then defined by the zeros of function $$f(z)$$.

is this OK?

Mark44
Mentor
back again (thanks Mark44 for fas reply), but I still have questions.
Let's say that I have a surface defined by $$x^2+y^2=f(z)$$ or rewritten $$x=\pm\sqrt{f(z)-y^2}=f(z, y)$$.
I'm not sure what you mean above. The expression on the left is a function of x and y, but the one on the right is a function of z alone.

In your integral below you have f(y, z), so is f a function of one variable or two?
The formula for surface area is in this case: $$P=\int\int\sqrt{ (\frac{\partial f(y, z)}{\partial y})^2+(\frac{\partial f(y, z)}{\partial z})^2 +1 } dy dz$$,
where we first integrate $$dy$$ from $$y=\pm\sqrt{f(z)}$$.
The borders ( for $$dz$$ are then defined by the zeros of function $$f(z)$$.

is this OK?

Sorry, when I read it again I saw that it is unclear:
f(z) is any function, that depends on z - for example: $$x^2+y^2=(z-1)^2$$ - this is some given function.
In the case of f(y, z) I just wanted to stress the dependance and f(y, z) serves only as an abbreviation.

Mark44
Mentor
Instead of complicating things by having f(z) on one side and a different function of x and y on the other, can you just solve for z to get z in terms of x and y?

In your example, x2 + y2 = (z - 1)2, so

$$z - 1 = \pm \sqrt{x^2 + y^2}$$
$$\Rightarrow z = 1 \pm \sqrt{x^2 + y^2}$$

Here z is NOT a function, but the upper half of the graph is a function (of x and y), and the lower half is a function as well.

The upper half of the graph uses the positive square root; the lower half uses the negative square root.

Mark44
Mentor
Looking at your example and previous posts about the iterated integral some more, you could have x as a function of y and z. Using your example, x = (z - 1)2 - y2. Solving for x gives
$$x = \pm \sqrt{(z - 1)^2 - y^2}$$

Here, x is in terms of y and z, but is not a function. If we restrict x to be nonnegative, then we get a function:
$$x = + \sqrt{(z - 1)^2 - y^2} = f(y, z)$$

For x <= 0, we get another function
$$x = - \sqrt{(z - 1)^2 - y^2} = -f(y, z)$$