Given that, $a^5 = e$ and $aba^{-1} = b^2$, $a,b \in G$
Order of an element of a group is the smallest $m$ such that $a^m = e$. So, $O(a) = 5$
$a^2ba^{-2} = a(aba^{-1})a^{-1} = ab^2a^{-1} = (aba^{-1})(aba^{-1}) = b^2b^2 = b^4$
$\color{navy}{a^3ba^{-3} = a^2(aba^{-1})a^{-2} \\= a^2(b^2)a^{-2} \\= a(aba^{-1})(aba^{-1})a^{-1} \\= a(b^2b^2)a^{-1} \\= (aba^{-1})(aba^{-1})(aba^{-1})(aba^{-1}) \\= b^2b^2b^2b^2 \\= b^8}$
Similarly, $a^4ba^{-4} = b^{16}$ and $a^5ba^{-5} = b^{32}$
- In a group inverse of identity element is identity element itself.
So, $a^5 = e$ and $a^{-5} = e^{-1} = e$
Multiplying both sides by $b^{-1}$, we get $\Rightarrow$
$b^{31} = e \Rightarrow \color{red}{O(b) = 31}$
Reference : http://fmwww.bc.edu/gross/MT310/hw02ans.pdf (See example $7$ and $8$)