Find limit as x approaches 0 of (1+sin4*x)^cotx

I know how to do this question because there was a "hint“ in the question that said to use natural log. I was just wondering if someone could explain to me why using log works in this case along with l'hopital's rule?? I just don't get the reason for its use. Thanks

let y = (1+sin(4x)^cotx

ln y = cotx(ln(1+sin4x))

lim (lny) , x ---> 0
= lim cotx(ln(1+sin 4x))
= lim -csc^2 x(ln(1+sin 4x)) + cotx(4cosx)/(1 + sin 4x)) , as x ---> 0 by L'Hopital

= lim - csc^2 x(ln(1+sin 4x)) + (sinx/cosx) (4cosx)/(1 + sin 4x))
= -1(ln(1 + 0) + 4/(1 + 0)
= 0 + 4
= 4

so lny = 4
y = e^4 or appr 54.598...

testing my answer, let x = .00001 and using my calculator....
(1+sin4*x)^cotx
= (1 + .000399999..)^9999.9999..
= 54.554 , my answer is reasonable