Tutorials › Calculus II › Integrating x Times The Inverse Tangent

Integration by Parts I · Tutorial 43 of 998

Integrating x Times The Inverse Tangent

Choose arctan x as u and x dx as dv, then split the leftover fraction x²/(1+x²) into a polynomial piece and an arctangent piece.

Intermediate 10 min read

What You'll Learn

  • Select u = arctan x and dv = x dx for the product x arctan x.
  • Reduce x²/(1+x²) to 1 − 1/(1+x²) before integrating.
  • Assemble the antiderivative ((x²+1)/2) arctan x − x/2 + C.
  • Evaluate definite integrals, using evenness for symmetric limits.
  • Check the result by differentiation.

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.

Result: \(\displaystyle\int x\arctan x\,dx=\frac{x^2+1}{2}\arctan x-\frac x2+C.\)

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

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

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

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

Substitute this back, keeping the factor \(\frac12\):

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

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

$$ \int_0^1x\arctan x\,dx=\frac\pi4-\frac12\approx0.285. $$

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\),

$$ \int_0^{\sqrt3}x\arctan x\,dx=\frac{2\pi}{3}-\frac{\sqrt3}{2}\approx2.094-0.866=1.228. $$

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]\):

$$ \int_{-1}^{1}x\arctan x\,dx=2\Bigl(\frac\pi4-\frac12\Bigr)=\frac\pi2-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

$$ \int_0^{1/\sqrt3}x\arctan x\,dx=\frac23\cdot\frac\pi6-\frac{1}{2\sqrt3}=\frac\pi9-\frac{\sqrt3}{6}\approx0.0606. $$

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

1
Choose the parts.
Take \(u=\arctan x\) and \(dv=x\,dx\), so \(du=\frac{dx}{1+x^2}\) and \(v=\frac{x^2}{2}\).
2
Form the new integral.
Write \(\frac{x^2}{2}\arctan x-\frac12\int\frac{x^2}{1+x^2}\,dx\).
3
Reduce the fraction.
Rewrite \(\frac{x^2}{1+x^2}=1-\frac{1}{1+x^2}\).
4
Integrate and combine.
Obtain \(x-\arctan x\) and merge the two arctangent terms.
5
Check.
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

IntegrandAntiderivative
\(\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.

  1. Evaluate \(\int_0^1x\arctan x\,dx\). Hint: use \(F(x)=\frac{x^2+1}{2}\arctan x-\frac x2\). Answer: \(\frac\pi4-\frac12\)
  2. Find an antiderivative of \(2x\arctan x\). Hint: double the result. Answer: \((x^2+1)\arctan x-x\)
  3. 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}\)
  4. Evaluate \(\int_{-1}^1x\arctan x\,dx\). Hint: the integrand is even. Answer: \(\frac\pi2-1\)
Takeaway: For \(x\arctan x\), put the arctangent in \(u\), integrate \(x\,dx\), and reduce \(\frac{x^2}{1+x^2}\) to \(1-\frac{1}{1+x^2}\). The answer \(\frac{x^2+1}{2}\arctan x-\frac x2\) is worth remembering.

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.

  1. Why is \(\arctan x\) chosen as \(u\) rather than \(x\)?
  2. Rewrite \(\frac{x^2}{1+x^2}\) as a polynomial plus a proper fraction.
  3. Evaluate \(\int_0^1x\arctan x\,dx\).
  4. Why is \(x\arctan x\) an even function, and how does this help on \([-2,2]\)?
  5. Differentiate \(\frac{x^2+1}{2}\arctan x-\frac x2\) and confirm that the result is \(x\arctan x\).

Test yourself: Calculus II final exam practice

Ready to check what you know? Work a full-length practice final, then open the complete worked solutions.

Want all 1,114 practice problems?

This tutorial covers one topic. Calc Pass covers the full Calculus AB & BC curriculum (the core of Calculus I and II): full review, every practice question, and step-by-step solutions to each one.

QR code to download the Calc Pass app

Get the Calc Pass App

Scan to download and practice on the go, with instant scoring.

Calc Pass Volume 1: 1,114 Practice Questions book cover

Vol. 1: 1,114 Questions

The complete practice question bank, organized by AB & BC topic.

View on Amazon
Calc Pass Volume 2: Solutions Manual book cover

Vol. 2: Solutions Manual

Fully worked solutions to every question in Volume 1.

View on Amazon