Loading [MathJax]/jax/output/HTML-CSS/jax.js
Ask Your Question
2

Taylor expansion, powers of x-a

asked 1 year ago

JC gravatar image

Hi all,

I noticed that taylor(...) has a somehow inconsistent behaviour. When used with a function of one variable, it returns an expression that is a sum of powers of xa. For instance taylor(sin(x), x,1,2) gives the result 12(x1)2sin(1)+(x1)cos(1)+sin(1) as expected. Same for taylor(sin(x*y), (x,1), (y,2),2) that gives the expected answer.

In contrast taylor(sqrt(1+4*x^2 + y^2),(x,1), (y,2),2) gives a result ending with 43x+23y+13 , where I was expecting something containing a term on x1 and a term in y2.

Any ideas?

JC

Preview: (hide)

Comments

I cannot reproduce your result in Sagecell. Please try to update your Sage version.

Max Alekseyev gravatar imageMax Alekseyev ( 1 year ago )

I am using sage 10.0 on ubuntu. Perhaps adding `var('x,y')' at the very beggining helps? I tried that in sage cell server ant the restult is the one in my original post.

JC gravatar imageJC ( 1 year ago )

The linear part can be rewritten as follows

maxima('taylor(4/3*x + 2/3*y + 1/3,[x,1,1],[y,2,1])')

((2*(y-2))/3+3)+(4*(x-1))/3
achrzesz gravatar imageachrzesz ( 1 year ago )

1 Answer

Sort by » oldest newest most voted
1

answered 1 year ago

Emmanuel Charpentier gravatar image

updated 1 year ago

On a (lame for now) Sage 10.1.beta8 :

sage: var("x, y")
(x, y)
sage: taylor(sqrt(1+4*x^2+y^2),(x, 1), (y, 2), 2)
10/27*(x - 1)^2 - 8/27*(x - 1)*(y - 2) + 5/54*(y - 2)^2 + 4/3*x + 2/3*y + 1/3
sage: var("u, v")
(u, v)
sage: taylor(sqrt(1+4*x^2+y^2).subs({x:u+1, y:v+2}),(u, 0), (v, 0), 2).subs({u:x
....: -1, v:y-2})
10/27*(x - 1)^2 - 8/27*(x - 1)*(y - 2) + 5/54*(y - 2)^2 + 4/3*x + 2/3*y + 1/3

Sage insists to develop degree 1 monomials with numerical coefficients :

sage: 1/2*(x-1)+2/3*(y-2)
1/2*x + 2/3*y - 11/6

This has already caused much tears, wails and teeth grindings (on this site and elsewhere). Complain fiercely...

EDIT : Same results on Sagecell...

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: 1 year ago

Seen: 298 times

Last updated: Aug 01 '23