acos(x>1) (arc cosinus(x) for x greater than one)

41 views
Skip to first unread message

Raphaël Garcia

unread,
Dec 8, 2021, 5:49:48 PM12/8/21
to sympy
Hello
Example for acos(1.279) one get the complex value 0.730*I
What the meaning of that ?

Best regards

emanuel.c...@gmail.com

unread,
Dec 8, 2021, 7:03:18 PM12/8/21
to sympy
>>> from sympy import *
>>> x,y=map(symbols, "xy")

Abraham de Moivre taught us that :

>>> cos(x).rewrite(exp)
exp(I*x)/2 + exp(-I*x)/2

This expression can be solved for all possible values, not only for reals of absolute value not superior to 1. However, the latter are the only ones for which the solution is real. Generally :

>>> solve(Eq(y,cos(x).rewrite(exp)), x)
[-I*log(y - sqrt(y**2 - 1)), -I*log(y + sqrt(y**2 - 1))]

Sympy’sacos returns one of these values.

HTH,

Oscar

unread,
Dec 9, 2021, 7:48:20 AM12/9/21
to sympy
The docstring for acos references the definition given in DLMF:

Definition 4.23.2 gives the value of acos(1.279) with the following integral:

In [17]: Integral(1/(sqrt(1-t**2)), (t, 1.279, 1)).n()
Out[17]: 0.730633885542373⋅ⅈ

SymPy's acos gives the principle value i.e. what DLMF calls arccos as opposed to the multivalued Arccos. Other possible values of Arccos arise from taking integration paths that loop around the singularities at +-1 but the principle values are defined by requiring that the integration path not cross these cuts.

Oscar

Reply all
Reply to author
Forward
0 new messages