 [Â HomeÂ ]

How to calculate definite integrals of a function. This topic is part of the TCS FREE high school mathematics 'How-to Library', and will help you to calculate definite integrals of a function. (See the index page for a list of all available topics in the library.)Â To make best use of this topic, you need to download the Maths Helper Plus software. Click here for instructions. ### Theory:

Consider the problem of finding the area ‘A’ between a curved line: y = f(x) and the ‘x’ axis, Â between x = a and x = b: We can approximate the area by slicing it into rectangles and adding up the areas of the rectangles. In the diagram below, there are three rectangles of equal width. The height of each rectangle equals the height of the function graph at its midpoint, and the width of each rectangle = (b-a)/3: The total area under the curve from x = a to x = b can be approximated by: A = A1 + A2 + A3.

Â Notice that the area A1 is an overestimate of the area under the curve, A2 is about right, and A3 is too small.Â  Thus this method may be accurate for some types of curves, but not for others. It depends on their shape.

Â One way to improve the accuracy for any shaped curve is to increase the number of rectangles. If there are ‘n’ rectangles, then as ‘n’ increases, the width of each rectangle decreases.

Â For very thin rectangles, areas at the top that don’t fit the curve become insignificant, then the sum of the rectangles becomes very close to the area under the curved graph line.

Let Â be the area under the graph: y = f(x) from x = a to x = b. Â We can calculate the area by summing up the areas of the rectangular slices. If there are ‘n’ slices, then the total area is approximated by: The true area is called the 'definite integral' of the function, and can be written as the limit of this sum as ‘n’ approaches infinity, like this: The 'Method' section below shows you how to use Maths Helper Plus to calculate the definite integral of a function by adding rectangles under its graph. This can be very accurate because the computer can add many thousands of tiny rectangles in a fraction of a second.

### Method:

To explain how to use Maths Helper Plus to calculate a definite integral, we will use the function:

Â

y = 0.02x³ + 0.05x² - 0.3x + 2

We will calculate the definite integral from x = -3 to x = 4.

#### Step 1Â  Start with an empty Maths Helper Plus document

If you have just launched the software then you already have an empty document, otherwise hold down ‘Ctrl’ while you briefly press the ‘N’ key.

#### Step 2Â  Graph your function

1. Press the F3 key to activate the 'input box' for typing (see below):

Â

2. Type the function into the input box: 3. Press ENTER to complete the entry

For more help on entering functions, see the 'Easy Start' tutorial in the Maths Helper Plus 'help'. To access the tutorial, click 'Help' on the Maths Helper Plus menu bar, then select: 'Tutorial...'

If the graph of the function does not appear, you need to adjust the graph scale.Â
First reduce the graph scale. Press the F10 key enough times until the main parts of the graph are visible.
To enlarge the graph, hold down 'Ctrl' while you press F10.

For more help on setting graph scales, click 'Help' on the Maths Helper Plus menu bar, then select 'Index'. Click the button at the top left corner of the help screen. Click 'Training', then 'Essential skills', then 'Graph scale magic'.Â

#### Step 3Â  Display the options dialog box and set options

Carefully point to the plotted function graph line with the mouse and double click the mouse. This will display the function options dialog box. Click to select the 'Integrals' tab at the top of the dialog box: 1. Click on the 'Limits of integration' edit box and type the lower and upper boundaries for the integral in square brackets like this: [a,b]

Â

For the example, we type: [-3,4]

2. Click on the 'Number of intervals' edit box, and type these values of 'n':

Â

2,4,10,50,100,200,300,500

The area under the graph between 'a' and 'b' will be divided up into 'n' slices to calculate the total area. Each number in this list will be used for 'n'. Higher values of 'n' will usually give a more accurate result, so by comparing results for increasing value of 'n', we can decide how accurate our answer is.

Â

3. Select 'Shade areas on graph' to shade the area being calculated.

Â

4. There are several different methods of calculating area under a curve. These can be selected by clicking the required options under 'Methods of Integration'. The method described in 'Theory' above is Rectangular (mid-point). the 'Trapezoidal rule' reduces errors by joining points on the graph with straight lines, while 'Simpson's rule' fits parabolas between points on the graph. You should select several methods for comparison.

Â

5. Make sure 'Calculation mode' is set to 'definite integral', unless you are calculating the true area between the graph and the 'x' axis. The true area is the same as the definite integral, unless part of the area lies under the 'x' axis. For definite integrals, areas below the 'x' axis are negative, and subtract from the total answer.

Â

Click OK to finish.

#### Step 4Â  Read the integral value from the table

The text view displays the table of calculated integrals. This is how the table looks for the example integral:

 Definite integral from x = -3 to x = 4 nÂ Â Â Â  SimpsonÂ Â  TrapezoidalÂ Â  Midpoint 2Â Â Â Â  15.3417Â Â  16.485Â Â Â Â Â Â Â  14.77 4Â Â Â Â  15.3417Â Â  15.6275Â Â Â Â Â Â  15.1988 10Â Â Â  15.3417Â Â  15.3874Â Â Â Â Â Â  15.3188 20Â Â Â  15.3417Â Â  15.3531Â Â Â Â Â Â  15.3359 50Â Â Â  15.3417Â Â  15.3435Â Â Â Â Â Â  15.3408 100Â Â  15.3417Â Â  15.3421Â Â Â Â Â Â  15.3414 200Â Â  15.3417Â Â  15.3418Â Â Â Â Â Â  15.3416 300Â Â  15.3417Â Â  15.3417Â Â Â Â Â Â  15.3416 500Â Â  15.3417Â Â  15.3417Â Â Â Â Â Â  15.3417

Â

Simpson's rule was fastest to achieve four decimal place accuracy.

Â

For the trapezoidal rule, four decimal place accuracy is achieved at n=300. This is proved because the last digit (7) does not change for n = 500.

Â

For the midpoint method, n = 500 is required to achieve four decimal place accuracy.Â

Â

NOTE: We could add another higher 'n' value to the list, say n = 700, to check out the accuracy of the last digit for the midpoint method, but since we already know this answer is correct from the other two columns, we don't need to do so.

Â