On this page
A sum of 39 ugly terms like f(1/40) + f(2/40) + … + f(39/40) looks like a calculator job. It isn't. If the function has one hidden property, the terms combine in pairs and the answer takes two lines. The same property also finishes a family of definite integrals.
Why does 4ˣ/(4ˣ + 2) pair up to 1?
Take f(x) = 4ˣ/(4ˣ + 2) and work out f(1 − x). Since 4¹⁻ˣ = 4/4ˣ, multiply the top and bottom by 4ˣ:
f(1 − x) = (4/4ˣ) / (4/4ˣ + 2) = 4/(4 + 2·4ˣ) = 2/(2 + 4ˣ)
f(x) + f(1 − x) = 4ˣ/(4ˣ + 2) + 2/(4ˣ + 2) = 1
So the values at x and 1 − x always add to 1. On a graph, the curve is point-symmetric about (1/2, 1/2): what it gains above 1/2 on one side, it loses below 1/2 on the other.
More generally, aˣ/(aˣ + √a) pairs to 1 for any a > 0. With a = 4, √a = 2: that is why the 2 is there.
How do you sum f(1/n) + f(2/n) + … + f((n − 1)/n)?
Suppose f(x) + f(1 − x) = c. The inputs k/n and (n − k)/n add to 1, so pair the first term with the last, the second with the second-last, and so on. There are n − 1 terms. If n is even, the middle term is f(1/2), and putting x = 1/2 in the rule gives 2f(1/2) = c, so it is worth c/2. Either way:
f(1/n) + f(2/n) + … + f((n − 1)/n) = (n − 1)c/2.
Worked example. The official JEE Advanced 2020 Paper 2 asked, as Q.16 in its numerical-value section, for f(1/40) + f(2/40) + … + f(39/40) − f(1/2) with f(x) = 4ˣ/(4ˣ + 2). That section gave +4 only for the correct number and 0 otherwise, with no options to guess from.
Check the pairing: f(x) + f(1 − x) = 1, so c = 1.
Count: k runs from 1 to 39, which is 39 terms, with f(20/40) = f(1/2) in the middle.
Pair: (1, 39), (2, 38), …, (19, 21) gives 19 pairs, each worth 1.
The middle term f(1/2) = 1/2 cancels the − f(1/2).
Answer: 19.
The same method gives f(1/1997) + … + f(1996/1997) = 1996/2 = 998.
Which other functions satisfy f(x) + f(1 − x) = constant?
Test the rule before relying on it: write f(1 − x), add it to f(x) and simplify. Besides aˣ/(aˣ + √a), these pass:
sin²(πx/2), since sin²(π/2 − θ) = cos²θ, with constant 1
log(x/(1 − x)) on (0, 1), with constant 0
The idea is not tied to 1. If f(x) + f(a − x) is constant, pair terms whose inputs add to a. Spotting which substitution makes a function behave nicely is the same skill you use in functional equations for JEE.
How does the same idea work for definite integrals?
The integral version rests on one substitution, t = a + b − x, which swaps the limits and gives ∫ₐᵇ f(x) dx = ∫ₐᵇ f(a + b − x) dx, often called the King property.
Now add the two forms of the same integral. For I = ∫₀¹ 4ˣ/(4ˣ + 2) dx, the swap turns the integrand into f(1 − x), so 2I = ∫₀¹ 1 dx = 1 and I = 1/2. Check directly: the antiderivative ln(4ˣ + 2)/ln 4 gives (ln 6 − ln 3)/ln 4 = 1/2.
The general result is that ∫ₐᵇ g(x)/(g(x) + g(a + b − x)) dx = (b − a)/2, the form PTC lists as the King rule in its Mathcad documentation. The classic case is ∫ from 0 to π/2 of √sin x/(√sin x + √cos x) dx: replacing x with π/2 − x swaps sin and cos, so the answer is (π/2)/2 = π/4.
The sum and the integral are linked: for f(x) = 4ˣ/(4ˣ + 2), where c = 1, the sum divided by n is (n − 1)/(2n), which tends to 1/2, matching ∫₀¹ f(x) dx. If an integral must be split first, see definite integrals with modulus and floor, and for another time-saving property, why the integral over n periods is n times one.
A 30-second check before you pair
Do the inputs pair up to a fixed total, like k/n and (n − k)/n?
Write f(total − x) and add it to f(x). Is the result a constant c?
Count the terms and find any middle term; it is worth c/2.
Re-read for terms added or subtracted at the ends.
For an integral, add I to its swapped form, then divide by 2.
If step 2 still leaves an x after simplifying, the pairing will not work, so try another route instead of forcing it.
To practise, the Fermi Problem Library has worked problems with a step-by-step solver that explains the reasoning rather than printing an answer. If the substitution feels shaky, the Fermi Concept Library has its own lesson for every concept in mathematics.



