# Bruker python 2, det er det eneste som stottes her from numpy import * import matplotlib.pyplot as plt f = lambda x: log(x) #def f(x): # return log(x) x = linspace(0.5, 2.5, 101) p1 = (x - 1) p2 = p1 - (1/2.0)*(x - 1)**2 p3 = p2 + (1/3.0)*(x - 1)**3 p4 = p3 - (1/4.0)*(x - 1)**4 p5 = p4 + (1/5.0)*(x - 1)**5 plt.plot(x, f(x), label='f(x)'); plt.plot(x, p1, label='T_1') plt.plot(x, p2, label='T_2') plt.plot(x, p3, label='T_3') plt.plot(x, p4, label='T_4') plt.plot(x, p5, label='T_5') plt.legend(); plt.show();