Point $Q$ has coordinates $(a+1,4 a+1)$ for some $a>1$, and lies on the line with equation $y=a x+3$. If $O$ is the origin $(0,0)$, determine the coordinates of the points $P$ and $R$ so that $O P Q R$ is a square with diagonal $O Q$.
Since $Q(a+1,4 a+1)$ lies on the line with equation $y=a x+3$, then

$$
\begin{aligned}
4 a+1 & =a(a+1)+3 \\
0 & =a^{2}-3 a+2 \\
0 & =(a-1)(a-2)
\end{aligned}
$$

Since $a>1$, then we must have $a=2$.

Therefore, $Q$ has coordinates $(3,9)$.

We want to find the coordinates of points $P$ and $R$ so that, together with $O(0,0)$ and $Q(3,9)$, the quadrilateral $O P Q R$ is a square.

Since $O Q$ is a diagonal of the square, then the midpoint, $M$, of $O Q$ is the centre of the square.

![](https://cdn.mathpix.com/cropped/2024_04_30_68642ad613c12af1e439g-03.jpg?height=417&width=420&top_left_y=2212&top_left_x=928)

Since $O$ has coordinates $(0,0)$ and $Q$ has coordinates $(3,9)$, then $M$ has coordinates $\left(\frac{3}{2}, \frac{9}{2}\right)$. Note that $P M$ and $M R$ are perpendicular to $O M$, since the diagonals of a square are perpendicular.

Since the slope of $O M$ is $\frac{\frac{9}{2}-0}{\frac{3}{2}-0}=3$, then the slope of $P M$ and $M R$ is $-\frac{1}{3}$.

The equation of the line through $M$ with slope $-\frac{1}{3}$ is $y-\frac{9}{2}=-\frac{1}{3}\left(x-\frac{3}{2}\right)$ or $y=-\frac{1}{3} x+5$.

An arbitrary point on this line can be written in the form $A(3 t,-t+5)$ for some real number $t$. The points $P$ and $R$ will be the two points on this line for which $O P$ and $P Q$ are perpendicular and $O R$ and $R Q$ are perpendicular.

Thus, given an arbitrary point $A$ on the line, we want to find all $t$ for which $O A$ and $A Q$ are perpendicular (that is, for which the slopes of $O A$ and $A Q$ have a product of -1 ).

The slope of $O A$ is $\frac{-t+5}{3 t}$. The slope of $A Q$ is $\frac{(-t+5)-9}{3 t-3}$.

We have the following equivalent equations:

$$
\begin{aligned}
\frac{-t+5}{3 t} \cdot \frac{-t-4}{3 t-3} & =-1 \\
(-t+5)(-t-4) & =-3 t(3 t-3) \\
t^{2}-t-20 & =-9 t^{2}+9 t \\
10 t^{2}-10 t-20 & =0 \\
t^{2}-t-2 & =0 \\
(t-2)(t+1) & =0
\end{aligned}
$$

Thus, $t=-1$ or $t=2$.

Substituting into $(3 t,-t+5)$, we obtain $P(-3,6)$ and $R(6,3)$.

We can check that the points $O(0,0), P(-3,6), Q(3,9), R(6,3)$ give $O P=P Q=Q R=R O$ and that consecutive sides are perpendicular, so $O Q P R$ is a square.

Thus, the coordinates of the points $P$ and $R$ are $(-3,6)$ and $(6,3)$.

ANswer: $(-3,6),(6,3)$