Reflect the variable

Replace x by a + b − x in a definite integral, then add the two forms. It turns some impossible-looking integrals into one line.

Level: STEP 2. Uses A-level Mathematics only.

The idea

Some definite integrals cannot be done by any standard method, yet have a simple answer. Often the reason is symmetry: the integral is unchanged when you run the interval backwards. The tool that exposes this is the substitution that reflects the variable in the middle of the interval:

∫abf(x) dx=∫abf(a+b−x) dx.\int_a^b f(x)\,dx=\int_a^b f(a+b-x)\,dx .

On the interval from 0 to aa, this is the substitution of a−xa-x for xx.

Why it is true

Put u=a+b−xu=a+b-x. Then du=−dxdu=-dx, and when xx runs from aa to bb, uu runs from bb back to aa. So

∫abf(a+b−x) dx=∫baf(u) (−du)=∫abf(u) du.\begin{aligned}\int_a^b f(a+b-x)\,dx&=\int_b^a f(u)\,(-du)\\&=\int_a^b f(u)\,du .\end{aligned}

The minus sign from dudu and the swapped limits cancel. Geometrically, the graph of f(a+b−x)f(a+b-x) is the graph of ff reflected in the line through the middle of the interval, and reflecting a region does not change its area.

On its own this tells you nothing new. Its power comes from the next step: you now have two expressions for the same integral, and adding them may give something much simpler than either.

Example 1: a fraction of sines and cosines

Find

I=∫0π/2sin⁡xsin⁡x+cos⁡x dx.I=\int_0^{\pi/2}\frac{\sin x}{\sin x+\cos x}\,dx .

Reflecting in the middle of the interval replaces xx by π2−x\tfrac{\pi}{2}-x, which swaps sine and cosine:

I=∫0π/2cos⁡xcos⁡x+sin⁡x dx.I=\int_0^{\pi/2}\frac{\cos x}{\cos x+\sin x}\,dx .

Now add the two forms. The numerators add to the denominator:

2I=∫0π/2sin⁡x+cos⁡xsin⁡x+cos⁡x dx=∫0π/21 dx=π2,soI=π4.\begin{aligned}2I&=\int_0^{\pi/2}\frac{\sin x+\cos x}{\sin x+\cos x}\,dx\\&=\int_0^{\pi/2}1\,dx\\&=\frac{\pi}{2},\\[6pt]\text{so}\quad I&=\frac{\pi}{4}.\end{aligned}

Notice what happened. We never found an antiderivative. We found a second integral that, added to the first, was trivial.

Example 2: getting rid of a stray x

Find

I=∫0πxsin⁡x1+cos⁡2x dx.I=\int_0^{\pi}\frac{x\sin x}{1+\cos^2 x}\,dx .

The factor xx is the problem: without it, the substitution u=cos⁡xu=\cos x would finish the job. Reflecting replaces xx by π−x\pi-x. Since sin⁡(π−x)=sin⁡x\sin(\pi-x)=\sin x and cos⁡2(π−x)=cos⁡2x\cos^2(\pi-x)=\cos^2 x, only the stray factor changes:

I=∫0π(π−x)sin⁡x1+cos⁡2x dx.I=\int_0^{\pi}\frac{(\pi-x)\sin x}{1+\cos^2 x}\,dx .

Adding the two forms removes xx completely:

2I=π∫0πsin⁡x1+cos⁡2x dx.2I=\pi\int_0^{\pi}\frac{\sin x}{1+\cos^2 x}\,dx .

With u=cos⁡xu=\cos x, so that du=−sin⁡x dxdu=-\sin x\,dx and uu runs from 1 to −1,

∫0πsin⁡x1+cos⁡2x dx=∫−11du1+u2=[arctan⁡u]−11=π2.\begin{aligned}\int_0^{\pi}\frac{\sin x}{1+\cos^2 x}\,dx&=\int_{-1}^{1}\frac{du}{1+u^2}\\&=\Bigl[\arctan u\Bigr]_{-1}^{1}\\&=\frac{\pi}{2}.\end{aligned}

So 2I=π2/22I=\pi^2/2, and

I=π24.I=\frac{\pi^2}{4}.

When to reach for it

  • The limits are "nice" (such as 0 to π/2\pi/2, 0 to π\pi, or 0 to 1) and the integrand changes into something related under x↦a+b−xx\mapsto a+b-x.
  • There is a factor of xx multiplying a function that is symmetric about the middle of the interval, as in Example 2.
  • The question says "by considering ∫f(a−x) dx\int f(a-x)\,dx" or "show that I=JI=J". STEP often gives you the reflection and expects you to add.

A useful habit: whenever you meet a definite integral that resists every method, write down the reflected version and look at the sum and the difference of the two.

Try this

Use the substitution x=tan⁡θx=\tan\theta, and then reflect the variable, to show that

∫01ln⁡(1+x)1+x2 dx=π8ln⁡2.\int_0^1\frac{\ln(1+x)}{1+x^2}\,dx=\frac{\pi}{8}\ln 2 .
Hint

After the substitution the integral is ∫0π/4ln⁡(1+tan⁡θ) dθ\int_0^{\pi/4}\ln(1+\tan\theta)\,d\theta. Use the formula for tan⁡(A−B)\tan(A-B) to simplify 1+tan⁡(π4−θ)1+\tan(\tfrac{\pi}{4}-\theta).

Solution

With x=tan⁡θx=\tan\theta, dx=sec⁡2θ dθdx=\sec^2\theta\,d\theta and 1+x2=sec⁡2θ1+x^2=\sec^2\theta, so the integral becomes

I=∫0π/4ln⁡(1+tan⁡θ) dθ.I=\int_0^{\pi/4}\ln(1+\tan\theta)\,d\theta .

Reflect: replace θ\theta by π4−θ\tfrac{\pi}{4}-\theta. Since

1+tan⁡(π4−θ)=1+1−tan⁡θ1+tan⁡θ=21+tan⁡θ,\begin{aligned}1+\tan\Bigl(\frac{\pi}{4}-\theta\Bigr)&=1+\frac{1-\tan\theta}{1+\tan\theta}\\&=\frac{2}{1+\tan\theta},\end{aligned}

we get

I=∫0π/4(ln⁡2−ln⁡(1+tan⁡θ)) dθ=π4ln⁡2−I.\begin{aligned}I&=\int_0^{\pi/4}\Bigl(\ln 2-\ln(1+\tan\theta)\Bigr)\,d\theta\\&=\frac{\pi}{4}\ln 2-I .\end{aligned}

So 2I=π4ln⁡22I=\frac{\pi}{4}\ln 2, which gives the result.

Want more like this? STEP Module 1: Structure and symmetry teaches ideas of this kind in depth, with exercises and a full STEP question. The STEP Starter Pack has all four modules and three practice papers. Or start free with the STEP sample question.