practicecalculus
Exponential and log integrals

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.

Exponential and log integrals Updated 3 min read

At a glance

\int 2^x\,dx = \frac{2^x}{\ln 2} + C
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
On this page
  1. Graph of 2ˣ with the area from 0 to 1
  2. How to integrate 2ˣ step by step
  3. Check by differentiating
  4. Definite integrals
  5. Worked examples
  6. Common mistakes

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

y = 2ˣ with the area from 0 to 1 shaded
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.

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²ˣ 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ˣ 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.

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².
  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 page for more on bases, and the integral of eˣ for the special case a = e.

Practice it now

Sine, cosine, eˣ and 1/x

Solve real problems on this topic with instant feedback, hints and a step-by-step walkthrough for every answer. Free, no sign-up needed to start.

Practice this lesson

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.

Written by the PracticeCalculus team

We build interactive calculus lessons and write every page to be clear and correct. Spotted something off? Tell us and we will fix it.