Integration Using Euler's Method
Key Questions
-
Estimating Definite Integral by Euler's Method
Example
Use Euler's Method to approximate the definite integral
int_{-1}^2(4-x^2)dx∫2−1(4−x2)dx .For simplicity, let us use the step size
Deltax=1 .Let
I(t)=int_{-1}^t(4-x^2)dx .So, we wish to approximate
I(2)=int_{-1}^2(4-x^2)dx Note that by Fundamental Theorem of Calculus I,
I'(t)=4-t^2 Now, let us start approximating.
I(-1)=\int_{-1}^{-1}(4-x^2)dx=0 By linear approximation,
I(0) approx I(-1)+I'(-1)cdot Delta x=0+3cdot1=3 I(1) approx I(0)+I'(0)cdot Delta x approx3+4cdot1=7 I(2) approx I(1)+I'(1)cdot Delta x approx 7+3cdot1=10 Hence,
I(2)=int_{-1}^2(4-x^2)dx approx 10
I hope that this was helpful.
-
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 calculatingF(b)-F(a) , whereF'(x)=f(x) for allx\in [a,b] . Also note that you can takeF(a)=0 and just calculateF(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 ofdy/dx=f(x), y(a)=0 atx=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 letDelta x=(b-a)/n . Once this is done, letx_{0}=a andy_{0}=0 and use the recursive equationsx_{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 ofn+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 isdy/dx=f(x)=x^2, y(0)=0 and we want to approximatey(3) . Let's choosen=4 so thatDelta x=\frac{3}{4}=0.75 . Thenx_{0}=0, x_{1}=0.75, x_{2}=1.5, x_{3}=2.25 , andx_{4}=3 . Alsoy_{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 , andy_{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 (andDelta x=(b-a)/n decreases). For instance, ifn=100 andDelta x=3/100=0.03 , the approximation for the integral is8.86545 . -
Estimating Definite Integral by Euler's Method
Example
Use Euler's Method to approximate the definite integral
int_{-1}^2(4-x^2)dx .For simplicity, let us use the step size
Deltax=1 .Let
I(t)=int_{-1}^t(4-x^2)dx .So, we wish to approximate
I(2)=int_{-1}^2(4-x^2)dx Note that by Fundamental Theorem of Calculus I,
I'(t)=4-t^2 Now, let us start approximating.
I(-1)=\int_{-1}^{-1}(4-x^2)dx=0 By linear approximation,
I(0) approx I(-1)+I'(-1)cdot Delta x=0+3cdot1=3 I(1) approx I(0)+I'(0)cdot Delta x approx3+4cdot1=7 I(2) approx I(1)+I'(1)cdot Delta x approx 7+3cdot1=10 Hence,
I(2)=int_{-1}^2(4-x^2)dx approx 10
I hope that this was helpful.