def integrate(i, dx):
	"""Takes a list of values, i.  i is split into n equal intervals of length dx, and contains the
	values of an arbitrary function at these points. With this data, this function will approximate
	the integral of the function using the trapezoidal rule."""
	n = len(i)
	sum = i[0]+i[n-1]
	for k in range(1,n-1):
		sum += 2*i[k]
	sum = (dx/2)*sum
	return sum