]> Mortgage Calculator

Mortgage Math

Variables

Ok, so you want a mortgage, but don't know what you can afford. The math for figuring it out is a little complicated, but once you understand it, not difficult. First we need to define some variables:

First it is important to get everything into the same units. The term and rate are both in terms of a year, so new terms need to be defined. Also, the rate is currently a percentage, so it needs to be scaled down by a factor of 100 to get a decimal to use in calculations:

The Mortgage

The loan value for the first month (l0) is simply the total loan amount. After that first month though, there is both accumulated interest and a payment. So, the value for the next month is:

l1= l0+l0r−p= l0(1+r)−p

The next month then will be:

l2= l1(1+r)−p= ( l0(1+r)−p ) (1+r)−p= l0(1+r)2 −p(1+r)−p

This continues to unfold and in a general form is:

li = li−1(1+r) −p = ( li−2(1+r) −p ) (1+r) −p = li−2 (1+r)2 −p −p (1+r) = ( li−3 (1+r) −p ) (1+r)2 −p −p (1+r) = li−3 (1+r)3 −p −p (1+r) −p (1+r)2 … = l0 (1+r)i −p −p (1+r) −p (1+r)2 … −p (1+r)i−1 = l0 (1+r)i −p [ 1+ (1+r)+ (1+r)2+ … + (1+r)i−1 ] = l0 (1+r)i −p ∑ x=0 i−1 (1+r)x

The payments are collecting according to the summation of a geometric series. That summation is generally:

Sn= ∑ k=0 n rk = 1−rn+1 1−r Sn−1= ∑ k=0 n−1 rk = 1−r(n−1)+1 1−r = 1−rn 1−r

So, for the mortgage, the value any given month is:

li= l0(1+r)i −p 1−(1+r)i 1−(1+r) = l0(1+r)i −p 1−(1+r)i −r

The Payment

Figuring out what your payment will be each month is based on the fact that at the end you will have paid off the loan, so lt=0.

lt= 0= l0(1+r)t −p 1−(1+r)t −r p= l0(1+r)t −r 1−(1+r)t

The Loan

The equation for lt is also easily solved for the loan amount:

lt= 0= l0(1+r)t −p 1−(1+r)t −r l0= p 1−(1+r)t −r(1+r)t