Prove that arccot x – arctan (1/x) is not constant but has zero derivative

Why is this not a violation of the zero-derivative theorem (Theorem 5.2 in Apostol)?

Proof. We can use the formulas for the derivatives of and (and the chain rule) to compute,

Proof. First, let . Then,

Then, since , we have

Next, let . Then, Again, using that , we have

Hence, there is no constant such that for all

This is not a violation of the zero-derivative theorem since the function is constant on every open interval on which it is defined. Since it isn’t defined at , any open subinterval must be a subinterval of only positive or only negative reals. The function is constant on any of these subintervals.