Hey ubhutto.

Since tan(x) is continuous around the neighbourhood of zero (past -pi/2 and before pi/2) you can use the fact that lim x->a f(x) = f(a). You can look up the definition for continuity in terms of the limits to see this, but the intuitive idea is that if the limit exists and equals the value of the function, then you apply this everywhere and you get continuity. The limit implies both sides are approaching the same point and if the limit equals this value, then it means that the value its approaching is the value of the function and not some "dot" that is out of whack like if you looked at a discontinuous function.

Also we know that if a is a constant then lim (x->b) a*f(x) = a* lim (x->b) f(x).