-1
import sympy as sp
def taylorCoefficient(f, a, n):
x = sp.symbols("x")
coefficient = []
for i in range(0, n + 1):
afgeleide = sp.diff(f(x), x, n=n)
def f(x0): return afgeleide.subs(x, x0)
coefficient += f(a)/sp.factorial(n)
return coefficient
x = sp.symbols("x")
taylorCoefficient(x ** 2 * sp.sin(x/2), 0, 3)
나는 mul 객체를 호출 할 수 없지만 왜 호출 할 수 있습니까? (온라인 afgeleide = ...)"mul 객체를 호출 할 수 없습니다."-error
역 추적 –
'f '는 호출 할 수없는'Mul' 객체이기 때문에. 기대 했니? 왜? – Goyo