# Integral of arctan x: Formula, Steps and Examples

> The integral of arctan x is x arctan x − ½ ln(1+x²) + C. See the integration by parts steps, a check, definite integrals and examples.

Source: https://practicecalculus.com/integrals/arctan-x
Updated: 2026-11-06

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

## At a glance

- **Antiderivative:** $x\arctan x - \frac{1}{2}\ln(1+x^2) + C$
- **Method:** Integration by parts with $u = \arctan x$, $dv = dx$
- **From 0 to 1:** $\frac{\pi}{4} - \frac{1}{2}\ln 2 \approx 0.439$
- **Related integral:** $\int \frac{dx}{1+x^2} = \arctan x + C$

## Key takeaways

- The integral of $\arctan x$ is $x\arctan x - \frac{1}{2}\ln(1+x^2) + C$.
- Use integration by parts with $u = \arctan x$ and $dv = dx$. The leftover integral $\int\frac{x}{1+x^2}\,dx$ is a simple log substitution.
- There is no absolute value in $\ln(1+x^2)$ because $1 + x^2$ is always positive.
- The same trick, parts with $dv = dx$, works for $\ln x$, $\arcsin x$ and $\arccos x$.

The **integral of $\arctan x$ is $x\arctan x - \dfrac{1}{2}\ln(1+x^2) + C$**. There is no basic rule that undoes arctan directly, so the standard route is integration by parts with a "hidden" factor of 1.

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

## Graph of arctan x and its antiderivative

```graph
title: 'y = arctan x and its antiderivative'
caption: 'The shaded area from $0$ to $1$ equals $\frac{\pi}{4} - \frac{1}{2}\ln 2 \approx 0.439$. The dashed antiderivative has a minimum at $x = 0$, where $\arctan x$ changes sign.'
x: [-4, 4]
y: [-2, 3.5]
functions:
  - expr: arctan(x)
    label: y = arctan x
  - expr: x*arctan(x) - 0.5*ln(1+x^2)
    label: y = x arctan x − ½ ln(1+x²)
    dashed: true
shade:
  expr: arctan(x)
  from: 0
  to: 1
points:
  - [0, 0, '(0, 0)']
```

## How to integrate arctan x step by step

The trick is to write $\arctan x$ as $\arctan x \cdot 1$ and use [integration by parts](/rules/integration-by-parts-rule), $\int u\,dv = uv - \int v\,du$.

1. **Choose the parts.** $u = \arctan x$ and $dv = dx$. Then $du = \frac{1}{1+x^2}\,dx$ and $v = x$.
2. **Apply the formula.**
$$\int \arctan x\,dx = x\arctan x - \int \frac{x}{1+x^2}\,dx$$
3. **Finish the leftover integral** with $w = 1 + x^2$, $dw = 2x\,dx$:
$$\int \frac{x}{1+x^2}\,dx = \frac{1}{2}\int\frac{dw}{w} = \frac{1}{2}\ln(1+x^2) + C$$
4. **Combine.**
$$\int \arctan x\,dx = x\arctan x - \frac{1}{2}\ln(1+x^2) + C$$

Why choose $u = \arctan x$? Its derivative $\frac{1}{1+x^2}$ is algebraic and much easier to work with. In the LIATE order, inverse trig functions come near the front, so they are good choices for $u$.

## Check by differentiating

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

The two fractions cancel exactly, leaving $\arctan x$.

## Definite integrals

**From 0 to 1:**

$$\int_0^1 \arctan x\,dx = \left(1\cdot\frac{\pi}{4} - \frac{1}{2}\ln 2\right) - (0 - 0) = \frac{\pi}{4} - \frac{\ln 2}{2} \approx 0.439$$

**From −1 to 1:** $\arctan x$ is an odd function, so $\int_{-1}^{1}\arctan x\,dx = 0$. The area above the axis on the right cancels the area below on the left.

**From 0 to √3:** $\sqrt{3}\cdot\frac{\pi}{3} - \frac{1}{2}\ln 4 = \frac{\pi\sqrt{3}}{3} - \ln 2 \approx 1.121$.

## Worked examples

**Example 1: a scaled input.** $\int \arctan(2x)\,dx$. Let $u = 2x$, so $dx = \frac{du}{2}$:

$$\frac{1}{2}\left(u\arctan u - \frac{1}{2}\ln(1+u^2)\right) + C = x\arctan(2x) - \frac{1}{4}\ln(1+4x^2) + C$$

Check: the derivative is $\arctan 2x + \frac{2x}{1+4x^2} - \frac{1}{4}\cdot\frac{8x}{1+4x^2} = \arctan 2x$.

**Example 2: x times arctan x.** Take $u = \arctan x$ and $dv = x\,dx$, so $v = \frac{x^2}{2}$:

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

Write $\frac{x^2}{1+x^2} = 1 - \frac{1}{1+x^2}$, which integrates to $x - \arctan x$. So

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

**Example 3: arctan of the square root.** For $\int\arctan\sqrt{x}\,dx$, let $x = t^2$ first, then use parts. The result is $(x+1)\arctan\sqrt{x} - \sqrt{x} + C$, which you can confirm by differentiating.

## Common mistakes

1. **Answering $\frac{1}{1+x^2}$.** That is the derivative of $\arctan x$, not its integral. See the [derivative of arctan x](/derivatives/arctan-x).
2. **Mixing up arctan and the reciprocal of tan.** $\tan^{-1}x$ is the inverse function. $\frac{1}{\tan x} = \cot x$ is a different function; see the [integral of cot x](/integrals/cot-x).
3. **Losing the factor $\frac{1}{2}$.** In $\int\frac{x}{1+x^2}\,dx$, the substitution gives $\frac{1}{2}\ln(1+x^2)$, not $\ln(1+x^2)$.
4. **Swapping the roles.** Picking $u = 1$ and $dv = \arctan x\,dx$ needs the integral you are trying to find. Always differentiate the inverse trig function.

To get arctan as an answer rather than integrate it, see the [integral of 1/(1+x²)](/integrals/1-over-1-plus-x-squared). The same parts trick is shown on the [integral of ln x](/integrals/ln-x) page, and the [integration by parts guide](/blog/integration-by-parts) has more practice.

## Frequently asked questions

### What is the integral of arctan x?

It is $x\arctan x - \frac{1}{2}\ln(1+x^2) + C$.

### What is the integral of tan⁻¹ x?

$\tan^{-1} x$ means $\arctan x$, so the integral is the same: $x\tan^{-1} x - \frac{1}{2}\ln(1+x^2) + C$. It is not $\int\frac{1}{\tan x}\,dx$, which equals $\ln\lvert\sin x\rvert + C$.

### What is the integral of arctan(2x)?

It is $x\arctan(2x) - \frac{1}{4}\ln(1+4x^2) + C$. Substitute $u = 2x$ and use the basic formula, or do parts directly.

### What is the integral of x arctan x?

It is $\frac{1}{2}(x^2+1)\arctan x - \frac{x}{2} + C$, by parts with $u = \arctan x$ and $dv = x\,dx$.
