# limits

> what a function heads toward, even where it isn't defined.

source: https://learning.anthnydas.com/math/limits/

## tl;dr

a limit is where f(x) is heading as x closes in on a, from both sides. what happens at a itself doesn't count, so a function can have a limit where it has no value.

- **the limit:** lim x→a f(x) = L (f(x) as close to L as you like, once x is close enough to a. a itself is left out)
- **a hole:** 0/0 (a sign to simplify, not an answer. factor, cancel, then plug in)
- **both sides:** left = right (or there is no limit. a jump has one from each side)
- **blowing up:** 1/x² → ∞ (how the limit fails. ∞ isn't a number)
- **at infinity:** (2x + 1)/(x − 3) → 2 (divide by the biggest power. a horizontal asymptote)
- **continuous:** lim f(x) = f(a) (then plugging in is the limit)
- **two to know:** sin x / x → 1 (by a squeeze. and (1 + 1/n)ⁿ → e)
- **reach for it:** a formula that comes out 0/0, asymptotes: what a graph does at its edges, the derivative and the integral, which are both limits

## the idea

take $f(x) = \dfrac{x^2 - 1}{x - 1}$ and ask what it does near $x = 1$. at 1 itself the formula gives $\frac{0}{0}$, which is nothing: no value, no point on the graph. but a step to the left, at $x = 0.9$, it gives 1.9. at 0.99, 1.99. at 0.999, 1.999. from the right, 1.1 gives 2.1, 1.01 gives 2.01 and 1.001 gives 2.001.

| $x$    | 0.9 | 0.99 | 0.999 | 1 | 1.001 | 1.01 | 1.1 |
| ------ | --- | ---- | ----- | - | ----- | ---- | --- |
| $f(x)$ | 1.9 | 1.99 | 1.999 | – | 2.001 | 2.01 | 2.1 |

the values close in on 2 from both sides, and they get as close as you like: as near to 1 as $x$ goes, that near to 2 $f(x)$ goes. that is a limit.

$$
\lim_{x \to 1} \frac{x^2 - 1}{x - 1} = 2
$$

read it as "the limit of $f(x)$, as $x$ goes to 1, is 2". it says where $f$ is heading, and nothing about where it is. $f(1)$ can be something else, or missing, as here. the movie walks in from both sides.

> **interactive figure:** an animation on a plot from x = −1 to 3 and y = 0 to 4 of f(x) = (x² − 1)/(x − 1): the line y = x + 1 draws itself with a hole at (1, 2), an open ring. then a point walks in toward 1 from the left, stopping at x = 0.5, 0.9, 0.99 and 0.999, while a table beside the plot fills with f(x) = 1.5, 1.9, 1.99 and 1.999. then it walks in from the right, stopping at x = 1.5, 1.1, 1.01 and 1.001, with f(x) = 2.5, 2.1, 2.01 and 2.001. both columns close in on 2, a dotted line marks y = 2, and the limit is written: lim x→1 f(x) = 2. the ring stays open.

take $f(x) = \dfrac{x^2 - 1}{x - 1}$. at $x = 1$ the formula is $\frac{0}{0}$, so there is no point there: the graph is a line with a hole at $(1, 2)$.

walk in toward 1 from the left: $x = 0.5, 0.9, 0.99, 0.999$. the values $f(x) = 1.5, 1.9, 1.99, 1.999$ close in on 2.

now from the right: $x = 1.5, 1.1, 1.01, 1.001$ give $2.5, 2.1, 2.01, 2.001$. closing in on 2 again.

both sides agree, so $\lim_{x \to 1} f(x) = 2$. the hole stays open: the limit is about where $f$ is heading, not where it is. $f(1)$ is still nothing.

the hole has a reason. for every $x$ but 1, $x^2 - 1 = (x - 1)(x + 1)$, and the $(x - 1)$ cancels:

$$
\begin{gathered}
\frac{x^2 - 1}{x - 1} = \frac{(x - 1)(x + 1)}{x - 1} \\[6pt]
= x + 1 \qquad (x \ne 1)
\end{gathered}
$$

so the graph is the line $y = x + 1$ with one point missing, and the limit is where that point would be: $1 + 1 = 2$. that is the pattern for every $\frac{0}{0}$. it isn't an answer, it's a sign that the formula is hiding a factor. simplify first, then plug in.

limits are what the next three pages are made of. a derivative is a limit of slopes, an integral is a limit of sums, and a series is a limit of running totals.

## explore

the game behind the definition. someone picks how close to $L$ they want $f(x)$ to be: a band of half-height $\varepsilon$ around $L$. you answer with a window of half-width $\delta$ around $a$, and you win if every $x$ in the window, except $a$ itself, has $f(x)$ inside the band. the limit is $L$ when you can win for every $\varepsilon$, however small. slide $\varepsilon$ and the figure finds the widest $\delta$ that works. drag the point along the curve to check it.

> **interactive figure:** an interactive plot of the ε–δ game with four curves to pick from: (x² − 1)/(x − 1) near 1, x² near 2, a jump from 1.5 to 2 at 1, and sin x / x near 0. a slider sets ε from 0.05 to 1. the figure shades the band from L − ε to L + ε in cyan, and in amber the widest window from a − δ to a + δ that keeps the curve inside the band, with the piece of curve over the window drawn in amber too. a point drags along the curve, or moves with the left and right arrow keys, and the readout says whether it's inside the window and inside the band. it opens on the line with the hole at ε = 0.5: the band from 1.5 to 2.5, δ = 0.5, the window from 0.5 to 1.5, and the point at x = 1.7, where f(x) = 2.7, outside both. on x² at ε = 0.5, δ = 0.121. the jump has no δ at any ε up to 0.5, and any δ past it. on sin x / x at ε = 0.5, δ = 1.895.

- on the line with the hole, $\delta = \varepsilon$: $f(x)$ is exactly as far from 2 as $x$ is from 1. the hole doesn't matter, since the game leaves $x = 1$ out
- on $x^2$ near 2 the window is narrower than the band, because the curve is steep there, and the right side decides: at $\varepsilon = 0.5$ the right edge allows 0.121 and the left 0.129, so $\delta = 0.121$. $x^2$ climbs faster to the right of 2
- the jump loses at every $\varepsilon$ up to 0.5. the window always holds an $x$ just left of 1, where $f(x) = 1.5$, outside the band. no $L$ wins for every $\varepsilon$, so there is no limit. past 0.5 any window works, but a limit has to survive every $\varepsilon$
- $\sin x / x$ has a hole at 0, like the line, and a limit of 1. at $\varepsilon = 0.1$ the window reaches out to 0.787. the key idea section says why the limit is 1

## try it

> **interactive figure:** a practice exercise with five kinds of question: a limit that comes out 0/0 and needs factoring, the limit of a function with two rules from the left, the right or both sides, a fraction that blows up and which way, a ratio of polynomials as x → ∞, and whether a function is continuous at a point. it opens on lim x→1 (x² − 1)/(x − 1), which is 2, then a function that is 2x below 1 and x + 3 from 1 on, where the limit at 1 doesn't exist. after each answer the function is drawn.

## the rules

### the limit

$$
\lim_{x \to a} f(x) = L
$$

$f(x)$ gets as close to $L$ as you like, for every $x$ close enough to $a$, on either side, and $a$ itself is left out. why leave it out: the question is where $f$ is heading, and that has an answer whether or not $f(a)$ exists, so the definition never looks. and when a limit exists it is one number: two different values can't both be what every nearby $f(x)$ is close to.

### one-sided limits

$$
\lim_{x \to a^-} f(x) \qquad \lim_{x \to a^+} f(x)
$$

the same question asked from one side only: the minus is from the left, $x < a$, and the plus from the right. the two-sided limit exists exactly when both one-sided limits exist and agree, and then it is their shared value. why: "close to $a$" means on both sides, so when the left heads to 2 and the right to 4, no single number is close to all the nearby values. that is a jump, and a jump has no limit at the jump, only one from each side.

### limits that blow up

$$
\begin{gathered}
\lim_{x \to 0} \frac{1}{x^2} = \infty \\[6pt]
\lim_{x \to 0^-} \frac{1}{x} = -\infty \qquad \lim_{x \to 0^+} \frac{1}{x} = \infty
\end{gathered}
$$

near 0, $1/x^2$ grows past every number: 100 at $x = 0.1$, 10,000 at 0.01, a million at 0.001. the limit doesn't exist, since there's no number the values close in on, and $= \infty$ records how it fails: by growing without bound. $\infty$ isn't a value to plug in or do arithmetic with. why $1/x^2$ blows up: name any bound $M$, and $1/x^2 > M$ as soon as $|x| < 1/\sqrt{M}$. the graph has a vertical asymptote at $x = 0$. $1/x$ blows up too, but the sides disagree, $-\infty$ from the left and $+\infty$ from the right, so even the $\infty$ description needs a side. a fraction whose bottom goes to 0 while its top doesn't blows up, and whether the bottom changes sign at $a$ decides if the two sides agree.

### limits at infinity

$$
\lim_{x \to \infty} \frac{1}{x} = 0 \qquad \lim_{x \to \infty} \frac{2x + 1}{x - 3} = 2
$$

$x \to \infty$ asks what $f$ settles toward as $x$ grows past every number. $1/x$ settles to 0: it's under $\varepsilon$ once $x > 1/\varepsilon$. for a ratio, divide top and bottom by the biggest power of $x$ in it:

$$
\frac{2x + 1}{x - 3} = \frac{2 + 1/x}{1 - 3/x} \to \frac{2 + 0}{1 - 0} = 2
$$

the leftover fractions all have $x$ in the bottom and go to 0, so only the leading terms survive. a value the graph settles toward is a horizontal asymptote, here $y = 2$: at $x = 100$ the function is 2.072, and at 1,000 it's 2.007. when the top's biggest power beats the bottom's, the ratio blows up instead, and when the bottom's wins, the limit is 0.

> **interactive figure:** the graph of (2x + 1)/(x − 3) from x = −6 to 12 and y = −6 to 10, with its two asymptotes dotted: x = 3, where the left arm runs down toward −∞ (−68 at x = 2.9) and the right arm comes down from +∞ (72 at x = 3.1), and y = 2, which both arms settle toward: 3 at x = 10, 2.072 at 100, 2.007 at 1,000.

### continuity

$$
\lim_{x \to a} f(x) = f(a)
$$

$f$ is continuous at $a$ when three things hold: $f(a)$ exists, the limit exists, and they agree. three ways to break it, one per condition: a hole ($f(a)$ missing, or a value off the curve), a jump (no limit), a blow-up (no limit, and no value). why it matters: for a continuous function the limit is the value, so plugging in answers the limit question. polynomials, roots, $\sin$, $\cos$, $e^x$ and $\log$ are continuous wherever they're defined, and so is anything built from them with $+$, $-$, $\times$, $\div$ and composition, away from the points where a bottom is 0 or a root or a log gets an input it can't take. that is why $\lim_{x \to 2} (x^2 + 1) = 5$ takes no work and the hole took factoring: $x + 1$ is continuous at 1, and the original formula isn't defined there.

> **interactive figure:** three sketches at x = 1, each with a dotted line there. a hole: the line y = x + 1 with an open ring at (1, 2), so f(1) is missing while the limit, 2, is there. a jump: y = x up to 1 and y = x + 1 from 1 on, with an open ring at (1, 1) and a filled dot at (1, 2), so f(1) = 2 but the sides disagree and there is no limit. a blow-up: 1/(x − 1)², two arms climbing past the top either side of x = 1, with no value and no limit there.

### the limit laws

if $\lim_{x \to a} f(x) = L$ and $\lim_{x \to a} g(x) = M$:

$$
\begin{gathered}
\lim\,(f \pm g) = L \pm M \\[4pt]
\lim\,(c \cdot f) = c\,L \\[4pt]
\lim\,(f \cdot g) = L\,M \\[4pt]
\lim \frac{f}{g} = \frac{L}{M} \quad \text{when } M \ne 0
\end{gathered}
$$

limits pass through arithmetic. why: if $f$ stays within $\varepsilon/2$ of $L$ and $g$ within $\varepsilon/2$ of $M$, their sum stays within $\varepsilon$ of $L + M$, and the other laws follow the same way with a little more algebra. the quotient law needs $M \ne 0$, and that is where $\frac{0}{0}$ comes from: when both limits are 0 the law says nothing, and the answer can be anything. $\frac{x^2 - 1}{x - 1} \to 2$, $\frac{x - 1}{x^2 - 1} \to \frac{1}{2}$, and $\frac{x - 1}{(x - 1)^2}$ blows up, all three $\frac{0}{0}$ at 1. that is why simplifying first is the rule.

the squeeze: if $g(x) \le f(x) \le h(x)$ near $a$, and $g$ and $h$ both have limit $L$ there, so does $f$. why: $f$ is trapped between two things heading to the same place. it's the tool for a limit nothing cancels in, like the first one below.

### two limits to know

$$
\begin{gathered}
\lim_{x \to 0} \frac{\sin x}{x} = 1 \\[8pt]
\lim_{n \to \infty} \left(1 + \frac{1}{n}\right)^n = e
\end{gathered}
$$

the first is the [small-angle fact](/math/trig/#the-circle-unrolled) from the trig page, $\sin x \approx x$ for small $x$, made exact: at $x = 0.1$ the ratio is 0.99833, at 0.01 it's 0.999983. it's $\frac{0}{0}$ at 0 and nothing cancels, so it takes a squeeze. on the circle of radius 1, for $0 < x < \pi/2$, the triangle with corners $(0, 0)$, $(1, 0)$ and $(\cos x, \sin x)$ sits inside the sector of angle $x$, which sits inside the triangle out to the tangent line at $x = 1$, whose top corner is $(1, \tan x)$:

$$
\frac{\sin x}{2} \le \frac{x}{2} \le \frac{\tan x}{2}
$$

divide through by $\frac{\sin x}{2}$ and flip each fraction: $\cos x \le \frac{\sin x}{x} \le 1$. as $x \to 0$, $\cos x \to 1$, and the ratio is squeezed to 1. that covers the right side, and the left follows since $\sin x / x$ is even.

> **interactive figure:** a quarter of the circle of radius 1 with a point at angle x, 0.8 radians to start, and three nested shapes: the triangle from the center to (1, 0) and the point, in cyan, with area ½ sin x = 0.359; the sector of angle x, in amber, with area ½ x = 0.400; and the triangle out to the tangent line, outlined, with area ½ tan x = 0.515. a slider moves x from 0.1 to 1.1 radians, and a readout gives the three areas and the sandwich they make, cos x = 0.697 ≤ sin x / x = 0.897 ≤ 1. at x = 0.1 it reads cos x = 0.995 ≤ sin x / x = 0.998 ≤ 1.

the second is the number behind compounding, from the [exponents + logs page](/math/exponents-logs/#e): one unit of money at 100% a year, paid in $n$ parts, grows to $(1 + 1/n)^n$. that's 2 for one payment, 2.25 for two, 2.6130 monthly, 2.7146 daily, and the limit, paid at every instant, is $e \approx 2.718$. it's a limit of a different shape. the $1/n$ heads to 0 and the exponent to infinity at once, so neither the limit laws nor plugging in apply: $1^\infty$ is as empty as $\frac{0}{0}$. the derivatives page is where $e$ earns its place.

## worked examples

### a hole

$\lim_{x \to 3} \dfrac{x^2 - 9}{x - 3}$. plugging in gives $\frac{0}{0}$. factor: $x^2 - 9 = (x - 3)(x + 3)$, cancel, and $x + 3 \to 6$. the table agrees: at $x = 2.99$ the original is 5.99, and at 3.01 it's 6.01.

### a square root

$\lim_{x \to 0} \dfrac{\sqrt{x + 4} - 2}{x}$ is $\frac{0}{0}$ again, and there's nothing to factor. multiply top and bottom by the conjugate, $\sqrt{x + 4} + 2$, so the root squares away:

$$
\begin{gathered}
\frac{\sqrt{x + 4} - 2}{x} \cdot \frac{\sqrt{x + 4} + 2}{\sqrt{x + 4} + 2} \\[6pt]
= \frac{(x + 4) - 4}{x\,(\sqrt{x + 4} + 2)} = \frac{1}{\sqrt{x + 4} + 2}
\end{gathered}
$$

the $x$ cancels, and plugging in $x = 0$ gives $\frac{1}{2 + 2} = \frac{1}{4}$. at $x = 0.01$ the original is 0.2498.

### a jump, and a non-jump

$f(x) = x + 1$ for $x < 1$ and $f(x) = 3 - x$ for $x \ge 1$. from the left, $x + 1 \to 2$. from the right, $3 - x \to 2$. the rule changes at 1 but the values meet, so $\lim_{x \to 1} f(x) = 2$, and since $f(1) = 2$ as well, $f$ is continuous there. change the second rule to $4 - x$ and the right side heads to 3: the sides disagree, there is no limit, and $f$ jumps.

### a blow-up

$\lim_{x \to 2} \dfrac{x + 1}{x - 2}$. the top heads to 3 and the bottom to 0, so the fraction blows up. which way: just left of 2 the bottom is a small negative number, so $f \to -\infty$, and just right of it a small positive one, so $f \to +\infty$. at $x = 1.99$ the value is −299, at 2.01 it's 301. the sides disagree, so the limit doesn't exist in either sense, and $x = 2$ is a vertical asymptote. square the bottom, $\frac{x + 1}{(x - 2)^2}$, and both sides turn positive, 29,900 at 1.99: then $\lim = \infty$.

### at infinity

$\lim_{x \to \infty} \dfrac{3x^2 - x}{2x^2 + 5}$. divide top and bottom by $x^2$: $\dfrac{3 - 1/x}{2 + 5/x^2} \to \dfrac{3}{2}$. at $x = 100$ the ratio is 1.495, and at 1,000 it's 1.4995. when the powers differ, the bigger one wins: $\dfrac{x + 1}{x^2 + 1} \to 0$ and $\dfrac{x^2 + 1}{x + 1} \to \infty$. at $x = 100$ they're 0.0101 and 99.02.

### a limit made continuous

$g(x) = \dfrac{x^2 - 1}{x - 1}$ for $x \ne 1$, and $g(1) = 3$. the limit at 1 is 2 and $g(1) = 3$. they disagree, so $g$ isn't continuous at 1, even though it has a value there: the graph is the line with a hole, plus a stray point at $(1, 3)$. set $g(1) = 2$ and it is continuous. the hole is filled with the limit, which is why this kind of break is called removable.

## the key idea up close

### the ε–δ definition

"as close as you like" has an exact form. $\lim_{x \to a} f(x) = L$ means:

$$
\begin{gathered}
\text{for every } \varepsilon > 0 \\[2pt]
\text{there is a } \delta > 0 \text{ such that} \\[6pt]
0 < |x - a| < \delta \\[2pt]
\Rightarrow\; |f(x) - L| < \varepsilon
\end{gathered}
$$

$\varepsilon$ is the challenge: how close to $L$ the values must come. $\delta$ is the answer: how close to $a$ is close enough. the $0 <$ leaves $a$ itself out. the explore figure plays it: for every band there has to be a window, and the window may shrink as the band does. the limit fails when some band has no window.

a proof for the hole, $f(x) = \frac{x^2 - 1}{x - 1}$ at $a = 1$, $L = 2$. given $\varepsilon$, take $\delta = \varepsilon$. if $0 < |x - 1| < \delta$, then $x \ne 1$, so $f(x) = x + 1$, and

$$
\begin{gathered}
|f(x) - 2| = |x + 1 - 2| \\[4pt]
= |x - 1| < \delta = \varepsilon
\end{gathered}
$$

on a curve, how much $x$ may move depends on where you are. for $x^2$ at $a = 2$, $L = 4$: $|x^2 - 4| = |x - 2|\,|x + 2|$. keep $|x - 2| < 1$, so that $|x + 2| < 5$. then $|x^2 - 4| < 5\,|x - 2|$, and $\delta = \min(1, \varepsilon/5)$ works. it isn't the widest window, the figure finds $\sqrt{4 + \varepsilon} - 2$, but any window that works is enough: the definition asks for one.

and why the jump has no limit. $f(x) = 1.5$ for $x < 1$ and $f(x) = 2$ for $x \ge 1$, and suppose some $L$ worked. take $\varepsilon = 0.25$. any window around 1 holds an $x$ on each side, with values 1.5 and 2, each within 0.25 of $L$ and so less than 0.5 apart. but they are exactly 0.5 apart. no $L$ works.

the other limits on this page have the same shape with one piece swapped. at infinity the window becomes a threshold: for every $\varepsilon$ there is an $N$ with $x > N \Rightarrow |f(x) - L| < \varepsilon$. a blow-up swaps the band for a floor: for every $M$ there is a $\delta$ with $0 < |x - a| < \delta \Rightarrow f(x) > M$.

## pitfalls

- **$\frac{0}{0}$ isn't an answer, and neither is "undefined".** it says the formula can't tell you yet. factor, cancel, multiply by a conjugate, or squeeze, then try again. the answer can be any number, or none: $\frac{x^2 - 1}{x - 1}$, $\frac{x - 1}{x^2 - 1}$ and $\frac{x - 1}{(x - 1)^2}$ are all $\frac{0}{0}$ at 1: the first two head to 2 and $\frac{1}{2}$, and the third blows up
- **the limit at $a$ isn't $f(a)$.** $f(1)$ can be missing, or 3, while the limit is 2. they're the same thing only when $f$ is continuous at $a$, which is what continuous means. plugging in is a shortcut that needs that license
- **$\infty$ isn't a number.** "the limit is $\infty$" means the limit doesn't exist in a particular way: the values grow past every bound. don't do arithmetic with it. $\infty - \infty$ and $\frac{\infty}{\infty}$ are as empty as $\frac{0}{0}$: $\frac{x^2 + 1}{x + 1}$ and $\frac{x + 1}{x^2 + 1}$ are both $\frac{\infty}{\infty}$ as $x \to \infty$, and head to $\infty$ and 0
- **a limit needs both sides.** check the left and the right whenever the rule changes at $a$, with an absolute value or a floor, or when a bottom changes sign, like $\frac{1}{x}$ at 0
- **a limit law needs its limits to exist.** $x \sin(1/x) \to 0$ at 0, though $\sin(1/x)$ has no limit there. the product law says nothing, since one factor has no limit, and the squeeze does the work: $|x \sin(1/x)| \le |x|$
- **floating point near a limit.** `(1 - Math.cos(x)) / (x * x)` heads to 0.5 as x shrinks, then goes wrong: 0.4999999970 at x = 1e-4, 0.5000444503 at 1e-6, 0.4996003611 at 1e-7, and exactly 0 at 1e-8. the mechanism: $1 - \cos x \approx x^2/2$, which at $x = 10^{-8}$ is $5 \times 10^{-17}$. the next double above 1 is $2^{-52} \approx 2.2 \times 10^{-16}$ away,[^mdn-epsilon] and the next one below is half that, $2^{-53} \approx 1.1 \times 10^{-16}$, since the exponent drops by one there. $1 - 5 \times 10^{-17}$ is nearer to 1 than to that neighbour, so `Math.cos(1e-8)` is exactly 1 and the top is $1 - 1 = 0$. before that, subtracting two nearly equal numbers throws away most of their digits, which is the drift. the half-angle form, $\frac{2 \sin^2(x/2)}{x^2}$, is the same quantity with no subtraction in it, and gives 0.5 at 1e-8

## practice

1. find $\lim_{x \to 3} \dfrac{x^2 - 9}{x - 3}$ and $\lim_{x \to 3} \dfrac{x^2 - 9}{x + 3}$.

   **answer:** the first is $\frac{0}{0}$ at 3, so factor: $\frac{(x - 3)(x + 3)}{x - 3} = x + 3$ for $x \ne 3$, which heads to 6. the second isn't $\frac{0}{0}$: the bottom is 6 at $x = 3$, the function is continuous there, and plugging in gives $\frac{0}{6} = 0$.

2. find $\lim_{x \to 0} \dfrac{\sqrt{x + 9} - 3}{x}$.

   **answer:** multiply top and bottom by the conjugate, $\sqrt{x + 9} + 3$. the top becomes $(x + 9) - 9 = x$, the $x$ cancels, and what's left is $\dfrac{1}{\sqrt{x + 9} + 3}$, which is $\dfrac{1}{3 + 3} = \dfrac{1}{6} \approx 0.1667$ at $x = 0$. check: at $x = 0.01$ the original is 0.1666.

3. $f(x) = 2x + 1$ for $x < 2$ and $f(x) = x^2$ for $x \ge 2$. find both one-sided limits at 2, say whether the limit exists, and whether $f$ is continuous at 2.

   **answer:** from the left, $2x + 1 \to 5$. from the right, $x^2 \to 4$. they disagree, so $\lim_{x \to 2} f(x)$ doesn't exist, and $f$ isn't continuous at 2. $f(2) = 4$ matches the right side only, so $f$ is continuous from the right there, and that's all.

4. find $\lim_{x \to \infty} \dfrac{5x^2 + 3x}{2x^2 - 7}$ and $\lim_{x \to \infty} \dfrac{3x + 1}{x^2 + 2}$.

   **answer:** divide the first by $x^2$: $\dfrac{5 + 3/x}{2 - 7/x^2} \to \dfrac{5}{2}$. at $x = 1{,}000$ it's 2.5015. in the second the bottom's power wins, so the limit is 0: divided by $x^2$ it's $\dfrac{3/x + 1/x^2}{1 + 2/x^2} \to \dfrac{0}{1}$, and at $x = 1{,}000$ it's 0.0030.

5. $g(x) = \dfrac{x^2 - 4}{x - 2}$ for $x \ne 2$, and $g(2) = c$. for which $c$ is $g$ continuous at 2?

   **answer:** away from 2, $g(x) = \dfrac{(x - 2)(x + 2)}{x - 2} = x + 2$, so the limit at 2 is 4. continuity needs $g(2)$ to equal the limit: $c = 4$. any other $c$ leaves a hole filled in the wrong place.

6. find $\lim_{x \to 0} \dfrac{\sin 3x}{x}$ and $\lim_{x \to 0} \dfrac{1 - \cos x}{x^2}$.

   **answer:** write the first as $3 \cdot \dfrac{\sin 3x}{3x}$. as $x \to 0$ so does $u = 3x$, and $\frac{\sin u}{u} \to 1$, so the limit is 3. check: at $x = 0.01$ the ratio is 2.9996.

   for the second, $1 - \cos x = 2 \sin^2(x/2)$, so the fraction is $\dfrac{2 \sin^2(x/2)}{x^2} = \dfrac{1}{2} \left(\dfrac{\sin(x/2)}{x/2}\right)^2$, and the bracket heads to 1. the limit is $\frac{1}{2}$. at $x = 0.1$ the ratio is 0.49958. it's the fraction from the last pitfall, and this form is the one that computes safely.

[^mdn-epsilon]: mdn's [Number.EPSILON](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/EPSILON) reference page: the constant is the difference between 1 and the smallest floating point number greater than 1, 2⁻⁵² or about 2.22 × 10⁻¹⁶, because the double format has 52 bits for the mantissa.

## related

- https://learning.anthnydas.com/math/functions.md
- https://learning.anthnydas.com/math/derivatives.md
- https://learning.anthnydas.com/math/integrals.md
- https://learning.anthnydas.com/math/series.md
- https://learning.anthnydas.com/math/exponents-logs.md
- https://learning.anthnydas.com/math/trig.md
