In this case a=0 and f(x)=cos(x). So by the given formula, we have
lim(h->0) (cos(0+h) - cos(0))/h =lim(h->0) (cos(h)-1)/h (Use the fact that cos(0)=1)
=lim(h->0) (1-2sin^2(h/2) -1) /h (Use the identity cos(x)=1-2sin^2(x/2))
=lim(h->0) -2sin^2(h/2) /h
=lim(h->0) -2sin(h/2)*(sin(h/2)/h) (Use sin^2(h/2) = sin(h/2)*sin(h/2))
=lim(h->0) -2sin(h/2)*(sin(h/2)/((h/2)*2) (Write h=(h/2)*2 )
=lim(h->0) -sin(h/2)*(sin(h/2)/(h/2)) (Cancel 2)
=lim(h->0) (-sin(h/2))* lim(h->0)(sin(h/2)/(h/2))
= 0*(1) (Use lim(u->0)(sin(u)/u)=1)
=0