[1]" "lim_(x->0)(cosx)^(1/x^2)
This is an indeterminate form of the type 1^oo. You need to first convert it to the form 0/0 or oo/oo so you can use L'Hopital's Rule. We can do this by using e and ln.
[2]" "=lim_(x->0)e^ln[(cosx)^(1/x^2)]
[3]" "=lim_(x->0)e^[(1/x^2)ln(cosx)]=lim_(x->0)e^[ln(cosx)/x^2]
We can take out e.
[4]" "=e^(lim_(x->0)ln(cosx)/x^2)
This is now an indeterminate form of the type 0/0. We can use L'Hopital's Rule now. Get the derivatives of both the numerator and denominator.
[5]" "=e^(lim_(x->0)(-sinx/cosx)/(2x))=e^(lim_(x->0)(-sinx/(2xcosx))
This is still indeterminate so you must apply L'Hopital's Rule again.
[6]" "=e^(lim_(x->0)(-cosx/(2(-xsinx+cosx)))
You can now get the limit by substitution.
[6]" "=e^(-cos0/(2(-0sin0+cos0)))
[7]" "=e^(-1/2)
[8]" "=color(blue)(1/sqrt(e))