How to evaluate A Taylor series at a specific value
08-22-2018, 06:56 PM (This post was last modified: 08-22-2018 08:14 PM by Albert Chan.)
Post: #20
 Albert Chan Senior Member Posts: 2,711 Joined: Jul 2018
RE: How to evaluate A Taylor series at a specific value

(05-12-2018 02:56 PM)Joe Horn Wrote:
(05-12-2018 02:44 PM)DrD Wrote:  taylor(sin(x))|x = 0.5

Hmmmm.... That seems to return sin(.5), not the desired result. Not sure why.
Perhaps the x gets substituted right away, resulting in taylor(sin(.5))?

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 ! *)
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
 « Next Oldest | Next Newest »

 Messages In This Thread How to evaluate A Taylor series at a specific value - Seisner - 05-11-2018, 11:44 PM RE: How to evaluate A Taylor series at a specific value - Tim Wessman - 05-12-2018, 03:40 AM RE: How to evaluate A Taylor series at a specific value - Seisner - 05-12-2018, 10:13 AM RE: How to evaluate A Taylor series at a specific value - parisse - 05-12-2018, 02:25 PM RE: How to evaluate A Taylor series at a specific value - Joe Horn - 05-12-2018, 02:36 PM RE: How to evaluate A Taylor series at a specific value - DrD - 05-12-2018, 02:44 PM RE: How to evaluate A Taylor series at a specific value - Joe Horn - 05-12-2018, 02:56 PM RE: How to evaluate A Taylor series at a specific value - Han - 08-21-2018, 08:54 PM RE: How to evaluate A Taylor series at a specific value - Albert Chan - 08-22-2018 06:56 PM RE: How to evaluate A Taylor series at a specific value - Han - 08-22-2018, 08:50 PM RE: How to evaluate A Taylor series at a specific value - Albert Chan - 08-22-2018, 09:23 PM RE: How to evaluate A Taylor series at a specific value - Seisner - 05-12-2018, 02:53 PM RE: How to evaluate A Taylor series at a specific value - DrD - 05-12-2018, 03:01 PM RE: How to evaluate A Taylor series at a specific value - Joe Horn - 05-12-2018, 03:06 PM RE: How to evaluate A Taylor series at a specific value - DrD - 05-12-2018, 03:13 PM RE: How to evaluate A Taylor series at a specific value - Mark Hardman - 05-12-2018, 04:00 PM RE: How to evaluate A Taylor series at a specific value - DrD - 05-12-2018, 04:42 PM RE: How to evaluate A Taylor series at a specific value - Mark Hardman - 05-12-2018, 04:53 PM RE: How to evaluate A Taylor series at a specific value - Aries - 08-21-2018, 03:00 PM RE: How to evaluate A Taylor series at a specific value - parisse - 08-21-2018, 04:47 PM RE: How to evaluate A Taylor series at a specific value - Komanguy - 08-21-2018, 07:37 PM RE: How to evaluate A Taylor series at a specific value - Aries - 08-26-2018, 08:43 AM RE: How to evaluate A Taylor series at a specific value - KeithB - 08-22-2018, 02:09 PM RE: How to evaluate A Taylor series at a specific value - parisse - 08-22-2018, 07:52 PM RE: How to evaluate A Taylor series at a specific value - Albert Chan - 08-23-2018, 02:30 PM RE: How to evaluate A Taylor series at a specific value - Han - 08-24-2018, 12:08 AM RE: How to evaluate A Taylor series at a specific value - Albert Chan - 08-24-2018, 01:06 AM RE: How to evaluate A Taylor series at a specific value - Wes Loewer - 08-27-2018, 02:33 PM RE: How to evaluate A Taylor series at a specific value - Albert Chan - 08-27-2018, 04:15 PM RE: How to evaluate A Taylor series at a specific value - Tim Wessman - 08-23-2018, 03:15 PM RE: How to evaluate A Taylor series at a specific value - parisse - 08-24-2018, 06:21 AM RE: How to evaluate A Taylor series at a specific value - Albert Chan - 08-24-2018, 07:42 AM RE: How to evaluate A Taylor series at a specific value - ijabbott - 08-24-2018, 02:08 PM RE: How to evaluate A Taylor series at a specific value - parisse - 08-24-2018, 06:58 PM RE: How to evaluate A Taylor series at a specific value - ijabbott - 08-24-2018, 08:23 PM RE: How to evaluate A Taylor series at a specific value - parisse - 08-27-2018, 03:10 PM

User(s) browsing this thread: 1 Guest(s)