Why the endpoints matter
Integration by parts is often introduced as a way to find an antiderivative. For a definite integral, the same method has an additional feature: it keeps track of the contributions from both endpoints. That is especially useful when the integrand contains the inverse tangent, since differentiating the inverse tangent produces a simple rational function.
In this tutorial, \(\arctan x\) denotes the principal inverse tangent, whose values lie between \(-\pi/2\) and \(\pi/2\). We will evaluate definite integrals of \(\arctan x\) and \(x\arctan x\) over finite real intervals. The goal is not only to obtain an answer, but to show where each endpoint term comes from and how to check the result.
Integration by parts for a definite integral
If \(u\) and \(v\) are differentiable functions on a finite interval \([a,b]\), the product rule gives \((uv)'=u'v+uv'\). Integrating this identity from \(a\) to \(b\), and rearranging, gives the definite integration-by-parts formula:
Here \(\bigl[u(x)v(x)\bigr]_a^b\) means \(u(b)v(b)-u(a)v(a)\). The formula applies when the functions and derivatives involved are continuous on the interval, as they are for the functions used below. This bracket notation is important: a definite integral requires evaluating the endpoint expression at the upper limit and subtracting its value at the lower limit.
Deriving a formula for the inverse-tangent integral
To integrate \(\arctan x\), choose \(u=\arctan x\) and \(v'=1\). Then \(u'=1/(1+x^2)\) and \(v=x\). Substitution into integration by parts gives the definite formula below for any finite real endpoints \(a\) and \(b\):
The remaining integral can be evaluated using the derivative of \(\ln(1+x^2)\). The chain rule gives \(\frac{d}{dx}\ln(1+x^2)=\frac{2x}{1+x^2}\), so the factor of \(2\) must be accounted for:
Combining these expressions yields the endpoint formula. It gives an exact value whenever the endpoint values of \(\arctan\) and the logarithms can be stated exactly.
This formula can also be checked directly. Differentiating its bracketed expression gives
Thus the expression is an antiderivative, and the Fundamental Theorem of Calculus gives the stated definite-integral formula.
Worked Example: Integrating arctan x from 0 to 1
Evaluate \(\displaystyle \int_0^1 \arctan x\,dx\). Use the endpoint formula and substitute both limits:
The lower endpoint is zero because \(\arctan 0=0\) and \(\ln 1=0\). To check, differentiate \(x\arctan x-\frac12\ln(1+x^2)\); the two rational terms cancel, leaving \(\arctan x\), the original integrand.
Integrating x times the inverse tangent
For the product \(x\arctan x\), use \(u=\arctan x\) and \(v'=x\). Then \(u'=1/(1+x^2)\) and \(v=x^2/2\). Applying definite integration by parts gives
The remaining fraction can be simplified by writing its numerator as \(x^2=(1+x^2)-1\). This produces an expression whose two terms have straightforward antiderivatives:
Substituting this result into the definite formula gives an endpoint expression for the full integral:
To verify this formula, let \(G(x)=\frac{x^2+1}{2}\arctan x-\frac{x}{2}\). The product rule and the derivative of \(\arctan x\) give
This check confirms that the endpoint expression differentiates to the required integrand.
Worked Example: Integrating x arctan x from 0 to 1
Evaluate \(\displaystyle \int_0^1 x\arctan x\,dx\). Substituting the endpoints into \(G(x)\) gives
As a check, the derivative of the expression in brackets is \(x\arctan x\), as shown above. The zero endpoint contributes zero, so the upper endpoint alone gives the value in this particular example.
A second interval and exact endpoint evaluation
The same formulas work when an endpoint is not a familiar special angle. The result can still be exact: it may simply contain \(\arctan 2\), rather than a rational multiple of \(\pi\). Substituting the endpoint carefully is the main task.
Worked Example: Integrating both functions from 0 to 2
First evaluate \(\displaystyle \int_0^2 \arctan x\,dx\). At \(x=2\), the endpoint expression is \(2\arctan 2-\frac12\ln 5\); at \(x=0\), it is zero. Therefore,
Next evaluate \(\displaystyle \int_0^2 x\arctan x\,dx\). The value of \(G(2)\) is \(\frac{4+1}{2}\arctan 2-\frac22=\frac52\arctan 2-1\), while \(G(0)=0\). Hence
Both values are exact. For a derivative check, differentiating the first bracketed expression gives \(\arctan x\), and differentiating the second gives \(x\arctan x\). Thus each endpoint evaluation corresponds to the intended integrand.
Using symmetry without losing the endpoints
The inverse tangent is an odd function: \(\arctan(-x)=-\arctan x\). Since \(x\) is also odd, their product \(x\arctan x\) is even. These properties can help with symmetric intervals, but the endpoint formulas still provide a direct check.
Worked Example: Evaluating the integrals from -1 to 1
For \(\arctan x\), evaluate the endpoint expression at \(1\) and at \(-1\):
This agrees with odd symmetry: contributions at opposite points cancel. For the product, use \(G(x)=\frac{x^2+1}{2}\arctan x-\frac{x}{2}\):
The lower endpoint has been subtracted, including its negative value. As a check, \(G'(x)=x\arctan x\), and the answer is twice the value from 0 to 1 because the integrand is even: \(2(\frac{\pi}{4}-\frac12)=\frac{\pi}{2}-1\).
A common factor-of-two mistake
When evaluating \(\int \frac{x}{1+x^2}\,dx\), it is easy to overlook the factor of \(2\) produced by differentiating the denominator. For instance, the incorrect calculation \(\int \frac{x}{1+x^2}\,dx=\ln(1+x^2)\) would lead to the wrong result for the first example:
This answer fails a derivative check: differentiating \(x\arctan x-\ln(1+x^2)\) gives \(\arctan x-\frac{x}{1+x^2}\), not \(\arctan x\). The correction is to include the factor of \(\frac12\), because \(\frac{d}{dx}\ln(1+x^2)=\frac{2x}{1+x^2}\). Therefore, the correct calculation is
The broader lesson is to check the derivative of a proposed antiderivative, especially when a chain rule introduces a constant factor.
Choosing and checking the method
For these two integrands, the useful choices in integration by parts are consistent: take the inverse tangent as \(u\), so that differentiating it produces \(1/(1+x^2)\), and integrate the remaining factor. For \(\arctan x\), the remaining factor is \(1\); for \(x\arctan x\), it is \(x\). The second choice leads to \(x^2/(1+x^2)\), which simplifies by splitting the numerator.
On a definite integral, write the endpoint bracket explicitly before simplifying. This makes the subtraction at the lower endpoint visible and reduces sign errors. An exact answer may involve familiar constants such as \(\pi\) and logarithms, or an unevaluated exact value such as \(\arctan 2\), depending on the endpoints. In either case, differentiate the antiderivative to check the integrand, then check the endpoint substitution separately.
Check Your Understanding
Use the endpoint formulas and show the upper- and lower-endpoint contributions in each calculation.
- Evaluate \(\displaystyle \int_0^1\arctan x\,dx\) and verify the antiderivative by differentiation.
- Evaluate \(\displaystyle \int_0^1 x\arctan x\,dx\) by definite integration by parts.
- Write the exact value of \(\displaystyle \int_0^2\arctan x\,dx\) in terms of \(\arctan 2\) and logarithms.
- Evaluate \(\displaystyle \int_{-1}^{1}\arctan x\,dx\) using the endpoint formula.
- What factor is needed in an antiderivative of \(\frac{x}{1+x^2}\), and how can differentiation check it?