Given that the compound interest formular when A=p(1+r/n)nt where A is the amount accumulated at the end of tyears. if p is invested compounded n times per year.how long will it take 500000 to double if its invested at 12percent.

I am sure you meant

A=p(1+r/n)^(nt)

for yours r/n = .12/12 = .01
and nt = 12t (our unknown)

so 500000(1.01)^(12t) = 1000000
1.01^(12t) = 2

take log of both sides
log 1.01^(12t) = log 2
12t log1.01 = log2
12t = log2/log1.01 = 69.6607
t = 5.8 years