If someone borrowed $30,000 over 4 years

The interest is 4.5% variable compounded monthly
How much is owing at the end of the 3rd year???

i = .045/12 = .00375

n = 48

first we have to find the payment

Present Value= payment[1 - (1+i)^-n]/i

30000=paym[1 - (1.00375)^-48]/.00375
.
.
paym = 684.10

Now find the Amount of 36 of those payments

Amount = 684.10[(1.00375)^36 - 1]/.00375
= 26314.83

Find out how much the debt would be worth after 3 years had no payments been made
Value of debt = 30000(1.00375)^36
=34327.44

Finally subtract those two values
34329.44-26314.83
=8012.61