How can I explain why numerical integration is easy, but symbolic integration is hard?

I'm asking about definite integrals that can effortlessly be found numerically by high schoolers using software. For example,

$$\int_{-1}^1\frac1x\sqrt{\frac{1+x}{1-x}}\ln\left(\frac{2\,x^2+2\,x+1}{2\,x^2-2\,x+1}\right) \ \mathrm dx$$

This link shows the numerical integration done by software.

This Reddit comment substantiates that the exact solution is knotty, but not why:

The extent of math that this involves (beyond standard integration techniques usually taught in Calc II, just applied on a large scale), is a significant bit of Complex Analysis (the residue theorem, etc.). In general, everything in his derivation should at least be understandable had you taken Calc I-III and Complex Analysis.

How can I explain to someone who is just getting started in calculus why it's so hard to find the exact solution by symbolic integration, when it's so trivial to get a numerical answer using software?

• – Joel Reyes Noche May 28 at 8:16
• I had a hard time understanding the original version of the question, and other people's comments suggest that I wasn't the only one. Only after re-reading it several times and clicking on the links did I realize what the OP was actually asking. I've rewritten the question to try to make it clearer, while hopefully not losing the OP's intent. – Ben Crowell May 30 at 13:15
• I tried plugging this equation into a TI84 calculator (this model is the "standard" the the teachers in my HS use), and I quickly got a 'divide by 0' error. I then adjusted to integrate from -1 to 0 and then 0 to 1 and got a sum of 8.372205547 which is different than the reported result on the linked page, after the 5th digit. Can I assume that the software 'numerical integration' uses a different algorithm between the 2? – JoeTaxpayer May 30 at 22:00
• Just as, for a five year old, learning addition, subtraction, multiplication, division may be incredibly difficult for most, they can easily be trained to use a calculator to "perform" the operations. That doesn't mean they understand how the operations work, just as being able to strictly use CAS for approximating integrals, numerically, doesn't mean students understand what, in fact, integration is. – Namaste May 31 at 17:10

It might be fun to have your students pretend that the only functions they know are sums of monomials $$cx^n$$ where $$n\in{\bf Z}$$, and in particular, play like they know nothing about the function $$f(x)=\ln(x)$$. You see where this is going: we can easily graph $$f(x)=x^n$$ between $$x=1$$ and $$x=2$$ for any $$n$$, and find an antiderivative with the one annoying exception of $$f(x)=x^{-1}$$.

So, what is done in some developments of calculus? We define a new function $$g(x)=\int_{1}^x \frac{1}{t}\, dt$$ precisely so that we can have an antiderivative for the situation where we were previously stuck, and give $$g(x)$$ the special name $$\ln(x).$$

The point is that integration, unlike differentiation, takes one outside the function type of the integrand, e.g., the derivatives of rational functions are rational functions, but their antiderivatives might not be.

Wrap up the lesson with the xkcd comic found here

https://xkcd.com/2117/

When students learn integration, it's usually the first time they've ever encountered a type of mathematical calculation for which there are techniques, but no general algorithm that always succeeds. A good way of explaining why differentiation is rule-based, but integration is not, is to make the analogy with discrete, finite sums.

If you want to evaluate the sum $$f(n)=1+2+3+\ldots+n$$, you can easily find the result for any given $$n$$, but it's harder to find a general formula for $$f(n)$$. OK, so next show the student how to visualize triangles of dots and use geometrical reasoning to find that the answer is $$n(n+1)/2$$.

But you can now demonstrate that going the opposite way is just a straightforward calculation of $$f(n)-f(n-1)$$, with a simplification to show that the result is $$n$$. This rule-based calculation is like a derivative.

So in your example of using software to numerically evaluate a definite integral, what the software is doing is essentially like finding that $$1+2+3=6$$. That's straightforward and rule-based. But that doesn't mean that we can find the general formula $$n(n+1)/2$$ in the same rule-based way.

• Ah man, this is a great insight I was looking for! I always attributed the phenomenon to the arbitrariness of what most are willing to call a 'closed form' (what if erf is a named/special function for you but you don't consider exp simple or important enough to give a name?) or treated it as a byproduct of that system, but differentiation comprises two evaluations (the usual system of writing being biased so as to make $f(x+\delta)$ (or the difference $f(y)-f(x)$) usually 'simplifiable' or analyzable) and discarding terms that are $o(\delta)$, both of which tend to be amenable to – Vandermonde Jun 2 at 15:07
• convenient writing. Whereas (discrete) integration involved adding an indefinite number of terms (or for normal integration, perhaps you can think of a hyperreal number $N$), and it's a miracle when that sum, as a function of $N$, happens to match one that one counts as familiar. Thank you for finding words for the intuition! – Vandermonde Jun 2 at 15:11

This reminds me of one of Euler's papers, where he evaluates (not the definite integral, but indefinite integral) $$\int\frac{dz}{(3\pm z^2)\sqrt{1\pm 3z^2}}$$ using an amazing variety of substitutions and other tricks, among other things the formula $$\arctan(x)-\arctan(y) = \arctan\left(\frac{x-y}{1+xy}\right)$$. (In fact, he evaluates it two different ways!)

I think you can feel perfectly free to say that one the greatest mathematicians of all time struggled with various unusual integrals, even of the type which are actually doable with elementary antiderivatives, and then published papers about them. Maybe we don't do that as much today. And that apparently he also thought it wasn't evident which ones are easy and which ones aren't.

But far from being a discouragement, this should be instead freedom for a student. Use creativity, and see what you get! Use all the tricks you have access to now, acquire more later, and keep trying. And these are good thoughts for life; know what you've got, have a growth learning mindset to get more, and persevere.

• We rarely tell students that integration is actually guess-work. We can do the standard integrals now because we have a list of good guesses. – Jessica B May 29 at 6:20
• @JessicaB, it can be taken beyond guesswork. – Peter Taylor May 29 at 7:30
• True. Though note the part of the Wikipedia page connecting this to the undecidable 'does this expression equal zero' problem. In any case, my point was more the discovery than actual integration of any particular integrand. – kcrisman May 30 at 4:27
• @Peter Taylor, the Risch algorithm might “fail” by determining that the anti-derivative is not an elementary function. Then guesswork resumes...perhaps by using elliptic functions, or perhaps the definite integral can be evaluated by contour integration, etc. – user52817 Jun 1 at 18:31

One way of thinking about it (although I'm not sure whether it would be helpful for the student of interest to you):

What are you doing when you 'graph' the function? At each point on the $$x$$-axis, you calculate the value of the function, and plot that on the $$y$$-axis. That is something that can be done at each value. In practice, we start by knowing this is a 'reasonably nice' function (ie mostly continuous), so you can get away with finding the value at finitely many points and either stopping (on a computer screen) or joining the dots (in your head).

Now, what are you doing when you 'integrate' the function? Finding the area under the graph. Well, sort of. Finding the area under the graph can be done. An integral does exist (ignoring issues about measure etc). That's a point students don't always appreciate. There is an integral, and it is some function. The problem is how to write down what that function is. When a student asks 'can I integrate this?' what they really mean is 'can I write the integral of this function in a reasonably nice formula using functions I am familiar with?'

I think phrased that way, it becomes clear why integration is 'harder' than graphing, which should be sufficient explanation for most 17-year-olds.

(Now I've written it out, I can see that this is similar to the point made by user52817 .)

You should expect numerical integration to be "easier"  than symbolic integration because it is answering a fundamentally weaker question. That is, symbolic integration, if you can do it, gives you an infinitely precise answer. Numerical integration gives you an answer which is approximate, ideally with some bound on the amount of error.

It is like the difference between $$\sqrt{2}$$ and $$1.414 \pm 0.0003$$.

: You might not find numerical integration quite as easy if you were to do it by hand. If you level the playing field and allow the computer for symbolic integration, it can often be pretty easy too.