# Integral of 2ˣ and aˣ: Formula, Steps and Examples

> The integral of 2ˣ is 2ˣ/ln 2 + C, and ∫aˣ dx = aˣ/ln a + C. See the derivation from e^(x ln a), a graph, definite integrals and examples.

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

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

## At a glance

- **Antiderivative:** $\dfrac{2^x}{\ln 2} + C$
- **General base:** $\int a^x\,dx = \dfrac{a^x}{\ln a} + C$ for $a > 0$, $a \ne 1$
- **Method:** Rewrite $a^x = e^{x\ln a}$, then divide by $\ln a$
- **From 0 to 1:** $\frac{1}{\ln 2} \approx 1.443$
- **Value of ln 2:** $\approx 0.6931$

## Key takeaways

- The integral of $2^x$ is $\frac{2^x}{\ln 2} + C$.
- For any base $a > 0$, $a \ne 1$: $\int a^x\,dx = \frac{a^x}{\ln a} + C$.
- The formula comes from writing $a^x = e^{x\ln a}$ and using $\int e^{kx}\,dx = \frac{1}{k}e^{kx}$ with $k = \ln a$.
- When $a = e$, $\ln e = 1$ and the formula becomes $\int e^x\,dx = e^x + C$.

The **integral of $2^x$ is $\dfrac{2^x}{\ln 2} + C$**. Every exponential $a^x$ integrates the same way: keep the exponential and divide by the natural log of the base.

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

The general formula holds for any base $a > 0$ with $a \ne 1$.

## Graph of 2ˣ with the area from 0 to 1

```graph
title: 'y = 2ˣ with the area from 0 to 1 shaded'
caption: 'The shaded area is $\frac{2 - 1}{\ln 2} = \frac{1}{\ln 2} \approx 1.443$. The dashed curve is the antiderivative $\frac{2^x}{\ln 2}$, about $1.44$ times as tall as $2^x$ everywhere.'
x: [-3, 3]
y: [-0.5, 9]
functions:
  - expr: 2^x
    label: y = 2ˣ
  - expr: 2^x/ln(2)
    label: y = 2ˣ/ln 2 (antiderivative)
    dashed: true
shade:
  expr: 2^x
  from: 0
  to: 1
points:
  - [0, 1, '(0, 1)']
  - [1, 2, '(1, 2)']
```

## How to integrate 2ˣ step by step

The trick is to turn the base into $e$, since you already know how to integrate exponentials of $e$.

1. **Rewrite with base $e$.** Since $2 = e^{\ln 2}$, we have $2^x = \left(e^{\ln 2}\right)^x = e^{x\ln 2}$.
2. **Integrate.** $\ln 2$ is just a constant, about $0.693$. Using $\int e^{kx}\,dx = \frac{1}{k}e^{kx} + C$ from the [integral of e²ˣ](/integrals/e-to-the-2x) page:
$$\int e^{x\ln 2}\,dx = \frac{1}{\ln 2}e^{x\ln 2} + C$$
3. **Go back to base 2.** $e^{x\ln 2} = 2^x$, so the answer is $\frac{2^x}{\ln 2} + C$.

Replace $2$ by $a$ everywhere and you get the general formula. The base must be positive so that $\ln a$ is defined, and $a \ne 1$ so that $\ln a \ne 0$. (For $a = 1$, $1^x = 1$ and $\int 1\,dx = x + C$.)

## Check by differentiating

The [derivative of 2ˣ](/derivatives/2-to-the-x) is $2^x\ln 2$. So

$$\frac{d}{dx}\left(\frac{2^x}{\ln 2}\right) = \frac{2^x\ln 2}{\ln 2} = 2^x$$

## Definite integrals

| Integral | Work | Value |
| --- | --- | --- |
| $\int_0^1 2^x\,dx$ | $\frac{2 - 1}{\ln 2}$ | $\approx 1.443$ |
| $\int_0^3 2^x\,dx$ | $\frac{8 - 1}{\ln 2}$ | $\approx 10.099$ |
| $\int_0^2 3^x\,dx$ | $\frac{9 - 1}{\ln 3}$ | $\approx 7.282$ |
| $\int_{-\infty}^{0} 2^x\,dx$ | $\frac{1 - 0}{\ln 2}$ | $\approx 1.443$ |

Compare the second row with a sum: $2^0 + 2^1 + 2^2 = 7$. The integral $\frac{7}{\ln 2}$ is larger because the area includes the curve rising between the integers. This contrast between sums and integrals shows up again in the [integral test](/learn/calculus-2/sequences-and-series/integral-test-and-p-series).

## Worked examples

**Example 1: base 10.** $\displaystyle\int 10^x\,dx = \frac{10^x}{\ln 10} + C \approx 0.434\cdot 10^x + C$.

**Example 2: a linear exponent.** $\displaystyle\int 2^{3x}\,dx$. Let $u = 3x$, $du = 3\,dx$:

$$\frac{1}{3}\int 2^u\,du = \frac{2^{3x}}{3\ln 2} + C$$

You could also write $2^{3x} = 8^x$ and get $\frac{8^x}{\ln 8}$. Since $\ln 8 = 3\ln 2$, the answers match.

**Example 3: a fraction as the base.** $\displaystyle\int\left(\frac{1}{2}\right)^x dx = \frac{(1/2)^x}{\ln(1/2)} + C = -\frac{2^{-x}}{\ln 2} + C$.

**Example 4: combine bases.** $\displaystyle\int 2^x 3^x\,dx = \int 6^x\,dx = \frac{6^x}{\ln 6} + C$.

**Example 5: a substitution.** $\displaystyle\int x\,2^{x^2}\,dx$. With $u = x^2$, $du = 2x\,dx$:

$$\frac{1}{2}\int 2^u\,du = \frac{2^{x^2}}{2\ln 2} + C$$

## Common mistakes

1. **Using the power rule.** $\int 2^x\,dx \ne \frac{2^{x+1}}{x+1}$. Compare $\int x^2\,dx = \frac{x^3}{3}$, where the variable is the base; see the [integral of x²](/integrals/x-squared).
2. **Multiplying by $\ln 2$ instead of dividing.** Multiplying is what differentiation does. Integration divides.
3. **Using $\log_{10}$.** The formula needs the natural log. $\int 10^x\,dx = \frac{10^x}{\ln 10}$, not $\frac{10^x}{\log 10} = \frac{10^x}{1}$.
4. **Applying it to $x^x$.** When the variable is in both the base and the exponent, neither rule applies, and $\int x^x\,dx$ has no elementary answer.

See the [exponential functions](/functions/exponential-functions) page for more on bases, and the [integral of eˣ](/integrals/e-to-the-x) for the special case $a = e$.

## Frequently asked questions

### What is the integral of 2ˣ?

It is $\frac{2^x}{\ln 2} + C$, which is about $1.443\cdot 2^x + C$.

### What is the integral of aˣ?

It is $\frac{a^x}{\ln a} + C$ for any constant base $a > 0$ with $a \ne 1$. For example, $\int 10^x\,dx = \frac{10^x}{\ln 10} + C$.

### Is the integral of 2ˣ equal to 2^(x+1)/(x+1)?

No. That is the power rule, which only applies when the variable is the base, as in $x^2$. In $2^x$ the variable is the exponent.

### What is the integral of 2^(−x)?

It is $-\frac{2^{-x}}{\ln 2} + C$. Write $2^{-x} = \left(\frac{1}{2}\right)^x$ and use the formula with $a = \frac{1}{2}$, where $\ln\frac{1}{2} = -\ln 2$.
