Ask Your Question
0

A problem in powerseries

asked 2019-03-16 16:41:49 +0200

updated 2019-03-16 17:39:59 +0200

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
edit retag flag offensive close merge delete

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 ( 2019-03-16 17:38:51 +0200 )edit

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

vdelecroix gravatar imagevdelecroix ( 2019-03-16 20:34:29 +0200 )edit

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 ( 2019-03-17 01:04:30 +0200 )edit

1 Answer

Sort by » oldest newest most voted
0

answered 2019-03-18 22:02:40 +0200

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,

edit flag offensive delete link more

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: 2019-03-16 16:41:49 +0200

Seen: 447 times

Last updated: Mar 18 '19