Given,
1stGP⇒First term=a,a3=b
⇒ar2=b
⇒r2=ab
⇒a10=ar10=a(ab)5...(i)
2ndGP⇒First term=a,a5=b
⇒aR4=b...(ii)
⇒ap=aRp−1
⇒ap=a[(ab)41]p−1...(ii)
Now, using the given condition of pth term we get,
⇒a(ab)5=a(ab)4p−1
⇒(ab)5=(ab)4p−1
⇒5=4p−1
⇒p=21