21. In a square garden $P Q R T$ of side $10 \mathrm{~m}$, a ladybird sets off from $Q$ and moves along edge $Q R$ at $30 \mathrm{~cm}$ per minute. At the same time, a spider sets off from $R$ and moves along edge $R T$ at $40 \mathrm{~cm}$ per minute.
What will be the shortest distance between them, in metres?
A 5
B 6
C $5 \sqrt{2}$
D 8
E 10
Solution
$\mathbf{D}$
Let $L$ be the point that the ladybird reaches after $t$ minutes. Then $Q L=30 t \mathrm{~cm}$. The side length of the square is $10 \mathrm{~m}$ which is the same as $1000 \mathrm{~cm}$. Therefore the length of $L R$ is $(1000-30 t) \mathrm{cm}$.

Let $S$ be the point that the spider reaches after $t$ minutes. Then $R S=40 t \mathrm{~cm}$.

Let the length of $L S$ be $x \mathrm{~cm}$. This is the distance between the ladybird and the spider after $t$ minutes.

Because $P Q R T$ is a square, $\angle L R S=90^{\circ}$. By
Pythagoras' Theorem applied to the triangle $L R S$, we have
$$
\begin{aligned}
x^{2} & =(1000-30 t)^{2}+(40 t)^{2} \\
& =1000000-60000 t+900 t^{2}+1600 t^{2} \\
& =2500 t^{2}-60000 t+1000000 \\
& =2500\left(t^{2}-24 t+400\right) \\
& =2500\left((t-12)^{2}+256\right) .
\end{aligned}
$$

Because $(t-12)^{2} \geq 0$ for all values of $t$, it follows that $x^{2} \geq 2500 \times 256$ for all values of $t$. Since $x^{2}=2500 \times 256$ when $t=12$, it follows that the smallest value of $x^{2}$ is $2500 \times 256$. Therefore the smallest value taken by $x$ is $\sqrt{2500 \times 256}$, which is equal to $50 \times 16$, that is, 800 . Hence the shortest distance between the ladybird and the spider is $800 \mathrm{~cm}$ which is $8 \mathrm{~m}$.