Definite Integrals and Number Crunching

Previous ChapterContentsNext Chapter


Subsections


Definite Integrals and Number Crunching

Definite IntegralsIf you are evaluating a definite integral, the final step is to evaluate it across its limits of integration. This is basically a matter of arithmetic. This work is mainly concerned with more abstract math; mental arithmetic has already been covered well by others, and there are many good books on the subject. One in particular I like and recommend is Math Magic by Scott Flansburg. Nevertheless, there are some techniques and things to consider that are particular to doing abstract math, and which I haven't seen elsewhere. This section discusses some of them.

The best approach depends on the situation. Do you need an exact answer, or will an approximation do? Suppose the correct result is, say, 14.21; if you get 14 as an answer, or even 15, and you know that your answer is close but not exact, will that be good enough for what you need now? The answer really depends on what why you are solving this particular problem. If all you need is an estimate, an approximation will be fine. If you are calculating the final measurements for part of a robotic space satellite, it's important to be as accurate as you can.

If an exact result is necessary, you may be able to calculate it mentally. Again, books such as Math Magic teach how to do this even for complex calculations. Otherwise, you can use a calculator or math software for the final, calculation step.

If an approximation is sufficient, good! You are free to take shortcuts that will let you get to the solution quickly. You can round numbers to one or two significant digits (replacing 19.87 with 20, or 1,311 with 1300). You can estimate square roots for non-square arguments; since $\sqrt{19.2}$ is partway between 16 and 25, you might estimate it to be 4.4 or 4.5. (The actual square root is approximately 4.38.)

If you do decide to do the final number calculation mentally, there are two general strategies that make it easier and faster. They are especially useful when you are approximating.


Calculating Term by Term

Here is the first calculating strategy: if the resulting expression has many terms added and/or subtracted together, you can calculate the terms one at a time, keeping a running total as you go along. For example, say you mentally evaluate $\int_{2}^{10}\left(u^{3}+2u-3\right)du$, and end up visualizing

Image fig-int1-k

It can get complex here, because to evaluate it mentally, there are three groups of information to keep in your head at once:

  1. the expression $\frac{u^{4}}{4}+u^{2}-3u$,
  2. the limits of integration, 10 and 2, and
  3. the running total.
While it's possible to keep track of all of this information mentally, generally speaking most people will find it hard at first, except for simpler expressions. As you practice more, the size of expression that you consider ``simple'' will naturally grow. So what do you do when you are dealing with an expression so large that you have trouble remembering everything? Fortunately, you can often rely on a few things that will help. First, many times when evaluating an integral, the original expression will be written or printed someplace that you can see. In our example, $\int_{2}^{10}\left(u^{3}+2u-3\right)du$ will be physically printed somewhere you can easily glance at. This is not always true; sometimes you will have constructed the integral internally yourself. But if it is available physically, you can use it in a few ways. The limits of integration are in it; you can just glance at the integral twice, when you need each one, rather than remember both of them. Also, glancing at the integrand can jog your memory of what term is next.

The polynomial above is a good example to work with, because it is a mid-size expression. Depending on the size of the expression and your own ability (as aided by the techniques in this chapter), you may be able to hold the whole integrated expression in your memory, and visualize each term as needed. If it seems to be larger than you know how to handle at that point, it may be best to write it down. You can then glance at it as you do the calculation.

To help calculate this, you can utilize a tool called subimages. Using subimages is kind of a cross between windowing and chunking. Imagine you have two cards floating in front of you, stacked over each other. On one of them you will keep a running total, and on the other you will put one of the terms in the expression above. You visualize one of them as having the number 0 on it:

Image fig-int1-ba

In your mind's eye, bring the bottom one on top, so that you can see it better:

Image fig-int1-bb

That second one has the first term in the antiderivative. Plug in 10 for u there (the value of the higher limit of integration), and evaluate it.

Image fig-int1-bc

Image fig-int1-bd

Image fig-int1-be

The other card is a running total, which of course started at zero. Now that you have the value of the first term, switch back to the running total card and add it in:

Image fig-int1-bf

Image fig-int1-bg

Image fig-int1-bh

Then switch back to the other card, which now shows the next term in the series.

Image fig-int1-bi

Again, plug in for $u=10$, evaluate it, and add it into the running total.

Image fig-int1-bj

Image fig-int1-bk

Image fig-int1-bl

Image fig-int1-bm

Image fig-int1-bn

Repeat this process for each of the terms in the expression (in this example, there is only one left, -3u). That done, you run through them again. This time, you (a) use the other limit of integration, and (b) negate each term, multiplying it by -1. So after running through the expression the first time, you would visualize

Image fig-int1-bo

The top subimage, 2570, is the running total. That's the value of $\frac{1}{4}u^{4}+u^{2}-3u$ at u = 10. The subimage below it, which you can't see well here, contains -30 (the value of the last term, -3u, at u = 10). At this point, we are ready to run through the terms again. Start by putting $-\frac{u^{4}}{4}$ in the subimage for the term, and evaluating it at u = 2:

Image fig-int1-bp

Image fig-int1-bq

Image fig-int1-br

Image fig-int1-bs

Do you understand why it is $-\frac{u^{4}}{4}$ instead of $+\frac{u^{4}}{4}$? It is, of course, just because $\int_{a}^{b}f(x)\ dx=F(b)-F(a)$, and we are now evaluating with the lower limit of integration.

Next, you add the value from this term into the subtotal, just as above.

Image fig-int1-bt

Image fig-int1-bu

Image fig-int1-bv

Continue this with the other terms. You finally will end up visualizing

Image fig-int1-bw

2568 is the final total.


Calculating From The Inside Out

The second principle that will help you calculate a complex expression mentally is to calculate from the ``inside out''. In other words, you calculate in the way that most rapidly reduces the complexity of the expression. Mastering this will help you do very complicated arithmetic almost as easily as with the simple cases.

The basic idea of this is that if you are evaluating some expression numerically - meaning, you have actual numbers to plug in for all the variables and now want to simplify the expression to a single number - you can choose to evaluate parts of the expression in a certain order that maximally simplifies the expression as you go along. At each point, ask yourself, ``What part of this expression can I reduce next that will result in the simplest possible result?'' Often, if you have an expression with many nested expressions, the best path is to calculate the most deeply nested ones first. This results in a simpler expression, which may also have nested elements; you then repeat the process again, only it's easier this time, since the expression has fewer symbols to keep track of.

As an example, consider using the quadratic formula to solve equations of the form $ax^{2}+bx+c=0$. Say you want the solutions of the equation $2.2x^{2}+4x-0.3=0$. Factoring this, mentally or not, would be a lot of work, so it's easiest to just calculate the solution directly with $x=\frac{1}{2a}\left(-b\pm\sqrt{b^{2}-4ac}\right)$.

The rule of thumb to use to decide what part of the expression to reduce next at any given stage is: when deciding which part of an expression to reduce numerically, choose the part of that will result in the expression that has the fewest symbols. In other words, you don't have to evaluate the the expression left-to-right; you choose to evaluate that part of the expression, anywhere within it, that will reduce it the most. When you are reducing a large, complex expression numerically, following this rule makes the process far easier and faster. There are some subtleties to the process, including in combination with windowing, which we will discuss now.

Look at the quadratic formula carefully:


\begin{displaymath} x=\frac{1}{2a}\left(-b\pm\sqrt{b^{2}-4ac}\right)\end{displaymath}

Which symbols in the right-hand side can you reduce by plugging in numbers, that will give you an expression that is simpler (in terms of having fewer symbols)? By ``simpler'' here, we basically mean ``easier to work with mentally''. If you reduce the $\frac{1}{2a}$ to (approximately) 0.23, you end up with $0.23\left(-b\pm\sqrt{b^{2}-4ac}\right)$. That's probably a little easier to visualize, but not much. What if you plug in for the -b term? Well, you end up with

\begin{displaymath} \frac{1}{2a}\left(-4\pm\sqrt{b^{2}-4ac}\right),\end{displaymath}

which is about the same complexity as the original expression.

The other option is to calculate the discriminant. Depending on your skill and how ``nice'' the numbers are, you may mentally calculate $b^{2}-4ac$ in one step. In this case, that would leave you visualizing $\frac{1}{2a}\left(-b\pm\sqrt{18.64}\right)$. If that is not doable, you can apply the inside-out strategy to the discriminant itself. The inside-out strategy is recursive! Temporarily forget about the larger expression, and just calculate the value of $\sqrt{b^{2}-4ac}$. (This is where windowing comes in.) What part of this expression can you reduce by plugging in numbers, which will simplify the expression the most? The answer is probably the $4ac$ term. Reducing that term gives you the expression $\sqrt{b^{2}+2.64}$. Visualizing that, you can next substitute in for the $b^{2}$ and simplify to get $\sqrt{18.64}$. Since this is not a perfect square, we can choose to approximate a value of 4.4. (The actual value is approximately 4.32.) At this point, you can visualize the original, full expression, which now looks like $\frac{1}{2a}\left(-b\pm4.4\right)$. Much easier to visualize than $\frac{1}{2a}\left(-b\pm\sqrt{b^{2}-4ac}\right)$, isn't it? By properly using the ``inside-out'' strategy, you can rapidly whittle very complex expressions down to more manageable sizes. Since this expression has a plus-or-minus symbol, you will at some point have to split up your image into two parts, one for each solution[*]. Regardless, you can continue reducing it from the inside out in a similar way.



Footnotes

... solution[*]
The chapter of Inner Algebra entitled ``Plurality'' teaches some specific techniques for working with equations with multiple solutions. It is based on subimages, similar to what was done above.




Previous ChapterContentsNext Chapter