The integral of 1/x is ln|x| + C, because the standard power rule of integration (∫xⁿ dx = x^(n+1)/(n+1) + C) fails specifically for n=-1, leading to an undefined division by zero (x⁰/0). Instead, the natural logarithm function, ln(x), is uniquely defined as the function whose derivative is 1/x, filling this mathematical gap. The absolute value, |x|, is crucial to ensure the antiderivative’s domain covers all non-zero real numbers, matching the domain of 1/x itself.
The integral of 1/x is an exception. It is the one exception to the integration power rule. Below, you will find out why the power rule fails. You will also learn how logarithms emerge naturally from the area under a hyperbola. In addition, you will get step-by-step proofs. We include seven worked examples, common pitfalls, and practice problems with solutions.
Why Does the Power Rule Fail for the Integral of 1/x?
The power rule for integration is a fundamental tool, but it has a specific limitation that makes it inapplicable to 1/x. The standard integration power rule states that for any real exponent n:
$$\int x^n \, dx = \frac{x^{n+1}}{n+1} + C$$
This rule works for every real power. However, it does not work for n = -1. If you attempt to plug n = -1 into the formula, the calculation collapses:
$$\int x^{-1} \, dx = \frac{x^{-1+1}}{-1+1} + C = \frac{x^0}{0} + C$$
Division by zero is mathematically undefined. Therefore, you cannot evaluate or simplify x⁰/0. It will not become a real number or function. Every other power integrates into an algebraic term. This includes positive, negative, integer, and fractional powers. For example, integrating x⁻² gives -x⁻¹ + C. Also, integrating x⁻⁰ˑ⁵ results in 2x⁰ˑ⁵ + C. However, the power n = -1 creates a single structural gap. In this case, algebra alone cannot yield an antiderivative.
How Does the Natural Logarithm Fill This Power Rule Gap?
The natural logarithm fills the gap left by the power rule because its derivative is exactly 1/x, making it the antiderivative. You must find a function whose derivative equals 1/x. This will be the antiderivative of 1/x. The natural logarithm function satisfies this exact differential relationship. This is due to the fundamental definition of logarithmic differentiation.
$$\frac{d}{dx} \ln(x) = \frac{1}{x} \quad \text{for } x > 0$$
This relationship is not an arbitrary patch invented to fix a failing rule. Instead, the natural logarithm is the mathematical limit of the power rule itself as the exponent approaches -1. Consider the definite integral of tⁿ from 1 to x for n ≠ -1:
$$\int_1^x t^n \, dt = \left[ \frac{t^{n+1}}{n+1} \right]_1^x = \frac{x^{n+1} - 1}{n+1}$$
Let h = n + 1. You can then see what happens as n approaches -1. As n → -1, h → 0. Substituting h gives:
$$\lim_{h \to 0} \frac{x^h - 1}{h}$$
We apply L’Hôpital’s Rule with respect to h. This means we differentiate the numerator and denominator with respect to h. As a result, this yields:
$$\lim_{h \to 0} \frac{\frac{d}{dh}(x^h - 1)}{\frac{d}{dh}(h)} = \lim_{h \to 0} \frac{x^h \ln(x)}{1} = x^0 \ln(x) = \ln(x)$$
This limit demonstrates an important concept. The standard power rule antiderivative converges smoothly. This happens as the exponent n moves continuously toward -1. Therefore, it approaches the natural logarithm.
Why is the Absolute Value Symbol Necessary in ln|x| + C?
The absolute value symbol is essential because it extends the domain of the antiderivative to include negative numbers, matching the full domain of the original function 1/x. The function f(x) = 1/x has a domain consisting of all real numbers except zero: (-∞, 0) ∪ (0, ∞). However, the standard logarithm function ln(x) is defined strictly for positive numbers (x > 0). Leaving out the absolute value bars would restrict your antiderivative to only half of the integrand’s domain.
To extend the antiderivative to negative numbers (x < 0), evaluate the derivative of ln(-x). Since x < 0, the argument -x is strictly positive, making ln(-x) well-defined. Using the chain rule:
$$\frac{d}{dx} \ln(-x) = \frac{1}{-x} \cdot \frac{d}{dx}(-x) = \frac{1}{-x} \cdot (-1) = \frac{1}{x}$$
The derivative of ln(x) equals 1/x for positive numbers. Also, the derivative of ln(-x) equals 1/x for negative numbers. Therefore, both cases combine into a single formula. You can use the absolute value function.
$$\int \frac{1}{x} \, dx = \ln|x| + C$$
Strictly speaking, the function domain splits into two disconnected intervals. This occurs at x = 0. Therefore, the constant of integration could take different values on each side.
$$\int \frac{1}{x} \, dx = \begin{cases} \ln(x) + C_1 & \text{if } x > 0 \\ \ln(-x) + C_2 & \text{if } x < 0 \end{cases}$$
This distinction with two constants (C1 and C2) is mathematically precise because the antiderivative on one interval does not necessarily connect smoothly to the antiderivative on the other. For instance, you could have ln(x) + 5 for x > 0 and ln(-x) + 10 for x < 0. However, in standard calculus coursework, you typically write a single constant C for simplicity, which also applies to most practical applications. Therefore, you write it as ln|x| + C. This applies across both domains.
Why is the Area Under a Hyperbola a Logarithm?
The geometric interpretation of the area under the hyperbola y = 1/x naturally leads to the properties of logarithms. You can understand the connection between 1/x and logarithms geometrically. Look at the area under the hyperbola y = 1/x. First, define an area function A(a). This is the region bounded by y = 1/t, the horizontal axis, t = 1, and t = a.
$$A(a) = \int_1^a \frac{1}{t} \, dt$$
Imagine stretching this geometric region horizontally by a scaling factor b while squashing it vertically by the same factor b. The horizontal transformation maps t to bt, and the vertical transformation maps y to y/b. The area differential transforms as:
$$dA = y \, dt \longrightarrow \left(\frac{y}{b}\right) \, d(bt) = \left(\frac{y}{b}\right) (b \, dt) = y \, dt$$
The scaling factors cancel out. So, the total area remains unchanged under this transformation. The original region was between t = 1 and t = a. It scales to a new region. This region runs from t = b to t = ab. It does so under the identical curve y = 1/t. Therefore, the area under the curve from b to ab equals the area from 1 to a.
$$\int_b^{ab} \frac{1}{t} \, dt = \int_1^a \frac{1}{t} \, dt = A(a)$$
You can add the area from 1 to b to both sides. This area is A(b). As a result, you obtain the following:
$$\int_1^{ab} \frac{1}{t} \, dt = \int_1^b \frac{1}{t} \, dt + \int_b^{ab} \frac{1}{t} \, dt \implies A(ab) = A(a) + A(b)$$
Any continuous function converts multiplication of inputs into addition of outputs. This function is a logarithmic function. By the Fundamental Theorem of Calculus, the derivative of A(x) at x = 1 is 1/1 = 1. This proves that A(x) is specifically the natural logarithm ln(x).
How Do You Evaluate Definite Integrals of 1/x?
To evaluate definite integrals of 1/x, apply the Fundamental Theorem of Calculus by evaluating the antiderivative at the upper and lower limits of integration. When you compute definite integrals of 1/x, evaluate the antiderivative at the upper and lower limits. Use the Fundamental Theorem of Calculus to do this.

$$\int_a^b \frac{1}{x} \, dx = [\ln|x|]_a^b = \ln|b| - \ln|a| = \ln\left|\frac{b}{a}\right|$$
Here are three fundamental examples:
- Integrating from 1 to e: \(\int_1^e \frac{1}{x} \, dx = \ln(e) - \ln(1) = 1 - 0 = 1\). This equation gives a standard geometric definition of Euler’s number e. Also, it is the exact upper bound. Here, the area under 1/x starting at 1 equals 1.
- Integrating over a positive interval: \(\int_1^2 \frac{1}{x} \, dx = \ln(2) - \ln(1) = \ln(2) \approx 0.6931\).
- Integrating over a negative interval: \(\int_{-3}^{-1} \frac{1}{x} \, dx = \ln|-1| - \ln|-3|\). This equals \(\ln(1) - \ln(3)\). Therefore, it is \(-\ln(3) \approx -1.0986\). The result is negative. This is because the curve y = 1/x lies below the x-axis for negative values.
Warning on improper integrals: You cannot use simple substitution here. For example, do not evaluate \(\int_{-1}^1 \frac{1}{x} \, dx\) to get \(\ln|1| - \ln|-1| = 0\). The integrand 1/x has an infinite vertical asymptote at x = 0. Therefore, this is an improper integral. You must split it at the discontinuity.
$$\int_{-1}^1 \frac{1}{x} \, dx = \lim_{t \to 0^-} \int_{-1}^t \frac{1}{x} \, dx + \lim_{s \to 0^+} \int_s^1 \frac{1}{x} \, dx$$
Because \(\lim_{t \to 0^-} \ln|t| = -\infty\), both limits diverge. Consequently, the integral diverges and has no finite value.
How Do You Integrate Algebraic Variations of 1/x?
Many common rational and logarithmic integrals simplify directly into forms related to 1/x using u-substitution. This technique allows you to transform complex integrals into the basic 1/u form, making them solvable with natural logarithms.

Linear Denominator Pattern
When the denominator is a linear expression ax + b, you can substitute u = ax + b. This gives du = a dx. So, dx = du/a.
$$\int \frac{1}{ax + b} \, dx = \frac{1}{a} \int \frac{1}{u} \, du = \frac{1}{a} \ln|ax + b| + C$$
For example:
$$\int \frac{1}{3x + 2} \, dx = \frac{1}{3} \ln|3x + 2| + C$$
Derivative-Over-Function Pattern
Whenever the numerator of a fraction equals the exact derivative of its denominator, the integral yields a natural logarithm:
$$\int \frac{f'(x)}{f(x)} \, dx = \ln|f(x)| + C$$
For example, to evaluate \(\int \frac{2x}{x^2 + 1} \, dx\), set u = x² + 1. The derivative is du = 2x dx, yielding:
$$\int \frac{2x}{x^2 + 1} \, dx = \int \frac{du}{u} = \ln|x^2 + 1| + C$$
The term x² + 1 > 0 for all real x. Therefore, absolute value signs are unnecessary here. You can use this same technique to solve trigonometric integrals. For example, consider the integral of tan x. You rewrite tan(x) as sin(x)/cos(x). This exposes the derivative of cos(x) in the numerator.
Seven Worked Examples
These examples illustrate various scenarios where the integral of 1/x, or its variations, appears in integration problems.
Example 1 (Splitting a rational expression). Evaluate \(\int \frac{x^2 + 1}{x} \, dx\).
Divide each term in the numerator by the denominator x first:
$$\int \left( \frac{x^2}{x} + \frac{1}{x} \right) \, dx = \int \left( x + \frac{1}{x} \right) \, dx$$
Apply the power rule to the first term and the logarithmic rule to the second term:
$$\int \left( x + \frac{1}{x} \right) \, dx = \frac{x^2}{2} + \ln|x| + C$$
Example 2 (Logarithm inside a denominator). Evaluate \(\int \frac{1}{x \ln(x)} \, dx\).
Notice that 1/x is the derivative of ln(x). Let u = ln(x), so du = (1/x) dx. Substituting these into the integral gives:
$$\int \frac{1}{\ln(x)} \cdot \frac{1}{x} \, dx = \int \frac{1}{u} \, du = \ln|u| + C = \ln|\ln(x)| + C$$
Over the interval [e, e²], evaluating this integral yields \(\ln|\ln(e²)| - \ln|\ln(e)| = \ln(2) - \ln(1) = \ln(2)\).
Example 3 (Exponential in the numerator). Evaluate \(\int \frac{e^x}{e^x + 3} \, dx\).
The numerator eˣ is the exact derivative of the denominator eˣ + 3. Let u = eˣ + 3, so du = eˣ dx:
$$\int \frac{du}{u} = \ln|u| + C = \ln(e^x + 3) + C$$
You can drop the absolute value bars. This is because eˣ + 3 is strictly positive for all real x.
Integrating Using Partial Fractions
Example 4 (Partial fraction decomposition). Evaluate \(\int \frac{1}{x(x+1)} \, dx\).
Split the integrand into simpler components using partial fraction decomposition:
$$\frac{1}{x(x+1)} = \frac{1}{x} - \frac{1}{x+1}$$
Integrate each term individually:
$$\int \left( \frac{1}{x} - \frac{1}{x+1} \right) \, dx = \ln|x| - \ln|x+1| + C = \ln\left| \frac{x}{x+1} \right| + C$$
Example 5 (Scaling bounds in a definite integral). Evaluate \(\int_e^{e^3} \frac{1}{x} \, dx\).
Apply the fundamental theorem of calculus:
$$\int_e^{e^3} \frac{1}{x} \, dx = [\ln|x|]_e^{e^3} = \ln(e^3) - \ln(e) = 3 - 1 = 2$$
Example 6 (Identifying non-logarithmic look-alikes). Evaluate \(\int \frac{1}{x^2 + 1} \, dx\).
People often mistake this expression for a logarithm. However, the numerator (1) is not the derivative of the denominator (2x). Instead, this integral is a fundamental inverse trigonometric form:
$$\int \frac{1}{x^2 + 1} \, dx = \arctan(x) + C$$
Always inspect the numerator before assuming a rational expression integrates to a logarithm. You can verify antiderivatives like this quickly using an integral calculator.
Example 7 (Definite integration over negative domains). Evaluate \(\int_{-3}^{-1} \frac{1}{x} \, dx\).
Apply the absolute value rule within the logarithmic antiderivative:
$$\int_{-3}^{-1} \frac{1}{x} \, dx = [\ln|x|]_{-3}^{-1} = \ln|-1| - \ln|-3| = \ln(1) - \ln(3) = 0 - \ln(3) = -\ln(3) \approx -1.0986$$
How to Identify When an Integral Yields a Logarithm
Before integrating a fraction, run through this three-step checklist to select the correct method:

- Is the denominator a single power x¹ or a linear term ax + b? If yes, the integral evaluates directly to a natural logarithm. Higher powers like x² or x³ require the power rule instead.
- Is the numerator proportional to the derivative of the denominator? Check if the fraction matches k · f'(x) / f(x). If it does, substitute u = f(x) to obtain k · ln|f(x)| + C.
- Is the numerator’s degree equal to or greater than the denominator’s? First, use polynomial long division. This separates the fraction into a polynomial plus a proper remainder fraction. Then, check if the remainder yields a log.
Common Mistakes When Integrating 1/x
Avoiding these common errors will help ensure accuracy when dealing with integrals involving 1/x and similar forms.
- Applying the standard power rule. Writing \(\int x^{-1} \, dx = \frac{x^0}{0}\) creates an undefined division by zero. Therefore, always use ln|x| + C for n = -1.
- Omitting the absolute value signs. Writing ln(x) + C instead of ln|x| + C invalidates the answer for negative x values. The domain of ln(x) is only x > 0, while 1/x is defined for all x ≠ 0.
- Forgetting the chain rule constant factor. Writing \(\int \frac{1}{3x+2} \, dx = \ln|3x+2| + C\) leaves out the factor of 1/3 from u-substitution. The correct antiderivative, however, is \(\frac{1}{3}\ln|3x+2| + C\). This happens when the coefficient of x in the linear denominator is not 1.
- Assuming symmetry cancels discontinuities across zero. Evaluating \(\int_{-1}^1 \frac{1}{x} \, dx = 0\) is incorrect because 1/x approaches infinity at x = 0, causing the improper integral to diverge. You must split the integral at the discontinuity and evaluate the limits separately.
- Mistaking quadratic denominators for logarithms. You might mistake quadratic denominators for logarithms. For example, terms like \(\int \frac{1}{x^2} \, dx\) integrate to -1/x + C. This happens via the power rule. Also, \(\int \frac{1}{x^2+1} \, dx\) integrates to arctan(x) + C. Always check if the numerator is the derivative (or proportional to the derivative) of the denominator.
Where Is the Integral of 1/x Used in Mathematics and Science?
The integral of 1/x appears repeatedly across applied mathematics, physics, and chemistry, demonstrating its fundamental importance in modeling natural phenomena.

- Separable differential equations: You can model population growth or radioactive decay. First, start with \(\frac{dy}{dt} = ky\). Separating variables gives \(\int \frac{1}{y} \, dy = \int k \, dt\). This yields \(\ln|y| = kt + C\). As a result, this leads directly to exponential growth \(y(t) = y_0 e^{kt}\).
- Thermodynamics and gas expansion: An ideal gas undergoes isothermal (constant temperature) expansion. You can calculate the physical work W performed by integrating pressure over volume. So, \( W = \int_{V_1}^{V_2} P \, dV = \int_{V_1}^{V_2} \frac{nRT}{V} \, dV = nRT \ln\left(\frac{V_2}{V_1}\right) \).
- Infinite series convergence: The integral \(\int_1^\infty \frac{1}{x} \, dx\) diverges. It equals \(\lim_{b \to \infty} \ln(b) = \infty\). This proves the harmonic series \(\sum_{n=1}^\infty \frac{1}{n}\) diverges. We know this via the Integral Test. Conversely, series with higher powers, like \(\sum \frac{1}{n^2}\), converge. You can see the ratio test article for more on series convergence.
Learning how 1/x integrates into logarithms also sets up advanced integration techniques. For example, you use integration by parts to find the integral of ln x.
Try It Yourself
Use this interactive tool to test your understanding of integrating expressions related to 1/x.
Step-by-step solver·Exact symbolic engine
Interactive Calculus Problem Solver
Derivatives, antiderivatives, definite and improper integrals, and limits. Every answer comes with the rules used, and antiderivatives are verified by differentiating them back.
Input syntax
- Powers
x^2, rootssqrt(x),cbrt(x), absolute value|x| - Implicit multiplication works:
3x sin(2x) sin cos tan sec csc cot,asin acos atan,sinh cosh tanhe^xorexp(x);ln(x)is the natural log. In this solverlog(x)also means the natural log (the usual calculus convention); typelog10(x)for base 10- Constants
piande; bounds acceptinfand-inf
Practice Problems
Test your understanding with these practice problems:

- \(\int \frac{3}{x} \, dx\)
- \(\int \frac{1}{5 - 2x} \, dx\)
- \(\int_2^8 \frac{1}{x} \, dx\)
- \(\int \frac{x + 1}{x} \, dx\)
- \(\int \frac{e^x}{e^x + 3} \, dx\)
- \(\int_e^{e^3} \frac{1}{x} \, dx\)
Answers:
- \(3\ln|x| + C\)
- \(-\frac{1}{2}\ln|5 - 2x| + C\)
- \(\ln(4)\) (since \(\ln(8) - \ln(2) = \ln(8/2) = \ln(4)\))
- \(x + \ln|x| + C\)
- \(\ln(e^x + 3) + C\)
- \(2\)
Frequently Asked Questions
Is the integral of 1/x equal to ln(x) or ln|x|?
For strictly positive numbers (x > 0), the answer is ln(x) + C. However, the general antiderivative valid across all non-zero real numbers requires absolute value bars: ln|x| + C. This ensures the domain of the antiderivative matches that of 1/x.
What is the integral of 1/x²?
The integral of 1/x² does not use logarithms because the power rule applies for n = -2. Rewriting as \(\int x^{-2} \, dx\) gives \(\frac{x^{-1}}{-1} + C = -\frac{1}{x} + C\).
Why does the integral of 1/x from 1 to infinity diverge?
Evaluating \(\int_1^b \frac{1}{x} \, dx\) yields ln(b). As b approaches infinity, ln(b) grows without bound toward infinity. As a result, the improper integral is divergent.
What is the integral of 1/(ax + b)?
Using u-substitution with u = ax + b gives \(\frac{1}{a}\ln|ax + b| + C\). The leading factor 1/a, therefore, accounts for the derivative of the inner linear function.
Why is the definite integral of 1/x from -1 to 1 not equal to zero?
The function 1/x has an infinite vertical discontinuity at x = 0. Because both single-sided integrals from -1 to 0 and from 0 to 1 diverge individually, the overall improper integral diverges.
Further Reading
- Computing Indefinite Integrals (Paul’s Online Math Notes) — basic integration rules, including the special case for 1/x.
- Derivatives of Exponential and Logarithmic Functions (OpenStax Calculus Volume 1) — detailed derivations of logarithmic derivatives and antiderivatives.
- Integral Test (Paul’s Online Math Notes) — how the divergence of the integral of 1/x proves harmonic series divergence.
Calculators for this topic
Keep learning
Integration Formulas and Integral Rules: Complete List
Every basic integration formula and integral rule: power, exponential, log, trig and inverse trig integrals, substitution, by parts and definite integrals.
Integrals Class 12: All Formulas, Methods and Solved Examples
Class 12 Integrals: standard formulas, substitution, partial fractions, integration by parts, special integrals and definite integral properties, solved.

