Understanding Arccos(x) for Values Outside [-1, 1]

  • Thread starter Philosophaie
  • Start date
In summary, when trying to take the arccos of a number greater than 1 or less than -1, you will end up with a complex number. To solve this, you can use the quadratic formula or the atan2 function. This issue may arise due to numerical errors in calculating the cosine of a real number.
  • #1
Philosophaie
462
0
What happens if you have to take the arccos of a number greater than 1 or less than -1.

I know from a right triangle if you have:

[ tex ]\Theta[ /tex ]=arccos(x)

if you use x as the adjacent side, 1 as the hypotenuse and [ tex ]\sqrt{1-x^2}[ /tex ] as the opposite.

Is that where the negative sign start?

I have an equation that has numbers from -1.01 to 1.01 as inputs "x". The output runs from 0 to 180 without the numbers 180 to 359 or any negative numbers.

Where do I find the negative or the higher angles?
 
Last edited:
Mathematics news on Phys.org
  • #2
Cos and sin of real variables are confined to the [-1,1] range. To get outside this range, you have to use complex numbers, i.e. cos(z) where z is complex. To get arccos of u, when |u| > 1, you will end up with a complex number.
 
  • #3
As mathman said, for any real x, cos(x) lies in the interval [-1, 1]. To go outside that you must look for a complex z.

For z a complex number, [itex]cos(z)= (e^z+ e^{-z})/2[/itex]. If y> 1, you must solve [itex](e^z+ e^{-z})/2= y[/itex] for y. One way to do that is to let [itex]x= e^z[/itex] so that the equation is so that the equation becomes [itex]x+ 1/x= 2y[/itex]. Multiplying through by x, that gives the quadratic equation [itex]x^2+ 1= 2xy[/itex] or [itex]x^2- 2y x+ 1= 0[/itex]. Solve that with the quadratic formula.
 
  • #4
HallsofIvy said:
As mathman said, for any real x, cos(x) lies in the interval [-1, 1]. To go outside that you must look for a complex z.

For z a complex number, [itex]cos(z)= (e^z+ e^{-z})/2[/itex]. If y> 1, you must solve [itex](e^z+ e^{-z})/2= y[/itex] for y. One way to do that is to let [itex]x= e^z[/itex] so that the equation is so that the equation becomes [itex]x+ 1/x= 2y[/itex]. Multiplying through by x, that gives the quadratic equation [itex]x^2+ 1= 2xy[/itex] or [itex]x^2- 2y x+ 1= 0[/itex]. Solve that with the quadratic formula.

Actually, cos(z) = (e^(i z) + e^(-iz))/2. However, as long as you let x=e^(i z), you'll still be able to take the same approach to solve the problem.
 
  • #5
When dealing with computers, it is at times very easy to arrive at some value that is supposed to be the cosine of a real (rather than complex) angle but the computed value is slightly outside the interval [-1, 1].

Suppose the variable in question is costheta and from this you want to compute the value of theta. A fairly standard approach is
  • If costheta is between -1 and +1 use theta=acos(costheta).
  • If costheta is less than -1 by a small amount, use theta=M_PI.
  • If costheta is greater than +1 by a small amount, use theta=0.
  • Otherwise, croak. The angle is supposed to be real, not complex, so the odds are that a mistake was made somewhere along the way in calculating costheta.

A similar concern exists for sine, where values slightly less than -1 map to -pi/2, slightly greater than 1 to pi/2.

That said, there are (at least) a couple of other options if you can simultaneously compute costheta and sintheta. One approach is to use
  • theta=asin(sintheta) if abs(sintheta)<abs(costheta),
  • theta=acos(costheta), otherwise.
This simultaneously avoids the range error problem and avoids precision loss problems. Calling acos or asin with an argument -1 or +1 loses several bits of precision.

An even easier approach is to use atan2(sintheta, costheta) or atan2(costheta, sintheta), depending on the language.
 
  • #6
Char. Limit said:
Actually, cos(z) = (e^(i z) + e^(-iz))/2. However, as long as you let x=e^(i z), you'll still be able to take the same approach to solve the problem.
Yes, thanks.
 
  • #7
In general, arccos(x) = (1/i)*log(x + sqrt(x2-1)) = (1/i)*log(x + i*sqrt(1-x2))

So arccos(x) = -i*arccosh(x) if x > 1
 
  • #8
Given the ranges of values in the original post, this problem is not about extending cosine and its inverse to the complex numbers. I strongly suspect the underlying problem here is dealing with the numerical errors that result in calculating some number that is supposed to be the cosine of some real (not complex!) number.
 

1. What is the domain of arccos(x) where x>1 or x<-1?

The domain of arccos(x) where x>1 or x<-1 is restricted to values of x that are greater than 1 or less than -1. This is because the range of the inverse cosine function is limited to values between 0 and π, and values outside of this range would result in imaginary numbers.

2. What is the range of arccos(x) where x>1 or x<-1?

The range of arccos(x) where x>1 or x<-1 is limited to values between 0 and π, as this is the range of the inverse cosine function. Any values outside of this range would result in imaginary numbers.

3. What is the relationship between arccos(x) where x>1 or x<-1 and the unit circle?

The inverse cosine function, arccos(x), is related to the unit circle as it represents the angle of a right triangle where the adjacent side is divided by the hypotenuse. When x>1 or x<-1, the adjacent side would be greater than the hypotenuse, which is not possible in a right triangle. Therefore, the inverse cosine function in this range would result in imaginary numbers.

4. How can I use arccos(x) where x>1 or x<-1 in real-world applications?

The inverse cosine function, arccos(x), can be used in real-world applications such as calculating the angle of elevation or depression in trigonometry problems. It can also be used in physics and engineering to calculate the phase angle of an AC circuit.

5. Can the values of arccos(x) where x>1 or x<-1 be simplified?

No, the values of arccos(x) where x>1 or x<-1 cannot be simplified because they are already in the simplest form. Any attempts to simplify these values would result in imaginary numbers.

Similar threads

Replies
7
Views
984
Replies
2
Views
1K
Replies
12
Views
1K
  • General Math
Replies
1
Views
1K
Replies
13
Views
1K
  • General Math
Replies
1
Views
995
  • Precalculus Mathematics Homework Help
Replies
12
Views
2K
Replies
5
Views
715
  • Calculus and Beyond Homework Help
Replies
5
Views
2K
Replies
6
Views
1K
Back
Top