Let A be the amount at the end of the time of t = 9 years.
Let S be the starting amount.
Let r be the annual rate of interest, 0.06/year.
After the first year,
A = (1 + 0.06) S = (1.06)(4000) = 4240
and after the second year,
A = (1.06)(4240) = (1.06)(1.06)(4000) = (1.06^2)(4000) = 4494.40
and after the ninth year of yearly compounding
A = (1.06^9)(4000) = (1.69)(4000) = 6757.92
if we had gotten simple (not compounded) interest for 9 years, we would have
A = (1 + .06 x 9) (4000) = (1.54)(4000) = 6160
so, compounding (getting interest on our interest) gave us (6757.92 - 6160) = 597.92 more.
If the interest is compounded quarterly, it becomes 0.06/4 = 0.015,
and the number of quarters becomes 36, so
A = (1.015^36)(4000) = (1.709)(4000) = 6836 (I've dropped the pennies),
somewhat more than the annual compounding.
Monthly compounding would be with a monthly rate of 0.06/12 = 0.005,
and we would have 9x12 = 108 months,
A = (1.005^108)(4000) = (1.714)(4000) = 6856,
20 more than the quarterly compounding.
If we compound continuously (like every second), the mathematical expression to use
is the exponential growth factor, exp(rt)
r is the interest rate per unit time
t is the time in those units
here (r)(t) = (.06)(9) or (.015)(36) or (.005)(108) = .54, all the same
A = S exp(rt) = (4000) exp(0.54) = (4000)(1.716) = 6864,
8 more than the monthly compounding.