practicecalculus
Inverse trig integrals

Integral of 1/(1+x²): Formula, Steps and Examples

The integral of 1/(1+x²) is arctan x + C. See why with a tan substitution, the 1/(a²+x²) version, a graph and worked examples.

Inverse trig integrals Updated 3 min read

At a glance

\int \frac{1}{1+x^2}\,dx = \arctan x + C
Antiderivative
\arctan x + C
General form
\displaystyle\int \frac{dx}{a^2+x^2} = \frac{1}{a}\arctan\frac{x}{a} + C
Method
Substitution x = \tan\theta, or recognize the arctan derivative
From 0 to 1
\dfrac{\pi}{4}
Over the whole line
\pi
On this page
  1. Graph of 1/(1+x²) and its antiderivative
  2. How to integrate 1/(1+x²) step by step
  3. Check by differentiating
  4. Definite integrals
  5. Worked examples
  6. Common mistakes

The integral of \dfrac{1}{1+x^2} is \arctan x + C. It is one of the few integrals you should know on sight, because it turns a plain rational function into an angle.

\int \frac{1}{1+x^2}\,dx = \arctan x + C

The more general version, for any constant a > 0, is

\int \frac{1}{a^2+x^2}\,dx = \frac{1}{a}\arctan\frac{x}{a} + C

Graph of 1/(1+x²) and its antiderivative

y = 1/(1+x²) with the area from 0 to 1 shaded
The shaded area equals \arctan 1 - \arctan 0 = \frac{\pi}{4} \approx 0.785. The dashed curve is the antiderivative \arctan x, which levels off at \pm\frac{\pi}{2}.

The curve \frac{1}{1+x^2} is positive everywhere, so its antiderivative is always increasing. It also flattens out fast, which is why \arctan x approaches the horizontal lines y = \pm\frac{\pi}{2}.

How to integrate 1/(1+x²) step by step

You can simply recognize the derivative of arctan x. If you want to see where the answer comes from, use the substitution x = \tan\theta.

  1. Let x = \tan\theta, so dx = \sec^2\theta\,d\theta.
  2. Use the identity 1 + \tan^2\theta = \sec^2\theta: \int \frac{\sec^2\theta}{1+\tan^2\theta}\,d\theta = \int \frac{\sec^2\theta}{\sec^2\theta}\,d\theta = \int 1\,d\theta = \theta + C
  3. Go back to x. Since x = \tan\theta, we have \theta = \arctan x.

For \frac{1}{a^2+x^2}, factor out a^2 and substitute u = \frac{x}{a}, dx = a\,du:

\int \frac{dx}{a^2\left(1 + \frac{x^2}{a^2}\right)} = \frac{1}{a^2}\int \frac{a\,du}{1+u^2} = \frac{1}{a}\arctan u + C = \frac{1}{a}\arctan\frac{x}{a} + C

This is the same idea as trig substitution, in its simplest form.

Check by differentiating

\frac{d}{dx}\left(\frac{1}{a}\arctan\frac{x}{a}\right) = \frac{1}{a}\cdot\frac{1}{1 + \frac{x^2}{a^2}}\cdot\frac{1}{a} = \frac{1}{a^2 + x^2}

With a = 1 this gives back \frac{1}{1+x^2}.

Definite integrals

Integral Value
\int_0^1 \frac{dx}{1+x^2} \frac{\pi}{4} \approx 0.785
\int_{-1}^{1} \frac{dx}{1+x^2} \frac{\pi}{2}
\int_0^{\sqrt{3}} \frac{dx}{1+x^2} \frac{\pi}{3}
\int_{-\infty}^{\infty} \frac{dx}{1+x^2} \pi

The last one is an improper integral. It converges even though the interval is infinite, because \frac{1}{1+x^2} shrinks like \frac{1}{x^2}.

Worked examples

Example 1: a constant other than 1. \displaystyle\int \frac{dx}{9 + x^2}. Here a = 3:

\int \frac{dx}{9+x^2} = \frac{1}{3}\arctan\frac{x}{3} + C

Example 2: a coefficient on x². \displaystyle\int \frac{dx}{1 + 4x^2}. Let u = 2x, du = 2\,dx:

\frac{1}{2}\int \frac{du}{1+u^2} = \frac{1}{2}\arctan(2x) + C

Example 3: complete the square. \displaystyle\int \frac{dx}{x^2 + 2x + 5}. Write x^2 + 2x + 5 = (x+1)^2 + 4, then use a = 2 with u = x + 1:

\int \frac{dx}{(x+1)^2 + 4} = \frac{1}{2}\arctan\frac{x+1}{2} + C

Example 4: split the numerator. \displaystyle\int \frac{x + 3}{x^2 + 1}\,dx. Split into two integrals you know:

\int \frac{x}{x^2+1}\,dx + 3\int \frac{dx}{x^2+1} = \frac{1}{2}\ln(x^2+1) + 3\arctan x + C

The first part is covered on the integral of x/(x²+1) page.

Common mistakes

  1. Writing \ln(1 + x^2). That is the antiderivative of \frac{2x}{1+x^2}, not \frac{1}{1+x^2}. Without an x on top, there is no du for a log substitution.
  2. Dropping the \frac{1}{a}. \int \frac{dx}{4+x^2} is \frac{1}{2}\arctan\frac{x}{2}, not \arctan\frac{x}{2}. Differentiate your answer to catch this.
  3. Mixing it up with \frac{1}{1-x^2}. A minus sign changes everything. \frac{1}{1-x^2} needs partial fractions and gives logs; see the integral of 1/(x²−1).
  4. Using degrees. \arctan 1 = \frac{\pi}{4}, not 45. Calculus always uses radians.

For the inverse function itself, see the arctangent page. To integrate \arctan x (instead of getting it as an answer), see the integral of arctan x.

Practice it now

Trig substitution

Solve real problems on this topic with instant feedback, hints and a step-by-step walkthrough for every answer. Free, no sign-up needed to start.

Practice this lesson

Frequently asked questions

What is the integral of 1/(1+x²)?

It is \arctan x + C, also written \tan^{-1} x + C.

What is the integral of 1/(a²+x²)?

It is \frac{1}{a}\arctan\left(\frac{x}{a}\right) + C for a > 0. For example, \int \frac{dx}{4+x^2} = \frac{1}{2}\arctan\frac{x}{2} + C.

What is the integral of x/(1+x²)?

It is \frac{1}{2}\ln(1+x^2) + C. Let u = 1 + x^2, so du = 2x\,dx. The extra x on top changes the answer from an arctan to a log.

What is the integral of 1/(1+x²) from minus infinity to infinity?

It is \pi. The antiderivative \arctan x goes from -\frac{\pi}{2} to \frac{\pi}{2}, so the total area is \frac{\pi}{2} - \left(-\frac{\pi}{2}\right) = \pi.

Written by the PracticeCalculus team

We build interactive calculus lessons and write every page to be clear and correct. Spotted something off? Tell us and we will fix it.