This behaviour is due to Maple. Maple's TAYLOR command actually behaves as described in the Maple documentation, which includes these parts (in series and order):
- If the third argument n is present then it specifies the "truncation order'' of the series calculations. This does not mean the truncation order of the actual series. See Order for more information about this.
- The environment variable Order represents the order of series calculations performed by Maple. It does not represent the order of the series output. In the given example, note that the order of the series expansion of exp(x)/x is only 7 rather than 8, since the series expansion of exp(x) is divided by x, thereby reducing the degree by 1.
To work around this behaviour calling TAYLOR with higher order approximations changes the behavior of future low-order approximations. For example:
t = maple('taylor','(x^3+x^5)/x^2','x=0','4')
t =
series(1*x+O(x^3),x,3)
t = maple('taylor','(x^3+x^5)/x^2','x=0','7')
t =
series(1*x+1*x^3,x)
t = maple('taylor','(x^3+x^5)/x^2','x=0','4')
t =
series(1*x+1*x^3,x)
So the workaround would be to perform some high order approximations before computing the order you really care about.
Best Answer