I don't seem to understand something regarding how interest is paid on a mortgage. Say the loan is for $100,000 at a 5% rate for 10 years, paid monthly.
I would think that on the first month, the interest I have to pay $100,000 × (0.05 ÷ 12) = $416.67. However the mortgage calculator says that the first payment is actually $412.39. While it's not a huge difference, it's a difference nonetheless and I can't really figure out where it comes from.
My intuition is that it's somehow related to the fact that interest is compounded daily, but when I take r = 0.05 ÷ 365 and N = 365 × 10 payments (keeping leap years in mind for later), and calculate the first 30 days, I get $409.70, and the first 31 days give $423.32. I guess that the "actual" number is some kind of weighted average since the calculator doesn't ask at which month your loan starts.
So where is this $412.39 coming from? In reality when paying a mortgage, do you see the interest fluctuating as it decreases, depending on the number of days every month?
You need to figure out how many days there were in the first month calculation.