Tutorials › Calculus II › Definite Integrals of Inverse-Tangent Forms

Completing the Square Techniques · Tutorial 256 of 998

Definite Integrals of Inverse-Tangent Forms

Use a general inverse-tangent formula to evaluate definite integrals of reciprocal irreducible quadratics, with careful attention to endpoint transformations and signs.

Intermediate 9 min read

What You'll Learn

  • Identify when a quadratic is irreducible over the real numbers.
  • Derive the inverse-tangent antiderivative using a completed square.
  • Evaluate definite integrals by transforming both endpoints correctly.
  • Keep track of the scale factor determined by the quadratic coefficients.
  • Check the result by differentiating the antiderivative and examining its sign.

From an Antiderivative to a Definite Integral

A reciprocal quadratic can have an antiderivative involving the inverse tangent when its denominator has no real roots. For a definite integral, finding that antiderivative is only part of the work: the original limits must be substituted carefully, including in the transformed argument of the inverse tangent. A missed scale factor or a sign error at one endpoint changes the value of the integral.

This tutorial develops a formula for a general irreducible quadratic and applies it to definite integrals. The main points are to identify the conditions under which the formula applies, preserve the sign of the denominator, and evaluate the transformed expression at both original endpoints.

Definition: A quadratic \(q(x)=ax^2+bx+c\), with \(a\ne 0\), is irreducible over the real numbers if it has no real roots. Equivalently, its discriminant satisfies \(b^2-4ac<0\).

For such a quadratic, \(4ac-b^2>0\). Define \(D=\sqrt{4ac-b^2}\), taking the positive square root. Since the quadratic has no real zeros, its reciprocal is continuous on every finite interval, so the definite integral exists.

The Formula and Its Conditions

For \(a\ne0\) and \(b^2-4ac<0\), an antiderivative of \(1/(ax^2+bx+c)\) is

$$ F(x)=\frac{2}{D}\arctan\!\left(\frac{2ax+b}{D}\right), \qquad D=\sqrt{4ac-b^2}. $$

The coefficient \(2/D\) is positive, even if \(a\) is negative. The sign of the integrand is accounted for by the argument \(2ax+b\), whose slope is \(2a\). This distinction matters: changing or discarding that slope can give an incorrect sign.

The inverse tangent here is the principal inverse tangent, whose values lie between \(-\pi/2\) and \(\pi/2\). For finite real endpoints \(r\) and \(s\), the definite-integral formula is

$$ \int_r^s \frac{dx}{ax^2+bx+c} = \frac{2}{D} \left[ \arctan\!\left(\frac{2as+b}{D}\right) - \arctan\!\left(\frac{2ar+b}{D}\right) \right]. $$

Both endpoint values must be computed from the same transformed expression. In particular, the transformed endpoint is \((2ax+b)/D\), not just \(x\), and the lower-endpoint value is subtracted from the upper-endpoint value.

Why the Formula Works

Complete the square in the denominator. Because \(a\ne0\),

$$ ax^2+bx+c = \frac{(2ax+b)^2+D^2}{4a}. $$

Indeed, expanding the numerator gives \(4a^2x^2+4abx+b^2+4ac-b^2=4a(ax^2+bx+c)\). Now set \(u=(2ax+b)/D\). Differentiating gives \(du/dx=2a/D\), while the completed-square identity gives \(1+(2ax+b)^2/D^2=4a(ax^2+bx+c)/D^2\). Therefore

$$ \begin{aligned} \frac{d}{dx}\left[ \frac{2}{D}\arctan\!\left(\frac{2ax+b}{D}\right) \right] &= \frac{2}{D}\, \frac{2a/D}{1+(2ax+b)^2/D^2}\\ &= \frac{4a/D^2}{4a(ax^2+bx+c)/D^2}\\ &= \frac{1}{ax^2+bx+c}. \end{aligned} $$

This derivative calculation proves the antiderivative formula. The denominator in the inverse-tangent derivative is positive, and the cancellation is valid because \(a\ne0\). Applying the Fundamental Theorem of Calculus then gives the definite-integral formula by evaluating \(F(s)-F(r)\). The transformed expression varies continuously between the endpoint values, so there is no need to adjust the principal inverse tangent by adding or subtracting a multiple of \(\pi\).

Worked Examples

Worked Example: A Shifted Quadratic on a Finite Interval

Evaluate \(\int_0^1 \frac{dx}{x^2+2x+5}\).

Here \(a=1\), \(b=2\), and \(c=5\). The discriminant is \(b^2-4ac=4-20=-16<0\), so the denominator is irreducible. Calculate the scale parameter:

$$D=\sqrt{4ac-b^2}=\sqrt{20-4}=4.$$

The transformed endpoint is \((2ax+b)/D=(2x+2)/4=(x+1)/2\), and the outside factor is \(2/D=1/2\). At \(x=1\), the transformed value is \(1\); at \(x=0\), it is \(1/2\). Thus

$$\int_0^1 \frac{dx}{x^2+2x+5}=\frac12\left(\arctan(1)-\arctan\!\left(\frac12\right)\right).$$

Since \(\arctan(1)=\pi/4\), this can also be written as \(\pi/8-\frac12\arctan(1/2)\). To check the antiderivative, differentiate \(F(x)=\frac12\arctan((x+1)/2)\):

$$F'(x)=\frac12\cdot\frac{1/2}{1+((x+1)/2)^2}=\frac{1}{(x+1)^2+4}=\frac{1}{x^2+2x+5}.$$

The derivative matches the integrand, and the endpoint substitution uses the original lower and upper limits in the correct order.

Worked Example: A Quadratic with a Nonunit Leading Coefficient

Evaluate \(\int_{-1}^{2}\frac{dx}{2x^2-4x+5}\).

For this denominator, \(a=2\), \(b=-4\), and \(c=5\). Its discriminant is \(b^2-4ac=16-40=-24<0\). Hence

$$D=\sqrt{4ac-b^2}=\sqrt{40-16}=2\sqrt6,\qquad \frac{2}{D}=\frac{1}{\sqrt6}.$$

The transformed argument is \((4x-4)/(2\sqrt6)=(2x-2)/\sqrt6\). At the upper endpoint \(x=2\), it equals \(2/\sqrt6=\sqrt6/3\). At the lower endpoint \(x=-1\), it equals \(-4/\sqrt6=-2\sqrt6/3\). Therefore

$$\int_{-1}^{2}\frac{dx}{2x^2-4x+5}=\frac{1}{\sqrt6}\left[\arctan\!\left(\frac{\sqrt6}{3}\right)-\arctan\!\left(-\frac{2\sqrt6}{3}\right)\right].$$

Using the oddness of the principal inverse tangent, the bracket is the sum \(\arctan(\sqrt6/3)+\arctan(2\sqrt6/3)\). To check, differentiate \(F(x)=\frac1{\sqrt6}\arctan((2x-2)/\sqrt6)\):

$$F'(x)=\frac{1}{\sqrt6}\cdot\frac{2/\sqrt6}{1+(2x-2)^2/6}=\frac{1/3}{1+(2x-2)^2/6}=\frac{2}{(2x-2)^2+6}=\frac{1}{2x^2-4x+5}.$$

The final equality follows because \((2x-2)^2+6=4x^2-8x+10=2(2x^2-4x+5)\). This check confirms both the outside factor and the transformed argument.

Worked Example: A Negative Quadratic

Evaluate \(\int_0^1\frac{dx}{-x^2+2x-2}\).

Here \(a=-1\), \(b=2\), and \(c=-2\). The discriminant is \(b^2-4ac=4-8=-4<0\), and \(D=\sqrt{4ac-b^2}=\sqrt{8-4}=2\). The transformed argument is \((-2x+2)/2=1-x\), and \(2/D=1\). The endpoint values are \(1\) at \(x=0\) and \(0\) at \(x=1\), so

$$\int_0^1\frac{dx}{-x^2+2x-2}=\arctan(0)-\arctan(1)=-\frac{\pi}{4}.$$

The negative answer is consistent with the integrand: \(-x^2+2x-2=-((x-1)^2+1)\), which is negative for every real \(x\). For a derivative check, \(F(x)=\arctan(1-x)\) gives

$$F'(x)=\frac{-1}{1+(1-x)^2}=\frac{1}{-((x-1)^2+1)}=\frac{1}{-x^2+2x-2}.$$

Thus the antiderivative and the sign of the definite integral agree.

Endpoint Tracking and Common Errors

In each example, the original endpoint is substituted into the complete transformed argument before the inverse tangent is evaluated. A useful way to organize the work is to write down the coefficients, compute \(D\), identify the transformed argument and outside factor, and then evaluate that argument at both endpoints. This keeps the scale and endpoint calculations separate.

1
Check irreducibility.
Verify that \(a\ne0\) and \(b^2-4ac<0\). Only then is \(D=\sqrt{4ac-b^2}\) a positive real number and the stated formula applicable.
2
Compute the scale.
Use \(D=\sqrt{4ac-b^2}\) and retain the factor \(2/D\) outside the inverse tangent.
3
Transform both limits.
Evaluate \((2ax+b)/D\) separately at the upper and lower endpoints, keeping any negative values.
4
Subtract in the correct order.
Use the value at the upper endpoint minus the value at the lower endpoint.

A common mistake is to replace a negative transformed endpoint by its absolute value. In the second example, doing that would incorrectly use \(\arctan(2\sqrt6/3)\) at the lower endpoint. It would produce \(\frac1{\sqrt6}[\arctan(\sqrt6/3)-\arctan(2\sqrt6/3)]\), rather than the correct \(\frac1{\sqrt6}[\arctan(\sqrt6/3)+\arctan(2\sqrt6/3)]\). The correction is to substitute \(x=-1\) into \((2x-2)/\sqrt6\) exactly: the result is \(-2\sqrt6/3\), and \(\arctan(-z)=-\arctan(z)\).

Another potential error is assuming that the answer must be positive because \(2/D>0\). The third example shows why that conclusion is false: when \(a<0\), the denominator can be negative throughout the interval. The endpoint difference then correctly gives a negative integral. A sign check on the integrand is a quick way to detect an inconsistent result.

Why Definite Integrals Need Careful Substitution

The inverse-tangent formula makes these definite integrals explicit, but the endpoint work is part of the mathematics, not just bookkeeping. The quadratic coefficients determine both the scale and the transformed coordinate. Losing either one can produce a plausible-looking expression that does not differentiate to the original integrand or has the wrong sign.

For a finite interval, the negative-discriminant condition guarantees that the denominator never vanishes. This means the integrand is continuous throughout the interval and the Fundamental Theorem of Calculus applies directly. The derivative check is a reliable final test: if the proposed antiderivative differentiates to the reciprocal quadratic, then evaluating it at the original endpoints gives the required definite integral.

Takeaway: For \(ax^2+bx+c\) with \(a\ne0\) and \(b^2-4ac<0\), use \(D=\sqrt{4ac-b^2}\), retain the factor \(2/D\), and substitute both original endpoints into \((2ax+b)/D\) before taking their inverse-tangent difference.

Check Your Understanding

Work through these questions using the endpoint and sign checks from the examples.

  1. For \(3x^2+6x+8\), calculate \(D\) and the transformed argument \((2ax+b)/D\).
  2. State the conditions on \(a,b,c\) that allow the inverse-tangent formula to be used.
  3. For \(\int_0^2 dx/(x^2+1)\), identify the transformed values at the two endpoints and write the exact definite-integral value.
  4. Why must a negative transformed endpoint remain negative when it is substituted into the principal inverse tangent?
  5. Explain how checking the sign of the integrand can help detect an error in the evaluated definite integral.

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