Tutorials › Calculus II › Integrating x Squared Times The Inverse Tangent

Integration by Parts I · Tutorial 44 of 998

Integrating x Squared Times The Inverse Tangent

Choose the inverse tangent as the part to differentiate, divide the resulting rational expression, and verify the antiderivative by differentiation.

Beginner 9 min read

What You'll Learn

  • Set up integration by parts for x squared times the inverse tangent.
  • Explain why differentiating the inverse tangent simplifies the integral.
  • Divide x cubed by one plus x squared and integrate the resulting terms.
  • State the domain and conditions for the resulting antiderivative.
  • Check the final formula by differentiating it.
  • Recognize and correct common sign and polynomial-division errors.

Why This Integral Needs Two Ideas

The integral \( \int x^2\arctan(x)\,dx \) combines a polynomial with an inverse-trigonometric function. Neither factor is especially difficult on its own, but their product does not have a direct elementary antiderivative rule. Integration by parts separates the factors: differentiating the inverse tangent produces a rational function, while integrating \(x^2\) is straightforward.

That separation does not finish the problem. It leaves a rational expression whose numerator has higher degree than its denominator. Polynomial division turns that expression into simpler terms that can be integrated directly. The essential sequence is therefore: choose the parts, apply the product-rule identity, divide the rational expression, and check the result.

Goal: Find an antiderivative of \(x^2\arctan(x)\) for real \(x\), and justify the algebra and conditions used along the way.

The Setup and Conditions

For differentiable functions \(u\) and \(v\), integration by parts follows from the product rule: \( (uv)'=u'v+uv' \). In integral notation, if \(du=u'\,dx\) and \(dv=v'\,dx\), then

$$ \int u\,dv=uv-\int v\,du. $$

For the target integral, choose \(u=\arctan(x)\) and \(dv=x^2\,dx\). The inverse tangent is chosen for differentiation because its derivative is the simple rational function \(1/(1+x^2)\). Integrating the polynomial factor gives \(v=x^3/3\).

Conditions: The principal inverse tangent is differentiable for every real \(x\), with derivative \(1/(1+x^2)\). The denominator \(1+x^2\) is strictly positive for every real \(x\), so the rational expression produced by integration by parts is defined on all of \(\mathbb R\). The logarithm that appears after integration has positive argument \(1+x^2\) everywhere on this domain.

Worked Example: The Main Integral

Worked Example: Evaluate \( \int x^2\arctan(x)\,dx \)

Set \(u=\arctan(x)\), so \(du=\frac{1}{1+x^2}\,dx\). Set \(dv=x^2\,dx\), so \(v=\frac{x^3}{3}\). Apply integration by parts:

$$ \begin{aligned} \int x^2\arctan(x)\,dx &=\frac{x^3}{3}\arctan(x)-\frac13\int\frac{x^3}{1+x^2}\,dx. \end{aligned} $$

The remaining rational expression requires polynomial division. Dividing \(x^3\) by \(x^2+1\), the leading term of the quotient is \(x\). Multiplying back gives \(x(x^2+1)=x^3+x\); subtracting this from \(x^3\) leaves the remainder \(-x\). Thus

$$ \frac{x^3}{x^2+1} =x+\frac{-x}{x^2+1} =x-\frac{x}{x^2+1}. $$

Integrate each term. In the second integral, use the substitution \(w=1+x^2\), so \(dw=2x\,dx\):

$$ \begin{aligned} \int\frac{x^3}{1+x^2}\,dx &=\int\left(x-\frac{x}{1+x^2}\right)\,dx\\ &=\frac{x^2}{2}-\frac12\int\frac{2x}{1+x^2}\,dx\\ &=\frac{x^2}{2}-\frac12\ln(1+x^2)+C. \end{aligned} $$

Substitute this expression into the integration-by-parts result. The constant can be written as a single arbitrary constant at the end:

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

Check the result by differentiating the nonconstant terms. The product rule and chain rule give

$$ \begin{aligned} \frac{d}{dx}\left( \frac{x^3}{3}\arctan(x)-\frac{x^2}{6} +\frac16\ln(1+x^2) \right) &=x^2\arctan(x)+\frac{x^3}{3(1+x^2)} -\frac{x}{3}+\frac{x}{3(1+x^2)}\\ &=x^2\arctan(x) +\frac{x^3+x}{3(1+x^2)}-\frac{x}{3}\\ &=x^2\arctan(x)+\frac{x}{3}-\frac{x}{3}\\ &=x^2\arctan(x). \end{aligned} $$

The rational terms cancel, so the derivative is exactly the original integrand.

Why the Method Works

The integration-by-parts formula is not an independent trick: it is the product rule rearranged and integrated. Starting with \( (uv)'=u'v+uv' \), integrate both sides with respect to \(x\). The integral of the derivative of the product is \(uv\), up to a constant. Rearranging isolates the integral of \(uv'\):

$$ \begin{aligned} \int (uv)'\,dx&=\int u'v\,dx+\int uv'\,dx,\\ uv&=\int v\,du+\int u\,dv,\\ \int u\,dv&=uv-\int v\,du. \end{aligned} $$

In this problem, the choice \(u=\arctan(x)\) transfers the derivative onto that factor, replacing it by \(1/(1+x^2)\). Meanwhile, the polynomial has an elementary antiderivative, \(x^3/3\). The product \(v\,du\) is therefore \(x^3/[3(1+x^2)]\,dx\). Division then reveals a polynomial term and a term suited to a logarithm. Both choices are important: integration by parts creates a rational integral, and division makes that integral manageable.

Key identity: The division step is the exact equality \(x^3/(1+x^2)=x-x/(1+x^2)\). Its quotient is \(x\), and its remainder is \(-x\). Integrating the remainder term produces the logarithm in the final answer.

Worked Example: A Second Route to the Same Integral

Worked Example: Use a Different Parts Choice

A different valid choice shows that integration by parts need not produce the same intermediate expression. Rewrite the integrand as \(x\bigl(x\arctan(x)\bigr)\), and set \(u=x\arctan(x)\), \(dv=x\,dx\). Then \(v=x^2/2\). By the product rule,

$$ du=\left(\arctan(x)+\frac{x}{1+x^2}\right)\,dx. $$

Apply integration by parts and name the original integral \(I\):

$$ \begin{aligned} I &=\frac{x^3}{2}\arctan(x) -\frac12\int x^2\arctan(x)\,dx -\frac12\int\frac{x^3}{1+x^2}\,dx\\ &=\frac{x^3}{2}\arctan(x)-\frac12 I -\frac12\int\frac{x^3}{1+x^2}\,dx. \end{aligned} $$

Add \(I/2\) to both sides, then multiply by \(2/3\):

$$ \begin{aligned} \frac32 I &=\frac{x^3}{2}\arctan(x)-\frac12\int\frac{x^3}{1+x^2}\,dx,\\ I &=\frac{x^3}{3}\arctan(x)-\frac13\int\frac{x^3}{1+x^2}\,dx. \end{aligned} $$

Use the division identity from the first example and integrate the two terms:

$$ \begin{aligned} I &=\frac{x^3}{3}\arctan(x) -\frac13\left(\frac{x^2}{2}-\frac12\ln(1+x^2)\right)+C\\ &=\frac{x^3}{3}\arctan(x)-\frac{x^2}{6} +\frac16\ln(1+x^2)+C. \end{aligned} $$

This agrees with the first result. Different choices can change the route, but the check is that differentiating the resulting expression returns the integrand.

Choosing the Constant

An indefinite integral represents a family of antiderivatives. Any two antiderivatives of the same function on an interval differ by a constant. The constant can be fixed if a particular value of the antiderivative is specified. The following example uses the same integrand and formula, while making that constant explicit.

Worked Example: Choose the Antiderivative That Is Zero at \(x=0\)

Write the family of antiderivatives as

$$ F(x)=\frac{x^3}{3}\arctan(x)-\frac{x^2}{6} +\frac16\ln(1+x^2)+C. $$

Impose \(F(0)=0\). Since \(\arctan(0)=0\), \(0^2=0\), and \(\ln(1+0^2)=\ln(1)=0\), substitution gives

$$ F(0)=0-0+0+C=C. $$

Therefore \(F(0)=0\) requires \(C=0\). The specified antiderivative is

$$ F(x)=\frac{x^3}{3}\arctan(x)-\frac{x^2}{6} +\frac16\ln(1+x^2). $$

Its derivative is \(x^2\arctan(x)\), as checked in the first example, and direct substitution gives \(F(0)=0\). Both the derivative condition and the specified value are satisfied.

Common Mistakes and How to Correct Them

A frequent error is to use the wrong sign for the remainder in polynomial division. For example, writing \(x^3/(1+x^2)=x+x/(1+x^2)\) is incorrect: multiplying \(x^2+1\) by \(x\) gives \(x^3+x\), so a remainder of \(+x\) would reconstruct \(x^3+2x\), not \(x^3\).

$$ x^3=x(x^2+1)-x \qquad\Longrightarrow\qquad \frac{x^3}{x^2+1}=x-\frac{x}{x^2+1}. $$

Check the identity by multiplying through by \(x^2+1\): the right-hand numerator becomes \(x(x^2+1)-x=x^3+x-x=x^3\). This quick reconstruction catches the sign error before it affects the logarithm.

A second possible error is to forget the factor \(1/3\) carried by \(v=x^3/3\). The integration-by-parts remainder is not the full rational integral; it is one third of it. Keeping the factor visible until substitution prevents losing it:

$$ -\frac13\left(\frac{x^2}{2}-\frac12\ln(1+x^2)\right) =-\frac{x^2}{6}+\frac16\ln(1+x^2). $$

Finally, the logarithm has a positive sign in the answer because the division remainder is negative and the integration-by-parts formula subtracts the rational integral. The two negative signs combine for the logarithmic term.

When the Result Applies

The displayed formula is an antiderivative on the entire real line. There are no excluded real \(x\)-values: \(1+x^2>0\), so the derivative of \(\arctan(x)\) has no singularity, and \(\ln(1+x^2)\) is defined. The constant \(C\) may be any real number. Differentiation verifies the formula at every real \(x\), not merely at selected values.

The method relies on choosing a differentiable \(u\), an integrable \(dv\), and carrying out the division exactly. It does not mean that every product involving an inverse trigonometric function becomes simple after one application of parts. Here the polynomial degree and the derivative \(1/(1+x^2)\) combine to give a rational expression with a simple quotient and a logarithmic remainder. If the division identity or the chain-rule factor is changed, the final derivative will fail to match the integrand.

Takeaway: For this integral, integration by parts reduces the product to \( \int x^3/(1+x^2)\,dx \); polynomial division gives \(x-x/(1+x^2)\). Keeping the factors and signs intact yields the verified antiderivative \( \frac{x^3}{3}\arctan(x)-\frac{x^2}{6}+\frac16\ln(1+x^2)+C \).

Check Your Understanding

Use the methods and checks in this tutorial to answer the following questions.

  1. For \( \int x^2\arctan(x)\,dx \), what are \(u\), \(dv\), \(du\), and \(v\) in the integration-by-parts setup?
  2. Divide \(x^3\) by \(x^2+1\). State the quotient and remainder, then verify them by multiplication.
  3. Why does \(\ln(1+x^2)\) have a positive coefficient in the final antiderivative?
  4. Differentiate \( \frac{x^3}{3}\arctan(x)-\frac{x^2}{6}+\frac16\ln(1+x^2) \) and show where the rational terms cancel.
  5. What value of \(C\) makes the antiderivative equal to zero at \(x=0\), and how do you verify that condition?
  6. Why is the resulting formula valid for every real \(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