# Understanding the integral of 1/(1+x^2)

1. ### MurdocJensen

47
If we have 1/(1+x2), the antiderivative for it is tan-1(Θ), correct?

I'm trying to understand how the substitution needed to get this works. First we have 1/(1+x2). Then we say that if we replace x with tan(Θ), we can replace the denominator with its identity, sec2(Θ), correct? Is it the change of variable that allows use to make this substitution?

For some reason I'm not convinced that something isn't lost when we change x to tan(Θ).

2. ### agentredlum

460
I don't think anything is lost because the range of tan(8) is the same as the domain of x. To put it another way, any real number you can think of for x, there is a theta, in the interval -pi/2 to pi/2 that will give tan(8) equal to that x because the tangent is continuous and has range -infinity to +infinity

Note* For any real x there are an infinite number of theta that give tan(8) = x but that's a detail...

3. ### brocks

184
You are making things way too hard.

When you integrate cos(x), you don't have to substitute anything, because you know that the derivative of sin(x) is cos(x), so the integral of cos(x) is sin(x).

Similarly, since you know that the derivative of arctan is 1/(1+x^2), you know that the integral of the latter is the former. No substitution is needed.

4. ### Bohrok

867
The antiderivative should actually be tan-1x + c

5. ### MurdocJensen

47
Brocks: My question is still valid. I know you could just remember the derivative of arctan, but I was curious about how you get to that answer. What is the logic behind the intermediate steps of finding the integral of 1/(1+x2)?

6. ### FeDeX_LaTeX

434
I thought that was the only way to get the answer... it's the one I've always used.

Let x = tan(u), then dx = sec2(u)

1 + tan2(u) = sec2(u)

So we have

$$\int \frac{1}{{\sec}^{2}(u)}{\sec}^{2}(u)du = \int 1du = u$$

Since x = tan(u), u = arctan(x).

7. ### HallsofIvy

40,769
Staff Emeritus
The only logic necessary in integrating $1/(x^2+ 1)$ is that the derivative of $tan^{-1}(\theta)$ is $1/(x^2+ 1)$.

That can be shown starting from the fact that the derivative of sin(x) is cos(x) and that the derivative of cos(x) is -sin(x).

8. ### hunt_mat

1,613
To expand on HallsofIvy's comment: Let $y=\tan^{-1}x$, then $x=\tan y$. Differentiate both sides w.r.t. x , doing this to obtain:
$$\sec^{2}y\frac{dy}{dx}=1$$
Re-arrange to obtain:
$$\frac{dy}{dx}=\cos^{2}y$$
The you have to fine cos y in terms of x which I will leave that to you.

9. ### brocks

184
The point is you don't need intermediate steps. Integration is not like differentiation --- there is no general algorithm.

There are two ways to solve integration problems exactly (i.e., ruling out numerical methods): from scratch, or by finding an antiderivative.

For very simple functions, like y=x^2, you can use algebra to integrate from scratch, by taking partitions and letting them get smaller and more numerous, until you have a formula for an infinite sum that you can solve, but for the vast majority of functions, including trig functions, it's very difficult or impossible to do that.

The ONLY WAY to integrate most functions is to find a function whose derivative is the function you are trying to integrate. In other words, an antiderivative.

If I asked you to integrate y=x^27, you would immediately say (x^28)/28, right? You wouldn't do it from scratch (although you could), you would just know from practice how to find a function whose derivative is y.

The reason that there are whole books full of tables of integrals, but just a dozen or so basic formulas for derivatives, is because you learn formulas for differentiation that allow you to find the derivative of any elementary function by combining a few simple algorithms - product rule, chain rule, etc. But for integration, you don't have that. All you have are techniques to transform the function you start with, into something that you recognize as having an antiderivative that you know. You can then invoke the Fundamental Theorem of Calculus, which roughly says that if you can find an antiderivative, then you have your answer.

All the techniques you learn -- substitution, integration by parts, partial fractions, etc. --- don't have anything to do with actually finding the limit of the Riemann sum; they are just ways to turn the function you started with into a function whose antiderivative you already know.

So yes, you can let x=tan(theta) and transform the function into something whose antiderivative you know, but why do that when you already know its antiderivative is arctan? It's kind of like figuring out how many cows are in a field by counting their legs and dividing by four. You should end up with the same answer, but there's no need for it, and it gives you a lot more opportunity to make a mistake.

If you think it's "cheating" or "too easy," don't worry --- you will have all the algebraic and trig manipulations you want once you get into slightly harder problems. And when solving those problems, I guarantee that once you see how to transform your function into something that resembles 1/(1+x^2), you will jump on it, and then happily go to arctan in the next step, without worrying that you are skipping any steps.

Last edited: Aug 16, 2011
10. ### disregardthat

1,834
To see how substitution works, it is vital to understand why

$$\int^b_a f(g(x))g^{\prime}(x) dx = \int^{g(b)}_{g(a)} f(x) dx$$.

This can be proved as such:

If F is an antiderivative of f, then f(g(x))g'(x) is the derivative of F(g(x)). So F(g(x)) is an antiderivative of f(g(x))g'(x). Hence

$$\int^b_a f(g(x))g'(x) dx = F(g(b))-F(g(a)) = \int^{g(b)}_{g(a)} f(x) dx$$

This of course assumes that g is differentiable and f is integrable.

This is exactly why we can substitute. Taking your example, $$\frac{1}{x^2+1}$$, we will evaluate $$\int^b_a \frac{1}{1+x^2} dx$$. We note that if we put $$g(x) = \arctan(x)$$, then $$\tan(g(x)) = x$$, and so upon differentiating wrt x, we get that $$(\tan(g(x))^2+1)g^{\prime}(x) = 1$$.

So $$\int^b_a \frac{1}{x^2+1} dx = \int^b_a [\frac{\tan(g(x))^2+1}{x^2+1}]g^{\prime}(x) dx$$

Here $$\frac{\tan(g(x))^2+1}{x^2+1} = 1$$ will function as f(g(x)) (where f(x) = 1), so using our equality above, we have

$$\int^b_a \frac{1}{x^2+1} dx = \int^b_a f(g(x))g^{\prime}(x) dx =\int^{\arctan(b)}_{\arctan(a)} f(x) dx = \int^{\arctan(b)}_{\arctan(a)} 1 dx = \arctan(b)-\arctan(a)$$.

Normally though, you will not end up with an easy expression as 1 in the integrand after defining g(x). But the important thing is to end up with something that can be expressed as f(g(x)), for some function f. In practice, this will correspond to the usual way of substituting.

When integrating we generally don't know what to substitute. We can't calculate it, so to say, just by looking at the integrand, we must have a hunch of what will work. This time arctan(x) worked.

Note though that nothing is lost when substituting. It is only necessary that the substitution is differentiable. Also, the "reverse" substitution of x = g(u) is perfectly fine whenever g is differentiable and its derivative is almost everywhere non-zero (i believe).

Last edited: Aug 16, 2011