# Limits and Continuity
## What is a limit?
A limit describes what happens when a function "approaches" a point. The idea of a limit can be made intuitive through an example.
> Let $f(x) = \frac{x^2-1}{x-1}$, what does $f(x)$ approach as $x\to1$? (the sign $\to$ means approaches)
Let's take a look at the graph of $f(x)$.

We can see that there is a hole at $x=1$ is undefined -> ($f(1)=\frac{1^2-1}{1-1}=\frac{0}{0}=\text{undefined}$)
But a limit only needs to find what $f(x)$ approaches as $x\to1$, it does not matter what actually happens at the point $x=1$. Just looking at the graph, we can see that $f(x)\to2$ as $x\to1$.
$\therefore$ the answer to our question is 2.
note: a function must approach the value from both sides for the limit to exist (this will be made more clear later)
Before we move on, we need to learn limit notation. In almost all cases limits will be expressed in this way:
> $\lim \limits_{x\to c}f(x)=b$
The limit of $f(x)$ as $x$ approaches $c$ is equal to $b$
## Evaluating limits
It'd be silly to draw out every graph in order to find its limit...
Instead, there are many ways we can evaluate a limit algebraically.
We will be covering the three most common and practical methods. (they're not exactly methods as they only work for specific cases).
How do we evaluate $\lim \limits_{x\to c}f(x)=b$?
### Direct Substitution
This one is very simple, just evaluate $f(c)$. Note that this only works if $f(c)$ is defined. For example:
> Evaluate $\lim \limits_{x\to4}\frac{6x-2}{3x+4}$
>
The answer is simply $\frac{6(4)-2}{3(4)+4} =\frac{22}{16}=\frac{11}{8}$.
$\therefore \lim \limits_{x\to4}\frac{6x-2}{3x+4} =\frac{11}{8}$
Pretty simple
If $f(c)$ is undefined, we may need to try a different method...
### Factoring
This strategy is mainly used in rational functions, when direct substitution results in a 0 in the denominator. Essentially, you want to factor both the numerator and the denominator and cross out pesky terms are making your fraction indeterminate forms. We can learn from example:
> Evaluate $\lim \limits_{x\to 1}{\frac{x^2-1}{x-1}}$
Let's try direct substitution
$\frac{1^2-1}{1-1} = \frac{0}{0}$
Uhoh, that didn't seem to work. Let's try factoring instead!
$\frac{x^2-1}{x-1} = \frac{(x+1)(x-1)}{(x-1)} = x+1$
Now we can apply direct substitution
$x+1 = (1)+1 = 2$
$\therefore \lim \limits_{x\to 1}{\frac{x^2-1}{x-1}} = 2$
### Conjugates
Multiplying by a conjugate is another strategy used to evaluate limits of rational functions, when direct substitution results in a 0 in the denominator. The idea is to multiply the numerator and the denominator by a conjugate in order to rid the denominator of the 0 (kind of similar to rationalizing the denominator). Again, an example:
> Evaluate $\lim \limits_{x\to 4}\frac{\sqrt{x-3}-1}{x-4}$
We can multiply by the conjugate of numerator.
$\frac{\sqrt{x-3}-1}{x-4}=\frac{\sqrt{x-3}-1}{x-4}\times\frac{\sqrt{x-3}+1}{\sqrt{x-3}+1} = \frac{x-4}{(x-4)(\sqrt{x-3}+1)}=\frac{1}{\sqrt{x-3}+1}$
Now we can apply direct substitution:
$\frac{1}{\sqrt{x-3}+1}=\frac{1}{\sqrt{(4)-3}+1}=\frac{1}{2}$
$\therefore \lim \limits_{x\to 4}\frac{\sqrt{x-3}-1}{x-4} = \frac{1}{2}$
## Continuity
What is continuity? What makes a function continuous? Let's look at some examples!
Here are two functions, one is continuous, one is not:
Try drawing any function. If you need to lift up your pencil when drawing, the function is not continuous. If you do not need to lift up your pencil when drawing, the function is continuous.
More formally, any function $f(x)$ is continuous over interval $(a,b)$ if and only if every point between a and b is continuous.
But how can a point be continuous? Well, we define point $f(x)$ to be continuous at $x=c$ if and only if $f(c)=\lim \limits_{x\to c}f(x)$.
(Why this is true will become evident when we talk about discontinuities).
(Note that this equality implies that both $f(x)$ and $\lim \limits_{x\to c}f(x)$ exist)
Let's see what happens when this is not true
## Types of discontinuities
### Removable discontinuity
A removable discontinuity occurs when $f(c)\neq\lim \limits_{x\to c}f(x)$ even though both $\lim \limits_{x\to c}f(x)$ exists. In other words, a removable discontinuity exists when the limit exists, but is not equal to the value of the function at that point. Consider the following graphs:


These are both graphs that exhibit removable discontinuities. Can you see why $f(c)\neq\lim \limits_{x\to c}f(x)$?
It is also possible that $f(x)$ is undefined at $x=c$ (a hole). Although many also classify this as a removable discontinuity, it is more specifically classified as a removable singularity. Although you don't need to know this in high school, [you can read more about it here](https://en.wikipedia.org/wiki/Removable_singularity).
### Jump Discontinuity
A jump discontinuity occurs when $\lim \limits_{x\to c^+}f(x)\neq\lim \limits_{x\to c^-}f(x)$ (this means that $f(x)$ does not approach the same value from the right and left side). This means that $\lim \limits_{x\to c}f(x)$ does not exist, thus $f(c)\neq\lim \limits_{x\to c}f(x)$. Consider the following graph, (taken from wikipedia because piecewise functions on desmos are annoying):

This graph is an example of a jump discontinuity. It looks like the y value of the function is "jumping".
(Note that the value of $f(x_0)$ is irrelevant, as long as it is defined)
### Asymptotic Discontinuity
An asymptotic discontinuity occurs when both $f(c)$ and $\lim \limits_{x\to c}f(x)$ are undefined as a result of a vertical asymptote. Since they are both undefined, $f(c)\neq\lim \limits_{x\to c}f(x)$. Consider the graph of $\frac{5}{x}$:

An asymptotic discontinuity occurs at $x=0$.