Ma · Mathematics

Can You Pull the Logarithm of a Constant Out of an Integral?

Published By the 9to5Science editorial team

At a glance

  1. 1. Check the expression

    If the logarithm’s argument is constant, its value is constant with respect to the integration variable.

  2. 2. Use linearity

    A constant factor can be moved outside an integral; integrate the remaining function as usual.

  3. 3. Keep log rules separate

    A logarithm of a product splits into a sum, not a product of logarithms.

  4. 4. Check the domain

    For real logarithms, the constant inside the log must be positive.

If cc is a fixed positive number, then log⁡(c)\log(c) does not depend on the integration variable xx. It is therefore an ordinary constant, and you may factor it out of an integral when it multiplies the rest of the integrand:

∫log⁡(c) f(x) dx=log⁡(c)∫f(x) dx.\int \log(c)\,f(x)\,dx = \log(c)\int f(x)\,dx.

The key condition is that the logarithm is of a constant, not that a logarithm can be moved outside an integral in general. Integration is linear, so constant multipliers can be factored out. Logarithms do not have a general rule that lets you exchange the logarithm and the integral.

Why the constant can be factored out

An indefinite integral is an antiderivative with respect to a specified variable. If cc is fixed while xx varies, then log⁡(c)\log(c) is fixed too. The constant-multiple rule says

∫kf(x) dx=k∫f(x) dx,\int k f(x)\,dx = k\int f(x)\,dx,

where kk is independent of xx. Set k=log⁡(c)k=\log(c) to get the stated rule.

For real logarithms, the input must satisfy c>0c>0. The base also matters if you write a base explicitly: for log⁡b(c)\log_b(c), require b>0b>0, b≠1b\ne 1, and c>0c>0. Any valid fixed base gives a number that is constant with respect to xx.

Worked example

Evaluate

∫log⁡2(8) (3x2+1) dx.\int \log_2(8)\,(3x^2+1)\,dx.

First, evaluate the logarithm: log⁡2(8)=3\log_2(8)=3, since 23=82^3=8. Then factor out that constant and integrate the polynomial:

∫log⁡2(8)(3x2+1) dx=3∫(3x2+1) dx=3(x3+x)+C=3x3+3x+C.\begin{aligned} \int \log_2(8)(3x^2+1)\,dx &=3\int (3x^2+1)\,dx\\ &=3(x^3+x)+C\\ &=3x^3+3x+C. \end{aligned}

Differentiating the result gives 9x2+39x^2+3, which agrees with the original integrand 3(3x2+1)3(3x^2+1).

If the integrand is just the logarithm of a constant, the same idea gives

∫log⁡(c) dx=xlog⁡(c)+C.\int \log(c)\,dx = x\log(c)+C.

This formula assumes cc is fixed and positive for a real logarithm.

When the logarithm is inside a product

Suppose instead that the integrand is log⁡(cf(x))\log(c f(x)). For positive real inputs, the product rule for logarithms gives

log⁡(cf(x))=log⁡(c)+log⁡(f(x)).\log(c f(x))=\log(c)+\log(f(x)).

Thus, where both terms are defined,

∫log⁡(cf(x)) dx=xlog⁡(c)+∫log⁡(f(x)) dx.\int \log(c f(x))\,dx = x\log(c)+\int\log(f(x))\,dx.

Here the constant logarithm becomes an additive term in the integrand, whose integral is xlog⁡(c)x\log(c). It does not become a multiplier of the entire integral. For example, log⁡(2x)=log⁡(2)+log⁡(x)\log(2x)=\log(2)+\log(x) for x>0x>0, not log⁡(2)log⁡(x)\log(2)\log(x).

For a definite integral, the same distinction applies. If ff is integrable on [a,b][a,b], then

∫ablog⁡(c)f(x) dx=log⁡(c)∫abf(x) dx.\int_a^b \log(c)f(x)\,dx = \log(c)\int_a^b f(x)\,dx.

If the integrand is log⁡(cf(x))\log(c f(x)) and the logarithm law applies throughout the interval, then the constant term contributes (b−a)log⁡(c)(b-a)\log(c):

∫ablog⁡(cf(x)) dx=(b−a)log⁡(c)+∫ablog⁡(f(x)) dx.\int_a^b \log(c f(x))\,dx =(b-a)\log(c)+\int_a^b\log(f(x))\,dx.

Common mistakes

  • Treating log⁡(cf(x))\log(c f(x)) as log⁡(c)f(x)\log(c)f(x). The product rule is log⁡(cf(x))=log⁡(c)+log⁡(f(x))\log(c f(x))=\log(c)+\log(f(x)), when the real logarithms are defined.
  • Factoring out a quantity that depends on xx. You may factor out log⁡(c)\log(c) if cc is fixed, but not log⁡(x)\log(x) or log⁡(g(x))\log(g(x)) as a constant multiplier.
  • Dropping the integration variable’s effect. The antiderivative of a constant kk is kx+Ckx+C, not merely kk.
  • Ignoring the logarithm’s domain. For real logarithms, arguments must be positive. If the argument can be zero or negative on the interval, the real-valued log expression may not be defined there.

The practical test is simple: identify the integration variable. If the entire factor log⁡(c)\log(c) is independent of that variable and multiplies the integrand, pull it out using the constant-multiple rule. If the variable occurs inside the logarithm, first use a valid logarithm identity—or leave the expression as it is.

References

  1. James Stewart, Calculus: Early Transcendentals
  2. Tom M. Apostol, Calculus, Volume 1

Spotted an error? Send a correction. Read how we write and check articles in our editorial policy.