annuity interest payments Someone takes a loan of $S_1$ as an annuity at an annual interest rate $i$, paid back in monthly installments of $M$. Now I wonder how I can get the annual interest payments for each year $t$.
I can calculate the remaining debt after each year using 
$$ S_{t}=\frac{M}{\frac{i}{12}} - \bigg(1+\frac{i}{12}\bigg)^{12}\times \bigg(\frac{M}{\frac{i}{12}}-S_{t-1}\bigg) $$
(e.g., wikipedia, adapted to have monthly payments). Using this, I can then calculate the interest numerically as $I_t = 12 \times M - (S_t - S_{t-1})$ but this approach fails in the last period when $M$ is paid only for a few months until $S_1$ is fully repaid. Therefore, I wonder whether anyone is aware of an equation to get annual interest payments analytically. 
 A: In situation, where $S_t > 12M$, we can use this formula:

The fixed monthly payment $M$ for a loan of $S$ for $n$ months and a monthly interest rate $i$ is:
  $$M=S\frac{i(1+i)^n}{(1+i)^n-1}$$

After some transformations you obtain the number of months to pay this loan:
$$n=\log _{i+1} \frac{M}{M-Si}$$
So the total value of loan to pay in the last year $t$ is equal to
$$M\log _{i+1} \frac{M}{M-iS_{t-1}}$$
A: The loan $S=Ma_{\overline{n}|r}$ where $r=i/12$ in $n$ total months. 
If $S$ and $M$ are known we can easily find tne number of months to repay the loan 
$$
S=Ma_{\overline{n}|r}=M\frac{1-(1+r)^{-n}}{r}\quad\Longrightarrow\; n=\frac{\log\left(\frac{M}{M-rS}\right)}{\log(1+r)}
$$
and the number of years is $m=n/12$.
At any time $k$ (month) the interest payment is
$$
I_k=rMa_{\overline{n-k+1}|r}=M\left(1-v^{n-k+1} \right)
$$
with $v=\frac{1}{1+r}$ and the principal payment is
$$
P_k=M v^{n-k+1}
$$
so that $M=P_k+I_k$ and the oustanding balance is
$$
B_k=Ma_{\overline{n-k}|r}
$$
If the outstanding balance at month $k-1$ is known, i.e. what is left to be paid back, and the payment $M$, we can find the interest payed at month $k$ as 
$$
I_k=rB_{k-1}
$$
and $P_k=M-I_k$.
The monthly repayment of the loan is equivalent to the yearly repayment of the loan with effective annual interest $$j=\left(1+\frac{i}{12}\right)^{12}-1=(1+r)^{12}-1$$
for $m=n/12$ years:
$$
S=Ma_{\overline{n}|r}=M\frac{1-\frac{1}{(1+r)^n}}{r}=M\frac{1-\frac{1}{(1+j)^m}}{r}=M\cdot\frac{j}{r}\cdot \frac{1-\frac{1}{(1+j)^m}}{j}=A a_{\overline{m}|j}
$$
observing that $(1+r)^n=(1+r)^{12\times\frac{n}{12}}=(1+j)^m$ and the yearly installment is $A=M\times\frac{j}{r}$. Observe that $A$ is the future vale at the end of the year of 12 installment of value $M$ at monthly interest $r$:
$$
A=M\times\frac{j}{r}=M\times\frac{(1+r)^{12}-1}{r}=M\cdot s_{\overline{12}|r}
$$
and expressing $r=i/12$ we have that
$$
A=M\times\frac{j}{r}=M\times\frac{j}{i/12}=12M\times\frac{j}{i}
$$
that is $A>12M$: the installment that we have to pay annually is greater than the sum of the monthly installments in one year, because the annual effective interest $j$ is greater than the monthly interest $i$:
$$
\frac{j}{i}=\frac{(1+i/12)^{12}-1}{i}>1\quad \text{for } i>0
$$
At any time $t$ (year) the interest payment is
$$
I_t=jAa_{\overline{m-t+1}|j}=A\left(1-\nu^{m-t+1} \right)
$$
with $\nu=\frac{1}{1+j}$ and the principal payment is
$$
P_t=A \nu^{m-t+1}
$$
so that $A =P_t+I_t$ and the oustanding balance is
$$
B_t=Aa_{\overline{m-t}|j}
$$
If the outstanding balance at year $t-1$ is known, i.e. what is left to be paid back, and the payment $A=Mj/r$ we can find the interest payed at year $t$ as 
$$
I_t=jB_{t-1}
$$
and $P_t=A-I_t$.
