Trig Identity question
#1

Hi All,

Anyone knows of a trig identity between the arc tangent of an angle and it's multiples, like:

arctan(2x) = function of arctan(x)

Thanks!

Namir

PS: I have found a polynomial approximation by Eurler to calculate arctan very accurately, but I require tens of thousands of terms!!!!! Ouch!

#2

Used WolframAlpha with:

Taylor[arctan[2*tan[y]],y]

The result is:

2 y-2 y^3+4 y^5-(142 y^7)/15+(4612 y^9)/189-(312644 y^11)/4725+O(y^12)

But that's probably not what you are looking for: a simple formula.

HTH

Thomas


If you do it with the inverse order of the functions:
Taylor[tan[2*arctan[y]],y]
The result is:
2 y+2 y^3+2 y^5+2 y^7+2 y^9+2 y^11+O(y^12)
(converges when abs(y)<1)
This geometric series leads to the well known result:

Edited: 3 Mar 2013, 1:08 p.m.

#3

I am looking for an equation that is similar to the one for tan(2x) but expressed in terms of arctan(2x) and arctan(x).

I have a good Pade Approximant for tan(x). Ultimately, I can can use the Pade approximant for tan(x) in an iterative process. That would still be much faster than calculating 3000 to 4000 terms in a slow converging polynomial.

Namir

Edited: 3 Mar 2013, 4:22 p.m.

#4

Quote:
I am looking for an equation that is similar to the one for tan(2x) but expressed in terms of arctan(2x) and arctan(x).

This doesn't appear to be possible. From the identity #1 here I've obtained

and


None of which will serve your purpose, though.

Edited to correct a typo in the second equation

Edited: 3 Mar 2013, 7:07 p.m.

#5

It may not be clear from my answer but the solution is:

arctan(2x) = 2 arctan(x) - 2 arctan3(x) + 4 arctan5(x) + ...
This is not the formula you are looking for but its Taylor expansion. So all you need to do is find a closed formula of this series. I didn't made any attempts to find it but just from looking at the coefficients of the higher orders I doubt that there is any.

It's not that you can expect that there is a closed formula in general. In the case of tan(x) it is related to the multiplication of complex numbers.

Sorry for the bad news.

Cheers

Thomas

#6

I found the following useful identity:

arctan(x) = pi/2 - arctan(1/x)

This identity allows me to calculate the arctan for high values (just below 90 degrees) by calculating the arctan of 1/x.

I can calculate arctan with good accuracy for low x values using polynomial approximations or iteratively. Either way, I get good results for high x values!

Namir

Edited: 4 Mar 2013, 7:22 a.m.

#7

I found an efficient algorithm to calculate arctan(x).

EPS = 1e-8
A1 = 1/SQRT(1+x*x)
B1 = 1

Do
A0 = A1
B0 = B1
A1 = (A0+B0)/2
B1 = SQRT(A1*B0)
Loop until |A1-A0|<=EPS and |B1-B0|<=EPS

arctan(x) = x/(SQRT(1+x*x)*A1)

Algorithm works as efficiently for small and large values of x. Number of iterations for the above loop range from 11 to 15.

Edited: 4 Mar 2013, 11:08 a.m.

#8

I'm glad you found something useful. That's an interesting algorithm which reminds me of the arithmetic–geometric mean. However there's a slight difference:

B1 = SQRT(A1*B0)
instead of
B1 = SQRT(A0*B0)

In the Wikipedia article is a reference to the article:

B. C. Carlson (1972). "An algorithm for computing logarithms and arctangents". Math.Comp. 26 (118): 543–549.

Was that your source?

Kind regards

Thomas

#9

Without coding and testing anything, I wonder if the difference is significant. The AGM converges pretty quickly which would mean A0 -> A1.


- Pauli

#10

A quick check and they do converge different after all.

- Pauli

#11

The CORDIC algorithm is another efficient way of computing arctangents with few iterations, but it requires a precomputed table of coefficients.

In another post you mentioned wanting the arctan of high values. If what you need is the angle given an x and y coordinate, i.e., the atan2(y,x) function, CORDIC is very good for that as well, since you don't have to do the y/x division, which can lose a lot of precision.

#12

My source was the Wolfram web site.


Edited: 4 Mar 2013, 7:59 p.m.

#13

Acton, F. S. "The Arctangent." In Numerical Methods that Work, upd. and rev. Washington, DC: Math. Assoc. Amer., pp. 6-10, 1990.

Unfortunately without further explanations.

Cheers

Thomas

#14

That's the same algorithm I found on the Wolfram web site. It works well even for large values of x. There is no need to use the trick:

arctan(x) = pi/2 - arctan(1/x)

Namir

Edited: 4 Mar 2013, 11:09 p.m.



Possibly Related Threads…
Thread Author Replies Views Last Post
  Trig vs hyperbolic handling differences in Prime CAS Michael de Estrada 3 1,534 11-08-2013, 06:26 PM
Last Post: Mark Hardman
  Trig Functions Howard Owen 11 3,412 09-16-2013, 02:53 PM
Last Post: Fred Lusk
  trig scales on the Post Versalog slide rule Al 12 3,595 09-15-2013, 06:01 AM
Last Post: John I.
  Some trig help, please Matt Agajanian 33 6,952 04-12-2013, 06:39 PM
Last Post: Matt Agajanian
  Question about trig functions approximation Namir 8 2,427 01-10-2013, 06:49 AM
Last Post: Valentin Albillo
  Check on mathematical identity Namir 21 4,900 08-26-2012, 11:21 AM
Last Post: Les Koller
  WP 34S Complex trig/hyperbolic bugs? Eamonn 35 8,248 04-26-2012, 07:32 PM
Last Post: Pete Wilson
  Just a thought I had--a 35S Trig fix Matt Agajanian 62 11,908 03-26-2012, 10:40 AM
Last Post: bill platt
  10bii+ Trig Bug Katie Wasserman 5 1,884 07-06-2011, 05:01 PM
Last Post: Thomas Radtke
  HTML glitch in Don Jennings' "Trig questions" thread? Karl Schneider 5 1,539 11-22-2008, 04:14 PM
Last Post: V-PN

Forum Jump: