Integral of 1/x

Integrating 1/x yields the natural logarithm of the absolute value of x, plus a constant—essential for reciprocal function problems.

1xdx=lnx+C\int \frac{1}{x}\,dx = \ln|x| + C

Solve a problem with Integral of 1/x

Type the problem. The solver will use Integral of 1/x where Integral of 1/x is the right tool, and tell you when it is not.

Drag one in or paste from the clipboard. JPEG, PNG or WebP. You get the transcription to check before anything is solved.

How to get a better answer
  • Paste the whole problem, including the instruction word — "simplify", "solve for x" and "factor" lead to three different answers.
  • Say what you have already tried. "I got x = 4 and the book says 2" turns a solution into a diagnosis.
  • Set the level in the settings button. A calculus shortcut is not a better answer if you have not met derivatives yet.
  • For a photo, get the whole problem in frame and hold the page flat — you get the transcription to fix before anything is solved.

What each symbol means

What Integral of 1/x takes
xx
CC
Integral of 1/x
SymbolMeaning
xxThe variable of integration, representing the input to the reciprocal function; if x is negative, the absolute value ensures the logarithm remains defined and real.
CCThe constant of integration, representing the family of all antiderivatives; different values of C produce infinitely many functions that all have the same derivative.

When to use it

Use this whenever you need to integrate a reciprocal function or encounter a variable in the denominator where the power rule does not apply.

Level

Usually taught in: Calculus I

Worked examples

1. Integrate the basic reciprocal

Problem

Find 1xdx\int \frac{1}{x} dx.
  1. 1xdx\int \frac{1}{x} \, dx

    This is the integral we need to evaluate.

  2. ddx[lnx]=1x\frac{d}{dx}[\ln|x|] = \frac{1}{x}

    Recognize that the derivative of lnx\ln|x| is 1x\frac{1}{x}—this means lnx\ln|x| is the antiderivative we seek.

  3. lnx+C\ln|x| + C

    Therefore, the antiderivative of 1x\frac{1}{x} is lnx\ln|x| plus an arbitrary constant of integration CC.

Answer: lnx+C\ln|x| + C

This is the fundamental formula for reciprocal integration. The absolute value ensures the result is defined for both positive and negative x (as long as x ≠ 0).

2. Integrate a reciprocal with a coefficient

Problem

Find 42xdx\int \frac{-4}{2x} dx.
  1. 42xdx\int \frac{-4}{2x} \, dx

    Write the integral we need to evaluate.

  2. 2xdx\int \frac{-2}{x} \, dx

    Simplify the fraction: 42x=2x\frac{-4}{2x} = \frac{-2}{x}.

  3. 21xdx=2lnx+C-2 \int \frac{1}{x} \, dx = -2 \ln|x| + C

    Factor out the constant 2-2 using linearity, then apply the integral formula for 1x\frac{1}{x}.

Answer: 2lnx+C-2 \ln|x| + C

Constants multiply through the entire result. This technique simplifies any constant multiple of 1x\frac{1}{x} by reducing it to the basic formula first.

3. Find profit from a reciprocal rate

Problem

A coffee shop's hourly profit rate is 240t\frac{240}{t} pounds per hour, where tt is hours after opening. If profit is £0 at t=1t = 1 hour, find the total profit at t=6t = 6 hours.
  1. P(t)=240tdtP(t) = \int \frac{240}{t} \, dt

    Total profit P(t)P(t) is found by integrating the profit rate (the rate of change of profit) with respect to time.

  2. P(t)=2401tdt=240lnt+CP(t) = 240 \int \frac{1}{t} \, dt = 240 \ln|t| + C

    Factor out the constant 240, then apply the integral formula for 1t\frac{1}{t} (since t>0t > 0 in this context, t=t|t| = t).

  3. 0=240ln(1)+C=2400+C=C0 = 240 \ln(1) + C = 240 \cdot 0 + C = C

    Use the initial condition: profit is £0 at t=1t = 1 hour. Since ln(1)=0\ln(1) = 0, we get C=0C = 0.

  4. P(6)=240ln(6)240×1.792430P(6) = 240 \ln(6) \approx 240 \times 1.792 \approx 430

    Evaluate at t=6t = 6 hours by substituting into P(t)=240ln(t)P(t) = 240 \ln(t) and computing 240ln(6)430240 \ln(6) \approx 430 pounds.

Answer: P(6)=240ln(6)430 poundsP(6) = 240 \ln(6) \approx 430 \text{ pounds}

This problem shows how the reciprocal integral arises in real-world contexts where rates change inversely with time, and how initial conditions let you find the particular solution.

Common mistakes

Where Integral of 1/x usually goes wrong
Answer came out wrong
Writing ln(x)\ln(x) instead of lnx\ln|x|
Always include the absolute value: 1xdx=lnx+C\int \frac{1}{x} dx = \ln|x| + C. This makes the formula valid for all x0x \neq 0.
Writing 1xdx=lnx\int \frac{1}{x} dx = \ln|x| (omitting the +C+ C)
Always write the constant of integration: 1xdx=lnx+C\int \frac{1}{x} dx = \ln|x| + C. The +C+ C is not optional—it represents all antiderivatives at once.
Applying the power rule and writing 1xdx=x00\int \frac{1}{x} dx = \frac{x^0}{0} (or claiming it is undefined)
Recognize that 1x\frac{1}{x} is the exception to the power rule and use the special formula 1xdx=lnx+C\int \frac{1}{x} dx = \ln|x| + C instead.
The mistakeWhy it is wrongThe fix
Writing ln(x)\ln(x) instead of lnx\ln|x|The natural logarithm is undefined for negative numbers, so ln(x)\ln(x) only works when x>0x > 0, leaving you with no answer for x<0x < 0.Always include the absolute value: 1xdx=lnx+C\int \frac{1}{x} dx = \ln|x| + C. This makes the formula valid for all x0x \neq 0.
Writing 1xdx=lnx\int \frac{1}{x} dx = \ln|x| (omitting the +C+ C)Without +C+ C, you claim there is exactly one antiderivative, but every function differing by a constant also has the same derivative.Always write the constant of integration: 1xdx=lnx+C\int \frac{1}{x} dx = \ln|x| + C. The +C+ C is not optional—it represents all antiderivatives at once.
Applying the power rule and writing 1xdx=x00\int \frac{1}{x} dx = \frac{x^0}{0} (or claiming it is undefined)The power rule xndx=xn+1n+1+C\int x^n dx = \frac{x^{n+1}}{n+1} + C breaks down when n=1n = -1 because you cannot divide by zero; the reciprocal case requires a different formula.Recognize that 1x\frac{1}{x} is the exception to the power rule and use the special formula 1xdx=lnx+C\int \frac{1}{x} dx = \ln|x| + C instead.

Tips and when to use something else

  • Always include the absolute value: lnx\ln|x| handles both positive and negative inputs, while ln(x)\ln(x) fails for x<0x < 0.
  • Factor out constants before integrating: axdx=alnx+C\int \frac{a}{x} dx = a \ln|x| + C for any constant aa.
  • This formula is an exception to the power rule—use it when you see x1x^{-1} or 1x\frac{1}{x}, never the power rule.
  • If your integral looks complicated, try U-Substitution first to transform it into the form 1udu\int \frac{1}{u} du before applying this formula.

Frequently asked questions

Why do we need the absolute value in ln|x|?
The natural logarithm function is only defined for positive arguments. When x is negative, ln(x) is undefined. The absolute value x|x| ensures we always feed a positive number to the logarithm, making the formula work for all nonzero values of x.
Do I have to write + C every single time?
Yes—when finding an indefinite integral, the +C+ C is mandatory. It represents the entire family of antiderivatives, since any two antiderivatives of the same function differ by exactly a constant. Omitting it claims you've found a unique answer, which is mathematically false.
Can I use this formula if I have 5xdx\int \frac{5}{x} dx or other constants in the numerator?
Absolutely. Pull out the constant first using linearity: 5xdx=51xdx=5lnx+C\int \frac{5}{x} dx = 5 \int \frac{1}{x} dx = 5 \ln|x| + C. This works for any constant coefficient in the numerator, whether positive, negative, or fractional.
What happens if my integral looks like 1x+3dx\int \frac{1}{x + 3} dx instead?
This is still a reciprocal, but of x+3x + 3 rather than xx alone. Use U-Substitution: let u=x+3u = x + 3, so du=dxdu = dx. Then 1x+3dx=1udu=lnu+C=lnx+3+C\int \frac{1}{x+3} dx = \int \frac{1}{u} du = \ln|u| + C = \ln|x+3| + C. The method is the same once you substitute.

Need a different method?

The full solver is not scoped to one formula — type any problem and it will pick the method.

Open the math solver

Reviewed 2026-09-18