At 5% interest compounded annually the investment increases by a factor of 1.05 every year. After the first year the investment will be $10,000*1.05, after the second year it will be $10,000*1.05*1.05=$10,000*1.052 and so on. The pattern is that after n years the investment will be $10,000*1.05n. After 20 years the investment will have grown to $10,000*1.0520=$26,532.98.
The formula for continuous interest is A=Pert, where A is the final amount, P is the principle, $5,000 in this case, r is the rate of interest, 0.1 in this case, and t is the time in years, 20 in this case. So A=$5,000*e0.1*20=$36,945.28.
So it better to invest $5,000 at a 10% compounded continuously.
I tutor online, so if you need more help send me a message.