[tex]\bf ~~~~~~ \textit{Compound Interest Earned Amount}
\\\\
A=P\left(1+\frac{r}{n}\right)^{nt}
\quad
\begin{cases}
A=\textit{accumulated amount}\\
P=\textit{original amount deposited}\to &\$10000\\
r=rate\to 4\%\to \frac{4}{100}\to &0.04\\
n=
\begin{array}{llll}
\textit{times it compounds per year}\\
\textit{annually, thus once}
\end{array}\to &1\\
t=years\to &12
\end{cases}
\\\\\\
A=10000\left(1+\frac{0.04}{1}\right)^{1\cdot 12}\implies A=1000(1.04)^{12}\\\\\\ A\approx 16010.32[/tex]
he then turns around and grabs that money and sticks it for another 9 years,
[tex]\bf ~~~~~~ \textit{Compound Interest Earned Amount}
\\\\
A=P\left(1+\frac{r}{n}\right)^{nt}
~~
\begin{cases}
A=\textit{accumulated amount}\\
P=\textit{original amount deposited}\to &\$16010.32\\
r=rate\to 5\%\to \frac{5}{100}\to &0.05\\
n=
\begin{array}{llll}
\textit{times it compounds per year}\\
\textit{semi-annually, thus twice}
\end{array}\to &2\\
t=years\to &9
\end{cases}
\\\\\\
A=16010.32\left(1+\frac{0.05}{2}\right)^{2\cdot 9}\implies A=16010.32(1.025)^{18}
\\\\\\
A\approx 24970.64[/tex]
add both amounts, and that's how much is for the whole 21 years.