Completing the Square in 3D

CURC at Colorado State University · 2025
High School Honors

Just as we can complete the square for quadratic equations, it is possible to “complete the cube” for cubic equations. This method has both a geometric interpretation in terms of shapes, and an algebraic interpretation in terms of symbols.

That was the idea behind my 2025 research poster. I wanted to see how far we could take the geometry. Could the pieces of a cube actually help us solve a cubic equation, rather than just illustrate one?

Four groups of colored three-dimensional solids, representing x cubed, three x squared y prisms, three x y squared prisms, and y cubed, converge through a downward arrow into one completed cube. All diagrams use matching lengths for a z-sized cube.

1. From Squares to Cubes

When we complete the square, we start with a square for \(x^2\) and rectangles for the linear term. We add the missing area and turn everything into one larger square. The algebra works because the areas of all the little pieces must add up to the area of the finished square.

Now let’s try the same idea with volumes instead of areas.

A cube with side length \(x+y\) has volume

\[ (x+y)^3=x^3+3x^2y+3xy^2+y^3. \]

That expansion can look like a collection of terms, but every term is an actual shape. There is one \(x^3\) cube, three \(x^2y\) prisms, three \(xy^2\) prisms, and one smaller \(y^3\) cube. Eight pieces in all.

A square divided into x squared, two xy rectangles, and y squared is compared with a cube divided into one x cubed block, three x squared y blocks, three x y squared blocks, and one y cubed block.

From completing the square to completing the cube

The nice thing about this picture is that the algebra and the geometry are saying exactly the same thing. We just need to figure out how to use that fact to solve an equation.

2. Completing the Cube

Let’s try the equation

\[ x^3+3x=5. \]

There is no \(x^2\) term, so this is called a depressed cubic. It doesn’t factor nicely, and it has no rational roots. But we can use the \(x^3\) term as the starting cube, extend each side by an unknown length \(y\), and call the new side length \(z=x+y\).

Four groups of three-dimensional pieces, representing x cubed, three x squared y, three x y squared, and y cubed, combine into a cube with side length x plus y.

Four groups of pieces forming a completed cube

Now we want the new pieces to match the terms of our equation. The two sets of three prisms look different, but we can pair each \(x^2y\) prism with an \(xy^2\) prism. Since \(x+y=z\), each pair makes one \(xyz\) prism. We have three pairs, giving

\[ z^3=x^3+3xyz+y^3. \]

Three combined rectangular prisms form a volume of 3xyz, representing the two middle groups of the expanded cube.

The middle six pieces regrouped into three longer prisms

To match the \(3x\) in our original equation, we need \(3yz=3\), or simply \(yz=1\). Then we can add the missing \(y^3\) to complete the cube. This gives us two equations:

\[ \begin{aligned} yz&=1,\\ z^3&=5+y^3. \end{aligned} \]

An algebraic matching diagram showing z cubed equals x cubed plus 3xyz plus y cubed, with yz equal to one and z cubed equal to five plus y cubed.

Matching the cube terms to a numerical cubic equation

From the first equation, \(z=1/y\). If we substitute this into the second equation and multiply through by \(y^3\), we get

\[ 1=5y^3+(y^3)^2. \]

At first it looks like we have gone from bad to worse, since a sixth power has appeared. But this is really a quadratic in disguise! We can solve for \(y^3\) by completing the square or using the quadratic formula, then recover \(z\) and finally \(x=z-y\).

The result is

\[ x=\sqrt[3]{\frac{5+\sqrt{29}}{2}}+\sqrt[3]{\frac{5-\sqrt{29}}{2}}\approx1.1542. \]

We started with a cubic equation, completed a cube, and ended up solving a quadratic. That is a pretty interesting connection.

3. Completing the Cube Twice

The first construction handles depressed cubics. But what about the general equation

\[ x^3+bx^2+cx+d=0? \]

The usual approach is to substitute a new variable to get rid of the \(x^2\) term, then use the method we just explored. I wanted to see if we could keep the quadratic term and still make the geometry work.

The trick is to use the cube we have already constructed as the basis to complete the cube again.

Start with the cube of side length \(x+y\). This time, extend it by another unknown length \(u\) in all three directions. Call the total side length \(v\):

\[ v=x+y+u. \]

A cube with an existing x plus y section is extended by a length u along each dimension to form a larger cube with side length v equal to x plus y plus u.

Extending a completed cube by another length

The larger cube breaks into four groups, just as the first one did: our original \((x+y)^3\) cube, three wide prisms, three narrow prisms, and a small \(u^3\) cube. Algebraically, this is

\[ v^3=(x+y)^3+3u(x+y)^2+3u^2(x+y)+u^3. \]

The extended cube is separated into the original x plus y cube, three prisms of volume u times x plus y squared, three prisms of volume u squared times x plus y, and a smaller u cubed cube.

The four groups making up the second completed cube

Now we need to break apart the new prisms again. Their sides contain \(x+y\), so each one can be split into an x block and a y block. After splitting both sets, we can group the new pieces by whether they contain \(x\) or \(y\).

Two sequences of rectangular prisms demonstrate splitting pieces along lengths x and y into separate x-block and y-block groups.

Splitting the new prisms into x blocks and y blocks

Next, we pair the blocks again. The added lengths combine to make \(x+y+u=v\), so the new pieces can be expressed as three \(uvx\) prisms and three \(uvy\) prisms.

Groups of x-blocks and y-blocks are each combined into three longer rectangular prisms, representing 3uvx and 3uvy.

Pairing the blocks into longer prisms

Finally, we break apart our original \((x+y)^3\) cube in the same way we did in Section 1. When we put all the volumes together and group the terms according to powers of \(x\), we get

\[ v^3=x^3+3yx^2+(3y^2+3uv)x+(y^3+u^3+3uvy). \]

This looks promising! Now the geometry contains both an \(x^2\) term and an \(x\) term, so we can match them to the coefficients of our general cubic:

\[ \begin{aligned} b&=3y,\\ c&=3y^2+3uv,\\ v^3+d&=y^3+u^3+3uvy. \end{aligned} \]

A coefficient-matching diagram connects b to three y, c to three y squared plus three uv, and the constant terms to the completed cube equation.

Matching the volumes of the larger cube to the coefficients of a general cubic

We now have three equations for the three unknown quantities \(y\), \(u\), and \(v\). The first gives \(y=b/3\) right away. After substituting and simplifying the other two, we eventually get an equation that is quadratic in \(u^3\). So even after completing the cube twice, we end up using the same disguised-quadratic trick.

Finally, because \(v=x+y+u\), we can recover \(x=v-y-u\). The algebra leads to the cubic formula without first making the usual substitution to remove the quadratic term. I have not found this particular two-stage geometric construction in the sources I checked, although its underlying algebra is equivalent to Cardano’s method.

4. Geometry and Algebra

Here is what I like most about the construction. On paper, rewriting

\[ 3x^2y+3xy^2=3xy(x+y) \]

is just factoring. But in three dimensions, it means physically pairing rectangular prisms to make larger ones. We are doing the same mathematics either way.

I 3D-printed models of the pieces at my school so that visitors to my poster could see how the construction worked as an arrangement of actual objects. The printed blocks helped turn the equation into something you could visualize from several angles.

The main idea: the geometry does not replace the algebra. It shows why the algebraic rearrangement works.

5. What About Four Dimensions?

If we can complete a square in two dimensions, and complete a cube in three dimensions, why stop there? Could we solve quartic equations by completing a four-dimensional hypercube?

Quartic equations can be solved using radicals, but methods such as Ferrari’s are not simply four-dimensional versions of completing the square. I tried to extend the construction algebraically, and the expressions got complicated very quickly. It is also much harder to picture the geometry once we leave three dimensions.

I don’t have the equivalent completed-hypercube construction worked out. But the question is still interesting, and it is one I would like to explore further.

Original Poster

I presented this project at the 2025 Celebrate Undergraduate Research and Creativity (CURC) Showcase at Colorado State University, where it received High School Honors.

View the original CURC poster (PDF) →