Week 2 Discussion Notes

Table of Contents

L'Hôpital's Rule

Here's an abridged statement of L'Hôpital's rule:

Theorem (L'Hôpital's rule)

Let f(x),g(x)f\p{x}, g\p{x} be functions such that

  1. limxaf(x)=limxag(x)=0\lim_{x\to a} f\p{x} = \lim_{x\to a} g\p{x} = 0 or limxaf(x)\lim_{x\to a} f\p{x} and limxag(x)\lim_{x\to a} g\p{x} are both infinite.
  2. limxaf(x)g(x)\lim_{x\to a} \frac{f'\p{x}}{g'\p{x}} exists or is infinite.

Then

limxaf(x)g(x)=limxaf(x)g(x).\lim_{x\to a} \frac{f\p{x}}{g\p{x}} = \lim_{x\to a} \frac{f'\p{x}}{g'\p{x}}.

It's slightly different from the textbook's definition because I wanted to focus on what I think are the more interesting conditions.

Pitfalls

Don't use the quotient rule!

Example 1.

Calculate limxxex\displaystyle \lim_{x\to \infty} \frac{x}{e^x}.

Solution.

As xx \to \infty, the numerator and denominator both go to \infty also, so we can apply L'Hôpital's rule. Sometimes, students will write something like this:

limxxex=limxexxexe2x=0.\lim_{x\to\infty} \frac{x}{e^x} = \lim_{x\to\infty} \frac{e^x - xe^x}{e^{2x}} = 0.

The problem with this is that instead of taking the derivative of the numerator and denominator separately, this is the derivative of the entire fraction, which is wrong. Instead, you should end up with

limxxex=limx1ex=0.\lim_{x\to\infty} \frac{x}{e^x} = \lim_{x\to\infty} \frac{1}{e^x} = \boxed{0}.

Assumptions matter!

Example 2.

Calculate limx0x2cosx\displaystyle \lim_{x\to0} \frac{x^2}{\cos{x}}.

Solution.

The following thing is wrong:

limx0x2cosx=limx02xsinx=limx02sinxx=2.\lim_{x\to0} \frac{x^2}{\cos{x}} = \lim_{x\to0} \frac{2x}{-\sin{x}} = \lim_{x\to0} -\frac{2}{\frac{\sin{x}}{x}} = -2.

The problem here is that we didn't check condition (i) before applying L'Hôpital's rule. If we go back, you'll see that as x0x \to 0, the numerator goes to 00 but the denominator goes to 11, so we could've just plugged in to begin with:

limx0x2cosx=0.\lim_{x\to0} \frac{x^2}{\cos{x}} = \boxed{0}.
Example 3.

Calculate limxx+sinxx\displaystyle \lim_{x\to\infty} \frac{x + \sin{x}}{x}.

Solution.

This is also wrong:

limxx+sinxx=limx01+cosx1=DNE.\lim_{x\to\infty} \frac{x + \sin{x}}{x} = \lim_{x\to0} \frac{1 + \cos{x}}{1} = \dne.

This is because condition (ii) failed: the limit of f(x)g(x)\frac{f'\p{x}}{g'\p{x}} doesn't exist here, so you can't write the first equals sign. This means we need to try something else:

limxx+sinxx=limx(1+sinxx)=1.\lim_{x\to\infty} \frac{x + \sin{x}}{x} = \lim_{x\to\infty} \p{1 + \frac{\sin{x}}{x}} = \boxed{1}.

Your old techniques are still useful!

Even though L'Hôpital's rule is really useful, this doesn't mean that you can just forget all your old techniques for calculating limits. Example 3 above is one instance of this, and we also have this one:

Example 4.

Calculate limxexexex+ex\displaystyle \lim_{x\to\infty} \frac{e^x - e^{-x}}{e^x + e^{-x}}.

Solution.

The numerator and denominator both go to \infty as xx \to \infty, so we can apply L'Hôpital's rule:

limxexexex+ex=limxex+exexex.\lim_{x\to\infty} \frac{e^x - e^{-x}}{e^x + e^{-x}} = \lim_{x\to\infty} \frac{e^x + e^{-x}}{e^x - e^{-x}}.

Same thing happens with the new limit, so you try it again:

limxexexex+ex=limxex+exexex=limxexexex+ex=.\lim_{x\to\infty} \frac{e^x - e^{-x}}{e^x + e^{-x}} = \lim_{x\to\infty} \frac{e^x + e^{-x}}{e^x - e^{-x}} = \lim_{x\to\infty} \frac{e^x - e^{-x}}{e^x + e^{-x}} = \cdots.

Hopefully you realize that after two tries that L'Hôpital's isn't going to get you anywhere. This means that you will have to try one of your old techniques to calculate it. For this problem, you'll want to divide everything by the fastest growing function, which is exe^x in this case:

limxexexex+ex1ex1ex=limx1e2x1+e2x=1.\lim_{x\to\infty} \frac{e^x - e^{-x}}{e^x + e^{-x}} \cdot \frac{\frac{1}{e^x}}{\frac{1}{e^x}} = \lim_{x\to\infty} \frac{1 - e^{-2x}}{1 + e^{-2x}} = \boxed{1}.

Examples

Example 5.

Calculate limx0+sinxx21cos2x\displaystyle \lim_{x \to 0^+} \frac{\sin{x} - x^2}{\sqrt{1 - \cos^2{x}}}.

Solution.

Before using L'Hôpital's, you should always take a minute to see if you can simplify anything. In this problem, if you don't do that, you end up with a horrible derivative in the denominator. But if you do simplify, you will just get sinx\sin{x} in the bottom—much nicer! If you use L'Hôpital's after this, you just get

limx0+sinxx21cos2x=limx0+sinxx2sinx=limx0+cosx2xcosx=1.\lim_{x \to 0^+} \frac{\sin{x} - x^2}{\sqrt{1 - \cos^2{x}}} = \lim_{x \to 0^+} \frac{\sin{x} - x^2}{\sin{x}} = \lim_{x \to 0^+} \frac{\cos{x} - 2x}{\cos{x}} = \boxed{1}.
Example 6.

Calculate limx0+x2x\displaystyle \lim_{x \to 0^+} x^{2\sqrt{x}}.

Solution.

Here, we're going to want to use logarithms to bring the exponent down, but we need to make sure we undo it so that we don't change the function:

limx0+x2x=limx0+elnx2x=elimx0+2xlnx.\lim_{x \to 0^+} x^{2\sqrt{x}} = \lim_{x \to 0^+} e^{\ln{x^{2\sqrt{x}}}} = e^{\lim_{x \to 0^+} 2\sqrt{x}\ln{x}}.

The second equality comes from continuity of exe^x. It's somewhat technical (you need to do some ε\epsilon-δ\delta stuff to prove it), so I'll just gloss over the details since they won't be important for our class.

To finish the problem, we just need to calculate limx0+2xlnx\lim_{x \to 0^+} 2\sqrt{x}\ln{x}. If we want to use L'Hôpital's rule, we need a fraction, but thankfully, we can always turn a product into a quotient:

2xlnx=2lnx1x.2\sqrt{x}\ln{x} = \frac{2\ln{x}}{\frac{1}{\sqrt{x}}}.

I could've moved lnx\ln{x} to the denominator instead, but then we'd have to calculate the derivative of 1lnx\frac{1}{\ln{x}} which will get messy, so it'll be easier to keep lnx\ln{x} in the numerator. Then

limx0+2xlnx=limx0+2lnx1x=limx0+2lnxx1/2=limx0+2x12x3/2=limx0+4xx3/2=limx0+4x1/2=0.\begin{aligned} \lim_{x \to 0^+} 2\sqrt{x} \ln{x} &= \lim_{x \to 0^+} \frac{2\ln{x}}{\frac{1}{\sqrt{x}}} \\ &= \lim_{x \to 0^+} \frac{2\ln{x}}{x^{-1/2}} \\ &= \lim_{x\to0^+} \frac{\frac{2}{x}}{-\frac{1}{2}x^{-3/2}} \\ &= \lim_{x\to0^+} -\frac{4}{x} \cdot x^{3/2} \\ &= \lim_{x\to0^+} -4x^{1/2} \\ &= 0. \end{aligned}

Finally, we need to evaluate the original limit:

limx0+x2x=elimx0+2xlnx=e0=1.\lim_{x \to 0^+} x^{2\sqrt{x}} = e^{\lim_{x \to 0^+} 2\sqrt{x}\ln{x}} = e^0 = \boxed{1}.
Example 7.

Calculate limxx+1x2x24\displaystyle \lim_{x \to \infty} \abs{\frac{x + 1}{x - 2}}^{\sqrt{x^2 - 4}}.

Solution.

Like in the previous example, we're going to take a logarithm to bring the exponent down:

limxx+1x2x24=elimxx24lnx+1x2.\lim_{x \to \infty} \abs{\frac{x + 1}{x - 2}}^{\sqrt{x^2 - 4}} = e^{\lim_{x \to \infty} \sqrt{x^2 - 4}\ln\abs{\frac{x + 1}{x - 2}}}.

Then to calculate the limit in the exponent,

limxx24lnx+1x2=limxlnx+1x21x24=limxlnx+1lnx2(x24)1/2=limx1x+11x2x(x24)3/2=limxx2(x+1)(x2)x+1(x+1)(x2)x(x24)3/2=limx3(x24)3/2x(x+1)(x2)=limx3(x24)3/2x(x+1)(x2)\begin{aligned} \lim_{x \to \infty} \sqrt{x^2 - 4}\ln\abs{\frac{x + 1}{x - 2}} &= \lim_{x \to \infty} \frac{\ln\abs{\frac{x + 1}{x - 2}}}{\frac{1}{\sqrt{x^2 - 4}}} \\ &= \lim_{x \to \infty} \frac{\ln\abs{x + 1} - \ln\abs{x - 2}}{\p{x^2 - 4}^{-1/2}} \\ &= \lim_{x \to \infty} \frac{\frac{1}{x+1} - \frac{1}{x-2}}{-x\p{x^2 - 4}^{-3/2}} \\ &= \lim_{x \to \infty} \frac{\frac{x-2}{\p{x+1}\p{x-2}} - \frac{x+1}{\p{x+1}\p{x-2}}}{-x} \cdot \p{x^2 - 4}^{3/2} \\ &= \lim_{x \to \infty} \frac{-3\p{x^2 - 4}^{3/2}}{-x\p{x+1}\p{x-2}} \\ &= \lim_{x \to \infty} \frac{3\p{x^2 - 4}^{3/2}}{x\p{x+1}\p{x-2}} \end{aligned}

When xx is large, (x24)3/2\p{x^2 - 4}^{3/2} is roughly (x2)3/2=x3\p{x^2}^{3/2} = x^3, and the denominator is also roughly x3x^3. So, we will multiply and divide by 1x3\frac{1}{x^3}. Notice that x3=(x2)3/2x^3 = \p{x^2}^{3/2}, which gives

=limx3(x24)3/2x(x+1)(x+2)1x31x3=limx3(x24)3/2(1x2)3/2x(x+1)(x2)x3=limx3(x24x2)3/2xxx+1xx2x=limx3(14x2)3/2(1+1x)(12x)=3.\begin{aligned} &= \lim_{x \to \infty} \frac{3\p{x^2 - 4}^{3/2}}{x\p{x+1}\p{x+2}} \cdot \frac{\frac{1}{x^3}}{\frac{1}{x^3}} \\ &= \lim_{x \to \infty} \frac{3\p{x^2 - 4}^{3/2} \p{\frac{1}{x^2}}^{3/2}}{\frac{x\p{x+1}\p{x-2}}{x^3}} \\ &= \lim_{x \to \infty} \frac{3\p{\frac{x^2 - 4}{x^2}}^{3/2}}{\frac{x}{x} \frac{x+1}{x} \frac{x-2}{x}} \\ &= \lim_{x \to \infty} \frac{3\p{1 - \frac{4}{x^2}}^{3/2}}{\p{1 + \frac{1}{x}}\p{1 - \frac{2}{x}}} \\ &= 3. \end{aligned}

Finally, we just need to go back to the original limit:

limxx+1x2x24=elimxx24lnx+1x2=e3.\lim_{x \to \infty} \abs{\frac{x + 1}{x - 2}}^{\sqrt{x^2 - 4}} = e^{\lim_{x \to \infty} \sqrt{x^2 - 4}\ln\abs{\frac{x + 1}{x - 2}}} = \boxed{e^3}.

Integrals

Example 8.

Calculate eex+xdx\displaystyle \int e^{e^x+x} \,\diff{x}.

Solution.

Usually, it's a good idea to get rid of addition in the exponent since multiplication is easier to work with:

eex+xdx=eexexdx.\int e^{e^x+x} \,\diff{x} = \int e^{e^x} e^x \,\diff{x}.

One choice of uu is u=exu = e^x, which means du=exdx\diff{u} = e^x \,\diff{x}. Then

eexexdx=eudu=eu+C=eex+C.\int e^{e^x} e^x \,\diff{x} = \int e^u \,\diff{u} = e^u + C = \boxed{e^{e^x} + C}.
Example 9.

Calculate e2x1e2x+1dx\displaystyle \int \frac{e^{2x} - 1}{e^{2x} + 1} \,\diff{x}.

Solution.

This one is basically a trick. You want to turn everything into terms of exe^x, so you can do

e2x1e2x+11ex1exdx=exexex+exdx.\int \frac{e^{2x} - 1}{e^{2x} + 1} \cdot \frac{\frac{1}{e^x}}{\frac{1}{e^x}} \,\diff{x} = \int \frac{e^x - e^{-x}}{e^x + e^{-x}} \,\diff{x}.

From here, u=ex+exu = e^x + e^{-x} works since du=(exex)dx\diff{u} = \p{e^x - e^{-x}} \,\diff{x}, which is exactly the numerator, so

exexex+exdx=duu=lnu+C=lnexex+C.\int \frac{e^x - e^{-x}}{e^x + e^{-x}} \,\diff{x} = \int \frac{\diff{u}}{u} = \ln{\abs{u}} + C = \boxed{\ln{\abs{e^x - e^{-x}}} + C}.
Exercise 1.

To see if you understand the trick, try calculating these:

  1. e4x1e4x+1dx\displaystyle \int \frac{e^{4x} - 1}{e^{4x} + 1} \,\diff{x}
  2. e3x1e3x+1dx\displaystyle \int \frac{e^{3x} - 1}{e^{3x} + 1} \,\diff{x}
Example 10.

Calculate sin2xdx\displaystyle \int \sin^2{x} \,\diff{x}.

Solution.

This is basically a problem testing to see if you remember the double-angle identities:

sin2xdx=1cos2x2dx=x2sin2x4+C.\int \sin^2{x} \,\diff{x} = \int \frac{1 - \cos{2x}}{2} \,\diff{x} = \boxed{\frac{x}{2} - \frac{\sin{2x}}{4} + C}.