# Ask Uncle Colin: A STEP in the right direction

Dear Uncle Colin,

I’m struggling with a STEP question. Any ideas?

Given:

- $q^2 - pr = -3k$
- $r^2 - qp = -k$
- $p^2 - rq = k$
Find p, q and r in terms of k.

- Simultaneous Triple Equation Problem

Hi, STEP, and thanks for your question!

This is an absolute biter that took me several attempts to get under control. The key was to spot that the difference between each successive pair of equations is $2k$, and that there’s a common factor in the differences.

By which I mean:

- The difference between equations (1) and (2) is $r^2 - q^2 + p(r-q) = 2k$, which is $(r-q)(p+r+q) = 2k$ (*)
- The difference between equations (2) and (3) is $p^2 - r^2 + q(p-r) = 2k$, which is $(p-r)(p+r+q) = 2k$

Dividing both sides of both equations by $(p+r+q)$ gives $(r-q)=\frac{2k}{p + r + q} = (p-r)$, which means $2r = p+q$.

If we add (2) and (3), we get $p^2 + r^2 - q(p+r)=0$.

Replacing $p$ with $2r-q$ gives $5r^2 - 7rq + 2q^2 = 0$; that factorises as $(5r-2q)(r-q)=0$. That means either $5r-2q=0$ or $r-q=0$.

If $r=q$, then (*) says that $k=0$, and it follows from (3) that $p = \pm r$, and from (2) that all three variables are the same - which is a very dull solution.

The other option is that $5r=2q$. Knowing that $p+q=2r$, we can deduce $r = -2p$ and $q = -5p$.

Going back to equation (1) gives $27p^2 = -3k$, so $p=\frac{1}{3}\sqrt{-k}$, $q = -\frac{5}{3}\sqrt{-k}$ and $r = -\frac{2}{3}\sqrt{-k}$.

To check it works, suppose $k = -9$, so that $p=1$, $q=-5$ and $r=-2$. Substituting those into (1), (2) and (3) gives the answers 27, 9 and -9, as desired.

Hope that helps!

- Uncle Colin

* Thanks to @ajk_44 for suggesting this might interest me.