why is lim of tanx as x approaches to (pie/2)+ is negative infinity. Shouldnt it be positive infinity since pie/2 is approaching on the right

A quick test using a calculator, find the values of tan(89.99°) and tan(90.01°).

Also, look at the graph of tan(x).

The curve approaches +∞ up to π/2 from the left, and -∞ from the right, which confirms your previous results.

The limit of tan(x) as x approaches π/2 from the right is indeed negative infinity, not positive infinity. This may seem counterintuitive, but it can be explained by understanding the behavior of the tangent function.

To calculate this limit, we need to consider the behavior of tan(x) as x approaches π/2, both from the left and from the right.

When x approaches π/2 from the left, i.e., x → (π/2)^-, the values of tan(x) become larger and larger, effectively approaching positive infinity. This is because as x approaches π/2 from the left, the values of tan(x) increase without bound.

However, when x approaches π/2 from the right, i.e., x → (π/2)+, the behavior is different. As x gets very close to π/2 from the right-hand side, the values of tan(x) start to decrease without bound, approaching negative infinity. This behavior occurs because tan(x) is undefined at π/2 but has a vertical asymptote: it tends towards ±infinity on either side of π/2.

To understand why the limit is negative infinity and not positive infinity, consider the unit circle. At π/2, we are at the point (0, 1), where the y-coordinate represents the value of tan(x). As x gets very close to π/2 from the right, the angle formed with the positive x-axis is nearly 90 degrees, and the y-coordinate of the point on the unit circle becomes arbitrarily large in the negative direction, resulting in a negative infinity limit.

In summary, as x approaches π/2 from the right, the values of tan(x) decrease without bound, leading to the limit being negative infinity.