Ask Your Question

Taylor expansion assumptions

asked 2015-06-18 20:43:17 +0100

zalba gravatar image

updated 2023-01-09 23:59:37 +0100

tmonteil gravatar image

This is a very simply question, but I can't seem to get an appropriate answer in Sage. Let's say I have the following function:f(x,y,z)=sqrt(x^2+(y+1-z)^2). The taylor expansion around x=0 is sqrt((y+1-z)^2)+x^2/(2*sqrt((y+1-z)^2)) (analytic form, not the value Sage gives). Is it possible for Sage to take assumptions into account when expanding? For example, if I have assume(y>0,z>0,z>y+1), then clearly, (y+1-z)<0, so when simplifying, sqrt((y+1-z)^2)=z-y-1. However, Sage simply gives me the same answer regardless of assumption. Is there a way to fix this?

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2015-06-18 22:49:34 +0100

tmonteil gravatar image

updated 2015-06-19 19:07:57 +0100

On 6.8.beta4, i have the following behaviour, with no assumption:

sage: f(x, y, z) = sqrt(x^2 + (y+1-z)^2)
sage: f.taylor(x, 0, 3)
(x, y, z) |--> -1/2*x^2/(y - z + 1) - y + z - 1

This can be considered as a bug of too much simplifying.

edit flag offensive delete link more


I have the same thing; however, I was considering the case where z>y+1, so the solution given isn't correct in that case. The solution I gave was the general analytic form, not the one Sage gave.

zalba gravatar imagezalba ( 2015-06-18 23:13:24 +0100 )edit

I see, i didn't understood your question.

tmonteil gravatar imagetmonteil ( 2015-06-19 18:29:27 +0100 )edit

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


Asked: 2015-06-18 20:43:17 +0100

Seen: 385 times

Last updated: Jun 19 '15