Let the squares be ABCD and ADEF with AD as common side (see Fig.). Solving x + 2y + 3 = 0 and 2x − y − 4 = 0, we have A = (1, −2). Solving the equations x + 2y − 7 = 0 and 2x − y − 4 = 0, we have D = (3, 2). The length of the sides of squares
= AD = √(3 - 1)2 + (2 + 2)2 = √ 4 + 16 = 2√5. Let B(h, - (3 + h/2) be a point on the line x + 2y + 3 = 0 such that AB = 2√5.
Therefore,
Therefore, B = (5, -4) and F = (-3,0) Hence, the equation of the side BC is y + 4 = 2(x − 5) or 2x − y − 14 = 0 and the equation of the side FE is y − 0 = 2(x + 3) or 2x − y − 6 = 0. Equations of the fourth side of the square are 2x − y − 14 = 0 and 2x − y − 6 = 0.