open a savings account which pays the same interest as the
the loan, and make monthly installments to the account.
At the end of the loan, the amount in the savings account equals
the amount due on the loan, so you pay off the loan with the account
balance, closing both.
The amount due on the loan, with accrued interest, is:
Principal * ( 1 + interest ) ** Term
that is, the principal compound with its interest for Term times.
The amount saved in the bank is:
Payment * ( 1 + interest ) ** (Term - 1)
+ Payment * ( 1 + interest ) ** ( Term - 2 )
+ ...
+ Payment
that is, add up all the payments, applying individually to each, how
the interest compounds as the payment sits in the bank.
The hard part is making sense of the large sum of payments compounded
each by a different factor. Mathematicians know the formal power series:
1 / ( 1- t ) = 1 + t + t**2 + ...
This is an infinite sum. This series is truncated by subtracting
itself from itself
after it has been shifted up by the desired amount:
(t ** N) * 1 / ( 1 - t ) = t**N + t*(N+1) + ...
So the payment sum is also written:
Payment * ( 1 / ( 1 - t ) ) - Payment * (t**Term) * 1 / ( 1 - t )
where
t = 1 + interest
Setting Principal with accrued interest equal to savings with
accrued interest, and simplifying some algebra:
Principal * (1+interest)**Term
= Payment * ( (1+interest)**Term - 1 ) / interest
This is a formula used in the JavaScript function embedded in this page.
Burton Rosenberg
Math and Computer Sci
Univ of Miami
August 1997