To graph the tangent function, we mark the angle along the horizontal x axis, and for each angle, we put the tangent of that angle on the vertical y-axis. The result, as seen above, is rather jagged curve that goes to positive infinity in one direction and negative infinity in the other.
In the diagram above, drag the point A around in a circular path to vary the angle CAB. As you do so, the point on the graph moves to correspond with the angle and its tangent. (If you check the "progressive mode" box, the curve will be drawn as you move the point A instead of tracing the existing curve.)
As you drag the point A around notice that after a full rotation about B, the graph shape repeats. The shape of the tangent curve is the same for each full rotation of the angle and so the function is called 'periodic'. The period of the function is 360° or 2π radians. You can rotate the point as many times as you like.
This means you can find the tangent of any angle, no matter how large, with one exception. If you look at the graph above you see that tan90° is undefined, because it requires dividing by zero. Therefore, angles like this are not in the domain of the tan functions and produce an undefined result. Try tan90° on your calculator and you will get an error, whereas say 89.99 will work.
So the domain of the tan function is the set of all real numbers except 90°, -90°, 270°, -270° etc. (or the equivalent in radians: plus/minus pi over 2, 3pi over 2 etc).
The range of a function is the set of result values it can produce. The tangent function has a range that goes from positive infinity to negative infinity.
To see why this happens, click on 'reset' then drag point A counter clockwise. As it approaches the 90° point with AB nearly vertical, you can see that BC is getting very small. Since the tangent of an angle is "Opposite over Adjacent" (TOA), the result of dividing a number by a very small number produces a very large one. Eventually, the side BC approaches zero and the result approaches infinity.
A similar thing happens in the second quadrant, except that BC is then negative and so the function approaches negative infinity.
Infinity is not a real number, and so tan90° is actually undefined. As the angle gets close to 90° however the function will return some very large numbers. For example tan(89.999°) is over 57,000.
What if we were asked to find the inverse tangent of a number, let's say 4.0? In other words, we are looking for the angle whose tan is 4.0.
If we look at the curve above we see four angles whose tangent is 4.0 (red dots). In fact, since the graph goes on forever in both directions, there are an infinite number of angles that have a tangent of a given value.
If you ask a calculator to give the arc tangent (tan-1 or atan) of a number, it cannot return an infinitely long list of angles, so by convention, it finds just the first one. But remember there are many more.