#closed form maclaurin series for f(x)=tanx using sum notation

56 messages · Page 1 of 1 (latest)

keen otter
#

Is there a closed form for it? I tried deriving tanx 7 times but am having a hard time seeing a clear pattern

chrome lagoonBOT
keen otter
#

here are the derivatives of tangent up to the 7th

#

I see a pattern with the powers of secants and the tangents appearing

#

you alternate between increasing the powers of secant by 2 as well as adding a sec^2 term and multiplying by tangent

#

the coefficients for the sec^2 is obvious - they're being multiplied by 2 every time

#

the leading coefficient is also pretty easy - its increasing by the factorial function, so multiply by 2 then 3 then 4, etc

#

but the middle coefficients I don't see a pattern - like how did -120 go to -480 go to +2016?

#

and yes I checked on desmos, the derivatives are correct

lavish lantern
#

the power series for tan is notoriously whacky

blissful scroll
#

There is a closed form for the coefficients of the Maclaurin series, but it's complicated.
If you want to compute them more efficiently (by hand at least) than by computing derivatives, you can use the fact that tan(x) = sin(x) / cos(x) and divide those power series to deduce the coefficients.

keen otter
#

any closed form is good

#

doesn't matter how complicated

#

it can't possibly be more complicated than dividing infinite series for sin and cos

blissful scroll
#

I just mean that it's more algorithmic that way.

#

In any case it looks like this :

keen otter
#

what is B_(2n)

blissful scroll
#

Bernoulli numbers

keen otter
#

whats the formula for bernoulli numbers

#

like how do I calculate Bernoulli of 10?

blissful scroll
#

I suppose in some sense it's not really a closed form. From what I remember they're related to the expansion of $\frac{x}{e^x-1}$. And in any case the computation of the numbers themselves would probably be as time consuming by hand as the usual method, although a computer could probably spit them out.

visual pollenBOT
#

Azyrashacorki

blissful scroll
#

There is this explicit formula for it

keen otter
#

complex numbers?

#

or is i just an index

#

is this what it's suppose to look like, the bernoulli function?

#

i used x for n, n for k, and k for i

#

@blissful scroll

blissful scroll
#

It looks like this, but Desmos is trying to link the dots.

keen otter
#

oh hold on

#

what about this

#

i used the round function so that any x will be rounded to the nearest integer

blissful scroll
#

Have a = [0...100] and plot the dots directly as (a, f(a)) if you want actual points.

#

But yes I suppose it should look like this,,.

keen otter
#

steps are as good as points

#

when i plug x=5 it outputs 1.13*10^-13

#

is that suppose to be 0?

#

sometimes desmos does that - when it's 0 it'll output a very small number

blissful scroll
#

Yes. That's an artifact of floating point arithmetic.

keen otter
#

im afraid i'll break desmos if I try to plug the entire formula in lol

keen otter
#

this does not look like tangent

#

@blissful scroll

keen otter
#

it should converge for the entire function from -pi/2 to pi/2

#

ok so it actually works until N=7

#

at N=8 someting happens and it's no longer as close to the actual tanx

#

then at N=9 is where it just veers off into the opposite direction after around x=1/2 like in the image I showed

blissful scroll
#

Those are the ones up to n=5.
Again Desmos doesn't do a good job at rendering it.

blissful scroll
#

Here is for the first 30 approximations