# Derivative of x: Formula, Proof and Examples

> The derivative of x is 1. See why with the limit definition and the power rule, plus derivatives of 5x, ax + b and x with respect to other variables.

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

$$ \frac{d}{dx}\,x = 1 $$

## At a glance

- **Derivative:** $1$ for every real $x$
- **Multiple of x:** $\dfrac{d}{dx}(ax) = a$
- **Linear function:** $\dfrac{d}{dx}(ax + b) = a$
- **Power rule view:** $x = x^1$, so the derivative is $1 \cdot x^0 = 1$
- **Integral version:** $\int x\,dx = \frac{x^2}{2} + C$

## Key takeaways

- The derivative of $x$ is $1$, because the line $y = x$ has slope $1$ everywhere.
- Any multiple works the same way: $\frac{d}{dx}(ax) = a$, so $\frac{d}{dx}(5x) = 5$.
- Constants added on do not change the slope: $\frac{d}{dx}(ax + b) = a$.
- With respect to a different variable, $x$ may be a constant: $\frac{d}{dt}\,x = 0$ if $x$ does not depend on $t$.

The **derivative of $x$ is $1$**. The function $y = x$ is a straight line with slope $1$, and the derivative of a line is just its slope.

$$\frac{d}{dx}\,x = 1$$

## Graph of x and its derivative

```graph
title: 'Graph of y = x and its derivative y = 1'
caption: 'The line $y = x$ has the same slope everywhere, so its derivative is the flat line $y = 1$.'
x: [-4, 4]
y: [-4, 4]
functions:
  - expr: x
    label: y = x
  - expr: 1
    label: y = 1 (derivative)
    dashed: true
points:
  - [2, 2, '(2, 2)']
  - [2, 1, 'slope 1']
```

Because the slope never changes, the derivative is a constant. Pick any two points on the line: the rise always equals the run.

## Proof from the limit definition

The [limit definition of the derivative](/blog/limit-definition-of-the-derivative) says

$$f'(x) = \lim_{h \to 0} \frac{f(x + h) - f(x)}{h}$$

With $f(x) = x$:

$$f'(x) = \lim_{h \to 0} \frac{(x + h) - x}{h} = \lim_{h \to 0} \frac{h}{h} = \lim_{h \to 0} 1 = 1$$

The $h$ cancels before you ever take the limit, so there is nothing tricky to resolve.

## Proof from the power rule

Write $x$ as $x^1$. The [power rule](/rules/power-rule) says to bring the exponent down and lower it by one:

$$\frac{d}{dx}\,x^1 = 1 \cdot x^0 = 1$$

This uses $x^0 = 1$, which is fine for every $x \ne 0$, and the limit proof covers $x = 0$ too.

## Multiples and linear functions

With the [constant multiple rule](/rules/constant-multiple-rule) and the [constant rule](/rules/constant-rule), every linear function is easy:

| Function | Derivative |
| --- | --- |
| $5x$ | $5$ |
| $-x$ | $-1$ |
| $\frac{x}{3}$ | $\frac{1}{3}$ |
| $3x - 7$ | $3$ |
| $\pi x + e$ | $\pi$ |

The derivative of a line $y = mx + b$ is always $m$, its slope. The intercept $b$ only shifts the line up or down, so it does not affect how steep it is. See the [derivative of a constant](/derivatives/constant) for why the $b$ drops out.

## Worked examples

**Example 1: a sum.** Differentiate $f(x) = x^2 + 4x - 9$:

$$f'(x) = 2x + 4$$

The $4x$ term contributes $4$ and the $-9$ contributes $0$. The $x^2$ term uses the [derivative of x²](/derivatives/x-squared).

**Example 2: a product check.** Write $x^2 = x \cdot x$ and use the [product rule](/rules/product-rule):

$$\frac{d}{dx}(x \cdot x) = 1 \cdot x + x \cdot 1 = 2x$$

This matches the power rule, which is a good sanity check.

**Example 3: a different variable.** In $\frac{d}{dt}(xt)$, where $x$ does not depend on $t$, treat $x$ as a constant: the answer is $x$.

## Common mistakes

1. **Answering $0$.** Only constants have derivative $0$. The function $x$ changes, so its derivative is $1$.
2. **Writing $x$ as the answer.** The derivative of $x$ is not $x$. That is true for $e^x$, not for $x$.
3. **Keeping the constant term.** $\frac{d}{dx}(3x + 7) = 3$, not $3 + 7$ or $10$.

The reverse question, $\int x\,dx = \frac{x^2}{2} + C$, is on the [integral of x](/integrals/x) page. For drills, try the [power rule practice problems](/practice-problems/power-rule).

## Frequently asked questions

### What is the derivative of x?

The derivative of $x$ with respect to $x$ is $1$. The graph $y = x$ is a straight line that rises 1 unit for every 1 unit to the right.

### What is the derivative of 2x?

It is $2$. By the constant multiple rule, $\frac{d}{dx}(2x) = 2 \cdot \frac{d}{dx}x = 2 \cdot 1 = 2$.

### Why is the derivative of x not 0?

A derivative of $0$ means the function is flat. The line $y = x$ is not flat: it climbs with slope $1$. Only constants, like $7$ or $\pi$, have derivative $0$.

### What is the derivative of x with respect to y?

If $x$ and $y$ are independent, $\frac{d}{dy}\,x = 0$. If $x$ depends on $y$, the answer is $\frac{dx}{dy}$, which is $\frac{1}{dy/dx}$ when $dy/dx \ne 0$.
