Mortgage Payments

We want to understand the relationships between the mortgage payment of a fixed rate mortgage, the principal (the amount borrowed), the annual interest rate, and the period of the loan. We are going to assume that payments are made monthly, even though the interest rate is given as an annual rate. So, one of the things we will need is a way to convert years into months. Let's define

[Graphics:mortgagegr2.gif][Graphics:mortgagegr1.gif]

For example, we can write

[Graphics:mortgagegr2.gif][Graphics:mortgagegr3.gif]
[Graphics:mortgagegr2.gif][Graphics:mortgagegr4.gif]

to determine the number of monthly payments made on a 30 year loan, and we can write

[Graphics:mortgagegr2.gif][Graphics:mortgagegr5.gif]
[Graphics:mortgagegr2.gif][Graphics:mortgagegr6.gif]

to convert an annual percentage rate of 8% into a monthly rate.

Now let's think about what happens with each monthly payment. Some of the payment is applied to pay the interest for that month, and the remainder is applied to reduce the principal. Let P denote the principal at the beginning of the month, let R denote the amount of the monthly payment, and let J denote the monthly interest rate.

[Graphics:mortgagegr2.gif][Graphics:mortgagegr7.gif]

[Graphics:mortgagegr2.gif][Graphics:mortgagegr8.gif]

[Graphics:mortgagegr2.gif][Graphics:mortgagegr9.gif]

This allows us to compute a formula for the new principal.

[Graphics:mortgagegr2.gif][Graphics:mortgagegr10.gif]
[Graphics:mortgagegr2.gif][Graphics:mortgagegr11.gif]

In order to understand the full relationship between the principal, interest rate, number of payments, and monthly payment, we need to see how the outstanding principal changes over the course of several payments. The simplest way to think about this relationship is to observe that the outstanding principal changes with each payment by the formula we just worked out for computing the new principal after one payment; we simply need to repeat this process. The next series of commands shows how to do this. (The curious double definition of the function outstanding[N] is a standard technique in Mathematica to make the function remember values that it has computed earlier. See Section 2.4.9 of The Mathematica Book by Steven Wolfram.)

[Graphics:mortgagegr2.gif][Graphics:mortgagegr12.gif]

For example, here is the amount of the principal still outstanding after each of the first six payments.

[Graphics:mortgagegr2.gif][Graphics:mortgagegr13.gif]
[Graphics:mortgagegr2.gif][Graphics:mortgagegr14.gif]

Next, we'll try to find a better formula for the outstanding principal. It's clear from our examples that there will always be a term of the form [Graphics:mortgagegr15.gif]P. However, we need a better formula for the term involving R. The coefficients of powers of J in this term are reminiscent of the binomial coefficients. For example, we have

[Graphics:mortgagegr2.gif][Graphics:mortgagegr16.gif]
[Graphics:mortgagegr2.gif][Graphics:mortgagegr17.gif]

With a minor adjustment, we can get the exact term.

[Graphics:mortgagegr2.gif][Graphics:mortgagegr18.gif]
[Graphics:mortgagegr2.gif][Graphics:mortgagegr19.gif]

So, a formula for the outstanding principal is

[Graphics:mortgagegr2.gif][Graphics:mortgagegr20.gif]
[Graphics:mortgagegr2.gif][Graphics:mortgagegr21.gif]

Now suppose that after N payments the loan is paid off. Then the outstanding principal is zero. By setting outstandingPrincipal to zero and solving the resulting equation for R, we can compute the monthly payment as a function of the principal, interest rate, and number of payments.

[Graphics:mortgagegr2.gif][Graphics:mortgagegr22.gif]
[Graphics:mortgagegr2.gif][Graphics:mortgagegr23.gif]

[Graphics:mortgagegr2.gif][Graphics:mortgagegr24.gif]

For example, the payment on a loan of $150,000 at 8 percent for 30 years is

[Graphics:mortgagegr2.gif][Graphics:mortgagegr25.gif]
[Graphics:mortgagegr2.gif][Graphics:mortgagegr26.gif]

We may also want to determine the amount of money that can be borrowed as a function of the amount we are able to pay each month. We simply solve our equation for P in terms of the remaining variables.

[Graphics:mortgagegr2.gif][Graphics:mortgagegr27.gif]
[Graphics:mortgagegr2.gif][Graphics:mortgagegr28.gif]

[Graphics:mortgagegr2.gif][Graphics:mortgagegr29.gif]

For example, suppose we can afford to pay $1500 per month, and that the interest rate on a 30 year loan is 8 percent. Then the amount of money that can be borrowed is

[Graphics:mortgagegr2.gif][Graphics:mortgagegr30.gif]
[Graphics:mortgagegr2.gif][Graphics:mortgagegr31.gif]

As a final piece of the analysis, we are going to write a function that will produce a table of values showing how much of each of a series of payments is allocated toward the interest payment, and how much is used to reduce the principal. The function takes as inputs the initial principal, the annual interest rate, the monthly payment, and the number of payments to be made during the period of time covered by the table. We use the Mathematica commands Module and Do to write a function that can repeat a process a fixed number of times, using local variables to store the intermediate results of the computation.

[Graphics:mortgagegr2.gif][Graphics:mortgagegr32.gif]

Let's see what happens if we make one year's worth of $1100.65 payments on a $150,000 loan at an annual interest rate of 8 per cent.

[Graphics:mortgagegr2.gif][Graphics:mortgagegr33.gif]
[Graphics:mortgagegr2.gif][Graphics:mortgagegr34.gif]

Using similar techniques, we can determine the total amount of interest paid over the life of a loan. In order to do this, we need to know the principal, the interest rate, and the number of payments.

[Graphics:mortgagegr2.gif][Graphics:mortgagegr35.gif]

For example, let's continue to look at the case of a 30 year mortgage at eight percent. With a principal of

[Graphics:mortgagegr2.gif][Graphics:mortgagegr36.gif]

we pay a total interest of

[Graphics:mortgagegr2.gif][Graphics:mortgagegr37.gif]
[Graphics:mortgagegr2.gif][Graphics:mortgagegr38.gif]

Here is a pie chart showing the relative amounts paid in principal and interest over the life of the loan.

[Graphics:mortgagegr2.gif][Graphics:mortgagegr39.gif]

[Graphics:mortgagegr2.gif][Graphics:mortgagegr40.gif]
[Graphics:mortgagegr2.gif][Graphics:mortgagegr41.gif]