The heptagon puzzle

A few episodes of Wrong But Useful ago, Dave posed the problem:

A regular unit heptagon1 has two different diagonal lengths, $a$ and $b$. Show that $a+b = ab$

Heptagon puzzle setup

Unusually, I didn't blog a solution. Sorry about that.

A hat-rack trick

I've come up with two approaches, but wanted to showcase one by @notonlyahatrack (who is Will in real life) first. He spotted that you can make a cyclic quadrilateral from any four of the corners, and that you can pick the corners so that the sides are (in order) $1$, $1$, $a$ and $b$, as shown here:

Will's solution

He then uses a circle theorem I didn't know, but probably should have: Ptolemy's Theorem for cyclic quadrilaterals, which states:

The product of the diagonals of a cyclic quadrilateral is equal to the sum of the products of opposite sides

In the picture, that means $|CF|\cdot |BD| = |CD|\cdot |BF| + |BC|\cdot |BF|$, or $ab = a + b$, as required.

Very elegant! While it's perfectly legit, I didn't know Ptolemy's theorem, and had to resort to other methods.

Similar triangles

My first stab looked like this:

similar triangles

Looking back, it wasn't entirely obvious that triangles FED and FHD were congruent (although they are) - this is because the angle $F\hat D E$ is the same as angle $F \hat G D$, because $FC$ and $ED$ are parallel.

Cosine rule

There's another reason the angles are the same, too: it comes down to another circle theorem (the one about the angles at the edge being half the angles in the middle), from which you can prove that the angles between adjacent diagonals and/or sides from any point on a regular shape are the same. That means their cosines are all the same, too.


There are three distinct triangles here:

  • $FDE$, from which you can say the cosine of the angle is $\frac{a}{2}$;
  • $FDC$, from which you can say the cosine of the angle is $\frac{a^2 + b^2 - 1}{2ab}$
  • $FCB$, which tells you the cosine is $\frac{2b^2 - 1}{2b^2}$

Working from $\frac{a}{2} = \frac{a^2 + b^2 - 1}{2ab}$, we get $ a^2 b = a^2 + b^2 - 1$. That rearranges to $1 = a^2 + b^2 - a^2 b$.

Working from $\frac{2b^2 - 1}{2b^2} = \frac{a}{2}$, we get $2b^2 - 1 = ab^2$, or $1 = b^2(2-a)$

Eliminating the 1, we end up with $b^2(2-a) = a^2 + b^2 - a^2 b$. Take away a b^2 from either side:

$b^2 (1-a) = a^2(1-b)$, which expands to $b^2 - b^2a = a^2 - a^2 b$, or $b^2 - a^2 = b^2 a - a^2 b$; some nifty factorising:

$(b-a)(b+a) = ab(b-a)$ - and since $b \ne a$, we can divide by $b-a$ to get:

$b+a = ab$ as required.

There's probably a way through the algebra that's a bit quicker, but I'm quite pleased with that one; the Mathematical Ninja would hate it.


Colin is a Weymouth maths tutor, author of several Maths For Dummies books and A-level maths guides. He started Flying Colours Maths in 2008. He lives with an espresso pot and nothing to prove.

  1. a seven-sided shape where all the angles are the same, and all the sides are 1 unit long []


Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Sign up for the Sum Comfort newsletter and get a free e-book of mathematical quotations.

No spam ever, obviously.

Where do you teach?

I teach in my home in Abbotsbury Road, Weymouth.

It's a 15-minute walk from Weymouth station, and it's on bus routes 3, 8 and X53. On-road parking is available nearby.

On twitter