Common ratio of a GP - $a_p, a_q, a_r$ given $a_1, a_2 ...$ form an AP 
Given $a_1, a_2 ...$ form an AP and $a_p, a_q, a_r$ form a GP. Find $\dfrac{a_q}{a_r}$

I did :
$$a_p, a_q, a_r \text{ form a GP}$$
$$\implies a_q^2 = a_p\cdot a_r$$
I got till here :
$$a(2q-p-r) = d(2q-p-r+pr-q^2)$$
I cant eleminate a and d. The answer given was in ratio of p,q,r or:
Answer: $\dfrac{r-q}{q-p}$ 
Thank you.

Since 
\begin{align*}
a_q^2 & = a_pa_r\\
a_q^2 -a_ra_q& = a_pa_r-a_ra_q\\
a_q(a_q-a_r)&=a_r(a_p-a_q)\\
\frac{a_q}{a_r}& =\frac{a_p-a_q}{a_q-a_r}\\
\frac{a_q}{a_r}& =\frac{d(p-q)}{d(q-r)}\\
\frac{a_q}{a_r}& =\frac{p-q}{q-r}\\
\end{align*}
My answer and yours doesn't match (they are close in form). Perhaps check your answer again. If you want the common ratio then it will be $\dfrac{a_r}{a_q}=\frac{q-r}{p-q}$.
