A Product of a Polynomial and an Inverse Function
The integrand \(x\arctan x\) multiplies a simple polynomial by a function that is easy to differentiate but not easy to integrate. Integration by parts is the natural tool. The inverse tangent has the algebraic derivative \(\frac{1}{1+x^2}\), so assigning it the role of \(u\) removes the transcendental function from the problem. The factor \(x\,dx\) is assigned to \(dv\) because it integrates immediately to \(\frac{x^2}{2}\).
This is one of the first examples where the leftover integral is itself a rational function that needs a small algebraic step before it can be integrated. That step, dividing the numerator by the denominator, will recur throughout the course.
Deriving the Antiderivative
Let \(u=\arctan x\) and \(dv=x\,dx\). Then \(du=\frac{dx}{1+x^2}\) and \(v=\frac{x^2}{2}\). Integration by parts gives
The numerator and denominator of the remaining fraction have the same degree, so rewrite \(x^2=(1+x^2)-1\). Then \(\frac{x^2}{1+x^2}=1-\frac{1}{1+x^2}\), and
Substitute this back, keeping the factor \(\frac12\):
The two arctangent terms combine because both have the same argument, which leaves the compact form \(\frac{x^2+1}{2}\arctan x\).
Checking by Differentiation
The product rule gives \(\frac{d}{dx}\Bigl[\frac{x^2+1}{2}\arctan x\Bigr]=x\arctan x+\frac{x^2+1}{2}\cdot\frac{1}{1+x^2}=x\arctan x+\frac12\). Subtracting the derivative of \(\frac x2\), which is \(\frac12\), leaves \(x\arctan x\). The constants \(\frac12\) cancel exactly, and the nice cancellation of \(1+x^2\) against the factor \(x^2+1\) is a useful signal that the combined form is correct.
Worked Examples
Worked Example: A Definite Integral from 0 to 1
Evaluate \(\int_0^1x\arctan x\,dx\).
With \(F(x)=\frac{x^2+1}{2}\arctan x-\frac x2\), we get \(F(1)=\arctan1-\frac12=\frac\pi4-\frac12\) and \(F(0)=0\). Hence
The integrand rises from \(0\) to \(\frac\pi4\) and is convex near the origin, so an area of about \(0.285\) is reasonable compared with the triangle estimate \(\frac12\cdot\frac\pi4\approx0.393\).
Worked Example: An Upper Limit of √3
Evaluate \(\int_0^{\sqrt3}x\arctan x\,dx\).
At \(x=\sqrt3\), \(\frac{x^2+1}{2}=2\) and \(\arctan\sqrt3=\frac\pi3\), so \(F(\sqrt3)=\frac{2\pi}{3}-\frac{\sqrt3}{2}\). Since \(F(0)=0\),
Exact special values of the arctangent make the endpoint evaluation clean, which is why \(\sqrt3\) and \(1\) are such common upper limits.
Worked Example: Symmetric Limits
Evaluate \(\int_{-1}^{1}x\arctan x\,dx\).
Both \(x\) and \(\arctan x\) are odd, so their product is even. The integral over \([-1,1]\) is twice the integral over \([0,1]\):
Unlike the plain arctangent, this integrand does not cancel on a symmetric interval. Recognizing the even symmetry halves the work and avoids sign slips at the negative endpoint.
Worked Example: Upper Limit 1/√3
Evaluate \(\int_0^{1/\sqrt3}x\arctan x\,dx\).
At \(x=\frac{1}{\sqrt3}\), \(x^2=\frac13\), so \(\frac{x^2+1}{2}=\frac23\), and \(\arctan\frac1{\sqrt3}=\frac\pi6\). Thus
The small value makes sense: on this short interval the integrand is no larger than \(\frac{1}{\sqrt3}\cdot\frac\pi6\approx0.30\), and it starts at zero.
A Reliable Procedure
Take \(u=\arctan x\) and \(dv=x\,dx\), so \(du=\frac{dx}{1+x^2}\) and \(v=\frac{x^2}{2}\).
Write \(\frac{x^2}{2}\arctan x-\frac12\int\frac{x^2}{1+x^2}\,dx\).
Rewrite \(\frac{x^2}{1+x^2}=1-\frac{1}{1+x^2}\).
Obtain \(x-\arctan x\) and merge the two arctangent terms.
Differentiate; the \(\frac12\) from the product rule must cancel the \(-\frac12\) from \(-\frac x2\).
Common Mistakes
A frequent error is to integrate \(\frac{x^2}{1+x^2}\) as if it were \(\frac{1}{1+x^2}\), producing a lone arctangent. The numerator \(x^2\) must first be split. A second error is to forget the factor \(\frac12\) that comes from \(v=\frac{x^2}{2}\), which makes the final linear term \(-x\) instead of \(-\frac x2\).
Students also sometimes choose \(u=x\) and \(dv=\arctan x\,dx\). That would require the antiderivative of \(\arctan x\) already, and it leads to an integral that is no simpler. The rule of thumb is to give the inverse function the role of \(u\).
Quick Reference
| Integrand | Antiderivative |
|---|---|
| \(\arctan x\) | \(x\arctan x-\frac12\ln(1+x^2)\) |
| \(x\arctan x\) | \(\frac{x^2+1}{2}\arctan x-\frac x2\) |
| \(\frac{x^2}{1+x^2}\) | \(x-\arctan x\) |
| \(\frac{x}{1+x^2}\) | \(\frac12\ln(1+x^2)\) |
Interpreting the Result
For large \(x\), \(\arctan x\to\frac\pi2\), so \(x\arctan x\) behaves like \(\frac\pi2x\) and its integral grows like \(\frac\pi4x^2\). The antiderivative \(\frac{x^2+1}{2}\arctan x\) has leading behavior \(\frac{\pi}{4}x^2\), matching that estimate. The correction \(-\frac x2\) reflects the fact that \(\arctan x\) falls short of \(\frac\pi2\) by approximately \(\frac1x\), and \(x\cdot\frac1x\) integrates to a term linear in \(x\).
This asymptotic check is a quick way to catch gross errors, such as a wrong power of \(x\) or a missing factor of \(\frac12\), without any differentiation.
Practice Problems with Answers
Try each problem before reading the answer. Every answer below was checked by differentiation or by numerical integration.
- Evaluate \(\int_0^1x\arctan x\,dx\). Hint: use \(F(x)=\frac{x^2+1}{2}\arctan x-\frac x2\). Answer: \(\frac\pi4-\frac12\)
- Find an antiderivative of \(2x\arctan x\). Hint: double the result. Answer: \((x^2+1)\arctan x-x\)
- Evaluate \(\int_0^{\sqrt3}x\arctan x\,dx\). Hint: \(\frac{x^2+1}{2}=2\) at \(x=\sqrt3\). Answer: \(\frac{2\pi}{3}-\frac{\sqrt3}{2}\)
- Evaluate \(\int_{-1}^1x\arctan x\,dx\). Hint: the integrand is even. Answer: \(\frac\pi2-1\)
A Cleverer Choice of the Antiderivative of x
When integrating \(dv=x\,dx\), any antiderivative may be used, so we are free to take \(v=\frac{x^2+1}{2}\) instead of \(\frac{x^2}{2}\). This differs from the earlier choice by the constant \(\frac12\), which is allowed. With this \(v\), the parts formula gives \(\frac{x^2+1}{2}\arctan x-\int\frac{x^2+1}{2}\cdot\frac{1}{1+x^2}\,dx=\frac{x^2+1}{2}\arctan x-\int\frac12\,dx\). The denominator cancels completely, so no division step is needed, and the answer \(\frac{x^2+1}{2}\arctan x-\frac x2\) appears at once.
This trick is worth knowing: whenever the derivative of the inverse function has a denominator such as \(1+x^2\) or \(1-x^2\), adjusting the constant in \(v\) can make that denominator cancel. It works because \(\frac{d}{dx}\frac{x^2+1}{2}=x\) just as \(\frac{d}{dx}\frac{x^2}{2}=x\).
Extending the Pattern
The same technique handles \(x^3\arctan x\) and other odd powers. For \(\int x^3\arctan x\,dx\), take \(v=\frac{x^4-1}{4}\) so that \(v\) contains the factor \(x^2+1\), and the leftover integrand reduces to a polynomial. Even powers such as \(x^2\arctan x\) lead instead to a logarithm, because after division the remainder is a multiple of \(\frac{x}{1+x^2}\). Seeing which case applies before starting saves time and tells you what type of answer to expect.
A Numerical Spot Check
A single numerical evaluation can confirm the formula before the answer is used. At \(x=1\), the antiderivative equals \(\arctan1-\frac12=0.285\), which agrees with a rough trapezoid estimate of \(\int_0^1x\arctan x\,dx\) using the three points \(0\), \(\frac12\arctan\frac12\approx0.232\), and \(\arctan1\approx0.785\). The trapezoid rule with step \(\frac12\) gives \(\frac12\cdot\bigl(\frac{0+0.232}{2}+\frac{0.232+0.785}{2}\bigr)=0.312\), slightly above the exact value because the curve is convex. Agreement to within about ten percent is exactly what a coarse estimate should achieve.
Where This Fits in the Course
This tutorial belongs to the module “Integration by Parts I”. The tutorial just before it is “Integrating The Inverse Tangent Of An Affine Argument,” and the one that follows is “Integrating x Squared Times The Inverse Tangent.” The rational-reduction step here is the same algebra that drives partial fractions later in the course.
Check Your Understanding
Use the derivation and examples above to answer these questions.
- Why is \(\arctan x\) chosen as \(u\) rather than \(x\)?
- Rewrite \(\frac{x^2}{1+x^2}\) as a polynomial plus a proper fraction.
- Evaluate \(\int_0^1x\arctan x\,dx\).
- Why is \(x\arctan x\) an even function, and how does this help on \([-2,2]\)?
- Differentiate \(\frac{x^2+1}{2}\arctan x-\frac x2\) and confirm that the result is \(x\arctan x\).