# Rearrange amortisation formula to find interest

I'm struggling to rearrange the amortisation formula of a loan to find the interest rate when the other variables are known.

I.e. rearrange $$A = \frac{i \times P \times (1+i)^n}{(1+i)^n-1}$$

To find $$i = ...$$

Where
A = payment amount per period
i = interest rate (for the period)
P = principal amount of the loan
n = number of periods

I ended up with $$A = (1+i)^n(A-iP)$$ which isn't really any closer! Without the pesky i in the second bracket I was going to try to use logs, but I'm stumped and it seems a tad beyond my current limited abilities.

Is there something I'm missing or is quite difficult to rearrange?