Trig Identity question « Next Oldest | Next Newest »

 ▼ Namir Posting Freak Posts: 2,247 Threads: 200 Joined: Jun 2005 03-03-2013, 10:34 AM 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! ▼ Thomas Klemm Senior Member Posts: 735 Threads: 34 Joined: May 2007 03-03-2013, 11:20 AM 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. ▼ Namir Posting Freak Posts: 2,247 Threads: 200 Joined: Jun 2005 03-03-2013, 04:19 PM 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. ▼ Gerson W. Barbosa Posting Freak Posts: 2,761 Threads: 100 Joined: Jul 2005 03-03-2013, 05:10 PM 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. Thomas Klemm Senior Member Posts: 735 Threads: 34 Joined: May 2007 03-03-2013, 06:00 PM 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 ▼ Namir Posting Freak Posts: 2,247 Threads: 200 Joined: Jun 2005 03-04-2013, 07:16 AM 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. Namir Posting Freak Posts: 2,247 Threads: 200 Joined: Jun 2005 03-04-2013, 11:06 AM 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. ▼ Thomas Klemm Senior Member Posts: 735 Threads: 34 Joined: May 2007 03-04-2013, 06:34 PM 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 ▼ Paul Dale Posting Freak Posts: 3,229 Threads: 42 Joined: Jul 2006 03-04-2013, 06:39 PM Without coding and testing anything, I wonder if the difference is significant. The AGM converges pretty quickly which would mean A0 -> A1. - Pauli ▼ Paul Dale Posting Freak Posts: 3,229 Threads: 42 Joined: Jul 2006 03-04-2013, 06:53 PM A quick check and they do converge different after all. - Pauli Namir Posting Freak Posts: 2,247 Threads: 200 Joined: Jun 2005 03-04-2013, 07:57 PM My source was the Wolfram web site. Edited: 4 Mar 2013, 7:59 p.m. ▼ Thomas Klemm Senior Member Posts: 735 Threads: 34 Joined: May 2007 03-04-2013, 08:45 PM 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 ▼ Namir Posting Freak Posts: 2,247 Threads: 200 Joined: Jun 2005 03-04-2013, 11:08 PM 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. Eric Smith Posting Freak Posts: 2,309 Threads: 116 Joined: Jun 2005 03-04-2013, 07:45 PM 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.

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

Forum Jump: