Copyright 2001
Department of Mathematics
University of Georgia
Athens, Georgia

Home Mortgages

     In this project we will study the formula for the monthly payments on a mortgage if you borrow money to buy a house for P  dollars ( P  is called the principal )   at an annual interest rate of R % when you plan to pay off the loan in   n  months (we'll call n  the term  of the loan) . Let r = R/12  denote the monthly interest rate  where R  is the annual interest rate expressed as a decimal. Then the monthly payment   C  is given by the formula

C = P*r*(1+r)^n/((1+r)^n-1)  .

In this formula, the monthly interest rate must be expressed as a decimal. For example if the annual interest rate is 6.25%, you first convert the annual interest rate to a decimal 0.0625. Then the monthly interest rate is .625e-1/12 = .520833e-2 . Note that .625e-1 is Maple's way of expressing 0.0625. More precisely e-k means to multiply by 10^(-k) .  (Note also that the last number has been rounded off.)

Project - Part 1

In this part of the project we let P  = 100000 +10000 k  where k  is the number of letters in your last name.   We will study the effect on the monthly payment when we change the life of the loan.  Thus we want to enter C  as a function of n , while thinking of P  and r  as parameters whose values we will fix.

1.)   Enter   C   as a function of n .  (Remember this will begin with C:=n-> )

2.)   Use the monthly payment formula to calculate the monthly payment on a 30 year mortgage of $ P  at an annual rate of 7%.  (Be careful, n  will be 360, and as stated above, r  is .07/12 .)

3.)   What is the payment if the same mortgage is taken out for 20 years instead of 30 years?

4.)   For each of the above two loans, what is the total amount of money you pay over the life of the loan? (If you pay C ( n ) dollars for n  months, how much do you pay altogether?)

5.)   For each of the above two loans, what is the total amount of interest you pay over the life of the loan?

6.)   Most banks offer mortgages for periods from 10 years up to 30 years. Make a plot of the monthly payment as a function of n  for this range. Even though n  is usually an integer, assume n  can be any real number.

7.)    Suppose you can only afford monthly payments of 700 + 100k dollars for this loan.   For how many years should you take out your mortgage? Assume your bank will write a mortgage for any whole number of years between 10 and 30 years.

Derivatives with Maple

Maple can differentiate a function f, using the command [> D(f);    For example if we define the function f(x) = x^3-2*x^2+3  then we can differentiate that function by entering the above command.

>    f:=x->x^3-2*x^2 +3;

>   

f := proc (x) options operator, arrow; x^3-2*x^2+3 end proc

>    D( f) ;

proc (x) options operator, arrow; 3*x^2-4*x end proc

D(f) should be treated as a new function in Maple's memory which is the derivative of f.  It can be treated just like any other function, so it can be evaluated, plotted, and even differentiated:

>    D(f)(2);

4

>    D(f)(x);

3*x^2-4*x

>    plot([f(x),D(f)(x)], x=-2..2);

[Maple Plot]

>    D(D(f));

proc (x) options operator, arrow; 6*x-4 end proc

Warning:   The function we are differentiating is f, not f(x), so we enter D(f), not   D(f(x)).  (Try this and see what happens.)

>   

Project - Part 2

1.)  Considering n  to be a real variable, differentiate the function C  you defined in Part 1.  Plot this function on the interval of n  values corresponding to the range of 10 to 30 years.

2.)  Calculate    D(C)(240)   and C (241)- C (240).  Explain why these numbers are almost the same.  In common terms, what do these numbers represent?

3.)  In the graph, what happens to the value of D(C)(n)  as n  increases?   What does this mean in practical terms? What does this mean in terms of the graph of C  as a function of n?

4.) What is the limiting value of C  as n  gets large?  In practical terms, what does this number represent?

Project - Part 3

1.)   Consider the same mortgage as in Part 1 above. Define a function S   which gives the total interest paid to the bank as a function of n , the number of months of the mortgage.  

2.)    Make a plot of the total interest as a function S ( n ) for mortgages ranging between 10 years and 30 years. Describe the behavior of the total interest function as a function of n . Is the total interest a linear function?

3.)   Suppose the maximum total interest you are willing to pay is 90% of the original mortgage. Determine the length of your mortgage and your monthly payment.

4.)   Calculate the derivative of S  as a function of n . Explain what this derivative represents in practical terms. Explain what  this derivative means in terms of the graph of the total interest function, S .   (Think about questions 2 and 3 of part 2.)

Project - Part 4 (Advanced)

In this part of the project we suppose you purchase a house for the same amount as above and you have decided to take out a 30-year mortgage. You now want to study the monthly payment and total interest as functions of R , the annual interest rate as a percent.

1.)   Express the monthly payment  now as a function of R , fixing   n  = 360 and P  = 100000 +10000 k  where k  is the number of letters in your last name.   It might be good to call this function C2  so as to avoid confusion with the earlier function.

2.)   Make a plot of the monthly payment C2(R)     for values of R  between 0.04 and 0.10.

3.)  Calculate the derivative of C2 .   Plot this derivative for values of R  between 0.04 and 0.10.  Explain what the values of  this derivative mean in practical terms. Explain what these values mean in terms of the graph of   C2(R) .

 4.)   Suppose the annual interest rate drops from 7% to 6%. Calculate the corresponding percent change in the monthly payment.

5.)  Express the total interest  paid on the mortgage as a function of R .  Call this function S2  and make a plot of S 2( R ) for values of R  between 0.04 and 0.10.  Is the rate of change of S  with respect to R  smaller when R  is .05 or when R  is .08? Explain.

Project - Part 5 (More Advanced)

Here we investigate where the formula C = P*r*(1+r)^n/((1+r)^n-1)  comes from. To do this we need the notion of present value . Let's assume we have a monthly interest rate r . Suppose someone promises to pay you  $1000 at some point in the future, say n  months from now.   If the person wants to pay you now instead of waiting, she should be able to pay less than the $1000. The question is what is a fair value. In other words we want to know the present value  of $1000 to be paid n  months from now. Let S  denote the present value. Then S  is the amount you would need to invest now  under the same monthly interest rate so that after n  months your investment would be worth $1000.

1.)    Explain why the value of an investment of S  dollars after n  months at a monthly interest rate of r  is given by

S*(1+r)^n .

This leads to the equation S*(1+r)^n = 1000  or solving for S  we find S = 1000*(1+r)^(-n)  . In general a payment of C  dollars n  months from now has a present value of

 C*(1+r)^(-n)

Now suppose C  is your monthly mortgage payment. In other words, you are going to make n  equal payments of C  dollars to pay back your mortgage. Each of your payments has a present value. The present value of your payment after the month is C*(1+r)^(-1) . The present value of your payment at the end of the second month is C*(1+r)^(-2)  and so on. Finally the present value of your final payment after n  months is C*(1+r)^(-n) . Now the sum of all these present values must equal P , the amount of your mortgage.

2.)  Define a function called presentval where presentval( j ) = C*(1+r)^(-j) . Now use the sum  command in Maple to add up all the present values:

>    sum(presentval(j),j=1..n);

You will probably want to apply the simplify  command to the output to clean it up.

3.)  Now set up the equation P  equals the sum of your present values and solve for C , using the solve   command.   You should get a formula that is close to the original formula for C . In fact Maple has a tool called testeq  for deciding when two "reasonable" formulas are algebraically equivalent. You simply put two formulas into this tool separated by a comma and either true,   false  or FAIL  is returned. If true  is returned, the formulas are algebraically equivalent. FAIL is returned if Maple is unable to decide.   Execute the following commands as an example.

>    testeq((x+y)^2,x^2+y^2);

>    testeq((x+y)^2,x^2+2*x*y+y^2);

>    testeq(abs(x),sqrt(x^2));

Use the testeq  tool to show that the formula you got by summing up your present values is algebraically equivalent to the formula C = P*r*(1+r)^n/((1+r)^n-1) .

The next time a furniture company offers to sell you furniture with no payments for two years, you should compute the present value of your future payments and offer to pay them that amount now.

The Most Common Maple Commands

Academic Honesty Statement:

Place the following statement (by copying and pasting) at the end of your report and sign it in ink.  Your instructor will not grade your report unless this signed statement appears at the end of your report.

I understand that I may work with others if I give them credit in this statement.  I also understand that I am required to write my report--that to copy all or part of someone else's report or to allow someone else to copy all or part of my report constitutes plagiarism, which is a serious violation of academic honesty.

I worked with (replace this parenthetical remark with first and last names of those with whom you worked)  on this project.  I wrote my own report.  I did not copy any of this report from anyone else and I did not allow anyone else to copy any of this report.

Signed: