Let f(x)=tanx
We know that f′(x)=limh→0f(x+h)−f(x)h
⇒f′(x)=limh→0tan(x+h)−tanxh
⇒f′(x)=limh→01h(tan(x+h)−tanx)
⇒f′(x)=limh→01h(sin(x+h)cos(x+h)−sinxcosx)
⇒f′(x)=limh→01h(cosxsin(x+h)−cos(x+h)sinxcos(x+h)cosx)
⇒f′(x)=limh→01h(sin(x+h)cosx−cos(x+h)sinxcos(x+h)cos x)
Using {sin(A−B)=sinAcosB−cosAsinB}
⇒f′(x)=limh→01h(sin(x+h−x)cos(x+h)cosx)
⇒f′(x)=limh→01h((sinh)cos(x+h)cosx)
⇒f′(x)=limh→0sinhh1cos(x+h)cosx
⇒f′(x)=limh→0sinhh×limh→01cos(x+h)cosx
⇒f′(x)=1×limh→01cos(x+h)cosx
⇒f′(x)=limh→01cos(x+h)cosx
⇒f′(x)=1cos(x+0)cosx
⇒f′(x)=1cosxcosx
⇒f′(x)=1cos2x
⇒f′(x)=sec2x
Hence, f′(x)=sec2x