Tangent to an Ellipse

This is an exploration of what is involved when you try to find the general function for the tangent to an ellipse. Since an ellipse is not a function, a piecewise function is required in order to determine the general function of the tangent. It is possible to determine each of the necessary functions individually, but with a little careful thought and consideration of concepts such as symmetry, it is possible to avoid doing this, resulting in a more complex understanding of what is going on.
What happens to the tangent when x = 2 or x=-2? This applet only works for the given ellipse. Could you create a similar applet which works for any ellipse at all, i.e., could you find the general function for the tangent to the general equation for an ellipse?