HP Forums

Full Version: bug in arccotangent function
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hello!

i have found bug in arccotangent function for both Home and Cas modes.

For example, acot(-1)=-pi/4 that is wrong because acot(-1)=3pi/4.

The same behaviour exists for Xcas and Wolfram Alpha.
I think its not a bug: both results are correct: arccot ist periodical with period pi

Roland
(10-20-2022 03:27 PM)Roland57 Wrote: [ -> ]I think its not a bug: both results are correct: arccot ist periodical with period pi

You cannot have *both* right, since acot is one to one function.
It is just software packages may have different definition of acot.
Once defined, it is always one-to-one.

I prefer Mathematica's definition of acot(x) as odd function, even though curve has a discontinuity at 0.
see thread What should be the correct range of acot function

BTW, acot(x) is not periodic. (may be you meant cot(x) ?)
I'm a physicist, not a mathematician, I have a very practical look at this problem :-)

cot(-pi/4) equals cot(3pi/4) = -1

therefore, arccot(-1) has many solutions, among many others the above mentioned two.
And yes: cot() ist periodic and (for a physicist) arccot() ist not a one-to-one relation.

Roland
I am an engineer ... I thought we were talking about principle branch. :-)

acot(x) == atan(1/x) or (pi/2 - atan(x))



Ok. Thanks.

Then another question: Why does HP Prime as educational tool have another definition of arccotangent function opposite to such global educational tools as TI-Nspire CX CAS and TI-89 Titanium?
MATLAB (home use) -0.7854
wxMaxima: -pi/4
(10-21-2022 01:38 PM)gor1060 Wrote: [ -> ]Why does HP Prime as educational tool have another definition of arccotangent function opposite to such global educational tools as TI-Nspire CX CAS and TI-89 Titanium?

Some textbooks define acot(x) as pi/2-atan(x) as TI does. This is consistent with acos(x)=pi/2-asin(x) and acsc(x)=pi/2-asec(x).

Other textbooks define acot(x) as atan(1/x) as HP does. This is consistent with asec(x)=acos(1/x) and acsc(x)=asin(1/x).

Unfortunately, there is no consensus in the educational world as to the "correct" one.
:-(

Thanks to everybody for info.
Reference URL's