Inflation doesn't matter much now, when inflation is 1-2% but when it is around 3-5% it starts to matter. Basically, high inflation is good for debtors. Every year you don't pay your loan off, inflation makes the value of the loan (compared to what you are earning) decrease.
High inflation also decreases the returns of your investments. For instance a 0% checking account is losing money to inflation.
But, when we are comparing the two you only get to count it once because you have put the money in one option or the other. So its either you put the money towards the loan and then get the higher return there, or you put the money toward the investment account and get the lower return there.
Ok, no problems with the first two paragraphs.
Where things get hazier (for me) is in the third, particularly when we look at "one time" options. E.g., assume we have
- Amount A sitting in the bank earning interest W% (yes, currently that's ~0%)
- Investment option B that will return X%
- Loan with current principal C on which you are paying Y%
- Inflation running at Z%
- Marginal tax rate T%, that applies to any income from investments or deductions for loan interest
The Net Present Value (NPV) of leaving A in the bank for "n" years is A*[(1+W*(1-T))/(1+Z)]^n
NPV of option B is A*[(1+X*(1-T))/(1+Z)]^n, so if X>W option B is "better" than leaving the money in the bank - but (as discussed above) risk should be considered. Z is irrelevant for the sake of determining which NPV is higher.
That's easy enough because both the above are "continuous" investment returns. Making a one-time loan prepayment is, well, a one time thing:
The value of taking A to reduce C = A + A*Y*(1-T), so after one year the discounted value is A*[(1+Y*(1-T))/(1+Z)]^1. This is very similar to the formulas above so at first glance it all reduces to comparing X vs. Y vs. W and picking the largest (risk-adjusted).
And it's dinner time so a first glance is all for now - perhaps someone can finish/correct/comment?