5.23. Find the coordinates of vertices $C$ and $D$ of the square $ABCD$, if $A(2 ; 1), B(4 ; 0)$.
### 5.23. According to the condition, $A(2 ; 1)$,

$B(4 ; 0)$ are known, while $C\left(x_{1} ; y_{1}\right)$, $D\left(x_{2} ; y_{2}\right)$ are unknown vertices of the square (Fig. 5.13). Since the length of the side of the square $A B=\sqrt{2^{2}+1^{2}}=\sqrt{5}$ and $B C = A B$, we have

$$
B C^{2}=\left(x_{1}-4\right)^{2}+y_{1}^{2}=5
$$

Let's find the slope of the side

![](https://cdn.mathpix.com/cropped/2024_05_21_1e3d8d2f6605ac23e2a5g-608.jpg?height=321&width=418&top_left_y=766&top_left_x=737)

Fig. 5.13 of $A B$. For this, we will use formula (5.4), written as $k=\frac{y-y_{0}}{x-x_{0}}$, where $(x ; y)$ are the coordinates of point $B$, and $\left(x_{0} ; y_{0}\right)$ are the coordinates of point $A$; then we get $k=\frac{0-1}{4-2}=-\frac{1}{2}$. Since $B C \perp A B$, the equation of $B C$ is $y-0=2(x-4)$, i.e., $y=2 x-8$. Further, point $C\left(x_{1} ; y_{1}\right)$ lies on $B C$, so

$$
y_{1}=2 x_{1}-8
$$

Solving the system of equations (1) and (2), we find two points $C(5 ; 2)$ and $C(3 ;-2)$, which, as can be easily verified, are symmetric with respect to point $B$.

For point $C(5 ; 2)$, we have $\overline{A C}(3 ; 1), \overline{B D}\left(x_{2}-4 ; y_{2}\right)$, and considering that $A C \perp B D$, we get

$$
\overline{A C} \cdot \overline{B D}=0, \text { or } 3 x_{2}-12+y_{2}=0 \Rightarrow y_{2}=12-3 x_{2}
$$

Additionally, $B D^{2}=\left(x_{2}-4\right)^{2}+y_{2}^{2}=(\sqrt{5})^{2}+(\sqrt{5})^{2}$, or

$$
\left(x_{2}-4\right)^{2}+y_{2}^{2}=10 \text {. }
$$

Solving the system of equations (3) and (4), we find two points $D(5 ;-3)$ and $D(3 ; 3)$.

To select the correct point, we will use the collinearity of vectors $\overline{A B}$ and $\overline{C D}$. If $D(5 ;-3)$, then $\overline{C D}(0 ;-5), \overline{A B}(2 ;-1)$, i.e., $\overline{C D}$ is not collinear with $\overline{A B}$, so point $D(5 ;-3)$ is not a vertex of the square. If $D(3 ; 3)$, then $\overline{C D}(-2 ; 1)$, i.e., $\overline{C D} \parallel \overline{A B}$. Therefore, points $C(5 ; 2)$ and $D(3 ; 3)$ are vertices of the square.

Reasoning similarly, for point $C(3 ;-2)$, we find the vertex $D(1 ;-1)$.

Answer: $C(5 ; 2), D(3 ; 3)$ or $C(3 ;-2), D(1 ;-1)$.