Friday, October 02, 2026

A nice math problem

I encountered a nice math problem: You've got 40m of fencing and want to enclose a rectangular field beside a straight river:
The river forms one side of the rectangle, so you only need fencing along the other three. What is the maximum area of the field?

It is an optimization problem with a constraint and is normally solved using Lagrange Multipliers. Since my 14 year old son is preparing for the Turkish high school entrance exam (LGS), I wondered if it could be solved using only middle school mathematics.

Let's designate the short side of the rectangle as x and the long side as y. The length of the fencing gives us the equation

40 = 2x + y → y = 40 − 2x.

The area is A = xy. Substituting the equation for y,

A = x(40 − 2x) = 40x − 2x².

We are stuck because, in middle school, we don't know about derivatives. Or are we?

Rearrange the area equation:

A = −2(x² − 20x).

The expression x² − 20x = x² − 2*10x can be completed into a square by adding and subtracting 10²=100:

x² − 20x = x² − 20x + 100 − 100 = (x − 10)² − 100.

Plug this into the area equation:

A = −2((x − 10)² − 100) = −2(x − 10)² + 200.

Rearrange the terms:

A = 200 − 2(x − 10)².

Since we don't know x, we cannot find A... But let's think about this equation for a second...

We are subtracting a value from 200. If the whole −2(x − 10)² term could be positive, the result would be larger than 200. But wait: (x − 10)² cannot be negative because the square of a real number is always positive. This means that −2(x − 10)² is always zero or negative, making the area smaller than 200:

200 −2(x − 10)² ≤ 200 

In other words,

A ≤ 200.

The smallest possible value of −2(x − 10)² is zero, which happens when x = 10. Since the question asks for the maximum area, the answer is 200. We don't even need to find x = 10 and y = 20.

This is a very nice question because it requires you to see a missing piece, in this case, the missing terms needed to turn the expression into a perfect square. It also requires you to think more deeply about the equation and draw inferences from it. This is characteristic of the harder problems in the LGS exam.

Let's change the question slightly and say that we also need to use fencing material along the river side. The equations would then be:

40 = 2x + 2y → y = 20 − x

A = xy = x(20 − x) = 20x − x² = −(x² − 20x).

Complete the square:

A = −(x² − 20x + 100 − 100) = 100 − (x − 10)².

Using similar logic, the maximum area is 100 when x = 10 → y = 10. The fenced area is a square in this case. For this case, adding fencing along the river side halved the maximum area.

Can you prove that adding fencing along the river side always halves the maximum possible area, assuming the total amount of fencing remains the same, for any length of fencing?

No comments: