# Constant of integration

In calculus, the constant of integration, often denoted by $C$ (or $c$), is a constant term added to an antiderivative of a function $f(x)$ to indicate that the indefinite integral of $f(x)$ (i.e., the set of all antiderivatives of $f(x)$), on a connected domain, is only defined up to an additive constant. This constant expresses an ambiguity inherent in the construction of antiderivatives.
More specifically, if a function $f(x)$ is defined on an interval, and $F(x)$ is an antiderivative of $f(x),$ then the set of all antiderivatives of $f(x)$ is given by the functions $F(x)+C,$ where $C$ is an arbitrary constant (meaning that any value of $C$ would make $F(x)+C$ a valid antiderivative). For that reason, the indefinite integral is often written as ∫f(x)dx=F(x)+C, {\textstyle \int f(x)\, dx=F(x)+C, } although the constant of integration might be sometimes omitted in lists of integrals for simplicity.

## Origin

The derivative of any constant function is zero. Once one has found one antiderivative $F(x)$ for a function $f(x),$ adding or subtracting any constant $C$ will give us another antiderivative, because d/dx (F(x)+C)=d/dx F(x)+d/dx C=F$^′$(x)=f(x).{\textstyle {\frac {d}{dx}}(F(x)+C)={\frac {d}{dx}}F(x)+{\frac {d}{dx}}C=F'(x)=f(x).} The constant is a way of expressing that every function with at least one antiderivative will have an infinite number of them.
Let $F:\mathbb {R} \to \mathbb {R}$ and $G:\mathbb {R} \to \mathbb {R}$ be two everywhere differentiable functions. Suppose that $F\,'(x)=G\,'(x)$ for every real number x. Then there exists a real number $C$ such that $F(x)-G(x)=C$ for every real number x.
To prove this, notice that $[F(x)-G(x)]'=0.$ So $F$ can be replaced by $F-G,$ and $G$ by the constant function $0,$ making the goal to prove that an everywhere differentiable function whose derivative is always zero must be constant:
Choose a real number $a,$ and let $C=F(a).$ For any x, the fundamental theorem of calculus, together with the assumption that the derivative of $F$ vanishes, implying that
${\begin{aligned}&0=\int _{a}^{x}F'(t)\,dt\\&0=F(x)-F(a)\\&0=F(x)-C\\&F(x)=C\\\end{aligned}}$
thereby showing that $F$ is a constant function.
Two facts are crucial in this proof. First, the real line is connected. If the real line were not connected, one would not always be able to integrate from our fixed a to any given x. For example, if one were to ask for functions defined on the union of intervals [0,1] and [2,3], and if a were 0, then it would not be possible to integrate from 0 to 3, because the function is not defined between 1 and 2. Here, there will be two constants, one for each connected component of the domain. In general, by replacing constants with locally constant functions, one can extend this theorem to disconnected domains. For example, there are two constants of integration for ∫dx/x{\textstyle \int dx/x}, and infinitely many for ∫tan⁡xdx{\textstyle \int \tan x\, dx}, so for example, the general form for the integral of 1/x is:
$\int {\frac {dx}{x}}={\begin{cases}\ln \left|x\right|+C^{-}&x<0\\\ln \left|x\right|+C^{+}&x>0\end{cases}}$
Second, $F$ and $G$ were assumed to be everywhere differentiable. If $F$ and $G$ are not differentiable at even one point, then the theorem might fail. As an example, let $F(x)$ be the Heaviside step function, which is zero for negative values of x and one for non-negative values of x, and let $G(x)=0.$ Then the derivative of $F$ is zero where it is defined, and the derivative of $G$ is always zero. Yet it's clear that $F$ and $G$ do not differ by a constant, even if it is assumed that $F$ and $G$ are everywhere continuous and almost everywhere differentiable the theorem still fails. As an example, take $F$ to be the Cantor function and again let $G=0.$
It turns out that adding and subtracting constants is the only flexibility available in finding different antiderivatives of the same function. That is, all antiderivatives are the same up to a constant. To express this fact for $\cos(x),$ one can write: $\int \cos(x)\,dx=\sin(x)+C,$ where $C$ is constant of integration. It is easily determined that all of the following functions are antiderivatives of $\cos(x)$: ${\begin{aligned}{\frac {d}{dx}}[\sin(x)+C]&={\frac {d}{dx}}\sin(x)+{\frac {d}{dx}}C\\&=\cos(x)+0\\&=\cos(x)\end{aligned}}$

## Significance

The inclusion of the constant of integration is necessitated in some, but not all circumstances. For instance, when evaluating definite integrals using the fundamental theorem of calculus, the constant of integration can be ignored as it will always cancel with itself.
However, different methods of computation of indefinite integrals can result in multiple resulting antiderivatives, each implicitly containing different constants of integration, and no particular option may be considered simplest. For example, $2\sin(x)\cos(x)$ can be integrated in at least three different ways.
${\begin{alignedat}{4}\int 2\sin(x)\cos(x)\,dx=&&\sin ^{2}(x)+C=&&-\cos ^{2}(x)+1+C=&&-{\frac {1}{2}}\cos(2x)+{\frac {1}{2}}+C\\\int 2\sin(x)\cos(x)\,dx=&&-\cos ^{2}(x)+C=&&\sin ^{2}(x)-1+C=&&-{\frac {1}{2}}\cos(2x)-{\frac {1}{2}}+C\\\int 2\sin(x)\cos(x)\,dx=&&-{\frac {1}{2}}\cos(2x)+C=&&\sin ^{2}(x)+C=&&-\cos ^{2}(x)+C\\\end{alignedat}}$Additionally, omission of the constant, or setting it to zero, may make it prohibitive to deal with a number of problems, such as those with initial value conditions. A general solution containing the arbitrary constant is often necessary to identify the correct particular solution. For example, to obtain the antiderivative of $\cos(x)$ that has the value 400 at x = π, then only one value of $C$ will work (in this case $C=400$).
The constant of integration also implicitly or explicitly appears in the language of differential equations. Almost all differential equations will have many solutions, and each constant represents the unique solution of a well-posed initial value problem.
An additional justification comes from abstract algebra. The space of all (suitable) real-valued functions on the real numbers is a vector space, and the differential operator d/dx {\textstyle {\frac {d}{dx}}} is a linear operator. The operator d/dx {\textstyle {\frac {d}{dx}}} maps a function to zero if and only if that function is constant. Consequently, the kernel of d/dx {\textstyle {\frac {d}{dx}}} is the space of all constant functions. The process of indefinite integration amounts to finding a pre-image of a given function. There is no canonical pre-image for a given function, but the set of all such pre-images forms a coset. Choosing a constant is the same as choosing an element of the coset. In this context, solving an initial value problem is interpreted as lying in the hyperplane given by the initial conditions.