#y=tan(x)#
#tanx=sinx/cosx#
#y+Deltay=tan(x+Deltax)#
#tan(x+Deltax)=sin(x+Deltax)/cos(x+Deltax)#
#y+Deltay-y=tan(x+Deltax)-tan(x)#
#sin(A+B)=sinAcosB+cosAsinB#
#cos(A+B)=cosAcosB-sinAsinB#
#tan(x+Deltax)=(sinxcosDeltax+cosxsinDeltax)/(cosxcosDeltax-sinxsinDeltax)#
#Deltay=(sinxcosDeltax+cosxsinDeltax)/(cosxcosDeltax-sinxsinDeltax)-sinx/cosx#
#Deltay=(((cosx(sinxcosDeltax+cosxsinDeltax)-sinx(cosxcosDeltax-sinxsinDeltax)))/(cosx(cosxcosDeltax-sinxsinDeltax)))#
#=(cosxsinxcosDeltax+cos^2xsinDeltax-sinxcosxcosDeltax+sin^2xsinDeltax)/(cos^2xcosDeltax-cosxsinxsinDeltax)#
#=(cos^2xsinDeltax+sin^2xsinDeltax)/(cos^2xcosDeltax-cosxsinxsinDeltax)#
#=((cos^2x+sin^2x)sinDeltax)/(cos^2xcosDeltax-cosxsinxsinDeltax)#
Dividing throughout by
#cos^2xcosDeltax#
#=(tanDeltax+tan^2xtanDeltax)/(1-tanxtanDeltax)#
#Deltay=(1+tan^2x)(tanDeltax)/(1-tanxtanDeltax)#
#(Deltay)/(Deltax)=1/(Deltax)xx(1+tan^2x)(tanDeltax)/(1-tanxtanDeltax)#
#1+tan^2x=sec^2x#
#(Deltay)/(Deltax)=sec^2x xx1/(Deltax)xx(tanDeltax)/(1-tanxtanDeltax)#
applying limits as #Deltax->0#
#lim(Deltay)/(Deltax)=lim(sec^2x xx1/(Deltax)xx(tanDeltax)/(1-tanxtanDeltax))#
#=sec^2x xx lim(tanDeltax)/(Deltax)/(1-tanx xx limtanDeltax)#
#lim(tanDeltax)/(Deltax)=1#
#lim(tanDeltax)=0#
Thus,
#dy/dx=sec^2x xx 1/(1-tanx xx 0)#
#dy/dx=sec^2x#