Which is the correct graph of arccot x?

By Murray Bourne, 03 May 2011

A reader challenged me on the graph I had for y = arccot x, on the page Inverse Trigonometric Functions.

He wrote (in a rather unfriendly tone):




You incorrectly state the range of the arccotangent function as -pi/2 to pi/2.  It is not.  The correct range of arccotangent is 0 to pi.

After some deliberation, I have now included both interpretations on my page, because both are found in various sources.

First, some background.

Obtaining the graph of y = arccot(x)

The graph of y = arccot x can be obtained from a consideration of the graph of y = cot x.

But depending on your starting region, you'll get a different graph for y = arccot x.

Interpretation 1

The graph of y = cot x is as follows:

cot x

We choose the portion from x = 0 to x = π (as highlighted above), and reflect it in the line y = x like this.

cot x

Since reflection in the line y = x gives us the inverse of a function, we have obtained the graph of y = arccot x, as follows:

arccot x

From the graph we can see the domain (the possible x-values) of y = arccot x is:

All values of x

And the range (resulting y-values) of arccot x is:

0 < arccot x < π

If we evaluate our function for some negative value of x, say x = −2, then we get a positive answer, as expected from the graph:

arccot(−2) = 2.678...

Alternate View - Interpretation 2

Some math textbooks (and some respected math software, e.g. Mathematica) regard the following as the region of y = cot x that should be used (that is, −π/2 to π/2):

cot x

This would give the following discontinuous graph when reflected in the line y = x:

arccot x

So the domain of arccot x would be (as for Interpretation 1):

All values of x

Using this interpretation, the range of arccot x would be:

−π/2 < arccot x ≤ π/2 (arccot x ≠ 0)

If this is the correct graph, we expect a negative answer when we evaluate the function at x = −2. It is actually:

arccot(−2) = −0.46365...

Which is correct?

According to a response to a reader's question on this same issue, Dr. Math goes for the first interpretation:

In order to invert a trig function, we first restrict it to a domain on which it takes all its possible values, once each; then we invert the restricted function, whose range is then that restricted domain.

Look at a graph of the cotangent function, and you will see that although between -pi/2 and pi/2 it takes all its possible values, and takes each value only once, there is one problem with this choice: it is not continuous (or even defined) on this entire domain, but is undefined at 0.

The domain would then have to be

-pi/2 < x < 0 or 0 < x <= pi/2

To avoid this, we instead choose the domain

0 < x < pi

which is cleaner to work with, making a continuous function defined over the entire domain.

Math software doesn't agree, either

Let's now see the inconsistent way (respected) math software deals with this function.

Mathcad's Interpretation

When I graphed the function acot(x) in Mathcad, this is the result (they are using the first interpretation):

arccot x

Mathcad gives arccot(−2) = 2.678..., which is consistent with their graph. Mathcad uses "acot(x)" notation.

Mathematica's Interpretation

However, according to Mathematica (using Wolfram|Alpha) , this is the graph of y = arccot(x):

arccot x

So Mathematica is using the second interpretation of the function. (They use the somewhat poor notation y = cot−1x.)

Taking a typical value, Mathematica (Wolfram|Alpha) gives us

arccot(−2) = −0.46365...

How can this be? The first interpretation gives us a positive value for arccot(−2), while the second interpretation gives us a negative value.

Matlab's Interpretation

Matlab also gives us a discontinuous graph based on the second interpretation.

arccot x

Matlab also uses "acot(x)" notation.

Maple/Scientific Notebook's Interpretation

My version of Scientific Notebook has both Maple and MuPAD engines. The results using both of these are curious.

Using the Maple engine, we get an answer using the first interpretation.

arccot x

But when we switch to use MuPAD in Scientific Notebook, we get this result, which uses the second interpretation!

arccot x

So even the top math software makers can't agree.


Here's another case where our math definitions are not as tight as we are often led to believe.

Also, the notation is inconsistent. Different text books and different software use the following to mean the same thing:

  • arccot(x)
  • acot(x)
  • cot−1x

We should never use the last one! (See my rant on this here: Arcsin or sin?)

So which version of arccos(x) is the right one? Is my reader correct? (I don't know his name or email so I can't reply to him. Strange.)

I know which interpretation I think is "best". What are your thoughts?

See the 34 Comments below.

34 Comments on “Which is the correct graph of arccot x?”

  1. John Chase says:

    I love this careful, thoughtful discussion! I especially liked your investigation with each piece of math software. Thanks for doing the research.

  2. The Arc Cotangent Controversy « Random Walks says:

    [...] love this discussion at squareCircleZ. All my readers should check it out. Which is the graph of arccot(x)? from [...]

  3. Philip Petrov says:

    Good catch!

    Arccotg(x) is monotonously decreasing in the interval (0,Pi). Monotonous increasing/decreasing functions are "inversable" by one Theorem. Therefore this interval is the logical choice. For the same reason the books choose (-Pi/2,Pi/2) for Arctg(x).

    Ah yes, I do think that the correct notation is "arccotg(x)". See we have "tg" (TanGent) and we put "co" in front if it, so we should have "cotg" (COTanGent). Finally put an "arc" in front and it happens to be "arccotg" (ARCusCOTanGent).

    Your article is superb!

  4. Philip Petrov says:

    You inspired me. OK, I did some research and I found the answer. The “arccotg(x) in (-pi/2,pi/2) without 0? and “arccoth(x) in (0,pi)” are the inverse functions of TWO DIFFERENT FUNCTIONS. And yes, BOTH ARE VALID.

    Let me explain it with x^2. This function is NOT inversible. If you draw a horizontal line it will cross the function in two points. But still we usually say “the inverse function of x^2 is square root of x”. Yes, we do say it wrong! Actually the “square root of x” is inverse function of the following function:

    x^2 for x>=0
    undefined for x<0

    x=0 AND undefined for x<0" is NOT the same function as "x^2 for any x".

    It is the same with the trig functions. "cotg(x) in (-pi/2,pi/2)" is not the same function as "cotg(x) in (0,pi)". Therefore their inverses are also two different functions.

    Conclusion: it is WRONG to say "the inverse function of sin(x) is arcsin(x)". Well it is not true – sin(x) itself do NOT have an inverse function 🙂

    P.S. Fix your blog comments to convert the angle braces < and >. It seems like they do open HTML tags, which is bad. They must be converted to &gt; and &lt;

  5. Encuesta: ¿Cuál es la gráfica de la arcocotangente? | Gaussianos says:

    [...] En este post de squareCircleZ, que es de donde he sacado algunas de las imágenes, hablan también sobre este tema. MeneameBitacorasDeliciousGoogle BuzzFacebookTwitter [...]

  6. Mona Zeftel says:

    Thanks for clearly laying out the different approaches. I'm surprised that the computer algebra systems interpret this function differently. I checked a few calculus textbooks, and they agree with how Mathcad defines arccotangent, (acot function in Mathcad).

    I'm going to post it for our users to discuss in the Mathcad discussion.

    Thanks again,

    Mathcad Senior Technical Consultant

  7. Tom says:

    If only they taught this to high school trig students, then perhaps some of the kids would see that their negative preconceptions of the subject are not unjustified. (That is, trig doesn't always make sense!)

    Then again, it might show some of them that maths can be exciting and deliciously contentious.

    Excellent article!

  8. Murray says:

    That's really interesting, Valery - thanks for sharing!

    It's interesting because:

    (1) It is a Mathcad file that is displayed in a browser, and

    (2) Yes, many functions demonstrate interesting shapes in polar coordinates.

  9. Sophus Ng says:

    MathCad is right. The other software makers are at fault for not checking it thorough. This issue of detail is one where even an "A" student may overlook.

    Maybe the very best graduates end up working for the big banks and big bucks. The math software companies don't agree because they only got the second layer of the top tier graduates to work for them. MathCad was careful (we need to teach work ethic and values), or maybe just lucky.


  10. Richard says:

    I found that:

    Mathcad 13 works with Interpretation 1
    but Mathcad 15 with Interpretation 2 !!

    It's a pity !

  11. Murray says:

    @Richard - thanks for the information. Seems like their engineers are unsure, too!

  12. Rene says:

    (1) You should always use cot^{-1}(x), following the general notation for functions. This is different from cot(x)^{-1}, of course. Nobody really knows the meaning of arcus sinus etc. anymore.

    (2) It is a matter of definition, or rather does not matter at all, what interval we take. If I implemented that, I'd follow your advice to define it on [0,pi], since it is easier. There is no other reason.

    (3) If we argue from the geometrical point of view, cot(x) cannot be negative at all. It is the length of one of the segments of the tangent at the point (cos x, sin x). The other is tan(x). By the way, the tangent line intersects the y-axis in cosec(x), and the x-axis in sec(x). In triangle geometry, we wish to avoid negative lengths.

  13. Murray says:

    @Rene: No, cot^(-1)(x) is one of the worst notations ever, because of the confusion with reciprocal notation. See the last section on this page:
    Trig Functions of Any Angle

    I like your point about avoiding negative lengths, though.

  14. Ron says:

    Good discussion, and as someone noted, arccot(x) is not the inverse of cot(x). When we discuss the arccot(x) function as the inverse of another function, we must declare the restricted domain of that function (as we must do with all of the other inverse trigonometric functions).

    For option 1, arccot(x) is the inverse of the function cot(x) where x is between 0 and pi.

    For option 2, arccot(x) is the inverse of the function cot(x) where x is between -pi/2 and pi/2 (including pi/2, but not -pi/2) and not zero.

    Therefore, both interpretations are correct when stated correctly.

    Due to the modern calculator (which does not have an arccot(x) function), I prefer the second interpretation because this allows us to easily use a calculator and the identity: arccot(x) = arctan(1/x). This does require one special case when x = 0: arccot(0) = pi/2.

    One more thing. You said that one problem with the second interpretation is that the domain does not include x = 0. That is not correct. What the graphs do not show is that the left branch (below the x-axis) has an open circle on the y-axis and the right branch (above the x-axis) has a closed circle on the y-axis. Therefore, the domain of arccot(x) in either case is still all real numbers.

    Thanks for your discussion. This is always a confusing issue for students.

  15. Murray says:

    Thanks for your clarifications, Ron.

  16. Abhik Sarkar says:

    What is difference between arccot x & cot-1 x

  17. Murray says:

    @Abhik: The first one is much better notation, but normally they are taken to mean the same thing.

    See the bottom of this Trig Functions page where I explain further.

  18. John Tran says:

    Thanks for this article I am teaching trigonometry and I came across this issue of trying to figure out which arccot(x) graph to teach and am relieved to have the answer using this article. Thanks for the research

  19. Saman says:

    Thanks a lot for your detailed explanation. I was wondering if there is any way to get the first interpretation with Mathematica? I mean how can we graph a ArcCot in Mathematica in order to get the graph that is look like the first example(0 < arccot x < ?).


  20. Murray says:

    @Saman: You could plot the following 2 graphs on the one axis and get what you need:

    f1(x) = pi + ArcCot for x < 0 f2(x) = ArcCot[x] for x ≥ 0

  21. MIGUEL says:

    How do you acomodate the trigonometric identity
    ATAN(X) + ACOT(X)= PI/2 (PI=3.14......)

    You see simmilar to
    ASIN(X) + ACOS(X) = PI/2

    I can see the first interpretation looks the answer.

  22. Murray says:

    @Miguel: Yes, you are right. It would have to be the second interpretation.

  23. buzz says:

    why is that people use the principle interval (-pi/2, pi/2] in the first place

  24. Murray says:

    @Buzz: A lot of these things are due to convenience. Some problems work better with one interval and not the other.

  25. Kevin says:

    This is all based on what you consider to be a "natural" choice for the domain. So far it seems that everyone in the discussion has been valuing continuity and "simplicity" so they are opting for the 0 to Pi range.

    If we are sticking purely to real-valued numbers this makes sense, but the 0 to Pi range is an entirely unnatural choice for complex values. The source of the -Pi/2 to Pi/2 choice comes from finding the solution to the complex valued equation: z = Cot[w]. If we represent Cot[w] as Cos[w]/Sin[w] and then replace the sine and cosine functions with their complex exponential representation and then solve for w we get the equation:

    w = ln((z+i)/(z-i))/(2i)

    where ln is the complex logarithm. This is usually used as the definition of the complex arc-cotangent.

    For real numbers (x+i)/(x-i) has magnitude 1 and the logarithm becomes the Argument multiplied by i. If you graph the function


    you'll see that you get the Interpretation 2 graph. This is equivalent of a branch cut choice of (-i,i). You'll also see that when evaluated at 0, you get Pi/2.

    Due to the close relationship between how functions behave on the real number line due to the structure of the complex plane, I think it's quite natural to favor the definition based on the restriction of the complex definition to the real number line.

  26. Murray says:

    @Kevin: Thanks for the complex numbers interpretation. It seems to have the most weight so far.

  27. Declan says:

    I think the first interpretation - the one that gives the continuous function - is the better one to chose.

  28. Barry Lederman says:

    I originally would have said the arccot graph is the discontinuous one. however I ran into a problem with that approach in that if two functions have the same derivative, the function must differ by a constant.

    Since y=arctanx and y=-arccotx have the same derivative [1/(1+x^2)]; they must differ by a constant. your way will make this work. the constant will be pi/2. my original discontinuous way will be a mess.

  29. Murray says:

    @Barry: Thanks for sharing your thoughts on this.

    Are you any relation to Sol? http://wildaboutmath.com/about/

  30. Kevin says:


    The issue of the derivative doesn't support one interpretation over another. The derivative by definition is a local property of a function and doesn't necessarily tell us about the global structure of a function except under very specific circumstances. That's why two different Lie groups with very different global properties may share the same Lie algebra (The connection may seem strained, but lie algebras are tangent spaces for lie groups, and tangent spaces arise from derivatives).

    The proof for two functions sharing a derivative implying they are the same function different by a constant relies on the difference of the two functions being a differentiable function. The proof goes something like this:

    Let f and g be two differentiable functions that share derivatives on the interval (a,b). Then h = f-g is also a differentiable function on (a,b). Further h' = 0 on (a,b) which implies h is a constant function. Therefore, f and g differ by a constant on (a,b) QED.

    Note: the open intervals are necessary for the limit to be approached from both sides

    The discontinuous ArcCot[z] does not satisfy the requirements of the theorem (discontinuous functions are not differentiable at the discontinuity), therefore the theorem does not apply here. HOWEVER, we can break this into two separate regions: (-inf, 0) and (0, inf) and show that on these intervals -ArcCot[z] and ArcTan[z] are both continuous with matching derivatives. And in fact on the first interval they differ by -Pi/2 and on the second they differ by Pi/2.

  31. Jeff Cagle says:

    @ Barry:

    In support of Kevin, the full theorem is

    IF f and g are continuous on [a,b] and differentiable on (a,b) and if f'(x) = g'(x) on (a,b)
    THEN f(x) = g(x) + C on (a,b)

    which is proved by the MVT requiring continuity and differentiability.

    And since f(x) = arccot(x) with range (-pi/2,0)U(0,pi/2) (the "symmetric branch") fails to be continuous hence fails to be differentiable at x = 0, it is released from the conclusion of the theorem.

    However, it IS true that f(x) = pi/2 - arctan(x) on (0,+oo) and that f(x) = -pi/2 - arctan(x) on (-oo,0). On each of those intervals, the theorem holds true ... just for different constants for each interval!

    This is typical behavior for functions with discontinuous derivatives. Consider the derivative of int(x) and its relationship to g(x) = C with C constant.


    In addition to Kevin's comments, I want to give an aesthetic argument and a pragmatic argument for using the "symmetric branch."

    Aesthetic: By taking this branch, we have the tidy rule that odd trig functions are inverted on the restricted domain (-pi/2, pi/2) (open or closed as appropriate), while even trig functions are inverted on the restricted domain (0,pi).

    The continuous branch breaks the rule, which is not bad math, but is less tidy.

    Pragmatic: On this branch, arccot(x) = arctan(1/x), x ≠ 0, in keeping with arcsec(x) = arccos(1/x) and arccsc(x) = arcsin(1/x).

    This identity fails to hold on the continuous branch with range (0,pi).


    On the downside, the symmetric branch fails to be differentiable at x = 0, which is disappointing since the computed derivative (arccot(x))' = -1/(1+x^2) actually has a value at this point. That is to my mind the strongest argument for using the continuous branch.

  32. Nikhil Balwani says:

    Straight and simple. Mathcad is correct there

  33. Deepak Agrawal says:

    If continuity of arccot(x) is the problem for the range (-pi/2,pi/2]-{0}, then by this reason the functions arcsec(x) and arccosec(x) are also have the same problem then why we consider them and why not arccot(x).

  34. K.Lahiri says:

    Extremely well written article. However, in my opinion, arccot x defined for 0 to pi is more correct than the other, and here's why.

    arccot x + arctan x = pi/2. Therefore, the only way this relation is satisfied, is if the domain is constrained to 0 to pi.

    This reason can't hold for the first interpretation, and hence is erroneous.

Leave a comment

Comment Preview

HTML: You can use simple tags like <b>, <a href="...">, etc.

To enter math, you can can either:

  1. Use simple calculator-like input in the following format (surround your math in backticks, or qq on tablet or phone):
    `a^2 = sqrt(b^2 + c^2)`
    (See more on ASCIIMath syntax); or
  2. Use simple LaTeX in the following format. Surround your math with \( and \).
    \( \int g dx = \sqrt{\frac{a}{b}} \)
    (This is standard simple LaTeX.)

NOTE: You can't mix both types of math entry in your comment.

Search IntMath, blog and Forum