On this page
The obvious direct route for 1/(1 + tan x), putting t = tan x, ends in partial fractions. On 0 to π/2 you can skip it: one property of definite integrals gives π/4 in a few lines.
The tool is property P4 in the NCERT Class 12 Mathematics chapter on Integrals: the integral of f(x) from 0 to a equals the integral of f(a − x) from 0 to a. NCERT proves it with t = a − x, which reverses the limits and flips the sign of dt, so the two changes cancel.
What is the integral of 1/(1 + tan x) from 0 to π/2?
Call the integral I.
Write tan x as sin x/cos x and clear the fraction: I = ∫ cos x/(sin x + cos x) dx, from 0 to π/2.
Apply P4 with a = π/2. Since cos(π/2 − x) = sin x and sin(π/2 − x) = cos x, you get I = ∫ sin x/(cos x + sin x) dx over the same limits.
Add the two forms. The denominators match, so 2I = ∫ (cos x + sin x)/(sin x + cos x) dx = ∫ 1 dx from 0 to π/2 = π/2.
So I = π/4.
Step 1 also fixes the endpoint: tan x is undefined at π/2, but cos x/(sin x + cos x) is simply 0 there.
Why does adding the two forms give π/4?
The curve y = 1/(1 + tan x) starts at 1, falls through 1/2 at x = π/4 and reaches 0 at π/2. Its mirror image, y = 1/(1 + tan(π/2 − x)), is the same curve run backwards. At every x the two heights add to exactly 1, because cos x/(sin x + cos x) + sin x/(sin x + cos x) = 1.
So the two equal areas fill a rectangle of width π/2 and height 1, and each is half of it: π/4. In the diagram above, the yellow area under the curve and the pink area above it are the same shape turned half a circle about (π/4, 1/2).
To check it the long way, put t = tan x: the integral becomes ∫ dt/((1 + t)(1 + t²)) from 0 to infinity, and partial fractions give ½[ln(1 + t) − ½ ln(1 + t²) + tan⁻¹ t]. The logs cancel at infinity and tan⁻¹ t tends to π/2, so you again get π/4.
Does the same trick work for 1/(1 + √tan x)?
Yes. Multiply top and bottom by √cos x to get √cos x/(√cos x + √sin x). The swap x → π/2 − x turns it into √sin x/(√sin x + √cos x), the two forms add to 1, and the integral from 0 to π/2 is again π/4.
Nothing depends on the square root: 1/(1 + tanⁿ x) from 0 to π/2 gives π/4 for any positive n. The integrand equals cosⁿx/(cosⁿx + sinⁿx), the twin of the sinⁿx family we worked through in why the sinⁿx ratio integral is always π/4.
The limits can change too. NCERT's property P3 replaces x with a + b − x on any interval from a to b, and Example 33 in the same Integrals chapter uses it on 1/(1 + √tan x) from π/6 to π/3 to get π/12, half the interval's length.
In general, g(x)/(g(x) + g(a + b − x)) integrates to (b − a)/2 from a to b.
How do you spot an add-and-halve integral in an exam?
Look for three signs:
The limits are 0 and π/2, or any a and b where a + b − x turns sin into cos.
A term on top also appears in the bottom, as in sin x/(sin x + cos x).
A direct antiderivative looks long.
The swap helps even when the sum is not 1: in the ln(1 + tan x) integral from 0 to π/4 the two forms add to ln 2, and in the x(1 − x)ⁿ integral it moves the awkward power onto a single x.
Try these three, then check:
∫ 1/(1 + cot x) dx from 0 to π/2. Answer: π/4, since 1/(1 + cot x) = sin x/(sin x + cos x).
∫ 1/(1 + tan⁵ x) dx from 0 to π/2. Answer: π/4.
∫ 1/(1 + √cot x) dx from 0 to π/2. Answer: π/4.
The usual slip is in step 2: missing one sin or cos in the swap, or changing the limits when P4 keeps them. The Fermi Problem Library has worked problems with a step-by-step solver that explains the reasoning rather than printing an answer, so you can compare each line with your own. If the property itself feels shaky, the Fermi Concept Library covers every concept in mathematics, each with its own lesson and its place in the map.
Next time 1 + tan x sits in a denominator with limits 0 and π/2, write the swapped form first.



