HP Forums

Full Version: What should be the correct range of acot function
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
As in the book, the range of acot(x) is 0 to pi

But when I check in HP prime by plotting acot(x) function, the range is -pi/2 to pi/2

Also, in wolfram alpha, the range is -pi/2 to pi/2

In TI-Nspire, the range is 0 to pi

What should be the correct one?
Matlab also uses -pi/2 to pi/2. Both are valid ranges, and so would be e.g. 2pi to 3pi, although unusual. The cotangent, like the other trigonometric function, repeats with multiples of pi, so to define a function that is suitable for use as its inverse, you can take any interval of pi.
Thank you, anyfoo. I understand that the function is defined as interval of pi. But when referring to a standard function, it must have an agreed range e.g asin(x) - the range is -pi/2 to pi/2, acos(x) is 0 to pi. Just see that acot has different range in calculation tools and the book.
(06-06-2020 08:50 AM)teerasak Wrote: [ -> ]Thank you, anyfoo. I understand that the function is defined as interval of pi. But when referring to a standard function, it must have an agreed range e.g asin(x) - the range is -pi/2 to pi/2, acos(x) is 0 to pi. Just see that acot has different range in calculation tools and the book.

In “my” books, tangent is defined from ]-π/2, π/2[ to ℝ
And it’s reciprocal cotangent is defined from ℝ to ]-π/2, π/2[, but US Wikipedia says ]0, π[
IMHO, since the "co" stands for "complementary", it seems to make more sense from a language point of view for atan(x) + acot(x) (in radians mode) to sum to pi/2 in the same way than asin(x) + acos(x) sum to pi/2.
There is no consensus on the range of the acot(x) function.

Using -pi/2 < y < pi/2 comes from defining acot(x)=atan(1/x), consistent with asec(x)=acos(1/x) and acsc(x)=asin(1/x)

Using 0 < y < pi comes from defining acot(x)=supplement of atan(x), consistent with acos(x)=supplement of asin(x) and acsc(x)=supplement of asec(x).

Most US textbooks use (0,pi), but a few use (-pi/2,pi/2), and many simply don't mention acot at all. Each has its advantage: (0,pi) is continuous but (-pi/2,pi/2) preserves odd symmetry and can be calculated more precisely for negative values of x.

I bring up this issue in my Precalc class each year and have the students argue for their preference. Makes for a fun discussion.

The nice thing about standards is that you have so many to choose from. ~Andrew Tanenbaum

----
Edit: Sorry, I meant "complement" above, not "supplement." That's where the "co" in cosine, cotangent, and cosecant comes from.
Thank you for clarification. That clarifies my doubt.
Quote: Using 0 < y < pi comes from defining acot(x)=supplement of atan(x)

Woops. I meant complement, not supplement. That's what cosine means: the complement sine.

(We don't have to mention this little error to my students. :-) )
(06-06-2020 03:09 PM)Wes Loewer Wrote: [ -> ]There is no consensus on the range of the acot(x) function.

All these programs have range of acot(x) = [-pi/2, pi/2]:

1. Mathematica
2. Sympy
3. Maxima
4. Python mpmath
5. XCas
6. HP Prime, both Home + Cas

Is there any exceptions you know ? (e.g. acot(-1) return 3/4*pi, instead of -1/4*pi ?)
Excel (Version 16.46 for Mac)

ARCCOT(-1) =2,35619449

Documentation states that the results of ARCCOT are in the range between 0 and Pi

Felix
(03-21-2021 06:21 PM)Albert Chan Wrote: [ -> ]All these programs have range of acot(x) = [-pi/2, pi/2]:

1. Mathematica
2. Sympy
3. Maxima
4. Python mpmath
5. XCas
6. HP Prime, both Home + Cas

7. Google Sheets

(03-21-2021 06:21 PM)Albert Chan Wrote: [ -> ]Is there any exceptions you know ? (e.g. acot(-1) return 3/4*pi, instead of -1/4*pi ?)

. Excel, OpenOffice/LibreOffice, Quattro Pro
. Desmos
. GeoGebra (Well, sort of. It converts acot(x) to "pi/2-atan(x)")
. TI-Nspire

Not a program, but https://en.wikipedia.org/wiki/Inverse_tr...pal_values.
Here some more data points

-pi /2 to pi/2:

8. Sage: acot(-1) = -1/4 PI
9. Matlab (as already mentioned in the thread)
10. NIST Handbook of Mathematical Functions, 2010, p 112, Fig. 4.15.4

0 to pi:

Grapher (Mac program)


Edit: Added NIST reference
Reference URL's