Processing math: 100%

First time here? Check out the FAQ!

Ask Your Question
1

Displaying 1000 terms taylor series

asked 2 years ago

yuukono gravatar image

Hi,

I am trying to print up to 1000 terms of a Taylor series but my output either bleeds together or shows as a continuous line of numbers rather than separate fractions.

f = (x/sqrt(x^2-6*x+13));f taylor(f,x,4,500)

My output comes out as "fetch additional output" and the result is this: $\displaystyle \frac{79854682306522793194207787155926275411329758659461959227239100374575221031860704963210424694213147821527965196776756030407420591783729164672959605324317617935505546915704931}{305493636349960468205197939321361769978940274057232666389361390928129162652472045770185723510801522825687515269359046715531785342780428396973513311420091788963072442053377285222203558881953188370081650866793

And it goes on like this. Any tips or pointers? When I try 1000 terms it just gives me this error: "WARNING: 1 intermediate output message was discarded."

Preview: (hide)

Comments

Please provide more information: is this from the command-line, the notebook, CoCalc, SageCell? taylor(f, x, 4, 1000) works for me from the command line and the notebook. What are you doing to get LaTeX output?

John Palmieri gravatar imageJohn Palmieri ( 2 years ago )

1 Answer

Sort by » oldest newest most voted
0

answered 2 years ago

Emmanuel Charpentier gravatar image

updated 2 years ago

A trivial, brute-force solution to get a Latex expression of this series :

# The function
sage: f=(x/sqrt(x^2-6*x+13))
Its requested Taylor series
sage: %time s=f.taylor(x,4,1000)
CPU times: user 5.57 s, sys: 11.9 ms, total: 5.58 s
Wall time: 5.29 s
# Latex each ot its terms
sage: %time t=list(map(lambda u:str(latex(u)), reversed(s.operands())))
CPU times: user 59.2 ms, sys: 83 µs, total: 59.3 ms
Wall time: 59.3 ms
# Latex of the series
sage: %time p = " + ".join(t)
CPU times: user 127 µs, sys: 0 ns, total: 127 µs
Wall time: 133 µs

which I won't try to print since it would require about

sage: ceil(len(p)/35/60)
274

274 pages typeset at 60 characters per line on 35 lines per page.

Note that the result you'll get will express the development in terms of powers of x4 ; if you need it in terms of x, try the same trick on se = s.expand(). This will tell you that the x1000 coefficient is about 1.310352.

What are you trying to do ? Frighten the horses ?

HTH,

Preview: (hide)
link

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

Stats

Asked: 2 years ago

Seen: 331 times

Last updated: Nov 30 '22