Suppose you negotiate a loan at the bank for a total of $P$ euros at an annual interest rate of $r$ for a period of $n$ years. Then the periodic annual, amortized payment $A$ is calculated by this formula: $$A = P \frac{r(1+r)^n}{(1+r)^n - 1}$$ This can be calculated in Excel and Google Sheets with the PMT formula.
Now, the bank only allows this loan when I get some extra insurances at the bank (life insurance, fire insurance...) which all have their own specific annual cost. There are also additional costs, such as daily banking fees (which are different for every bank), file costs, etc. In order to compare banks in a transparent manner, the effective interest rate should be calculated (called JKP or "Jaarlijks KostenPercentage" in Dutch). That is, we add all annual costs (i.e. we increase $A$), and calculate the interest rate $r$ that corresponds to these costs.
Back to the maths: what I would like is to transform the formula above such that it appears in the form $r = \dots$ That is, given $A$, $P$ and $n$, I would like to be able to calculate the annual interest $r$.
EDIT: I've brought it down to the following equation: $$(c + 1)t^n - t^{n+1} - c = 0$$ ... in which $c = \frac{A}{P}$ and $t = r + 1$. I can solve this numerically, but not algebraically.
Any brilliant algebraic masters in this community here? :) Thanks!
The payments are done at times $1,2,3,....,n$. By no arbitrage, the sum of the capitalized annual payments up to $n$ must equal the investment of $P$ over $n$ years: $$\sum_{k=0}^{n-1}A(1+r)^k=P(1+r)^n$$ $$\sum_{k=0}^{n-1}(1+r)^{k-n}=\frac{P}{A}$$ $$\sum_{k=0}^{n-1}d^{k-n}=R$$
$$\sum_{k=0}^{n-1}d^{-(n-k)}=R$$
$$\sum_{j=1}^{n}d^{-j}=R$$
$$\frac{d^{-1}-d^{-(n+1)}}{1-d^{-1}}=R$$
$$\frac{h-h^{n+1}}{1-h}=R$$
$$h^{n+1}-h(R+1)+R=0$$
For large $n$, we have $h\approx(R)/(R+1)$, which implies $r=\frac{1}{R}=\frac{A}{P}$, otherwise you don't have a solution in closed form so you need numerical optimization. Indeed, by plugging in such $h$ we get $$\bigg(\frac{R}{R+1}\bigg)^{n+1}=0$$ which becomes approximately true for large $n$.