# A Generalized Series Expansion of the Arctangent Function Based on the Enhanced Midpoint Integration

^{1}

^{2}

^{3}

^{4}

^{*}

## Abstract

**:**

## 1. Introduction

## 2. Derivation

`Clear[atan,\[Gamma],\[Alpha],\[Beta]];`

`(* Equation (15) *)`

`atan[x_,nMax_,M_] := 2*Sum[(1/(2*n - 1))*`

`(\[Alpha][x,\[Gamma][m,M],n]/((2*m - 1)^(2*n - 1)*`

`(\[Alpha][x,\[Gamma][m, M],n]^2 + \[Beta][x,`

`\[Gamma][m,M],n]^2))),{m,1,M},{n,1,nMax}];`

`(* Argument gamma *)`

`\[Gamma][m_,M_] := \[Gamma][m,M] = N[(m - 1/2)/M,1000];`

`(* Expansion coefficients *)`

`\[Alpha][x_,t_,1] := \[Alpha][x,t,1] = 1/(x*t);`

`\[Beta][x_,t_,1] := \[Beta][x,t,1] = 1;`

`\[Alpha][x_,t_,n_] := \[Alpha][x,t,n] =`

`\[Alpha][x,t,n - 1]*(1 - 1/(x*t)^2) +`

`2*(\[Beta][x,t,n - 1]/(x*t));`

`\[Beta][x_,t_,n_] := \[Beta][x,t,n] =`

`\[Beta][x,t,n - 1]*(1 - 1/(x*t)^2) -`

`2*(\[Alpha][x,t,n - 1]/(x*t));`

`(* Computing data points *)`

`tabs := {Table[{x,atan[x,10,1]},{x,-20,20,Pi/20}],`

`Table[{x,atan[x,10,2]},{x,-20,20,Pi/20}],`

`Table[{x,atan[x,10,3]},{x,-20,20,Pi/20}]};`

`Print["Computing, please wait..."];`

`(* Plotting graphs *)`

`ListPlot[tabs,Joined->True,FrameLabel->{"Parameter x",`

`"Arctangent approximations"},PlotStyle->{Blue,Red,Green},`

`Frame->True,GridLines->Automatic]`

## 3. Applications

## 4. Conclusions

## Author Contributions

## Funding

## Institutional Review Board Statement

## Informed Consent Statement

## Data Availability Statement

## Acknowledgments

## Conflicts of Interest

## Abbreviations

EMI | Enhanced midpoint integration |

CAS | Computer algebra system |

## References

- Adegoke, K.; Layeni, O. The higher derivatives of the inverse tangent function and rapidly convergent BBP-type formulas for pi. Appl. Math. E-Notes
**2010**, 10, 70–75. Available online: https://www.math.nthu.edu.tw/~amen/2010/090408-2.pdf (accessed on 26 February 2023). - Lampret, V. The higher derivatives of the inverse tangent function revisited. Appl. Math. E-Notes
**2011**, 11, 224–231. Available online: https://www.math.nthu.edu.tw/~amen/2011/101020-2.pdf (accessed on 26 February 2023). - Abrarov, S.M.; Quine, B.M. A Simple Identity for Derivatives of the Arctangent Function. arXiv
**2016**, arXiv:1605.02843. [Google Scholar] - Abrarov, S.M.; Quine, B.M. A Reformulated Series Expansion of the Arctangent Function. arXiv
**2017**, arXiv:1701.05098. [Google Scholar] - Abrarov, S.M.; Quine, B.M. An Iteration Procedure for a Two-Term Machin-like Formula for pi with Small Lehmer’s Measure. arXiv
**2017**, arXiv:1706.08835. [Google Scholar] - Abrarov, S.M.; Siddiqui, R.; Jagpal, R.K.; Quine, B.M. A new form of the Machin-like formula for π by iteration with increasing integers. J. Integer. Seq.
**2022**, 25, 22.4.5. [Google Scholar] - Milgram, M. A new series expansion for integral powers of arctangent. Integ. Trans. Spec. Func.
**2006**, 17, 531–538. [Google Scholar] [CrossRef] - Sofo, A.; Villacorta, J.C. New identities for the arctangent function. J. Math. Anal.
**2012**, 3, 1–10. [Google Scholar] - Zhang, W. New formulae of BBP-type with different moduli. J. Math. Anal. Appl.
**2013**, 398, 46–60. [Google Scholar] [CrossRef] - Qi, F.; Zheng, M.-M. Explicit expressions for a family of the Bell polynomials and applications. Appl. Math. Comput.
**2015**, 258, 597–607. [Google Scholar] [CrossRef] - Pilato, L.; Fanucci, L.; Saponara, S. Real-time and high-accuracy arctangent computation using CORDIC and fast magnitude estimation. Electronics
**2017**, 6, 22. [Google Scholar] [CrossRef] - Qiao, Q.-X.; Chen, C.-P. Approximations to inverse tangent function. J. Ineq. Appl.
**2018**, 141. [Google Scholar] [CrossRef] [PubMed] - Benammar, M.; Alassi, A.; Gastli, A.; Ben-Brahim, L.; Touat, F. New fast arctangent approximation algorithm for generic real-time embedded applications. Sensors
**2019**, 19, 5148. [Google Scholar] [CrossRef] - Sofo, A.; Nimbran, A.S. Euler-like sums via powers of log, arctan and arctanh functions. Integ. Trans. Spec. Func.
**2020**, 31, 966–981. [Google Scholar] [CrossRef] - Kusaka, T.; Tanaka, T. Fast and accurate approximation methods for trigonometric and arctangent calculations for low-performance computers. Electronics
**2022**, 11, 2285. [Google Scholar] [CrossRef] - Brent, R.P. Fortran multiple-precision arithmetic. ACM Trans. Math. Soft.
**1978**, 4, 57–70. [Google Scholar] [CrossRef] - Brent, R.P. Fast Algorithms for High-Precision Computation of Elementary Functions. Available online: https://maths-people.anu.edu.au/brent/pd/RNC7t4.pdf (accessed on 26 February 2023).
- de Dinechin, F.; Villard, G. High precision numerical accuracy in physics research. Nucl. Instrum. Methods Phys. Res. A
**2006**, 559, 207–210. [Google Scholar] [CrossRef] - Bailey, D.H.; Barrio, R.; Borwein, J.M. High-precision computation: Mathematical physics and dynamics. Appl. Math. Comput.
**2012**, 218, 10106–10121. [Google Scholar] [CrossRef] - Bailey, D.H.; Borwein, J.M. High-precision arithmetic in mathematical physics. Mathematics
**2015**, 3, 337–367. [Google Scholar] [CrossRef] - Kneusel, R.T. Numbers and Computers; Springer: Cham, Switzerland, 2017. [Google Scholar]
- Vestermark, H. Fast Trigonometric Functions for Arbitrary Precision Number. Available online: https://www.researchgate.net/publication/361483599_Fast_Trigonometric_functions_for_Arbitrary_Precision_number?channel=doi&linkId=63fc7e065749505945498e6b&showFulltext=true (accessed on 26 February 2023).
- Johansson, F. Computing Elementary Functions Using Multi-Prime Argument Reduction (LFANT). arXiv
**2022**, arXiv:2207.02501. [Google Scholar] - Berggren, J.L.; Borwein, J.M.; Borwein, J. Pi: A Source Book, 3rd ed.; Springer: New York, NY, USA, 2004. [Google Scholar]
- Calcut, J.S. Gaussian integers and arctangent identities for π. Amer. Math. Mon.
**2009**, 116, 515–530. [Google Scholar] [CrossRef] - Nimbran, A.S. On the derivation of Machin-like arctangent identities for computing pi (π). Math. Stud.
**2010**, 79, 171–186. [Google Scholar] - Agarwal, R.P.; Agarwal, H.; Sen, K.S. Birth, growth and computation of pi to ten trillion digits. Adv. Differ. Equ.
**2013**, 100. [Google Scholar] [CrossRef] - Wetherfield, M.R.; Chien-Lih, H. Computing pi: Lists of Machin-Type (Inverse Cotangent) Identities for pi/4. Available online: http://www.machination.eclipse.co.uk (accessed on 26 February 2023).
- A Wolfram Notebook Playing with Machin-like Formulas. Available online: https://www.wolframcloud.com/obj/exploration/MachinLike.nb (accessed on 26 February 2023).
- Gasull, A.; Luca, F.; Varona, J.L. Three Essays on Machin’s Type Formulas. arXiv
**2023**, arXiv:2302.00154. [Google Scholar] - Abrarov, S.M.; Quine, B.M. Identities for the Arctangent Function by Enhanced Midpoint Integration and the High-Accuracy Computation of pi. arXiv
**2016**, arXiv:1604.03752. [Google Scholar] - Abrarov, S.M.; Quine, B.M. A formula for pi involving nested radicals. Ramanujan J.
**2018**, 46, 657–665. [Google Scholar] [CrossRef] - Abrarov, S.M. Array Numerical Integration by Enhanced Midpoint Rule (File ID: 71037). Available online: https://tinyurl.com/bdf8pt2m (accessed on 26 February 2023).
- Castellanos, D. The ubiquitous π. Math. Mag.
**1988**, 61, 67–98. [Google Scholar] [CrossRef] - Chien-Lih, H. An elementary derivation of Euler’s series for the arctangent function. Math. Gaz.
**2005**, 89, 469–470. [Google Scholar] [CrossRef]

**Figure 1.**Arctangent approximations computed by using series expansion (15) truncated at ${n}_{\mathrm{max}}=10$. Blue, red and green curves correspond to M taken to be 1, 2 and 3, respectively.

**Figure 3.**Logarithms of absolute difference $lo{g}_{10}\Delta $ between original arctangent function and series expansions (16) (blue), (17) (red) and (15) (green-to-black) truncated at ${n}_{\mathrm{max}}=10$. Integer M in the series expansion (15) is taken to be 1 (green), 2 (brown), 3 (gray), 4 (magenta) and 5 (black).

Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content. |

© 2023 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (https://creativecommons.org/licenses/by/4.0/).

## Share and Cite

**MDPI and ACS Style**

Abrarov, S.M.; Siddiqui, R.; Jagpal, R.K.; Quine, B.M.
A Generalized Series Expansion of the Arctangent Function Based on the Enhanced Midpoint Integration. *AppliedMath* **2023**, *3*, 395-405.
https://doi.org/10.3390/appliedmath3020020

**AMA Style**

Abrarov SM, Siddiqui R, Jagpal RK, Quine BM.
A Generalized Series Expansion of the Arctangent Function Based on the Enhanced Midpoint Integration. *AppliedMath*. 2023; 3(2):395-405.
https://doi.org/10.3390/appliedmath3020020

**Chicago/Turabian Style**

Abrarov, Sanjar M., Rehan Siddiqui, Rajinder Kumar Jagpal, and Brendan M. Quine.
2023. "A Generalized Series Expansion of the Arctangent Function Based on the Enhanced Midpoint Integration" *AppliedMath* 3, no. 2: 395-405.
https://doi.org/10.3390/appliedmath3020020