# Integral of x: Formula, Derivation and Examples

> The integral of x is x²/2 + C. See why with the reverse power rule and a triangle, plus definite integrals, the linear form ax + b and common mistakes.

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

$$ \int x\,dx = \frac{x^2}{2} + C $$

## At a glance

- **Antiderivative:** $\dfrac{x^2}{2} + C$
- **Rule used:** Reverse power rule with $n = 1$
- **Definite form:** $\int_0^b x\,dx = \dfrac{b^2}{2}$
- **Symmetric interval:** $\int_{-a}^{a} x\,dx = 0$
- **Check:** $\dfrac{d}{dx}\dfrac{x^2}{2} = x$

## Key takeaways

- The integral of $x$ is $\frac{x^2}{2} + C$: raise the power by one and divide by the new power.
- The area under $y = x$ from $0$ to $b$ is a triangle with area $\frac{b^2}{2}$, which matches the formula.
- The integral of $2x$ is $x^2 + C$, because the $2$ cancels the division by $2$.
- Over a symmetric interval like $[-1, 1]$ the integral of $x$ is $0$: the area below the axis cancels the area above.

The **integral of $x$ is $\dfrac{x^2}{2} + C$**. It comes straight from the reverse power rule: add one to the exponent, then divide by the new exponent.

$$\int x\,dx = \frac{x^2}{2} + C$$

## Graph of y = x and its antiderivative

```graph
title: 'Area under y = x from 0 to 2, with the antiderivative y = x²/2'
caption: 'The shaded triangle has base $2$ and height $2$, so its area is $2$. The dashed curve $y = \frac{x^2}{2}$ reaches exactly $2$ at $x = 2$.'
x: [-2.5, 3]
y: [-2.5, 4]
functions:
  - expr: x
    label: y = x
  - expr: x^2/2
    label: y = x²/2 (antiderivative)
    dashed: true
shade: {expr: x, from: 0, to: 2}
points:
  - [2, 2, '(2, 2)']
```

The antiderivative $\frac{x^2}{2}$ is a parabola. Its slope at each point equals the height of the line $y = x$: slope $0$ at the origin, slope $2$ at $x = 2$, and negative slopes for negative $x$.

## Derivation, step by step

1. Write $x$ as a power: $x = x^1$.
2. Apply the [reverse power rule](/rules/reverse-power-rule), $\int x^n\,dx = \frac{x^{n+1}}{n+1} + C$, with $n = 1$.
3. Add one to the exponent: $x^{2}$.
4. Divide by the new exponent: $\frac{x^2}{2}$.
5. Add the constant: $\frac{x^2}{2} + C$.

There is also a picture proof. The region under $y = x$ from $0$ to $b$ is a right triangle with base $b$ and height $b$, so its area is $\frac{1}{2}b\cdot b = \frac{b^2}{2}$. The area function is $\frac{x^2}{2}$, and that is exactly the antiderivative.

## Check by differentiating

$$\frac{d}{dx}\left(\frac{x^2}{2} + C\right) = \frac{2x}{2} + 0 = x \checkmark$$

The forward direction is on the [derivative of x](/derivatives/x) page.

## Definite integrals

$$\int_a^b x\,dx = \frac{b^2}{2} - \frac{a^2}{2} = \frac{b^2 - a^2}{2}$$

For example, $\int_1^3 x\,dx = \frac{9 - 1}{2} = 4$. That region is a trapezoid with parallel sides $1$ and $3$ and width $2$, and its area is $\frac{1 + 3}{2}\cdot 2 = 4$. Same answer.

When the interval crosses $0$, area below the axis counts as negative: $\int_{-1}^{1} x\,dx = \frac{1}{2} - \frac{1}{2} = 0$.

## The linear version: integral of ax + b

For a line $ax + b$ you can integrate term by term:

$$\int (ax + b)\,dx = \frac{ax^2}{2} + bx + C$$

With a [u-substitution](/rules/u-substitution-rule), $u = ax + b$, you get a second form:

$$\int (ax + b)\,dx = \frac{(ax + b)^2}{2a} + C$$

Both are correct. Expanding the second gives $\frac{ax^2}{2} + bx + \frac{b^2}{2a}$, which differs from the first only by the constant $\frac{b^2}{2a}$.

## Worked examples

**Example 1.** $\int 6x\,dx = 6\cdot\frac{x^2}{2} + C = 3x^2 + C$.

**Example 2.** $\int (4x - 5)\,dx = 2x^2 - 5x + C$. The $-5$ uses the [integral of a constant](/integrals/constant).

**Example 3.** $\int_0^4 \frac{x}{2}\,dx = \frac{1}{2}\cdot\frac{16}{2} = 4$.

**Example 4: average value.** The average of $f(x) = x$ on $[0, 6]$ is $\frac{1}{6}\int_0^6 x\,dx = \frac{1}{6}\cdot 18 = 3$, the midpoint, as you would expect for a line.

## Common mistakes

1. **Writing $x^2 + C$.** You must divide by the new exponent. The derivative of $x^2$ is $2x$, not $x$.
2. **Getting $1$.** That is the derivative of $x$, not its integral.
3. **Dropping $+ C$** on an indefinite integral.
4. **Expecting area to be positive.** A definite integral gives signed area. Use $\int\lvert x\rvert\,dx$ if you want total area; see the [integral of |x|](/integrals/absolute-value-of-x).

Keep going with the [integral of x²](/integrals/x-squared), or practice on [antiderivative problems](/practice-problems/antiderivatives).

## Frequently asked questions

### What is the integral of x?

The integral of $x$ is $\frac{x^2}{2} + C$. Check it: the derivative of $\frac{x^2}{2}$ is $\frac{2x}{2} = x$.

### What is the integral of 2x?

It is $x^2 + C$. Pull out the $2$: $2\cdot\frac{x^2}{2} = x^2$.

### What is the integral of x from 0 to 1?

It is $\frac{1^2}{2} - \frac{0^2}{2} = \frac{1}{2}$. That is the area of a right triangle with legs $1$ and $1$.

### Why is the integral of x from -1 to 1 equal to zero?

Because $y = x$ is an odd function. The triangle below the axis on $[-1, 0]$ has signed area $-\frac{1}{2}$ and cancels the triangle above the axis on $[0, 1]$.
