mpmathというモジュールの中にテイラー展開をしてくれmpmath.taylorがいらっしゃる。 Function approximation — mpmath 1.0.0 documentation mpmath.taylorは展開係数の入ったリストを返してくれる。リストの中身は昇べきの順で並んでいる。 一方、mpmath.polyvalは係数のリストを引数にして多項式の値を返してくれる。 Polynomials — SymPy v0.7.0 documentation ただし、リストの順番は次数に対して降べきの順である。 したがって、list[::-1]でリストの順番を逆にすればtaylor展開の値がpolyvalですぐに求まる。 #!/usr/bin/env python import numpy as np import mpmath as mp import matplotli