Answer
$x=\displaystyle \frac{\log(\frac{A}{P})}{m\cdot\log(1+i)}$
Work Step by Step
Divide both sides with $P$ ...
$(1+i)^{mx}=\displaystyle \frac{A}{P}\qquad$... apply log( ) to both sides
$ mx\displaystyle \cdot\log(1+i)=\log(\frac{A}{P})\qquad$...we applied $\log_{b}\left(x^{r}\right)=r\log_{b}x$
... divide with $[m\cdot\log(1+i)]$
$x=\displaystyle \frac{\log(\frac{A}{P})}{m\cdot\log(1+i)}$