Question is
Let $a_1,a_2,a_3....$ be an arithmetic progression. If $\frac{a_1+a_2+a_3+...+a_p}{a_1+a_2+a_3+...+a_q}=\frac{p^2}{q^2},p\not=q$, then find $\frac{a_6}{a_{21}}$
Answer: $\frac{11}{41}$
All options: $\frac{7}{2}$, $\frac{2}{7}$, $\frac{11}{41}$, $\frac{41}{11}$
My approach to the question is
Let $S_r$ be sum of first $r$ terms of this AP
Method 1
we know $\frac{S_p}{S_q}=\frac{p^2}{q^2}$
So,
$\frac{\frac{p}{2}(a_1+a_p)}{\frac{q}{2}(a_1+a_q)}=\frac{p^2}{q^2}$
$\frac{a_1+a_p}{a_1+a_q}=\frac{p}{q}$
After that I am stuck.
Method 2
But after taking another look at the question, I observed
$\frac{S_6}{S_{21}}=\frac{6^2}{21^2}=\frac{36}{441}$
Also,
$\frac{S_5}{S_{20}}=\frac{5^2}{20^2}=\frac{25}{400}$
And we know $S_r-S_{r-1}=a_r$
Then subtracting numerators and denominators of both
$\frac{S_6-S_5}{S_{21}-S_{20}}=\frac{a_6}{a_{21}}=\frac{36-25}{441-400}=\frac{11}{41}$
which we can't always do in maths, I cannot understand why Method 2 gave correct answer.
You can find from your first method!
$a_p = a_1+(p-1)d \\a_q = a_1+(q-1)d$
$$\implies\frac{2a_1+(p-1)d}{2a_1+(q-1)d}=\frac{p}{q}\implies2a_1q+pdq-dq=2a_1p+pdq-dp$$
$$\implies(2a-d)(q-p)=0 \iff q=p \text{ or } d=2a$$
As, we consider different $p$ and $q$, we have
$$\frac{a_6}{a_{21}} = \frac{a_1+5d}{a_1+20d}=\frac{11a_1}{41a_1}=\frac{11}{41}$$
Your method $2$ works for this case as long as you don't simplify the fractions. The reason behind it is,
$$\frac{s_p - s_{p-1}}{s_1-s_{q-1}}=\frac{a_p}{a_q}=\frac{a+(p-1)2a}{a+(q-1)2a}=\frac{2p-1}{2q-1}\equiv\frac{p^2-(p-1)^2}{q^2-(q-1)^2}$$ So don't use the second method as it may not work for other questions.