LIMA
With God's help
עברית

Surface and Volume Integrals

Imagine that you are trying to calculate the total amount of cream on a huge cake that is not coated evenly. Instead of guessing, you can divide the surface of the cake into tiny squares, check how much cream there is in each square, and add it all up – this is exactly a surface integral. And if it is a filled chocolate ball whose filling density changes from the center outward, you will not cut it into cubes crosswise. Instead, you will peel it in spherical layers, from the center to the shell, and sum up the filling in each layer, just as one does a volume integral in a spherical system so as not to miss a single crumb.

The theory in brief

In physics, to find the total charge \(Q\) from a continuous charge distribution, we sum the charge density over the relevant region. For a two-dimensional surface with a surface charge density \(\sigma(x,y)\), we use a double integral in Cartesian coordinates: \[Q = \iint \sigma(x,y)\,dx\,dy,\] where the limits of integration are determined by the geometry of the surface.

However, when we deal with three-dimensional bodies with spherical symmetry (such as a charged ball), using Cartesian coordinates leads to complicated limits of calculation. Therefore, we switch to a spherical coordinate system \((r, \theta, \phi)\). The key to this switch is the differential volume element; in a spherical system it is not a simple cube like \(dx\,dy\,dz\), but a piece of volume that grows the farther we move from the origin, and it is defined as \[dV = r^2 \sin\theta\,dr\,d\theta\,d\phi.\] To find the total charge from a volume charge density \(\rho\), we solve the triple integral: \[Q = \iiint \rho(r, \theta, \phi)\, r^2 \sin\theta\,dr\,d\theta\,d\phi.\] For a full sphere, the integration runs along \(\phi\) from 0 to \(2\pi\), \(\theta\) from 0 to \(\pi\), and the radius \(r\) from zero to the edge of the ball \((R)\), which allows an elegant and precise calculation of physical quantities in curved spaces.

zxy θφr drr dθr sinθ dφ dx dy xyy = x σ(x,y) dV = r² sinθ dr dθ dφ

How to read the lab

The holographic space

In triangle mode: a glowing coordinate grid, with a bright line every \(1\,\text{m}\) and a dim line every \(0.5\,\text{m}\). In ball mode: a holographic sphere of radius \(R = 2\,\text{m}\) with lines of longitude and latitude every \(15^\circ\), a vertical Z axis and a highlighted equator.

The blocks: pixels of area

Each block is an area element \(\Delta A = \Delta x\,\Delta y\). Its color and brightness are the density \(\sigma(x,y) = xy\) at the center of the block: dim dark red for low charge, and dazzling yellow-white for high charge.

y=x

The exact triangle

The cyan line is the triangle from the point \((0,0)\) to \((2,2)\): the diagonal line \(y = x\) and the right edge \(x = 2\). A block on the diagonal is counted in the sum in full, including the part of it that sticks out past the line.

The resolution slider

To the right: the blocks split into smaller and smaller squares, from 3 large blocks up to 8,256. At the right end \((\infty)\) the blocks become a continuous glowing surface, and the sum is the exact integral.

The green laser beam

"Scan \(dy\) first" scans columns, each from the bottom up. "Flip the scan" scans rows, each from the diagonal to the right. What the beam has already collected is lit, and what has not been collected yet is dim.

The wedges of the ball

Each crystal is a volume element \(dV = r^2\sin\theta\,dr\,d\theta\,d\phi\). It is not a cube but a small slice of watermelon. Its color is \(\rho\) at its center, on the same color scale as the blocks.

dV

The dV Wedge

The highlighted crystal labeled \(dV\) is the last one added: in the outer shell, in the last ring and at the last angle. Its volume is shown in the control column.

The \(\phi\), \(\theta\) and \(r\) sliders

They are the upper limits of the triple integral. \(\phi\) copies the wedge into a ring around the Z axis, \(\theta\) copies the ring from the north pole \((\theta = 0)\) to the south pole \((\theta = \pi)\), and \(r\) adds shells from the inside out.

Q=

The Charge Accumulator

In the bottom left corner of the view: the total charge collected so far, that is, the sum of density times area (or volume) of everything that has been built or scanned.

∫r²

Transparent Math

In the top right corner: the integral with the limits of this moment. The term that the slider being moved changes lights up in gold: \(\Delta x\,\Delta y\), the scan limits, \(r^2\), \(\sin\theta\) or \(d\phi\).

The charge density

\(\rho = 1.5\) uniform: the whole ball glows in the same color. \(\rho \propto r^2\) (here \(\rho = r^2\)): the center is dark and the outer shells blaze.

Camera

Dragging rotates the space through 360 degrees, the wheel zooms in and out, and dragging with the right button pans.

Speed and pause

The speed slider only changes the pace of the animation (the scan and the growth of the wedges), and ⏸ freezes it. The sums themselves do not depend on time.

μC

Units

\(x\), \(y\) and \(r\) in meters. \(\sigma\) in units of \(\mu\text{C}\cdot\text{m}^{-2}\), \(\rho\) in units of \(\mu\text{C}\cdot\text{m}^{-3}\), and the charge \(Q\) in \(\mu\text{C}\).

To the lab ↓
Loading the lab...
Transparent Math
Charge Accumulator
1

Experiments to try in the lab

  1. The "pixels of area" experiment (understanding the \(dxdy\) element and the continuous limit). Enter the two-dimensional mode (a surface integral over the triangle). Set the resolution slider to the lowest level (3 large blocks) and write down the total calculated charge. Now, slowly drag the slider to the right up to maximum resolution, and watch how the edges of the triangle become finer and how the value of the charge settles more and more on the exact result.
    This experiment will show you physically the abstract concept of a Riemann sum that turns into a definite integral. You will see that at low resolution, the large blocks go beyond the boundaries of the triangle (the line \(y=x\)), and so your calculation will be rough and inaccurate. As you shrink the blocks \((dx \to 0, dy \to 0)\), you will notice that the jagged edges are smoothed out and fit themselves exactly to the geometry of the surface. This is how you will understand that an integral is not magic that makes area disappear, but a summation of infinitely many tiny rectangles that merge into a smooth reality.
  2. The "flipping the scan" experiment (changing the order of integration). Choose the triangle surface. Press the "Scan \(dy\) first" button (a vertical scan) and watch the laser beam collect the charge for you in columns from the bottom \((y=0)\) up to the diagonal roof \((y=x)\). Then, press "Flip the scan" (\(dx\) first) and watch the beam collect the charge in horizontal rows from the diagonal wall \((x=y)\) to the right edge \((x=2)\). Compare the final result for the charge.
    Changing the order of integration is a common pitfall. In this experiment you will prove to yourself that changing the order is not just "swapping letters" in the equation, but a fundamental change in the way the area is built geometrically. You will see that even though the limits change completely and the way of scanning is reversed, the amount of charge you collected over the triangle stays the same. This visual experience will burn into your memory the logic behind setting limits that depend on a variable.
  3. The "secret of the equator" experiment (cracking the \(\sin\theta\) element). Switch to the three-dimensional ball mode. Set the azimuth slider \((\phi)\) to a full ring. Now, slowly drag the elevation angle slider \((\theta)\) from zero (the north pole) to \(\pi\) (the south pole). Notice the thickness and the volume of the "watermelon slices" added at each latitude.
    Why does the function \(\sin\theta\) appear in the spherical volume element \(dV\)? This experiment will make the answer self-evident for you. You will see clearly that the wedges formed at the poles are packed and very narrow, and contribute a tiny volume. In contrast, as you approach the equator \(\left(\theta = \frac{\pi}{2}\right)\), \(\sin\theta\) reaches its maximum \((1)\), and you will see that the wedges become especially wide and fat. The hands-on experience will make it clear to you that in spherical coordinates, moving through an equal angle does not sweep out an equal volume.
  4. The "onion effect" experiment (the dominance of the \(r^2\) term). Set the angles \(\phi\) and \(\theta\) to maximum to create a complete spherical shell. Start when the radius of the ball is zero, and pull the \(r\) slider gradually up to \(R=2\). Notice at which stage the Charge Accumulator jumps most sharply - in the inner layers or in the outer ones?
    This experiment will reveal to you the power of the \(r^2\) term inside the \(dV\) formula. You will experience visually that the inner layers (the core) are tiny and contain very little charge. But the farther you move from the center, you will see that the volume of each spherical shell grows quadratically. The understanding that the lion's share of the volume and the charge of a ball is always in its outermost "shells" is a critical intuition that will serve you later in your studies as well.
  5. The "battle of the densities" experiment (the effect of the charge density function). Set the simulation to a uniform charge density (\(\rho=1.5\), the whole ball lit with a uniform light), build the ball and write down the rate at which the charge grows. Now, change the setting to the density function from the exercise: \(\rho \propto r^2\). Notice how the outer shells now glow with a dazzling intensity compared to the dark center, and build the ball again.
    This is your summary test of understanding. You will see that with a uniform density, the charge grows only because of the geometry, that is, because of the \(r^2\) of the volume element \(dV\). But when you enter a density function that also depends on \(r^2\), you will notice that the charge in the outer layers simply "explodes". You will see that every wedge in the outer shell is both huge in size (geometry) and blazing with energy (physics). The integrand as a whole now behaves like \(r^4\), which shows you spectacularly how physics and geometry multiply each other inside your integrals.