MAT1052 · Week 1 · L'Hôpital's Rule, Improper Integrals

L'Hôpital's rule and improper integrals

You learn to solve indeterminate limits with derivatives and to show whether integrals that run to infinity or have singularities converge. This is the foundation of the integral test for series.

indeterminate formL'Hôpital's ruleimproper integralconvergedivergep-integraldirect comparison testlimit comparison test

The first week of Calculus II gives you two tools together. L’Hôpital’s rule solves indeterminate forms with derivatives. Improper integrals define, with limits, integrals whose limit is infinite or whose integrand blows up. The two are linked: when finding the value of an improper integral, an L’Hôpital limit almost always shows up at the end. The integral test in week 3 is also built directly on this topic.

The exam typically has 2-3 limits and 1-2 integrals of the “evaluate or show that it diverges” kind. Golden rules:

  1. Plug in first. L’Hôpital is valid only for the forms 0/00/0 or ∞/∞\infty/\infty.
  2. Differentiate the numerator and denominator separately. Do not use the quotient rule.
  3. Turn the other indeterminate forms (0⋅∞0\cdot\infty, ∞−∞\infty-\infty, 1∞1^\infty, 000^0, ∞0\infty^0) into 0/00/0 or ∞/∞\infty/\infty first.
  4. Improper integral = limit. You do not plug in infinity or the singular point directly; you write bb and take a limit.
  5. If there is a singularity inside the interval, split the integral at that point. If one of the pieces diverges, the whole thing diverges.

L’Hôpital’s rule

The rule. Let ff and gg be differentiable near aa, g′(x)≠0g'(x)\neq 0, and let lim⁡x→af(x)/g(x)\lim_{x\to a} f(x)/g(x) be of the form 0/00/0 or ∞/∞\infty/\infty. Then

lim⁡x→af(x)g(x)=lim⁡x→af′(x)g′(x)\lim_{x\to a}\frac{f(x)}{g(x)} = \lim_{x\to a}\frac{f'(x)}{g'(x)}

(if the limit on the right exists or is ±∞\pm\infty). Here aa can be a finite number, a±a^\pm or ±∞\pm\infty.

Intuition. In the 0/00/0 case both functions go to zero. Their slopes decide which one goes faster. Near aa, f(x)≈f′(a)(x−a)f(x)\approx f'(a)(x-a) and g(x)≈g′(a)(x−a)g(x)\approx g'(a)(x-a), and the ratio becomes f′(a)/g′(a)f'(a)/g'(a).

Example 1. lim⁡x→0ex−1−xx2\displaystyle\lim_{x\to 0}\frac{e^x-1-x}{x^2}

plug in x=0: (1-1-0)/0 = 0/0    → L'Hôpital
derivative:  (e^x - 1)/(2x)     → 0/0 again
derivative:  e^x / 2            → x=0: 1/2

The answer is 1/21/2. Check the form again at every step; you stop when the form is no longer indeterminate.

PITFALL · check the form. lim⁡x→0x+1cos⁡x\displaystyle\lim_{x\to 0}\frac{x+1}{\cos x} is not indeterminate, it is directly 1/1=11/1 = 1. If you apply L’Hôpital to it, you get 1−sin⁡x\dfrac{1}{-\sin x} and head to a wrong result.

Other indeterminate forms

FormWhat to doExample
0⋅∞0\cdot\inftyf⋅g=f1/gf\cdot g = \dfrac{f}{1/g}xln⁡x=ln⁡x1/xx\ln x = \dfrac{\ln x}{1/x}
∞−∞\infty-\inftycommon denominator, rationalize1x−1sin⁡x\dfrac1x - \dfrac{1}{\sin x}
1∞1^\infty, 000^0, ∞0\infty^0y=fgy = f^g, ln⁡y=gln⁡f\ln y = g\ln fxxx^x, (1+3/x)x(1+3/x)^x

Example 2. lim⁡x→0+xln⁡x\displaystyle\lim_{x\to 0^+} x\ln x. The form is 0⋅(−∞)0\cdot(-\infty).

xln⁡x=ln⁡x1/x  ⇒  1/x−1/x2=−x→0.x\ln x = \frac{\ln x}{1/x} \;\Rightarrow\; \frac{1/x}{-1/x^2} = -x \to 0.

Example 3. lim⁡x→∞(1+3x)x\displaystyle\lim_{x\to\infty}\left(1+\frac{3}{x}\right)^x. The form is 1∞1^\infty. Let yy be this expression:

ln⁡y=xln⁡ ⁣(1+3x)=ln⁡(1+3/x)1/x  →L’H  −3/x21+3/x−1/x2=31+3/x→3.\ln y = x\ln\!\left(1+\frac3x\right) = \frac{\ln(1+3/x)}{1/x} \;\xrightarrow{\text{L'H}}\; \frac{\dfrac{-3/x^2}{1+3/x}}{-1/x^2} = \frac{3}{1+3/x}\to 3.

So ln⁡y→3\ln y\to 3, y→e3y\to e^3. The general pattern: lim⁡x→∞(1+a/x)bx=eab\lim_{x\to\infty}(1+a/x)^{bx} = e^{ab}.

Example 4. lim⁡x→0+xx\displaystyle\lim_{x\to 0^+} x^x. The form is 000^0. ln⁡y=xln⁡x→0\ln y = x\ln x \to 0 (Example 2), so y→e0=1y\to e^0 = 1.

TIP · do not forget the last step. In 1∞1^\infty, 000^0, ∞0\infty^0 questions, the limit you find is the limit of ln⁡y\ln y. The answer is e(that number)e^{(\text{that number})}. This last line is where most points are lost.

Growth rates

As x→∞x\to\infty: ln⁡x≪xp≪ex\ln x \ll x^p \ll e^x (for every p>0p>0). L’Hôpital shows this: ln⁡xxp→1/xpxp−1=1pxp→0\dfrac{\ln x}{x^p}\to\dfrac{1/x}{p x^{p-1}} = \dfrac{1}{p x^p}\to 0. You will use this ordering constantly in the series chapter.

The exponential function beats every polynomial. For lim⁡x→∞x2ex\displaystyle\lim_{x\to\infty}\frac{x^2}{e^x}, apply L’Hôpital twice: 2xex\dfrac{2x}{e^x}, then 2ex→0\dfrac{2}{e^x}\to 0. With each derivative the degree of the polynomial drops by one, while exe^x never changes. For x10x^{10} you take ten derivatives, and the result is still 00. In the exam, do not wonder “how many times should I apply L’Hôpital”; keep going while the form stays indeterminate, and stop when the indeterminacy is gone.

Sometimes L’Hôpital does not work and goes in a loop: when x2+1x\dfrac{\sqrt{x^2+1}}{x} is differentiated it becomes xx2+1\dfrac{x}{\sqrt{x^2+1}}, and if you differentiate again you are back at the start. In that case use algebra: factor out the largest power in the numerator and denominator, 1+1/x2→1\sqrt{1+1/x^2}\to 1.

Improper integrals

The definite integral ∫abf dx\int_a^b f\,dx is defined for a bounded function on a finite interval. This breaks down in two cases:

Type 1: infinite interval.

∫a∞f(x) dx=lim⁡b→∞∫abf(x) dx,∫−∞∞f dx=∫−∞cf dx+∫c∞f dx.\int_a^\infty f(x)\,dx = \lim_{b\to\infty}\int_a^b f(x)\,dx, \qquad \int_{-\infty}^\infty f\,dx = \int_{-\infty}^c f\,dx + \int_c^\infty f\,dx.

Type 2: the integrand goes to infinity at the boundary or inside. If ff blows up at the point bb, then

∫abf(x) dx=lim⁡c→b−∫acf(x) dx.\int_a^b f(x)\,dx = \lim_{c\to b^-}\int_a^c f(x)\,dx.

If the limit is a finite number the integral converges, otherwise it diverges. For ∫−∞∞\int_{-\infty}^{\infty} and for cases with a singularity inside, each piece must converge separately.

Example 5. ∫1∞dxx2=lim⁡b→∞[−1x]1b=lim⁡b→∞(1−1b)=1.\displaystyle\int_1^\infty \frac{dx}{x^2} = \lim_{b\to\infty}\left[-\frac1x\right]_1^b = \lim_{b\to\infty}\left(1-\frac1b\right) = 1.

Example 6. ∫1∞dxx=lim⁡b→∞ln⁡b=∞\displaystyle\int_1^\infty \frac{dx}{x} = \lim_{b\to\infty}\ln b = \infty, diverges. 1/x1/x goes to zero, but not fast enough. The area under it is infinite.

Example 7. ∫01dxx=lim⁡a→0+[2x]a1=2.\displaystyle\int_0^1 \frac{dx}{\sqrt x} = \lim_{a\to 0^+}\left[2\sqrt x\right]_a^1 = 2. The function goes to infinity but the area is finite.

Example 8. ∫0∞xe−x dx\displaystyle\int_0^\infty x e^{-x}\,dx. Integration by parts: ∫xe−xdx=−xe−x−e−x\int x e^{-x}dx = -xe^{-x} - e^{-x}.

lim⁡b→∞(−be−b−e−b)−(0−1)=0+1=1.\lim_{b\to\infty}\left(-be^{-b}-e^{-b}\right) - (0 - 1) = 0 + 1 = 1.

The step be−b=b/eb→0b e^{-b} = b/e^b \to 0 is an L’Hôpital limit.

p-integrals

The reference families you will use for comparison:

IntegralConvergesDivergesValue
∫1∞dxxp\displaystyle\int_1^\infty \frac{dx}{x^p}p>1p>1p≤1p\le 11p−1\dfrac{1}{p-1}
∫01dxxp\displaystyle\int_0^1 \frac{dx}{x^p}p<1p<1p≥1p\ge 111−p\dfrac{1}{1-p}

p=1p=1 diverges on both sides. Memorize this table.

Comparison tests

Even if you cannot compute the integral, you can show whether it converges.

Direct comparison. Let 0≤f(x)≤g(x)0\le f(x)\le g(x) for x≥ax\ge a.

  • If ∫a∞g\int_a^\infty g converges, then ∫a∞f\int_a^\infty f converges too.
  • If ∫a∞f\int_a^\infty f diverges, then ∫a∞g\int_a^\infty g diverges too.

Limit comparison. If f,g>0f,g>0 and lim⁡x→∞f(x)/g(x)=L\lim_{x\to\infty} f(x)/g(x) = L with 0<L<∞0<L<\infty, the two integrals either both converge or both diverge.

Example 9. ∫1∞e−x2dx\int_1^\infty e^{-x^2}dx cannot be computed (with elementary functions), but for x≥1x\ge1, x2≥xx^2\ge x, so e−x2≤e−xe^{-x^2}\le e^{-x}. Since ∫1∞e−xdx=1/e\int_1^\infty e^{-x}dx = 1/e converges, ∫1∞e−x2dx\int_1^\infty e^{-x^2}dx converges.

Example 10. ∫1∞dxx+1\displaystyle\int_1^\infty \frac{dx}{\sqrt{x}+1}. Limit comparison with g=1/xg = 1/\sqrt x: 1/(x+1)1/x=xx+1→1\dfrac{1/(\sqrt x+1)}{1/\sqrt x} = \dfrac{\sqrt x}{\sqrt x+1}\to 1. ∫1∞x−1/2dx\int_1^\infty x^{-1/2}dx diverges (p=1/2≤1p=1/2\le1), so the given integral diverges too.

Singularity inside

Example 11. ∫03dx(x−1)2/3\displaystyle\int_0^3 \frac{dx}{(x-1)^{2/3}}. The integrand blows up at x=1x=1, and this point is inside the interval [0,3][0,3]. Split in two:

∫01(x−1)−2/3dx=lim⁡c→1−[3(x−1)1/3]0c=0−3(−1)=3,\int_0^1 (x-1)^{-2/3}dx = \lim_{c\to1^-}\left[3(x-1)^{1/3}\right]_0^c = 0-3(-1) = 3,

∫13(x−1)−2/3dx=lim⁡c→1+[3(x−1)1/3]c3=323−0.\int_1^3 (x-1)^{-2/3}dx = \lim_{c\to1^+}\left[3(x-1)^{1/3}\right]_c^3 = 3\sqrt[3]{2}-0.

Both pieces are finite, the total is 3+323≈6.783+3\sqrt[3]{2}\approx 6.78. If one of the pieces had come out infinite, the answer would be “diverges”; the value of the other would not matter.

Solution template for the exam

In an “evaluate or show that it diverges” question, follow this order:

1) Find the problem points: is a limit ∞? is there an x that makes the denominator zero? is ln or a root outside its domain?
2) Write a separate piece for each problem point, and write each piece with lim
3) Find the antiderivative (u-sub, integration by parts, partial fractions)
4) Take the limit; use L'Hôpital if needed (like b e^-b, ln b / b)
5) All finite → converges, write the value.  One is ∞ → diverges

If the antiderivative cannot be found (for example e−x2e^{-x^2}, 1x4+1\dfrac{1}{\sqrt{x^4+1}}), the question already asks “converge or diverge?”. Then instead of steps 3 and 4, you do a comparison: look at the behavior of the integrand as x→∞x\to\infty, find the dominant term, and compare with a p-integral. For example 1x4+1≈1x2\dfrac{1}{\sqrt{x^4+1}}\approx \dfrac{1}{x^2}, so it converges.

PITFALL · the direction of the comparison. “I am bigger than something that converges” proves nothing. To show convergence you must show that you are smaller than something that converges, and to show divergence that you are bigger than something that diverges.

Common mistakes

WrongCorrect
Applying L’Hôpital without looking at the formPlug in first; only 0/00/0, ∞/∞\infty/\infty
Taking (f/g)′(f/g)' (quotient rule)f′f' and g′g' separately
Writing the limit of ln⁡y\ln y as the answer in a 1∞1^\infty questionThe answer is elim⁡ln⁡ye^{\lim \ln y}
Saying 1∞=11^\infty = 1An indeterminate form; (1+1/x)x→e(1+1/x)^x \to e
∫−11x−2dx=−2\int_{-1}^1 x^{-2}dx = -2x=0x=0 is inside, it diverges
∫−∞∞x dx=0\int_{-\infty}^\infty x\,dx = 0 (“symmetric”)Both pieces diverge separately, the integral diverges
If f→0f\to 0 then ∫1∞f\int_1^\infty f converges1/x→01/x\to0 but the integral diverges
Concluding convergence from being smaller than something that divergesFor convergence you must be smaller than something that converges

Test yourself

Exam-style questions. Solve them on paper first, then reveal the answer.

Question 1easy

Evaluate lim⁡x→0sin⁡5x3x\lim_{x\to 0} \dfrac{\sin 5x}{3x}.

Show answer
5/35/3

Plugging in x=0x=0 gives 0/00/0, so L'Hôpital applies.
The derivative of the numerator and denominator: 5cos⁡5x3\dfrac{5\cos 5x}{3}. Plug in x=0x=0: 5/35/3.

Question 2easy

Evaluate lim⁡x→∞ln⁡xx\lim_{x\to\infty} \dfrac{\ln x}{\sqrt{x}}.

Show answer
00

The form is ∞/∞\infty/\infty. Derivatives: 1/x1/(2x)=2x→0\dfrac{1/x}{1/(2\sqrt{x})} = \dfrac{2}{\sqrt{x}} \to 0.
The logarithm grows more slowly than any positive power.

Question 3medium

Evaluate lim⁡x→01−cos⁡2xx2\lim_{x\to 0} \dfrac{1-\cos 2x}{x^2}.

Show answer
22

0/00/0. Apply L'Hôpital once: 2sin⁡2x2x\dfrac{2\sin 2x}{2x}, still 0/00/0.
Once more: 4cos⁡2x2→2\dfrac{4\cos 2x}{2} \to 2.

Question 4medium

Evaluate lim⁡x→∞(1−2x)3x\lim_{x\to\infty} \left(1-\dfrac{2}{x}\right)^{3x}.

Show answer
e−6e^{-6}

The form is 1∞1^\infty. Let LL be the limit: ln⁡L=lim⁡3xln⁡(1−2/x)\ln L = \lim 3x\ln(1-2/x), which is ∞⋅0\infty\cdot 0.
Write ln⁡(1−2/x)1/(3x)\dfrac{\ln(1-2/x)}{1/(3x)} and apply L'Hôpital: the numerator's derivative is 2/x21−2/x\dfrac{2/x^2}{1-2/x}, the denominator's derivative is −13x2-\dfrac{1}{3x^2}.
The ratio is −61−2/x→−6\dfrac{-6}{1-2/x}\to -6. So L=e−6L=e^{-6}.

Question 5medium

Evaluate lim⁡x→0(1x−1sin⁡x)\lim_{x\to 0} \left(\dfrac{1}{x} - \dfrac{1}{\sin x}\right).

Show answer
00

The form is ∞−∞\infty-\infty. Common denominator: sin⁡x−xxsin⁡x\dfrac{\sin x - x}{x\sin x}, now 0/00/0.
L'Hôpital: cos⁡x−1sin⁡x+xcos⁡x\dfrac{\cos x - 1}{\sin x + x\cos x}, again 0/00/0.
Once more: −sin⁡x2cos⁡x−xsin⁡x→02=0\dfrac{-\sin x}{2\cos x - x\sin x} \to \dfrac{0}{2} = 0.

Question 6hard

Evaluate lim⁡x→0tan⁡x−xx3\lim_{x\to 0} \dfrac{\tan x - x}{x^3}.

Show answer
1/31/3

0/00/0. Derivative: sec⁡2x−13x2=tan⁡2x3x2\dfrac{\sec^2 x - 1}{3x^2} = \dfrac{\tan^2 x}{3x^2}.
Since tan⁡xx→1\dfrac{\tan x}{x}\to 1, the result is 13\dfrac{1}{3}.

Question 7easy

Evaluate ∫2∞dxx3\displaystyle\int_2^\infty \frac{dx}{x^3}.

Show answer
1/81/8

lim⁡b→∞[−12x2]2b=lim⁡b→∞(−12b2+18)=18\displaystyle\lim_{b\to\infty}\left[-\frac{1}{2x^2}\right]_2^b = \lim_{b\to\infty}\left(-\frac{1}{2b^2}+\frac{1}{8}\right) = \frac{1}{8}.

Question 8medium

Evaluate ∫04dx4−x\displaystyle\int_0^4 \frac{dx}{\sqrt{4-x}} or show that it diverges.

Show answer
44 (converges)

The integrand goes to infinity at x=4x=4, so the singularity is at the upper limit.lim⁡b→4−[−24−x]0b=lim⁡b→4−(−24−b+4)=4\displaystyle\lim_{b\to 4^-}\left[-2\sqrt{4-x}\right]_0^b = \lim_{b\to 4^-}\left(-2\sqrt{4-b}+4\right) = 4.

Question 9medium

Evaluate ∫0∞dx1+x2\displaystyle\int_0^\infty \frac{dx}{1+x^2}.

Show answer
π/2\pi/2

lim⁡b→∞arctan⁡b−arctan⁡0=π2−0\displaystyle\lim_{b\to\infty}\arctan b - \arctan 0 = \frac{\pi}{2} - 0.

Question 10hard

A student writes ∫−11dxx2=[−1x]−11=−2\displaystyle\int_{-1}^{1}\frac{dx}{x^2} = \left[-\frac{1}{x}\right]_{-1}^{1} = -2. Is this correct?

Show answer
No, the integral diverges

The integral of a positive function cannot be negative, which is the first alarm. The problem: 1/x21/x^2 is undefined at x=0x=0, and this point is INSIDE the interval.
Split the integral at 00: ∫01dxx2=lim⁡a→0+(1a−1)=∞\displaystyle\int_0^1 \frac{dx}{x^2} = \lim_{a\to 0^+}\left(\frac{1}{a}-1\right)=\infty.
Since one piece diverges, the whole thing diverges.

Question 11hard

Evaluate ∫1∞ln⁡xx2 dx\displaystyle\int_1^\infty \frac{\ln x}{x^2}\,dx.

Show answer
11

Integration by parts: u=ln⁡xu=\ln x, dv=x−2dxdv = x^{-2}dx, v=−1/xv=-1/x.∫ln⁡xx2dx=−ln⁡xx+∫dxx2=−ln⁡xx−1x\displaystyle\int \frac{\ln x}{x^2}dx = -\frac{\ln x}{x} + \int \frac{dx}{x^2} = -\frac{\ln x}{x} - \frac{1}{x}.
As b→∞b\to\infty, ln⁡b/b→0\ln b / b \to 0 (L'Hôpital). Result: 0−(0−1)=10 - (0 - 1) = 1.

Question 12medium

Does ∫1∞dxx3+5\displaystyle\int_1^\infty \frac{dx}{x^3+5} converge or diverge? Justify with a comparison.

Show answer
Converges

For x≥1x\ge 1, x3+5>x3x^3+5 > x^3, so 0<1x3+5<1x30 < \dfrac{1}{x^3+5} < \dfrac{1}{x^3}.∫1∞dxx3\displaystyle\int_1^\infty \frac{dx}{x^3} is a p-integral (p=3>1p=3>1) and converges. By direct comparison, the smaller one converges too. (Its value is about 0.2225.)

Verification: Limits were evaluated numerically with values very close to the point, and improper integrals with tanh-sinh and an infinite-interval transformation in node (verify/MAT1052/01.mjs).

Review card

L'Hopital: only when 0/0 or ∞/∞. lim f/g = lim f'/g' (NOT the derivative of the quotient) 0·∞ → write f/(1/g). ∞-∞ → common denominator. 1^∞, 0^0, ∞^0 → take ln, then e^(...) lim (1+a/x)^(bx) = e^(ab) ln x << x^p << e^x (x→∞) Improper type 1: ∫_a^∞ f = lim_{b→∞} ∫_a^b f Improper type 2: singularity at c → approach with lim; if c is inside the interval, split in two p-integral: ∫_1^∞ 1/x^p → p>1 converges (=1/(p-1)), p≤1 diverges ∫_0^1 1/x^p → p<1 converges (=1/(1-p)), p≥1 diverges ∫_{-∞}^{∞}: split in two, BOTH must converge Comparison: 0≤f≤g, ∫g converges → ∫f converges; ∫f diverges → ∫g diverges Limit comp.: lim f/g = L, 0<L<∞ → both share the same fate PITFALL: ∫_{-1}^{1} 1/x^2 = -2 is wrong, it diverges (x=0 is inside)