That shape spinning to the right is a 4-dimensional cube. It looks impossible — but we can actually understand why it's 4-dimensional using nothing more than integrals.
The first step is to define what a dimension even is. That's where integrals come in: an integral takes a sum of shapes that share one dimension and uses them to build something one dimension higher.
If you remember Riemann sums, the smaller shapes that get summed together start out in the same dimension as the larger shape. But once n = ∞, their footprint in the highest dimension shrinks to nothing — and they effectively exist one dimension below.
The four Riemann sums below use that idea to define each dimension in turn, building a clean set of rules along the way — until the 4th dimension stops being mysterious.
Infinite 0-d points stack to form a 1-d line.
A line begins as a Riemann sum of smaller lines. As we increase the number of pieces, the length of each piece approaches 0 — until each one is effectively a 0-dimensional point.
The first dimension is purely linear: the existence of any object here is defined by a single variable, length.
Watch: as n grows, the gap Δx between points shrinks toward zero. The line is the limit of infinitely many points pressed together.
Infinite 1-d lines stack under a curve to form a 2-d area.
An area begins as a Riemann sum of rectangles. As n grows, the width of each rectangle approaches 0 — but its height, given by f(x), remains. Each rectangle effectively becomes a 1-d line.
The second dimension is planar: every object lives in a plane defined by two variables, length and height.
The function: f(x) = √(1 − x²) — the upper unit semicircle. Its true area is π/2 ≈ 1.5708.
Infinite 2-d disks stack along an axis to form a 3-d volume.
A volume begins as a Riemann sum of thin disks. Rotating the semicircle f(x) = √(1−x²) around the x-axis traces out a unit sphere. We slice it into n circular prisms of thickness Δx.
As n grows, each disk's thickness approaches 0 — leaving only a 2-d circular face. The third dimension is spatial: length, height, and depth.
True volume: (4/3)π ≈ 4.1888.
A step-by-step journey from the two core rules to a working intuition of the 4th dimension.
Each Riemann sum we've seen — line, area, volume — follows the same pattern. Two general rules emerge that define any dimension.
In an n-dimensional space, n equals the number of variables that define the shape of objects within it.
A finite number of n-d objects can build a larger n-d object — but an infinite number of (n−1)-d objects are needed to make a single n-d object.
These two rules are all we need to understand the 4th dimension. Let's apply them one at a time.
A dimension is a space whose geometry is governed by a certain number of independent variables. Our Riemann sum examples confirmed the pattern:
A 4th dimension requires a fourth independent variable, orthogonal to x, y, and z. This variable is conventionally called w. But what does w actually represent?
We know x describes length, y describes height, and z describes depth — each a physical direction we can point toward. A fourth spatial axis w should be physically perpendicular to all three, but our brains are wired for a 3D world. We literally cannot point in that direction.
Instead, w is best understood as something non-spatial. The strongest candidate is time: a fourth parameter that governs how a 3D scene changes from moment to moment.
This isn't speculation — physicists describe our universe as 4D "spacetime," combining three spatial axes with a time axis. For the rest of this lesson, we'll let w = time.
By Rule 2, a 4D object is built from an infinite number of 3D "slices" — a Riemann sum. Three decisions fix the setup:
Here is our unit sphere, centered at the origin. Its surface satisfies x² + y² + z² = 1 — three variables, three dimensions.
We're going to slice this sphere into infinitely many thin pieces along the x-axis, just as we did in the 3D section to compute a volume.
This time, the goal isn't the sphere's own volume — it's to use these slices as building blocks for something higher: a 4-dimensional object whose 3D cross-sections are themselves spheres.
Proceed to see the slicing begin.
We divide the sphere with n vertical planes perpendicular to the x-axis. Each slice is a thin 3D disk of radius r(x) = √(1−x²) and thickness Δx = 2/n.
Use the slider to increase n. Watch how each disk's thickness shrinks as more slices appear — the overall sphere shape is preserved, the slices just get thinner and thinner.
This is the same disk-method sum from the 3D section, viewed now as the preparation step for going to 4D.
When n approaches infinity, each disk's thickness Δx → 0. The disk loses its remaining depth and becomes a pure 2D circle of radius r(x) = √(1−x²).
Press n = ∞ to see the continuous limit: an infinite stack of 2D circles, each a cross-section of the sphere at a different x-position.
These circles are our (n−1)-dimensional building blocks — exactly what Rule 2 says we need to construct the next dimension up.
Now we integrate each 2D circle into a 3D sphere of the same radius. At each position w along the fourth axis, the cross-sectional sphere has radius r(w) = √(1−w²).
You're looking at n different 3D spheres, each living at a different moment in time (a different w-value). Individually they are 3D; collectively, stacked along the w-axis, they constitute a 4D hypersphere.
Since all spheres are displayed in 3D at once, they overlap — the true 4D structure is hidden. To see it, we need to animate through w...
The highlighted sphere travels left to right through each slice in sequence. At w = −1 it starts as a tiny point, grows to full size at w = 0, then shrinks back to a point at w = +1 before the cycle repeats.
The ghost spheres in the background show all n slices at once — together they form the complete 4D hypersphere. You can't perceive the full 4D shape simultaneously, but you can watch each 3D cross-section pass by in order, just as a 2D being could only ever see one 2D slice of a 3D sphere at a time.
The formal Riemann sum for the hypersphere's 4-volume is shown in the next section. Scroll down when you're ready.
You don't see depth directly — you see two flat retinal images and your brain reconstructs space from them. In the same way, a 4-d object can only reach us as a sequence of 3-d snapshots, one per moment of w.
Infinite 3-d spheres stack along the w-axis to form a 4-d hypersphere.
The 4th dimension introduces an axis w we can't see. Time stands in for it: we watch the sphere change as w sweeps from −1 to +1.
At each w, the cross-section of a unit hypersphere is a 3-d sphere of radius r(w) = √(1−w²) — small at the ends, largest at w = 0.
True 4-volume of unit hypersphere: π²/2 ≈ 4.9348.
We built a 4D shape — now let's recognize it as the shape we started with.
We showed that a 4D object is an infinite Riemann sum of 3D objects. We used spheres. But the same rule applies to any shape: a Riemann sum of 3D cubes stacked along the w-axis produces a 4D hypercube — the tesseract.
Since w = time, a tesseract is what a 3D cube traces out as it moves through time. To visualize it in 3D we only need two snapshots — start and end — connected by lines, exactly like a Riemann sum uses a line to approximate a curve.
Take a unit cube at the start of its motion — this is the snapshot at w = −1.
Place an identical cube at the end of its motion — the snapshot at w = +1.
Connect all 8 matching corners with lines. These purple edges approximate the cube's trajectory through time — the same role a Riemann sum rectangle plays for a curve.
The flat projection shows both cubes at the same size — accurate for the snapshots but it distorts their 4D depth relationship. Hyperperspective corrects this: the "farther" cube appears smaller, revealing the true 4D structure.
The rotating shape you see after applying hyperperspective is the same tesseract shown at the top of this page — built from first principles.