Answer
$a.\quad\approx 8.69$ years
$b.\quad\approx 8.66$ years
Work Step by Step
The amount A after t years due to a principal P
invested at an annual interest rate r, expressed as a decimal,
compounded n times per year is $A=P\displaystyle \cdot\left(1+\frac{r}{n}\right)^{nt}$
If the compounding is continuous, then $A=Pe^{rt}$
---
$a.$
We want $A=2P$, after $t=?$ years, with $n=12$ compounding periods per year.
and $r=0.08$
$2P =P\displaystyle \left(1+\frac{0.08}{12}\right)^{12t} \quad/\div P$
$2 =\displaystyle \left(1+\frac{0.08}{12}\right)^{12t} \quad/\log(...)$
$\displaystyle \log 2=12t\log 1.00667 \quad/\times\frac{1}{12\log 1.00667}$
$t=\displaystyle \frac{\log 2}{12\log 1.00667}\approx 8.69$ years
$b.$
$2P=Pe^{0.08t} \quad/\div P$
$2=e^{0.08t} \quad/\ln(...)$
$\ln 2=0.08t\cdot\ln e\quad/\div 0.08, \quad\ln e=1$
$t=\displaystyle \frac{\ln 2}{0.08}\approx 8.66$ years