Our mortgage is up for renewal in December, so this discussion is timely for us. Sounds like it may be for you, too...
In making up the spreadsheet to analyze this, I added the situation whereby you do all of the investing within an RRSP. So once a year you get to claim not only the interest payments on the investment (as a deduction), but you also get to claim the principal of the investments you make as an RRSP contribution, yielding a large tax return that can be applied to the principal of the mortgage. This results in cutting your mortgage term by about 25-30%.
At that point, your "loan" balance is about 75% of your original mortgage, and your RRSP balance is about 125% of your original mortgage... But consider that you'll be taxed at your marginal rate if you withdraw enough to pay off that loan overnight. Here's how the numbers (roughly) work for a $100K mortgage at 6%:
With all interest rates being equal (mortgage, loan, and investment), if the investment is done within an RRSP, the mortgage is done in about 7 years, with a loan balance around $75K, and an RRSP balance around $120K. If the RRSP was cleaned out to pay the loan, it would leave around $10K in the RRSP.
If the investing is done outside the RRSP, the mortgage is done in about 9 years, with a "loan" equal to the same mortgage principal you started with, but with an investment portfolio worth about $175K. Note that you'll pay capital gains tax on this portfolio if you remove anything from it, of course.
And finally, if you can turn over a better return rate than your mortgage, you'll be even further ahead, and vice-versa.
Time to go talk to a financial advisor... :)
-----
because everyone else has one...