The above simulation will calculate $\int_{x_i}^{x_f} f(x) dx$
where $f(x)$ can be any function of x
You need to specify the range of integration $x_i,x_f$
The default is $f(x)=sin (a*x)$ to show that user can enter methematic function
However, it can be changed to $f(x)=x+0.5*x*x$ or any other form of polynomial.