Re: Re: Arctangent approximation

```Murray Eisenberg wrote:
> I'll buy the first four terms of the approximation but not the fifth.
> What you seem to have here are the first 10 terms -- the first 5 nonzero
> terms -- of the Taylor expansion of ArcTan[x] around 0.
>
> Mathematica gives the result as:
>
>    Series[ArcTan[x], {x, 0, 9}] // Normal
>
> The result is a standard one that is taught in any standard calculus
> course. You obtain it by beginning with the geometric series expansion
>
>     (1-x)^(-1) = Sum[x^n, n,0,Infinity]
>
> (valid for Abs[x]<1), substitute there x = -(x^2), integrate the result
> term-by-term (which is legitimate for Abs[x] < 1), and then take the
> first 9 terms of that resulting infinite series.

It's the beginning of a(n) Hermite-like interpolation, as given in the
Medina article. The idea is to find a polynomial of degree 8*m that
agrees with ArcTan[x] at x=0 on derivatives 0 through 4*m, and agrees
with derivatives 1 through 4*m at x=1.

Code for deriving it is as follows.

m = 2;

f[x_] := ArcTan[x]
derivs = Table[D[f[x],{x,j}],{j,0,4*m}];
zeroCoeffs = derivs /. x->0;
oneCoeffs = Rest[derivs] /. x->1;

poly8m = Sum[a[j]*x^j, {j,0,8*m}];
polyDerivs =  Table[D[poly8m,{x,j}],{j,0,4*m}];
polyZeroCoeffs = polyDerivs /. x->0;
polyOneCoeffs = Rest[polyDerivs] /. x->1;

In[41]:= InputForm[poly8m /. Solve[
Join[zeroCoeffs-polyZeroCoeffs,oneCoeffs-polyOneCoeffs]==0]]

Out[41]//InputForm=
{x - x^3/3 + x^5/5 - x^7/7 + (5*x^9)/48 + x^10/20 -
(43*x^11)/176 + x^12/4 - (27*x^13)/208 +
x^14/28 - x^15/240}

The article discusses a more efficient way to obtain these, via recurrences.

Daniel Lichtblau
Wolfram Research

> On 2/17/2010 7:02 AM, sidey wrote:
>> A professor (Herbert Medina) came up with this remarkable
>> approximation.
>>
>> Since I don't have Mathematica, could someone run it for
>> numberofdigits=9 and 12  please? (and send me the result?)
>>
>> here is a short result
>> h2(x) = x - x^3/3 + x^5/5 - x^7/7 + 5x^9/48..
>>
>>                   Thank you.
>>
>> PS reference is: http://myweb.lmu.edu/hmedina/Papers/Arctan.pdf
>>
>> Clear[h, m, a, numberofdigits]
>> numberofdigits=12;
>> m=Floor[-(1/5) Log[4,5*0.1^(numberofdigits+1)]]+1;
>> Do[a[2j]=(-1)^(j+1) Sum[Binomial[4m,2k] (-1)^k, {k,j+1,2m}];
>> a[2j-1]=(-1)^(j+1) Sum[Binomial[4m,2k+1] (-1)^k, {k,j,2m-1}],
>> {j,0,2m-1}];
>> h[m,x_]:=Sum[(-1)^(j+1) / (2j-1) x^(2j-1), {j,1,2m}] +
>> Sum[a[j]/((-1)^(m+1) 4^m (4m+j+1)) x^(4m+j+1), {j,0, 4m-2}];
>> Print["h[",m,",x] given below computes ArcTan[x] with ",
>> numberofdigits," digits of accuracy for x in [0,1]."]
>> Print["h[m,x] = ", h[m,x]]

```

• Prev by Date: Re: Re: Re: May we trust IntegerQ
• Next by Date: Re: Re: Re: May we trust IntegerQ
• Previous by thread: Re: Re: Re: Arctangent approximation
• Next by thread: Re: Arctangent approximation