I'm a little confused with the .series method.In [8]: sin(x).series(x,0,10)Out[8]:3 5 7 9x x x xx - ── + ─── - ──── + ────── + O(x**10)6 120 5040 362880
In [9]: cos(x).series(x,0,10)Out[9]:2 4 6 8x x x x1 - ── + ── - ─── + ───── + O(x**10)2 24 720 40320From this it seems that .series(x,point,n) calculates the series expansion of f(x) till the nth exponent of x...
But,In [17]: exp(x**2).series(x,0,10)Out[17]:4 6 8 10 12 14 16 182 x x x x x x x x1 + x + ── + ── + ── + ─── + ─── + ──── + ───── + ────── + O(x**20)2 6 24 120 720 5040 40320 362880This doesnt seem to match up... Does the parameter 'n' mean 'the no of terms in the series expansion' or ' the last exponent of x in the expansion' ?
--
You received this message because you are subscribed to the Google Groups "sympy" group.
To view this discussion on the web visit https://groups.google.com/d/msg/sympy/-/iPZ8Z-N8jH0J.
To post to this group, send email to sy...@googlegroups.com.
To unsubscribe from this group, send email to sympy+un...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/sympy?hl=en.
I get this:
In [1]: exp(x**2).series(x,0,10)
Out[1]:
4 6 8
2 x x x ⎛ 10⎞
1 + x + ── + ── + ── + O⎝x ⎠
2 6 24
And it seems correct.
--
You received this message because you are subscribed to the Google Groups "sympy" group.
To post to this group, send email to sy...@googlegroups.com.
To unsubscribe from this group, send email to sympy+un...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/sympy?hl=en.
In [1]: (sin(x)/x**10).series(x,0,10)
Out[1]:
3 5
1 1 1 1 1 x x x
── - ──── + ────── - ─────── + ──────── - ──────── + ────────── - ────────────
9 7 5 3 362880⋅x 39916800 6227020800 130767436800
x 6⋅x 120⋅x 5040⋅x
7 9
x x ⎛ 10⎞
─ + ─────────────── - ────────────────── + O⎝x ⎠
0 355687428096000 121645100408832000
It works as expected. Can you check which version of sympy you are
actually using? Is it the master branch or a released version?