This result comes from using a trig identity and the quotient rule. First, we write tan(x) as sin(x)/cos(x). Then we apply the quotient rule. After doing the standard derivatives, the numerator of our fraction becomes another trig identity, sine squared + cosine squared, which equals one. Now, looking at our fraction, we can see we have 1/cos^2(x). We can then rewrite this as (1/cos(x))^2. We apply our final trig identity now, 1/cos(x)=sec(x), and we see that d/dx tan(x) = sec^2(x). (Due to the nature of writing mathematics, this is far easier to represent and explain using the whiteboard)