Post Reply 
How to evaluate A Taylor series at a specific value
08-22-2018, 08:50 PM
Post: #22
RE: How to evaluate A Taylor series at a specific value
(08-22-2018 06:56 PM)Albert Chan Wrote:  This is a bug.
Evaluate a taylor series while carrying the O[x] term is meaningless.
This is how Mathematica hande it:

In[1]:= taylor = Series[Sin[x], {x, 0, 5}]
Out[1]= x - x^3/6 + x^5/120 + O[x]^6

In[2]:= taylor /. x -> 0.5
SeriesData::ssdn: Attempt to evaluate a series at the number 0.5; returning Indeterminate.
Out[2]= Indeterminate

In[3]:=Normal[taylor] /. x -> 0.5 (* Drop the O[x] term, then substitute *)
Out[3]= 0.479427

BTW, Mathematica (v 4.0) had the bug too, if x had Pi in it.

In[4]:= taylor /. x-> 1/2 + Pi/10^10 // N
Out[4]= 1. 0.5 - 0.166667 0.125 + .00833333 0.03125 + O[0.5]^6

In[5]:= % // Normal (* above should be Indeterminate too ! Sad *)
Out[5]= 0.479427

BTW, you can test evaluation order with this: (x/x) |x = 0
For Mathematica, it is evaluation before substitution, result = 1, not 0/0

Why would the evaluate of a function that contains an error term magically drop the error term? Just because a certain piece of software has decided to follow a particular convention does not mean that it is necessarily universal -- or even mathematically correct. (x/x) | x=0 is indeterminate. The expression x/x is undefined at 0. Even if one were to "evaluate first", the expression x/x only evaluates to 1 when x is non-zero.

Graph 3D | QPI | SolveSys
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: How to evaluate A Taylor series at a specific value - Han - 08-22-2018 08:50 PM



User(s) browsing this thread: