# Computing arctan (inverse tan) function

Tags:
1. Apr 26, 2017

### Vital

1. The problem statement, all variables and given/known data
Hello!
Surprisingly I get different results when I try to compute the inverse tangent function.
My goal is to compute it both manually and using calculator in radiant mode.

2. Relevant equations

My goal is to compute arctan(½) both manually and using calculator in radiant mode.

3. The attempt at a solution

(1) First problem with calculator:
When I try to compute arctan(½) using any online calculator, I stumble upon different results; some calculators even refuse to compute it.
- https://web2.0calc.com gives me the result I see in the textbook
arctan(½) = 0.463647609001
- http://calculator.tutorvista.com/arctan-calculator.html
arctan(½) = 0.785...

(2) Second problem - manual computation gives different answer from any of above ones:
arctan(½) means that tan(θ) = ½
This means that θ can be in Quadrant I or in Quadrant III.

tan(θ) = sin(θ) / cos(θ)
sin(θ) = √1 - cos2(θ) (the whole expression is under square root sign, sorry for not being able to show it correctly)

hence, tan(θ) = ( √1 - cos2(θ)) / cos(θ)
Let cos(θ) = x, then tan(θ) = ( √1 - x2) / x = ½

Squaring both sides I get:

(1 - x2) / x2 = ¼

x = +- 2/√5
Let's choose positive cos, then cos(θ) = 2/√5 ≈ 0.8944
sin(θ) = √1-cos2(θ) = √1-0.89442 ≈ 0.4472

Thus tan(θ) = 0.4472 / 0.8944 = 0.5 (without any rounding, it is strictly 0.5)
Which is not 0.463647609001 (this can be rounded to 0.5, but it is not the same).

Please, help me to find my mistake in manual computation.
Thank you!

2. Apr 26, 2017

### Staff: Mentor

You simply recalculated tan(θ), not arctan(1/2).

You used that site incorrectly. It cannot parse 1/2 and is returning arctan(1). Try inputting 0.5 instead.

WolframAlpha is always a good resource for these calculations: http://www.wolframalpha.com/input/?i=arctan(1/2)

3. Apr 26, 2017

### Vital

I see. Thank you very much!
Could you, please, also take a look at my manual computation and why I don't get a correct answer there? Thank you very much for your help.

4. Apr 26, 2017

### Staff: Mentor

Because you are not computing anything! Nowhere are you writing an equation for θ. The best you will come to is $\theta = \arccos(2/\sqrt{5})$, which doesn't bring you closer to a numerical result than $\arctan(1/2)$. You are better off using the series expansion
$$\arctan(x) = x -\frac{x^3}{3} + \frac{x^5}{5} - \frac{x^7}{7} + \ldots$$
for $|x| < 1$.

5. Apr 26, 2017

### PeroK

If you have Excel spreadsheet, then simply typing $=ATAN(0.5)$ into a cell does the job.

6. Apr 26, 2017

### Vital

I do ) Thank you. But my main goal is to do the same manually - it is easy to use technical devices, but that doesn't help to learn. )

7. Apr 26, 2017

### Vital

Sorry, that is not the part I have leaned yet, so I have to use those easy tools which have been covered in the book thus far.

8. Apr 26, 2017

### PeroK

You were obviously struggling to find a technical device that you could successfully operate, so I suggested Excel and how to use it. If you already know how to compute this on a calculator, why are you posting your difficulties in doing so?

9. Apr 26, 2017

### Vital

When I posted the question, DrClaude has kindly helped me to see a mistake I did when trying to use an online calculator. So now that is clear to me.
If you take a look at my initial post, you will see that I am also struggling with a "manual" approach.

10. Apr 26, 2017

### Ray Vickson

As already pointed out, the manual method you used gave you $\cos(\theta)$, not $\theta$ itself.

In order to compute $\arctan(t)$ for any input $0 < t < \pi/2$ you need to be able to compute $\tan(\theta)$ for numerical inputs $\theta$, because what you want to do is solve the equation $\tan(\theta) = t$ numerically. Typical equation-solving methods obtain (approximate) solutions by, essentially, searching through different values of $\theta$ until finding one that "works". You can Google the following topics about solving single-variable equations numerically: bisecting search, secant method, regula falsi, Newton's method, and others.

11. Apr 26, 2017

### Vital

I see. Thank you very much for these suggestions. I will study them.