In
the case x > 4, Charlie’s post invites us to carry out the
substitution of his ‘y’ to obtain an explicit expression for
the area in terms of x.
But to avoid the complications:
we can split the area into a central inner square of side x – 2,
(with vertices at the inner corner of each square cut-out)
and four triangles each with base x – 2 and height 1: