We have had two good answers to this tough nut; one from Harry (Xiaotian) Li (aged 15) from Riccarton High School in Christchurch, New Zealand, and one from Ang Zhi Ping (aged 15) from River Valley High School in Singapore.
Harry Li starts by mentioning that there are two pairs of parallel lines, that the distance between each pair of lines has to be equal and that we need to have four right angles to make a square.
The gradient of the second pair of parallel lines is going to be the negative reciprocal of the first set of parallel lines in order to make right angles (ie. the product of their gradients will be -1).
For example:
| gradient of the first pair | gradient of the second pair |
|---|---|
| 2 | -1/2 |
| 4 | -1/4 |
| -10 | 1/10 |
To keep the distance between each pair of lines the same, we'd have to make sure that the difference of the two y-intercepts of one pair of lines is equal to the difference of the two x-intercepts of the other pair.
In the example given in the question:
y = 2x + 1 and y = 2x + 4 cut the vertical axis at (0,1) and (0,4),
three units apart,
and y = -0.5x + 1 and y = -0.5x + 2.5 cut the horizontal axis at
(2,0) and (5,0), also three units apart.
![]() |
Alternatively, the difference of the y-intercepts of the second pair have to be the same as the difference of the x-intercepts of the first pair.
In the example given in the question:
y = 2x + 1 and y = 2x + 4 cut the horizontal axis at (-0.5,0) and
(-2,0), one and a half units apart,
and y = -0.5x + 1 and y = -0.5x + 2.5 cut the vertical axis at
(0,1) and (0,2.5), also one and a half units apart.
This distance can be worked out easily:
it is the difference of the y-intercepts of the first pair divided
by the gradient.
In the example above, the difference between the y-intercepts of y = 2x + 1 and y = 2x + 4 is three. This difference divided by the gradient of two gives us 1.5; this is the difference between the y-intercepts of the other pair of lines, y = -0.5x + 1 and y = -0.5x + 2.5.
Consider another example:
If you are given the equations of two parallel lines
y = 4x - 2 and y = 4x + 3
and told that one of the vertices of the squares will be at
(0,-2)
we can deduce that the equation of one of the other lines will
be
y = -0.25x - 2 (perpendicular to the original pair with an
intercept at -2).
Since the difference between the y-intercepts of y = 4x - 2 and y =
4x + 3 is five,
the difference between the y-intercepts of the other pair of lines
will be five divided by the gradient (5/4 or 1.25).
One of the perpendicular lines is y = -0.25x - 2, so the other line
can be at y = -0.25x - 0.75,
cutting the vertical axis 1.25 units above the first line.
![]() |
By following the rules above, you could get the following formula:
If you are given the equations of two parallel lines
y = ax + b and y = ax + c
and you know that one of the vertices is at (0,b)
the equations of the other two lines will be:
y = (-1/a)x + b and y = (-1/a)x + b + (c - b)/a
[(c - b)/a is the difference between the intercepts of the first pair of lines divided by their gradient]
For example: y = 2x + 2, y = 2x + 6, y = -0.5x + 2, y = -0.5x + 4
Ang Zhi Ping noticed that the 4th line could lie either above or below y = (-1/a)x + b.
Thus in order to make the method more complete, we should say
that the possible equation for the 4th line should be
y = (-1/a)x + b ± (c - b)/a.
Hence the lines y = ax + b, y = ax + c, y = -x/a + b and y = -x/a + b ± (c-b)/a enclose a square.
We have just received another solution that approaches the problem in a different way which we thought was worth publishing.
Thank you to Iori Yagami (aged 14) from the Chinese High School in Singapore for this:
If the two lines formed by the equations y=ax + b and y=ax + c are rotated 90 degrees in the clockwise (or anti-clockwise) direction, a new pair of lines will appear, and when they are combined with the two previous lines, a square will be formed.
To find out the equations of the lines when they are rotated 90 degrees clockwise, consider what happens to a variety of points that are rotated 90 degrees clockwise:
| original (x,y) | (x,y) after rotation |
|---|---|
| (2,5) | (5,-2) |
| (4,1) | (1,-4) |
| (-6,6) | (6,6) |
We can see that a 90 degree clockwise rotation has the following effect:
new x coordinate = old y coordinate
new y coordinate = negative of the old x coordinate
Therefore, if the original equation is y = ax + b
old y = a old x + b, so
new x = -a new y + b, and this can be rearranged to give:
x = -ay + b
ay = -x + b
y = -x/a + b/a
Likewise, y = ax + c becomes y = -x/a + c/a after a 90 degree clockwise rotation.
A square will be formed, but since (0,b) must be one of the vertices, we have to make one of the new lines go through (0,b).
If we add (-b/a + b) to y = -x/a + b/a we get:
y = -x/a + b
and since we must keep both parallel lines the same distance apart
we must do the same to the other equation:
If we add (-b/a + b) to y = -x/a + c/a we get:
y = -x/a + b + (c - b)/a
so our pair of parallel lines are:
y = -x/a + b and y = -x/a + b + (c - b)/a
If we had wanted the other line to go through (0,b),
we would have to add (-c/a + b) to y = -x/a + c/a, and we would
get:
y = -x/a + b
and since we must keep both parallel lines the same distance apart
we must do the same to the other equation:
If we add (-c/a + b) to y = -x/a + b/a we get:
y = -x/a + b - (c - b)/a
so our pair of parallel lines are:
y = -x/a + b and y = -x/a + b - (c - b)/a
So we end with two choices for our final pair of parallel lines depending on whether we want the bottom or top line to go through (0,b). They are:
y = -x/a + b and y = -x/a + b + (c - b)/a
or
y = -x/a + b and y = -x/a + b - (c - b)/a