Application Center - Maplesoft

App Preview:

Compound interest

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

Learn about Maple
Download Application


 

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;

simple_amt := proc (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);

3800.00

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) ;

compound_amt := proc (principal, interest_rate, yea...

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 );

7016.291706

___________________________________________________________________________________

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;

3000.

3217.5000

3450.768750

3700.949484

3969.268323

4257.040275

4565.675694

4896.687183

5251.697004

5632.445037

6040.797303

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;

3000., 3000.

3330.00, 3347.156523

3660.00, 3734.485593

3990.00, 4166.635938

4320.00, 4648.794216

4650.00, 5186.747295

4980.00, 5786.951679

5310.00, 6456.611016

5640.00, 7203.762558

5970.00, 8037.373608

6300.00, 8967.449163

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;

3000., 3000.

3217.5000, 3224.874906

3450.768750, 3466.606050

3700.949484, 3726.456954

3969.268323, 4005.785838

4257.040275, 4306.052742

4565.675694, 4628.827143

4896.687183, 4975.796163

5251.697004, 5348.773392

5632.445037, 5749.708362

6040.797303, 6180.696738

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;

3000., 3000.

3200.915568, 3297.742764

3415.286826, 3625.035783

3644.014926, 3984.811842

3888.061368, 4380.294807

4148.452056, 4815.028503

4426.281591, 5292.908472

4722.717885, 5818.216872

5039.007066, 6395.660865

5376.478725, 7030.414782

5736.551484, 7728.166497

6120.738987, 8495.168385

6530.656239, 9338.293359

6968.026407, 10265.09646

7434.688071, 11283.88252

7932.602931, 12403.78065

___________________________________________________________________________________

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]);

[Maple Plot]

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]);

[Maple Plot]

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]);

[Maple Plot]

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]);

[Maple Plot]

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 );

.110203450

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

>