## How is mortgage monthly payment calculated?

Starting with a loan $L$ and annual interest rate $a$, let’s list the amounts of debt we owe the bank for each month.

To simplify the formulas, let’s write $r = 1 + a/12$, this is the rate at which your is increasing monthly. And $P$ is the monthly payment you are supposed to make to the bank.

Month Debt

At the nth monthly your debt should be cleared, so, setting it to 0 we get: