## Calculus proofs

In this article I resume some of my proofs of important theorems in calculus. This article is not as intuitive as the others. I just wrote it so people that already know calculus well can fastly recover some proofs and use them in my other articles.## Precise definition of limit

If $\lim_{x\to a}f(x) = L$ then for all $\epsilon > 0$, there ir a $\delta$ (which depends on $\epsilon$ and $a$) such that: $$0<|x-a|<\delta \implies |f(x)-L| < \epsilon$$

## Proof that the limit of a sum is the sum of limits

If $\lim_{x\to a}f(x) = L$ and $\lim_{x\to a}g(x) = M$, then to prove $\lim_{x\to a} [f(x) + g(x)] = L + M$ we must use the precise definition of limit:

$$\lim_{x\to a} [f(x) + g(x)] = L + M$$ means that $$\forall \epsilon>0, \exists\delta(\epsilon, a)| 0<|x-a|<\delta \implies |f(x) + g(x) -[L+M]|<\epsilon$$We only need to prove that for $\epsilon>0$ we have $|f(x) + g(x) -[L+M]|<\epsilon$. To do this, we will use what we already assumed true: the individual limits of each function.

We know that for $\epsilon>0$ we have $ |f(x)-L| < \epsilon$ and $ |g(x)-M| < \epsilon$. Sum the two inequalities to get:

$|f(x)-L| + |g(x)-M| < 2\epsilon$

But we need $|f(x) + g(x) -[L+M]|$, (the same as $|f(x)-L + g(x) - M|$) to appear in the inequality above. Using the **triangle inequality**:
$$|a+b|\le |a| + |b|$$
Then:
$$|f(x) - L + g(x) - M| \le |f(x)-L| + |g(x)-M| < 2\epsilon$$

Besides being needed to finish with something less than $\epsilon$ (and not $2\epsilon$ like above), our result is enough to prove that the function has a limit. If we wanted, for example, to prove that the function is always less than $2$, it will be enough to use $\epsilon = 1$. To prove that the function is less than $\frac{1}{2}$, we should let $\epsilon = \frac{1}{4}$. Following this reasoning, there is no reason why we couldn't prove that the function is less than a number (we should just choose the right $\epsilon$). Some books, however, define $|f(x)-L|<\frac{\epsilon}{2}$ and $|g(x)-M|<\frac{\epsilon}{2}$, so then, when we sum the two inequalities, we get $|f(x)-L| + |g(x)-M| < \epsilon$.

## Proof involving the limit of a function multiplied by constant

Given $\lim_{x\to a} cf(x) = cL$, then, by the definition: $$\forall \epsilon>0, \exists\delta(\epsilon, a)| 0<|x-a|<\delta \implies |cf(x)-cL|<\epsilon$$

By some properties of the absolute value, we know that $|cf(x)-cL|<\epsilon \implies |c||f(x)-L|<\epsilon$, then: $$\forall \epsilon>0, \exists\delta(\epsilon, a)| 0<|x-a|<\delta \implies |f(x)-L|<\frac{\epsilon}{|c|}$$

We can then prove that the function is always less than any number greater than $0$, just by choosing the right $\epsilon$. So: $$\lim_{x\to a}cf(x) = c\lim_{x\to a}f(x) = cL$$

## Limit definition of the derivative

Look at this graph of an arbitrary function $f(x)$

If we calculate the opposite side/adjacent side of the red triangle, we'll obtain the triangle's tangent between the two choosen points. But to obtain the most precise tangent, we need to choose two points close to each other. We'll choose $x$ and $x+\Delta x$.

The distance between the two points in the $x$ axis is $x+\Delta x - x = \Delta x$. If we let $\Delta x$ go to $0$, we'll get a better approximation for the tangent. That's where the derivative notion comes from, it gives an expression for the tangent line to a function at some point. To obtain the exact tangent line, we'll let $\Delta x$ get closer and closer to $0$, and then observe the function's behavior. If it gets closer and closer to some unique number, we'll define this number as the exact tangent to the function at that point.

Opposite side of the triangle: $f(x+\Delta x)-f(x)$

Adjacent side of the triangle: $x+\Delta x - x = \Delta x$

The tangent, then, is:

$$\frac{f(x+\Delta x)-f(x)}{\Delta x}$$

By letting $\Delta x \to 0$ ($\Delta x$ get close to $0$), we're calculating the **limit** of this expression, where $\Delta x$ tends to $0$:

$$f'(x) = \lim_{\Delta x\to 0}\frac{f(x+\Delta x)-f(x)}{\Delta x}$$

##### *$f'(x)$ detones the derivative of $f(x)$

## Second definition of derivative

We'll use the same reasoning, but this time the distance between the two points $a$ abd $b$ isn't given by $\Delta x$. The tangent still the same, but we'll take our limit with $b$ getting close to $a$.

$$f'(x) = \lim_{b\to a}\frac{f(b)-f(a)}{b-a}$$

## Equivalence between the two definitions of derivative

We have these two definitions:

$$f'(x) = \lim_{\Delta x\to 0}\frac{f(x+\Delta x)-f(x)}{\Delta x}$$

$$f'(x) = \lim_{b\to a}\frac{f(b)-f(a)}{b-a}$$

## Derivative of a sum

Consider the sum:

$$p(x) = f(x)+g(x)$$

By applying the limit definition of the derivative to $p(x)$

$$\frac{d}{dx}p(x) = \lim_{\Delta x \to 0}\frac{p(x+\Delta x)-p(x)}{\Delta x}$$

Substitute $p(x) = f(x)+g(x)$:

$$\frac{d}{dx}(f(x)+g(x)) = \lim_{\Delta x \to 0}\frac{f(x+\Delta x)+g(x+\Delta x)-f(x)-g(x)}{\Delta x}$$

We can break the sum:

$$\frac{d}{dx}(f(x)+g(x)) = \lim_{\Delta x \to 0}\left[\frac{f(x+\Delta x)-f(x)}{\Delta x} + \frac{g(x+\Delta x)-g(x)}{\Delta x}\right]$$

And transform it in two limits:

$$\frac{d}{dx}(f(x)+g(x)) = \lim_{\Delta x \to 0}\left[\frac{f(x+\Delta x)-f(x)}{\Delta x}\right] + \lim_{\Delta x \to 0} \left[\frac{g(x+\Delta x)-g(x)}{\Delta x}\right]$$

We finish with the sum of two limits that are just the derivatives of the respective $f$ and $g$ functions:

$$\frac{d}{dx}(f(x)+g(x)) = \frac{d}{dx} f(x) + \frac{d}{dx}g(x)$$

## Derivative of $c\cdot f(x)$ (function with a constant term multiplying)

We'll just use the limit definition to the derivative and then factor out the constant:

$$c\cdot f(x)$$

Let's consider $p(x) = c\cdot f(x)$. By the limit definition:

$$\frac{d}{dx}p(x) = \lim_{\Delta x\to 0}\frac{p(x+\Delta x)-p(x)}{\Delta x}$$

Substitute $p(x)$ por $c\cdot f(x)$:

$$\frac{d}{dx}(c\cdot f(x)) = \lim_{\Delta x\to 0}\frac{c\cdot f(x+\Delta x)-c\cdot f(x)}{\Delta x}$$

Factor $c$ out:

$$\frac{d}{dx}(c\cdot f(x)) = \lim_{\Delta x\to 0}c\cdot \frac{f(x+\Delta x)- f(x)}{\Delta x}$$

By the limit rule we just proved above, $\lim cf(x) = c\lim f(x)$:

$$\frac{d}{dx}(c\cdot f(x)) = c\cdot \lim_{\Delta x\to 0}\frac{f(x+\Delta x)- f(x)}{\Delta x}$$

Which is the same as saying:

$$\frac{d}{dx}p(x) = \frac{d}{dx}(c\cdot f(x)) = c\cdot \frac{d}{dx}f(x)$$

## Proof of the product rule

We'll proof a general formula for the product:

$$f(x)g(x)$$

By naming this product $p(x)$:

$$p(x) = f(x)g(x)$$

and applying our derivative definition:

$$\frac{d p(x)}{dx} = \lim_{\Delta x\to 0} \frac{p(x+\Delta x) - p(x)}{\Delta x}$$

Substitute $p(x)$ by the product of the two functions:

$$\frac{d p(x)}{dx} = \lim_{\Delta x\to 0} \frac{f(x+\Delta x)g(x+\Delta x) - f(x)g(x)}{\Delta x}$$

Now we'll just add and subtract an special term that will help us in a way that will be clear in a second. Note that $a+b$ is the same as $a+c-c+b$. Then, if we add and subtract $\color{Blue}{f(x+\Delta x)g(x)}$:

$$\frac{d p(x)}{dx} = \lim_{\Delta x\to 0} \frac{f(x+\Delta x)g(x+\Delta x) -\color{Blue}{f(x+\Delta x)g(x)} +\color{Blue}{f(x+\Delta x)g(x)}- f(x)g(x)}{\Delta x}$$

we can break the fraction in two terms and take their limit separately:

$$\frac{d p(x)}{dx} = \lim_{\Delta x\to 0} \left[\frac{f(x+\Delta x)g(x+\Delta x) -\color{Blue}{f(x+\Delta x)g(x)}}{\Delta x} + \frac{\color{Blue}{f(x+\Delta x)g(x)}- f(x)g(x)}{\Delta x}\right]$$

Factoring $\color{Green}{f(x+\Delta x)}$ and $\color{Red}{g(x)}$:

$$\frac{d p(x)}{dx} = \lim_{\Delta x\to 0} \left[\frac{\color{Green}{f(x+\Delta x)}\left[g(x+\Delta x) -g(x)\right]}{\Delta x} + \frac{\color{Red}{g(x)}\left[f(x + \Delta x) - f(x)\right]}{\Delta x}\right]$$

We can just take $\color{Green}{f(x+\Delta x)}$ and $\color{Red}{g(x)}$ out and let them multiply the fraction:

$$\frac{d p(x)}{dx} = \lim_{\Delta x\to 0} \left[\color{Green}{f(x+\Delta x)} \frac{g(x+\Delta x) -g(x)}{\Delta x} + \color{Red}{g(x)} \frac{f(x + \Delta x) - f(x)}{\Delta x}\right]$$

By using our limit properties and breaking the sum and products:

$$\frac{d p(x)}{dx} = \lim_{\Delta x\to 0} \color{Green}{f(x+\Delta x)} \lim_{\Delta x\to 0}\frac{g(x+\Delta x) -g(x)}{\Delta x} + \lim_{\Delta x\to 0}\color{Red}{g(x)} \lim_{\Delta x\to 0}\frac{f(x + \Delta x) - f(x)}{\Delta x}$$

Finally, we get the product rule:

$$\frac{d}{dx}f(x)g(x) = f(x)g'(x) + f'(x)g(x)$$

By using $f'(x)$ we designate the first derivative of the function, just like $f''(x)$ means the second derivative, and so on...

## Derivative of $x^n$ for any real $n$

We could use the binomial theorem and prove this derivative using the limit definition, but whis would work only for the case when $n$ is natural. If we do the following: $$\log_e{x} = \log_e{x}$$

And solve for $x$ on one side, we get:

$$x = e^{log_e{x}}$$

or just $x = e^{log{x}}$ if we let $\log(x)$ to mean a $\log$ with base $e$, we can then say:

$$x^n = e^{log(x^n)}$$

By some logarithm property, we can take the exponent $x$ and multiply the log with it:

$$x^n = e^{nlog(x)}$$

Then, by taking the derivative applying the chain rule:

$$\frac{d}{dx} x^n = \frac{de^{nlog(x)}}{dx} = \frac{de^{nlog(x)}}{d [nlog(x)]}\cdot \frac{d[nlog(x)]}{dx} = e^{nlog(x)}\cdot n\frac{1}{x}$$

But $e^{log(x^n)} = x^n$, so:

$$\frac{d}{dx} x^n = e^{nlog(x)}\cdot n\frac{1}{x} = x^n\cdot n\frac{1}{x} = n\cdot x^{n-1}$$

## Proof of the integration by parts formula

We know by the product rule:

$$\frac{d}{dx}f(x)g(x) = f(x)g'(x) + f'(x)g(x)$$

Integrating both sides

$$\int \frac{d}{dx}f(x)g(x)dx = \int f(x)g'(x)dx + \int f'(x)g(x)dx$$

In the left part of the equation, we have the integral of a derivative of a function, which is just the function itself. If we use bounds to our integral, we would get the function itself, but applied in the points of the limits of integration:

$$\int_0^1 \frac{d}{dx}\sin(x)dx = \int_0^1 \cos(x)dx$$

Integrating $\cos(x)$:

$$\int_0^1 \cos(x)dx = \sin(x)]_0^1$$

Which is the same as:

$$\int_0^1 \frac{d}{dx}\sin(x)dx = \sin(x)]_0^1$$

Therefore, in our formula:

$$\int_0^1 \frac{d}{dx}f(x)g(x)dx = f(x)g(x)]_0^1$$

In the right side of the equation, we can choose one of the two integrals to isolate and construct our formula. We can then create two different but equivalent formulas:

$$\int_a^b \frac{d}{dx}f(x)g(x)dx = \int_a^b f(x)g'(x)dx + \int_a^b f'(x)g(x)dx$$

I'll just choose the first integral and isolate it to ger the integration by parts formula:

$$\int_a^b f(x)g'(x)dx = f(x)g(x)]_a^b - \int_a^b f'(x)g(x)dx$$