I am using a program that outputs elements of the symbolic ring that are rational expressions in an exponential variables $p^s$ for some prime $p$. (Specifically, it is the igusa_zeta() function from here.) For example, one possible output is (p^(s + 3) - 1)*(p - 1)*p^(2*s)/((p^(s + 1) - 1)*(p^(2*s + 3) - 1))}
.
I would like to know if there is an automated way to change to the variable $t = p^s$ such that this expression becomes $$\frac{(p^3 t - 1) (p-1) t^2}{(pt-1) (p^3 t^2 - 1)}.$$