The time taken will be 38 years.
Step-by-step explanation
Given:
P = $1000 r=0.045 A=5000 n = 12 t=?
Using the formula;

where A is the amount, P is the principal , n is the number of time it is compounded and t is the time taken
Substitute the values and solve for t


Divide both-side by 1000

Take the log of both-side

Divide both-side by In(1.0035)


Divide both-side of the equation by 12



Hence, the time taken will be 38 years.