# Integral of a Constant and of 1: Formula and Examples

> The integral of a constant k is kx + C, and the integral of 1 is x + C. See why, the area picture, definite integrals and the mistakes to avoid.

Source: https://practicecalculus.com/integrals/constant
Updated: 2026-11-06

$$ \int k\,dx = kx + C $$

## At a glance

- **Antiderivative:** $kx + C$
- **Integral of 1:** $\int 1\,dx = x + C$
- **Integral of 0:** $\int 0\,dx = C$
- **Definite integral:** $\int_a^b k\,dx = k(b - a)$
- **Check:** $\dfrac{d}{dx}(kx + C) = k$

## Key takeaways

- The integral of a constant $k$ is $kx + C$. The integral of $1$ is $x + C$.
- Geometrically, $\int_a^b k\,dx = k(b - a)$ is the area of a rectangle of height $k$ and width $b - a$.
- Any expression without $x$ is a constant: $\int \pi\,dx = \pi x + C$ and $\int e^2\,dx = e^2 x + C$.
- The integral of $0$ is $C$, not $0$, because every constant has derivative $0$.

The **integral of a constant $k$ is $kx + C$**. In particular, the **integral of $1$ is $x + C$**. It is the simplest integral in calculus, and almost every other integral uses it somewhere, usually as the last term of a polynomial.

$$\int k\,dx = kx + C, \qquad \int 1\,dx = \int dx = x + C$$

## Graph: a constant gives a rectangle

```graph
title: 'Area under y = 3 from x = 0 to x = 2, with the antiderivative y = 3x'
caption: 'The shaded rectangle has height $3$ and width $2$, so its area is $6$. The dashed line $y = 3x$ is the antiderivative: it rises by exactly $6$ between $x = 0$ and $x = 2$.'
x: [-0.5, 3]
y: [-1, 8]
functions:
  - expr: '3'
    label: y = 3
  - expr: 3x
    label: y = 3x (antiderivative)
    dashed: true
shade: {expr: '3', from: 0, to: 2}
points:
  - [2, 6, '(2, 6)']
```

The area under a horizontal line is always a rectangle. Its height is $k$ and its width is how far $x$ has moved, so the accumulated area grows like $kx$. That is the whole formula in one picture.

## Why the integral of k is kx + C

An integral asks: what function has this derivative? We want a function whose slope is $k$ everywhere. A straight line with slope $k$ does exactly that:

$$\frac{d}{dx}(kx) = k$$

Adding any constant $C$ moves the line up or down without changing its slope, so every function $kx + C$ works. You can also see it as the [reverse power rule](/rules/reverse-power-rule) with $n = 0$: since $k = kx^0$,

$$\int kx^0\,dx = k\cdot\frac{x^{1}}{1} + C = kx + C$$

## Check by differentiating

Always check an antiderivative by taking its derivative:

$$\frac{d}{dx}\left(kx + C\right) = k + 0 = k \checkmark$$

The matching derivative page is the [derivative of a constant](/derivatives/constant), which runs the same idea backwards: the derivative of any constant is $0$.

## Definite integrals of a constant

With the [Fundamental Theorem of Calculus](/theorems/fundamental-theorem-of-calculus-part-2):

$$\int_a^b k\,dx = \Big[kx\Big]_a^b = kb - ka = k(b - a)$$

If $k$ is negative, the rectangle sits below the axis and the answer is negative. For example, $\int_0^4 (-2)\,dx = -8$.

## Worked examples

**Example 1.** $\int 7\,dx = 7x + C$.

**Example 2: constants that look like variables.** Any number without $x$ counts as a constant, even if it is written with a symbol:

$$\int \pi\,dx = \pi x + C, \qquad \int e^2\,dx = e^2 x + C, \qquad \int \ln 5\,dx = x\ln 5 + C$$

**Example 3: inside a polynomial.** Using the [linearity rules](/rules/integral-linearity-rules):

$$\int (6x^2 - 4x + 9)\,dx = 2x^3 - 2x^2 + 9x + C$$

The $9$ becomes $9x$. See the [integral of x](/integrals/x) and the [integral of x²](/integrals/x-squared) for the other two terms.

**Example 4: a different variable.** $\int 3\,dt = 3t + C$. The variable in the answer matches the variable in $dt$.

**Example 5: a definite integral.** $\int_{-1}^{4} 3\,dx = 3\big(4 - (-1)\big) = 15$.

## Common mistakes

1. **Integrating a constant to 0.** That is the derivative rule. Integration goes the other way: $\int 5\,dx = 5x + C$, not $0$.
2. **Writing $5 + C$.** The answer must contain $x$. Check: the derivative of $5 + C$ is $0$, not $5$.
3. **Forgetting $+ C$.** Without it you only have one antiderivative, not all of them.
4. **Treating $e^2$ or $\pi^2$ as a power of $x$.** These are plain numbers. $\int e^2\,dx$ is $e^2x + C$, not $\frac{e^3}{3}$.

Want more practice? Try the [antiderivative practice problems](/practice-problems/antiderivatives) or read the guide to [antiderivatives](/blog/antiderivatives).

## Frequently asked questions

### What is the integral of 1?

The integral of $1$ is $x + C$. Written on its own, $\int dx$ means the same thing and also equals $x + C$.

### What is the integral of a constant k?

It is $kx + C$. Check it by differentiating: the derivative of $kx$ is $k$ and the derivative of $C$ is $0$.

### What is the integral of 0?

It is an arbitrary constant $C$. Every constant function has derivative $0$, so the antiderivative of $0$ is any constant.

### What is the integral of 5 from 2 to 7?

It is $5(7 - 2) = 25$, the area of a $5$ by $5$ rectangle.
