AP Calculus AB and BC

Integral of x/(x^2+4): Log, Not Arctan

The integral of x over x squared plus 4 is one half times the natural log of x squared plus 4, plus C. The x in the numerator makes this a substitution giving a logarithm. Without it the answer would be an arctangent instead.

xx2+4dx=12ln(x2+4)+C\int \frac{x}{x^{2}+4}\,dx = \frac{1}{2}\ln\left(x^{2}+4\right) + C

The numerator decides the answer

u=x2+4,du=2xdx    xdxx2+4=12ln(x2+4)+Cu = x^{2}+4, \quad du = 2x\,dx \implies \int \frac{x\,dx}{x^{2}+4} = \frac{1}{2}\ln\left(x^{2}+4\right) + C

No absolute value is needed, since x2+44x^{2}+4 \ge 4 is always positive.

The pair to keep straight

With an x on top you get a logarithm; with a constant on top you get an arctangent. Checking the numerator before the denominator picks the right technique first time.

The arctangent partner

dxx2+4=12arctanx2+C\int \frac{dx}{x^{2}+4} = \frac{1}{2}\arctan\frac{x}{2} + C

Same denominator, different numerator, and a completely different family of answer. Both appear on the same exam question often enough that the contrast is worth learning as a pair.

Common mistakes

  • Answering an arctangent by pattern-matching the denominator alone.
  • Forgetting the 12\frac{1}{2} from du=2xdxdu = 2x\,dx.
  • Adding absolute value bars. Harmless but unnecessary here.

Every answer on this page is machine checked

An automated test differentiates the antiderivative above and confirms it returns the integrand. A wrong sign or a missing factor fails the build, so it cannot reach you.

Frequently asked questions

What is the integral of x/(x^2+4)?

It is 12ln(x2+4)+C\frac{1}{2}\ln\left(x^{2}+4\right) + C.

When is the answer an arctangent instead?

When the numerator is a constant. dxx2+4=12arctanx2+C\int \frac{dx}{x^{2}+4} = \frac{1}{2}\arctan\frac{x}{2} + C.