Application Center - Maplesoft

# Compound interest

You can switch back to the summary page by clicking here.

0302.mws

Module 3 : Finite Mathematics

302 : Simple & Compound Interest

O B J E C T I V E

We will learn to create financial formulas and use these formulas to analyze and better understand how different conditions create different results using numeric and graphical methods.

S E T U P

In this project we will use the following command packages. Type and execute this line before begining the project below. If you re-enter the worksheet for this project, be sure to re-execute this statement before jumping to any point in the worksheet.

> restart; with(plots):

```Warning, the name changecoords has been redefined
```

___________________________________________________________________________________

A. Interest Formulae

___________________________________________________________________________________

There are a variety of financial formulas you might encounter. We can create formulas in Maple to make financial computations. The format is this :
(formula name as a continuous string of characters) := (list of inputs) -> (forumula) ;
Unlike Mathematics, we can use descriptive names for quantities rather than single letters.

SIMPLE INTEREST

Here is a formula for the amount at maturity of a simple interest loan.

> simple_amt := (principal,interest_rate,years) -> principal + principal*interest_rate*years;

formula name := list of inputs crude arrow forumula ;
note that the using the input values
underscore allows
for a continuous string

Problem : Compute how much you will have if you invest \$2000 for 10 years at 9.5% using simple interest.

Note that we express the interest rate, 9.5%, as a decimal, .095.

> simple_amt( 2000, .09, 10);

COMPOUND INTEREST

Here is a formula to compute the maturity amount of a loan with compound interest.

> compound_amt := (principal, interest_rate, years, compounds ) ->
principal*(1+interest_rate/compounds)^(years*compounds) ;

Interest rate is in decimal form, time period is in years, compounds is the number of times per year that compounds are computed (for example, 1 means annually, 4 mean quarterly, and 12 means monthly).

Problem : Compute the amount you'll have if you invest \$6,000 at 5.25% for 3 years compounded quarterly.

Note that there is no comma in 6000 and the interest rate is expressed in decimal form.

> compound_amt( 6000, .0525, 3, 4 );

___________________________________________________________________________________

B. Analyzing Interest With Automation

___________________________________________________________________________________

Using the formulas we created above, we can analyze and visualize how different parameters effect an investment or loan using automated loops to compute repetitive values.

A loop is a statement that is repeated automatically. The format is this :
for k from 0 to (last year) do (one or more maple commands using k for the year) od;

The following command will create a list of how much an investmentof \$3,000 @ 7.25% compounded annually will grow at the end of each year for 10 years.

> for k from 0 to 10 do compound_amt( 3000, .0725, k, 1) od;

We can also use loops to make comparisons. Here is a year by year comparison of simple interest compared to compounding monthly using the same amount, same interest rate, and same time period.

> for k from 0 to 10 do
simple_amt(3000, .11, k), compound_amt(3000, .11, k, 12) od;

We can also compare the results year by year of compounding annually versus monthly.

> for k from 0 to 10 do
compound_amt(3000, .0725, k, 1),compound_amt(3000, .0725, k, 12) od;

Here is a comparison of \$3,000 invested at 6.5% and 9.5% for 15 years.

> for k from 0 to 15 do
compound_amt(3000, .065, k, 12), compound_amt(3000, .095, k, 12) od;

___________________________________________________________________________________

C. Analyzing Interest with Graphs

___________________________________________________________________________________

We can also make comparisons based on graphs and see the differences visually.

> plot( compound_amt( 1000, .0725, ceil(x), 1), x = 0..20, labels = [years, amount]);

This graph shows the yield for a inverstment of \$1,000 @ 7.25 % for 20 years compounded annually.

We can compare the yield from the same investment and same interest rate using simple and annually compound interest computations.

> plot( { simple_amt( 1000, .0525, ceil(x), 1), compound_amt(1000,.0725,ceil(x), 1)},
x = 0..20, labels = [years, amount]);

How does the yield compare over 30 years with compounding annually, quarterly, and monthly?

> plot( {compound_amt( 1000, .0725, ceil(x),1),amount( 1000, .0925, ceil(x), 4),
compound_amt( 1000, .0725, ceil(x),12)}, x = 0..30, labels =[years,amount]);

How much difference does a silly little percentage point make? Lets look at the yield for an investment with 3% compared to 4%.

> plot( { compound_amt( 1000, .03, ceil(x), 12),
compound_amt( 1000, .04, ceil(x), 12)}, x = 0..30, labels=[years,amount]);

Theres clearly a big difference! Exactly how much?

> compound_amt( 1000, .04, 30, 12) - compound_amt( 1a);

```Error, missing operator or `;`
```

___________________________________________________________________________________

D. The Financial Pacage

___________________________________________________________________________________

Maple also has a financial package with built-in functions. For example, we can compute the effective rate of a loan using a Maple command in the finance package.

> with(finance):

> effectiverate( 0.105, 12 );

The effective interest rate of a compounded loan is the actual interest paid over a year. Sometimes this is known as APR (annual percentage rate) . This command computes the effective interest rate of a 10.5% loan compounded monthly (12 times per year).

> ?finance

>