To approximate an integral like #\int_{a}^{b}f(x)\ dx# with Euler's method, you first have to realize, by the Fundamental Theorem of Calculus, that this is the same as calculating #F(b)-F(a)#, where #F'(x)=f(x)# for all #x\in [a,b]#. Also note that you can take #F(a)=0# and just calculate #F(b)#.

In other words, since Euler's method is a way of approximating solutions of initial-value problems for first-order differential equations, we want to calculate #\int_{a}^{b}f(x)\ dx=F(b)# by approximating the unique solution of #dy/dx=f(x), y(a)=0# at #x=b#.

This can be done with an "iteration scheme". Pick a positive integer #n# to be the number of steps of Euler's method you want to use and then let #Delta x=(b-a)/n#. Once this is done, let #x_{0}=a# and #y_{0}=0# and use the recursive equations #x_{k+1}=x_{k}+Delta x#, #y_{k+1}=y_{k}+Delta y=y_{k}+f(x_{k})\cdot Delta x# to generate a sequence of #n+1# points #(x_{0},y_{0}), (x_{1}, y_{1}), \ldots (x_{n},y_{n})# that approximate the unique solution of the initial-value problem.

The final result is that #\int_{a}^{b}f(x)\ dx=F(b)\approx y_{n}#.

This can be implemented fairly easily on a calculator or computer, though you'd have to be somewhat experienced with such programming.

As an example, suppose that you want to estimate #\int_{0}^{3}x^{2}\ dx# (which we already know is 9). The relevant initial-value problem is #dy/dx=f(x)=x^2, y(0)=0# and we want to approximate #y(3)#. Let's choose #n=4# so that #Delta x=\frac{3}{4}=0.75#. Then #x_{0}=0, x_{1}=0.75, x_{2}=1.5, x_{3}=2.25#, and #x_{4}=3#. Also #y_{1}=y_{0}+f(0)\cdot 0.75=0+0=0#, #y_{2)=y_{1}+f(0.75)\cdot 0.75=0+0.5625\cdot 0.75=0.421875#, #y_{3}=y_{2}+f(1.5)\cdot 0.75=0.421875+2.25\cdot 0.75=2.109375#, and #y_{4}=y_{3}+f(2.25)\cdot 0.75=2.109375+3.796875=5.90625# as our approximate answer for the integral.

This would get to be a better approximation (though very slowly) as #n# increases (and #Delta x=(b-a)/n# decreases). For instance, if #n=100# and #Delta x=3/100=0.03#, the approximation for the integral is #8.86545#.