def integrall(delta_x,Y = []):
'''Calculate the integral of the line under Y in step delta_x.
The Y is a list
The step is delta_x
The result is in the list F
that mapping to Y'''
F = [0]
for i in range(len(Y)):
F.append(F[i] + Y[i]*delta_x)
return F
Y =[g(x) for x in X]
int1 = integrall(delta_x,Y)
plt.plot(X,int1[1:])