Integrals: functions and by parts

∫1/x dx = log|x| + C

The integral of 1/x is log|x| + C, the formula for the n=−1 case where the power rule fails.

∫1x dx=log⁡∣x∣+C\int \frac{1}{x}\,dx=\log|x|+C

The power formula for xnx^n fails at n=−1n=-1 because the denominator becomes 00. ln⁡∣x∣\ln|x| fills that gap.

∫1x dx=ln⁡∣x∣+C\int \frac{1}{x}\,dx=\ln|x|+C

The absolute value is there so the formula also works for negative xx.

Examples

  1. 01For which n does this formula fail?∫xn dx=xn+1n+1\displaystyle \int x^{n}\,dx = \frac{x^{n+1}}{n+1}AnswerHide
    Answern=−1\displaystyle n=-1

    Steps

    1. Find the nn that makes the denominator n+1n+1 zero
    2. n+1=0\displaystyle n+1 = 0⇒n=−1\displaystyle \Rightarrow n = -1
    3. For every other nn the denominator is not 0, so the rule works as written
  2. 02What is this?∫2x dx\displaystyle \int \frac{2}{x}\,dxAnswerHide
    Answer2log⁡e∣x∣+C\displaystyle 2\log_e|x|+C

    Steps

    1. A constant factor just comes along; 1x\dfrac{1}{x} integrates to log⁡e∣x∣\log_e|x|
    2. f(x)\displaystyle f(x)=2log⁡e∣x∣\displaystyle = 2\log_e|x|f′(x)\displaystyle f'(x)=2x\displaystyle = \frac{2}{x}
    3. Differentiating gets us back. The 22 stays in front of the log⁡\log, never inside it
  3. 03What is the value?∫1e4x dx\displaystyle \int_{1}^{e} \frac{4}{x}\,dxAnswerHide
    Answer4\displaystyle 4

    Steps

    1. 1x\dfrac{1}{x} integrates to log⁡e∣x∣\log_e|x|; subtract the lower end from the upper
    2. 4(log⁡ee−log⁡e1)\displaystyle 4(\log_e e-\log_e 1)=4(1−0)\displaystyle = 4(1-0)=4\displaystyle = 4
    3. log⁡ee=1\log_e e = 1 and log⁡e1=0\log_e 1 = 0; taking ee as the upper end makes the answer a whole number
  4. 04What goes in □?∫133x dx=□log⁡e3\displaystyle \int_{1}^{3} \frac{3}{x}\,dx = \square\log_e 3AnswerHide
    Answer3\displaystyle 3

    Steps

    1. The constant comes out and 1x\dfrac{1}{x} integrates to log⁡e∣x∣\log_e|x|, so subtract the lower end from the upper
    2. 3(log⁡e3−log⁡e1)\displaystyle 3(\log_e 3-\log_e 1)=3log⁡e3\displaystyle = 3\log_e 3
    3. log⁡e1=0\log_e 1 = 0, so only log⁡e3\log_e 3 survives; □\square is 33
  5. 05Integrate∫1x dx\displaystyle \int \frac{1}{x} \, dxAnswerHide
    Answerlog⁡e∣x∣+C\displaystyle \log_e|x| + C
  6. 06Find the value∫141x2 dx\displaystyle \int_{1}^{4} \frac{1}{x^2} \, dxAnswerHide
    Answer34\displaystyle \frac{3}{4}

FAQ

Why the absolute value?
So that 1x\dfrac{1}{x} has an antiderivative for x<0x<0 too. Differentiating log⁡∣x∣\log|x| gives 1x\dfrac{1}{x} regardless of the sign of x.

Published 2026-09-03 · Updated 2026-10-14