The many C’s of tan x

a calculus conspiracy, exposed
∫ sec²x dx = tan x + C

That C is supposed to be “an arbitrary constant.” But tan x lives on infinitely many separate intervals, and nothing forces them to agree. Drag any branch up or down. Its derivative is still sec²x — check the dots in the bottom graph.

so what is “+ C” really?

An antiderivative of f on a set D is any F with F′ = f on D. Two antiderivatives differ by a function whose derivative is 0 on D. On an interval, derivative 0 forces a constant (that is the Mean Value Theorem again). But the domain of tan x is not an interval: it is the union of the intervals (kπ − π/2, kπ + π/2). A function with derivative 0 there only has to be constant on each piece. Such a function is called locally constant, and the honest answer is

∫ sec²x dx = tan x + C(x),   C(x) = Ck on (kπ − π/2, kπ + π/2),

one free constant per branch: the middle graph. The same thing happens with ∫ 1/x dx = ln|x| + C, which secretly has one constant for x < 0 and another for x > 0.

Does it matter? For a definite integral ∫ab sec²x dx the FTC needs [a, b] to sit inside one branch, so only one Ck is ever involved and it cancels. Across an asymptote the integral doesn’t exist, and no choice of constants rescues it. So in practice “+ C” is fine, and the fine print is a good party trick.

Disco mode varies the constants in time. At every instant, each Ck is a perfectly respectable constant. Keys: s shuffle, t staircase, d disco, b boring.