Taylor expansion around x = 0 and x = 1.5 of sin (x) using sympy.
from sympy import *
"""
Use the series function.
series("function",variable, "x=Where to deploy",Censoring order of expansion)
#By default x=Around 0
"""
x=Symbol('x') #letter'x'Is defined as the variable x
y=Symbol('y') #letter'y'Is defined as the variable y
series(sin(x),x) #Default configuration
series(sin(x),x, 0, 12) # x=O around 0(x^12)Expand to
series(sin(x),x, 1.5, 12) # x=1.O around 5(x^12)Expand to
Recommended Posts