# Evaluating $\int\frac {dx}{1+x^2}$

Evaluate $$\int\frac{dx}{1+x^2}$$

Please help me find my mistake. I have integrated $$\frac {1}{1+x^2}$$ and gotten the correct result by making a mistake in the substitution. I imagined a triangle, with $$1 = \cos\theta$$ and $$x = \sin\theta$$ I then integrated $$d\theta$$ and got $$\arctan$$ a numerical result as this was a definite integral. While the result was correct, I realized that I should have substituted $$dx$$ for $$\cos \theta$$ but if I do this I get the wrong result.

I think I am making a mistake in the substitution thinking. Thank you!

• Recall $\frac{d}{dx}\tan^{-1}(x)=\frac{1}{1+x^2}$ Jul 28, 2020 at 6:05
• Re " $1 = \cos\theta$ and $x = \sin\theta$ " if $\cos\theta =1$ won't $\sin\theta=0$? Jul 28, 2020 at 6:07
• @NarenNaruto Thanks, I know the derivative, but I wanted to solve it using trig substitution Jul 28, 2020 at 6:09
• @Oliver, Why dont you try with $x=\tan y$ ? Jul 28, 2020 at 6:10
• You've written sine and cosine when you mean the opposite leg and the adjacent leg, respectively. Don't get these mixed up (sine/cosine are ratios, not lengths) Jul 28, 2020 at 6:15

The folly:

When you put $$1=\cos\theta$$, you are fixing the values of $$\theta$$ to be equal to $$2n\pi+\frac{\pi}{2}$$, where $$n$$ is an integer.

Fixing it:

If you do know the following, well and good, else another method follows:

$$\frac{d}{dx}\arctan x=\frac{1}{1+x^2}$$

The other method:

Substitute $$x=\tan\theta$$. Or, $$dx=\sec^2\theta\cdot d\theta$$. So the integral becomes: $$I=\int\frac{dx}{1+x^2}=\int\frac{\sec^2\theta\cdot d\theta}{1+\tan^2\theta}$$ Hence, $$I=\int\frac{\sec^2\theta}{\sec^2\theta}d\theta=\int d\theta$$ Can you finish?

• Hi, thanks so much. I can finish, as this is what I originally got to get the correct result. But I am not quite understanding why this would be case with cosine. If I have a triangle, with the hypothenuse being length $\sqrt{1+x^2}$ and the lower side 1 and the opposite x. Does theta have to be fixed? Jul 28, 2020 at 6:15
• Hi, thank you very much, thanks to a commenter above, I see how the substitution is not working! And how your comment above makes sense too now as this triangle doesn't exist with this theta. Jul 28, 2020 at 6:18
• @oliver: If you substitute $1=\cos\theta$ then $\theta$ is fixed; but according to this comment if yours, $\cos\theta$ happens to be $\frac{1}{\sqrt{1+x^2}}$ and now it is not fixed, and is a valid substitution, though it's usefulness is debatable ;) Jul 28, 2020 at 6:19