I like to know where my formulas come from. I’m currently looking into purchasing a new vehicle, and with that will possibly be a car loan. Coming from an math/engineer perspective, I’ve found the specifics of car loans to be lacking. But that isn’t necessarily the point of this post. Many times, you want to know, given the size of the loan, the “interest rate”, and the number payments, how big will the monthly payment be?

So let’s derive it ourselves.

First, let’s define some variables. Let

$P_0 =$ Initial loan size ($) $R =$ Interest rate described as an annual number (%, 0-1) $r = R/12$ Interest rate per month (%, 0-1) $M =$ Monthly payment ($)

$n =$ Number of payments (months)

The way these loans typically work is that every month you have an interest payment on the amount you owe on the loan (principal). Anything extra that you pay that isn’t part of the interest payment will deduct from your total principal.

So let’s start from month 1. The amount of interest you owe will be the initial loan size, $P_0$ multiplied by the interest rate.

What should that interest rate be though? It’s usually not specified clearly in many places, but it’s often assumed that it’s the annual rate divided by 12 months, which we are denoting as $r$.

For this first payment the amount you are going to reduce the principal by is

So the principal after the first payment, $P_1$ will be

With a little algebra, this is equivalent to

From here, you can just continue the pattern, and it should be apparent that the following recursive formula is true.

This equation is the basis for all the loan payment formulas. But at this point, it’s not very useful.

We need to get rid of this subscript $n+1$ stuff. So let’s just start looking at bigger values of $n$ beyond 1, substituting for variables until we have only variables that we know. Let’s look at the case $n=3$ and see if we can spot some patterns. Using Eq. \eqref{eq:recursive},

Substituting Eq. \eqref{eq:n2} into \eqref{eq:n3}

Rearranging,

Let do one more substitution, Eq. \eqref{eq:n1} into \eqref{eq:newP3}.

Distribute that $\left(1 + r\right)^{2}$,

or

Cool. So we got to a point where we only have a $P_0$ and other terms we know ($M$ and $r$). The problem is that as we keep going, we add one more $M \left(1+r\right)^{n}$ term and that gets messy. Is there a way to simplify that?

If you were paying attention in calculus class, you may recognize that type of series the $M$ terms are going through. It’s known by math people as a geometric series, one in which you are multiplying by a factor over and over again. In our case, that factor is $\left(1 + r\right)$.

A finite geometric series is defined by the form

(We typically stop at $n - 1$ because we usually want $n$ to equal the total number of terms, and we have to include that $r^{0}$.)

This has a well known formula for the sum (for a derivation, check out Khan Academy).

Almost there. Now we can replace the terms in the square brackets in Eq. \eqref{eq:rearrangedform} with our formula for the sum where for us $a$ is like $M$ and $r$ is like $\left(1 + r\right)$.

We are interested in when $P_n = 0$ as this means the principal has gone to 0 and you owe nothing more! After all this work, one version of our final form is

We now have an equation, with four variables. Given 3 of them, we can use algebra to find the 4th. Now normally, you aren’t solving for $P_0$, the loan amount, but nothing would stop you. The equation most people will be interested in is solving Eq. \eqref{eq:base} for $M$, the monthly payment. With algebra, that formula is

The equation for $n$, the number of payment months, is less well known, but we can still get it.

Algebra time. Solving for $n$

Phew. I played around with trying to find a closed form solution for $r$, but this proved to be much more of a challenge. Simplified it a bit with some binomial coefficient formulas, but no luck completely isolating $r$. Since you have $r^n$, you get lots of solutions. Best way is to just numerically solve it using traditional techniques.