Cotangent Function and Undefined Values