Ask Your Question
0

A problem in powerseries

asked 6 years ago

updated 6 years ago

FrédéricC gravatar image

It seems there is a problem when expanding tan(t), sinh(t), cosh(t) using PowerSeries. The following works fine

R.<t> = PowerSeriesRing(QQ)
sin(t)/cos(t)
t + 1/3*t^3 + 2/15*t^5 + 17/315*t^7 + 62/2835*t^9 + 1382/155925*t^11 + 21844/6081075*t^13 + 929569/638512875*t^15 + 6404582/10854718875*t^17 + 443861162/1856156927625*t^19 + O(t^20)

However, tan(t) returns

TypeError: cannot coerce arguments: no canonical coercion from Power Series Ring in t over Rational Field to Symbolic Ring
Preview: (hide)

Comments

This is because the power series do have "sin" and "cos" methods, but no "tan" method. So Sage tries to fall back to the symbolic ring SR and fails.

FrédéricC gravatar imageFrédéricC ( 6 years ago )

For the situation you presented, you could use tan(t).taylor(t, 0, 10)

vdelecroix gravatar imagevdelecroix ( 6 years ago )

Thanks for the replies. Of course talylor can do the job, however I had in mind more compex calculations with several steps where the series expanded results from the first step can be used in the next one and so on. PowerSeries is very usefull to this end. I guess at some point in the future more methods will be included in PowerSeries. Some of them e.g. sinh(x), cosh(x) which can be explicitly written in terms of exponentials would be simple to implement , I guess.

irizos gravatar imageirizos ( 6 years ago )

1 Answer

Sort by » oldest newest most voted
0

answered 6 years ago

Emmanuel Charpentier gravatar image

If working in SR is good enough for your problem :

tan(x).maxima_methods().powerseries(x,0)
sum((2^(2*i1) - 1)*2^(2*i1)*(-1)^(i1 - 1)*x^(2*i1 - 1)*bern(2*i1)/factorial(2*i1), i1, 0, +Infinity)

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

1 follower

Stats

Asked: 6 years ago

Seen: 811 times

Last updated: Mar 18 '19