The formula is:
A = P * [(1+ r/n) ^ (n*t)]
P = initial amount (=in this example it is $5000)
A = final amount (=in this example it is $6500)
r= annual interest rate (here it is 7.5% or 0.075)
n = number of times the interest rate is compounded per year (yours is quarterly so n=4)
so we have:
6500 = 5000 * (1+ (0.075/4))^(4*t)
so 6500/5000 = (1+ 0.01875) ^(4*t) I divided both sides by 5000
1.3 = (1.01875) ^ (4*t)
now you need to take the log of both sides since your unknown (time) is the exponent.
log (1.3) = log [(1.01875) ^ (4*t)]
so log (1.3) = (4*t) * log (1.01875) note: exponent can be written in front of the log as part of property
finally, t = log(1.3) / (4*log(1.01875)) = 3.53 years
Please note you can use the formula for any compound problem (annual, semiannual, monthly...) except for continuous compound (which uses A = P* e^(r*t) formula).
and obviously n will change based on the type of compound. For example if it is monthly, you have to use n=12.
Hope this helps.