# Author : Mohammad Farhan Fahrezy
# https://github.com/farhanfahrezy/

# Insert the integral's bound
a = int(input("Lower bound : "))
b = int(input("Upper bound : "))
delta = float(input("Delta : "))
integral = 0

if delta>0:
  while(a<b):
    # Change the function as you like, in this case, the function is x^3 + x + 1
    lower = a**3+a+1
    upper = (a+delta)**3+(a+delta)+1
    areaOfTrapezoid = (upper+lower)*0.5*delta
    integral = integral+areaOfTrapezoid
    a = a+delta
  print('Integral of the function is :',integral)
else: print("Delta value invalid!")