Thursday, October 17, 2019

Sequence and series

sequence is a function defined on the set of positive integers. This means that if you give me a positive integer $5$, I should be able to give you some object $a_{5}$, labeled with the number you gave me, which is $5$ in this case.

For example, we can think about the "identity sequence" given by $a_{n} = n$. That is, this sequence gives you back the number your give it as an input. Another example can be $a_{n} = n^{2}$. Sometimes, you may not be able to write down the formula for $a_{n}$ explicitly. For instance, define $a_{n}$ to be the $n$-th digit of $\pi = 3.141592 \dots$ after the dot. We have $a_{1} = 1, a_{2} = 4, a_{3} = 1, a_{4} = 5, \dots.$ However, because $\pi$ is an irrational number, so there is no way you can write down a general formula for $a_{n},$ which we call the $n$-th term of the sequence $(a_{i})_{i \geq 1}.$

Remark. Note that most of the time, it is perfectly fine to extend the domain of the sequence from positive integersA sequence is a function defined on the set of positive integers. This means that if you give me a positive integer $5$, I should be able to give you some object $a_{5}$, labeled with the number you gave me, which is $5$ in this case.

For example, we can think about the "identity sequence" given by $a_{n} = n$. That is, this sequence gives you back the number your give it as an input. Another example can be $a_{n} = n^{2}$. Sometimes, you may not be able to write down the formula for $a_{n}$ explicitly. For instance, define $a_{n}$ to be the $n$-th digit of $\pi = 3.141592 \dots$ after the dot. We have $a_{1} = 1, a_{2} = 4, a_{3} = 1, a_{4} = 5, \dots.$ However, because $\pi$ is an irrational number, so there is no way you can write down a general formula for $a_{n},$ which we call the $n$-th term of the sequence $(a_{i})_{i \geq 1}.$

Remark. Note that most of the time, it is perfectly fine to extend the domain of the sequence from positive integers to non-negative integers. For example, the sequence given by the formula $a_{n} = n$ can be thought over all the non-negative integers or even negative integers. It is of course okay to extend this formula for all real numbers, but we usually don't call it a sequence if it is over all real numbers. There is a reason for this, but discussing this digresses too much from our main discussion, so we won't discuss this.

We can take the limit of sequence, when ever the limit exists. For example, we have
\[\lim_{n \rightarrow \infty}\frac{1}{n} = 0.\]
One important property of real numbers is the following. The name of this property is "completeness", although your book (p.477, Theorem 9.1) does not mention this terminology.

Completeness proeprty. Any increasing sequence bounded above is convergent.

Exercise. Determine whether the sequence given by the following formula is increasing:
\[a_{n} = \left(1 + \frac{1}{n}\right)^{n}.\]

For the problem above, you might find the following hint useful:

Consider $f(x) = (1 + 1/x)^{x},$ for $x > 0.$ Let $g(x) := \ln(f(x)) = x \ln(1 + 1/x)$ so that $$g'(x) = \ln\left(1 + \frac{1}{x}\right) + \frac{x}{1 + 1/x}\left(-\frac{1}{x^{2}}\right) = \ln\left(1 + \frac{1}{x}\right) - \frac{1}{x + 1}.$$
Hence $g'(x) > 0$ for $x \geq 1.$ This shows that $g(x) = \ln(f(x))$ is increasing for $x \geq 1,$ so $f(x)$ is increasing for $x \geq 1.$ This implies that $f(n) = a_{n}$ is increasing for $n = 1, 2, 3, \dots.$

Remark. How do we know that $g'(x) > 0$ for $x \geq 1$? First, note that $g'(1) = \ln(2) - 1/2 > 0$ because $2 > e^{1/2}$, because $4 > e.$ Now, take the derivative of $g'(x)$ to have $$(g'(x))' = g''(x) = \frac{1}{1 + 1/x}\left(- \frac{1}{x^{2}}\right) + \frac{1}{(x + 1)^{2}} = -\frac{1}{x(x + 1)} + \frac{1}{(x+1)^{2}} > 0,$$ for $x \geq 1.$ Thus, we must have $g'(x) \geq \ln(2) - 1/2 > 0$ for all $x \geq 1.$

We have checked that the sequence $a_{n} = (1 + 1/n)^{n}$ is increasing. The sequence is also bounded above by $3$. Checking this is same as checking $1 + 1/n \leq 3^{1/n},$ which can be checked by checking $1 + x \leq 3^{x}$ for $0 \leq x \leq 1,$ which can be checked by differentiation trick we have introduced above. Therefore, by the completeness property, the limit of $a_{n}$ exists, and we call this limit $e.$ That is, we define $$e := \lim_{n \rightarrow \infty}\left(1 + \frac{1}{n}\right)^{n}.$$

geometric sequence is a sequence such that that each pair of the consecutive terms have the same ratio. If such a common ratio $r$ is non-zero, then we can consider this sequence to be given by $a_{n+1}/a_{n} = r$ for all $n \geq 1.$ More explicitly, you may deduce that
\[a_{n} = a_{1}r^{n-1}.\] 
series is a sum of the terms of a sequence. You can have finite series or infinite series. There is a version of $p$-test in the series world. 

$p$-series. Given any real number $p,$ the series
\[\sum_{n=1}^{\infty}\frac{1}{n^{p}}\]
converges if and only if $p > 1.$ We refer to this as "$p$-series", although this is not a standard math terminology outside Math 116.

Question. Is there a more general phenomenon?

Answer. Yes! This is what we call the integral test. Please read the link, and at least get comfortable with the statement. Alternatively, you may read p.492 of your book.

Exercise. Solve #4 of Exam 3, Fall 2016.

Optional reading. You may consider $p$-series as a function in $p$, and it turned out that this is one of the most important functions in mathematics, called "zeta function". I like thinking about it, since it often breaks data about integers into atomic pieces about prime numbers.

geometric series is a sum of a geometric sequence. Say $a_{1}, a_{2}, a_{3}, \dots$ is the geometric sequence of ratio $r$. Then we may consider their partial sums $$s_{n} := a_{1} + \cdots + a_{n}.$$

Exercise. Show that $s_{n} - s_{n-1} = a_{n}$ for $n \geq 1.$ Note that this holds for any sequence, not just for geometric sequences. This proves that if $s_{n}$ converges, then $a_{n}$ converges to $0$, which is called the general term test. (You might have to call it "$n$-th term test" for your exam, but this terminology is misleading.) A more useful way of thinking about this test is the following.

Term test for divergence. If $a_{n}$ does not go to $0,$ then $\sum_{n=1}^{\infty}a_{n}$ diverges.

Exercise. Using the fact that $a_{n} = a_{1}r^{n-1}$, show that if $r \neq 1,$ then
\[s_{n} = \frac{a_{1}(r^{n} - 1)}{r - 1} = \frac{a_{1}(1 - r^{n})}{1 - r}.\]
In particular, if $-1 < r < 1,$ then
 $$a_{1} + a_{2} + a_{3} + \cdots = \lim_{n \rightarrow \infty}s_{n} = \frac{a_{1}}{r - 1},$$ and you must remember this fact about geometric series!

Exercise. Show that $0.99999 \dots = 1.$

Friday, October 11, 2019

Probability

Introduction to probability distributions. The discussion here might be too advanced for Math 116 students, so I highly recommend you read through Section 8.7 and 8.8 of your book. Nevertheless, I think the book needs a bit more explanations, so I am just writing some here. Don't worry. I won't give proofs in class!

A continuous real-valued function $p(x)$ is called a probability density function (pdf) if the following two conditions are satisfied:
  1. $p(x) \geq 0$ for all $x.$
  2. $\int_{-\infty}^{\infty}p(x)dx = 1.$
Thus, given such a function $p(x),$ you can model some notion of probability. For example, your model can design (if chosen at random) "the probability that a person's height $x$ is between $5$ feet and $6$ feet" as the quantity $$\int_{x=5}^{x=6} p(x) dx.$$ Of course, you might want to pick $p(x)$ well enough that your probability is not too far from reality. (This is very nontrivial in practice.)

The cumulative distribution function (cdf) of a pdf $p(x)$ is $$P(t) := \int_{x= - \infty}^{x=t}p(x)dx.$$

Exercise. If $P(t)$ is the cdf of a pdf $p(x),$ then show that $P'(t) = p(t).$

Exercise. If $P(t)$ is the cdf of a pdf $p(x),$ then show that
  1. $P(t)$ is non-decreasing,
  2. $\lim_{t \rightarrow -\infty}P(t) = 0$,
  3. $\lim_{t \rightarrow \infty}P(t) = 1$, and
  4. $\int_{a}^{b}p(x)dx = P(b) - P(a).$
Exercise. Book 8.7: #1, #5, #14, #24.

Given any p.d.f. $p,$ its mean is $$\mu(p) := \int_{-\infty}^{\infty}x p(x) dx,$$ and we will only consider the case when this is a convergent integral.

Remark. For this, we need to ensure that $p(x)$ decays fast enough. For instance, if we let $c = \int_{1}^{\infty}x^{-2} dx$ and define $p(x) = c^{-1}x^{-2}$ for $x \geq 1$ and $0$ elsewhere, then $p(x)$ is a legitimate p.d.f, while we have $$\mu(p) = c^{-1}\int_{1}^{\infty} \frac{1}{x} dx = \infty,$$ which we cannot use in practice.

The standard deviation of $p$ is defined by $$\sigma(p) := \left(\int_{-\infty}^{\infty}(x - \mu(p))^{2}f(x)dx\right)^{1/2}.$$ Again we need to assume that $p(x)$ decays quite fast as it goes away from $0$ to $\infty$ or $-\infty.$

Theorem 1. If $p$ is a p.d.f that decays fast enough, we have
$$\sigma(p)^{2} = \int_{-\infty}^{\infty}x^{2}p(x)dx - \mu(p)^{2}.$$ Proof. For convenience, write $\mu = \mu(p).$ By definitions of the standard deviation and the mean of $p$, we have
\begin{align*} \sigma(p)^{2} &= \int_{-\infty}^{\infty}(x - \mu(p))^{2}p(x)dx \\ &= \int_{-\infty}^{\infty}(x^{2} - 2\mu x + \mu^{2})p(x)dx \\ &= \int_{-\infty}^{\infty}x^{2}p(x) dx - 2\mu\int_{-\infty}^{\infty}xp(x)dx + \mu^{2}\int_{-\infty}^{\infty}p(x)dx \\ &= \int_{-\infty}^{\infty}x^{2}p(x) dx - 2\mu\mu + \mu^{2} \cdot 1 \\ &= \int_{-\infty}^{\infty}x^{2}p(x) dx - \mu^{2}. \end{align*}
Note that for the second to the last equality, we have used the condition $$\int_{-\infty}^{\infty}p(x)dx = 1,$$ which follows from the assumption that $p$ is a p.d.f. This finishes the proof.

We will compute the mean and the standard deviation of the following probability distribution function (p.d.f.): $$f_{m,s}(x) = \frac{e^{-(x - m)^{2}/(2s^{2})}}{s\sqrt{2 \pi}},$$ where $m, s$ are constants and $s > 0.$ It is evident that $f_{m,s}(x) \geq 0$ for all $x$ because the exponentiation always gives us a positive value. However, to show $f_{m,s}(x)$ is a p.d.f., we also need to check that $$\int_{-\infty}^{\infty}f_{m,s}(x)dx = 1,$$ and this is not so obvious.

How to check this in your future. The easiest case is when $s = 1/\sqrt{2}$ and $m = 0$ (which can be done in Math 215 using the change of variables in polar coordinates). Then the substitution method to manipulate the integral will do the job.

Theorem 2. We have $\mu(f_{m,s}) = m.$

Proof. By definition of the mean, we have
\[\mu(f_{m,s}) = \int_{-\infty}^{\infty}xf_{m,s}(x) dx = \int_{-\infty}^{\infty} \frac{xe^{-(x - m)^{2}/(2s^{2})}}{s\sqrt{2\pi}}dx.\]
Consider the substitution
\[u = \frac{x - m}{s\sqrt{2}},\]
which comes with
\[du = \frac{dx}{s\sqrt{2}}.\]
Moreover, note that $x = s\sqrt{2} \cdot u + m.$ Hence, following the computation we have made above, we get
\begin{align*}\mu(f_{m,s}) &= \frac{1}{\sqrt{\pi}}\int_{-\infty}^{\infty}(s\sqrt{2} \cdot u + m)e^{-u^{2}}du \\ &= \frac{m}{\sqrt{\pi}}\int_{-\infty}^{\infty}e^{-u^{2}}du \\ &= m.\end{align*}
Note that the second to the last equality uses that
\[\int_{-\infty}^{\infty}ue^{-u^{2}}du = 0,\]
which is a property for any odd function. The last equality uses the fact that $f_{0,1/\sqrt{2}}$ is a p.d.f.

The following turned out to be more difficult that I thought:

Theorem 3. We have $\sigma(f_{m,s}) = s.$

Proof. By definition of the standard deviation and using Theorem 2 which says $\mu(f_{m,s}) = m$, we have
\[\sigma(f_{m,s})^{2} = \int_{-\infty}^{\infty}(x - m)^{2}f_{m,s}(x)dx = \int_{-\infty}^{\infty} \frac{(x - m)^{2}e^{-(x - m)^{2}/(2s^{2})}}{s\sqrt{2\pi}}dx.\]
Consider the substitution
\[t = \frac{x - m}{s\sqrt{2}},\]
which comes with
\[dt = \frac{dx}{s\sqrt{2}}.\]
Moreover, note that $x - m = st\sqrt{2}.$ Hence, following the computation we have made above, we get
\[\sigma(f_{m,s})^{2} = \frac{1}{\sqrt{\pi}}\int_{-\infty}^{\infty}2s^{2}t^{2}e^{-t^{2}}dt = \frac{4s^{2}}{\sqrt{\pi}}\int_{0}^{\infty}t^{2}e^{-t^{2}}dt,\]
where the last integral uses a property of even functions. Hence, we can just focus on computing the last integral. Since we only need to think about $t \geq 0,$ we can use the substitution
\[u = t^{2},\]
which comes with $du = 2tdt.$ Continuing the computation above, we have
\begin{align*}\sigma(f_{m,s})^{2} &= \frac{4s^{2}}{\sqrt{\pi}}\int_{0}^{\infty}t^{2}e^{-t^{2}}dt \\ &= \frac{2s^{2}}{\sqrt{\pi}}\int_{0}^{\infty}u^{1/2}e^{-u}du \\ &= \frac{2s^{2}}{\sqrt{\pi}}\Gamma(3/2), \end{align*}
where
\[\Gamma(z) = \int_{0}^{\infty}u^{z-1}e^{-u}du.\]
This is called the Gamma function, which you can read about here. One of the properties in the link says that we have the duplication formula:
\[\Gamma(z)\Gamma(z + 1/2) = 2^{1 - 2z} \sqrt{\pi}\Gamma(2z).\]
It is also not difficult to figure out $\Gamma(n) = (n-1)!$ for all integer $n \geq 1.$ Hence taking $z = 1$ in the duplication formula, we get $$\Gamma(3/2) = 2^{-1}\sqrt{\pi}\Gamma(2) = 2^{-1}\sqrt{\pi}.$$ Combining with the previous computation, we have $$\sigma(f_{m,s})^{2} = \frac{2s^{2}}{\sqrt{\pi}}\Gamma(3/2) = \frac{2s^{2}}{\sqrt{\pi}}2^{-1}\sqrt{\pi} = s^{2}.$$
This implies that $\sigma(f_{m,s}) = s,$ as desired.

Upshot: The distribution given by the p.d.f $f_{m,s}$ is called the normal distribution with mean $m$ and standard deviation $s.$

Median. Given a pdf $p(x),$ the median of the distribution given by $p(x)$ is the value $T$ such that $$\int_{-\infty}^{T}p(x) dx  = 1/2.$$ Roughly, the median estimates what's in the middle, while the mean means the average.

Exercise. Suppose that $p(x)$ is a pdf that is symmetric to the vertical line $x = a,$ where $a$ is a fixed real number.

  1. What is the median given by the distribution?
  2. What is the mean given by the distribution?

Tuesday, October 8, 2019

Work

In this posting, we study the concept of work. You may find more detailed exposition with various examples in Section 8.5 of your book.

Slogan: Work is "energy".

Linear fashion (local/micro work). Work = Force $\times$ Distance

Nonlinear fashion (global/total work). When $x$ is a position that moves from $a$ to $b$ and $F(x)$ is the force acting at $x$, then
\[\text{Work} = \int_{a}^{b}F(x) dx.\]

Gravitational acceleration from physics. It is quite a remarkable observation that on Earth, if you drop any two objects from the same height when there is no air at presence, both objects will hit the ground at the same time. This means that any object has a constant acceleration, not depending on the object, when we do not count air resistance. In the unit (meter/second)/second = $m/s^{2}$, this constant is denoted as $g$, and it is known that it is approximately equal to $9.8$, so when the problem does not give you any information about gravitation, you should start by write something like "Let $g$ be the gravitational acceleration in $m/s^{2}$" or "Let $g = 9.8 m/s^{2}$ be the estimated gravitational constant."

Force is mass times acceleration when the quantities are constant. In classical mechanics, it is assumed that the force is equal to mass times acceleration (a.k.a., the "law" $F = ma$). This is something we assume in this course as well, if the mass and acceleration are assumed to be constant. However, this will rarely happen. This formula will usually make sense when we compute micro-force.

Exercise. Suppose that the mass of your book is $2$kg. If you have lifted your book $1.5$ meters off the floor, then how much work have you done?

Exercise. Say you are pushing a ball whose mass is $1$kg along the graph $y = x$ from point $(0, 0)$ to $(1, 1)$. When you are done, how much work would you have done? (Suppose that the unit for distance on our $xy$-plane is in meters.)

Exercise (Hard). Say you are pushing a ball whose mass is $1$kg along the graph $y = x^{2}$ from point $(0, 0)$ to $(1, 1)$. When you are done, how much work would you have done? (Suppose that the unit for distance on our $xy$-plane is in meters.)

(Hint: This is a very hard exercise for any student who is taking Math 116 from my past experience. Writing $g$ for the constant gravitational acceleration, if you compute correctly the instantaneous force for the particle with $x$-coordinate $x$ is equal to $g \sin(\theta(x))$ and the instantaneous distance would be $\Delta x / \cos(\theta(x))$. Here, note that $\theta(x)$ is the angle between the tangent line of the point $(x, y)$ on the graph $y = x^{2}$ and the $x$-axis. Note that by taking derivative, you see $\tan(\theta(x)) = 2x,$ and this would let you compute the integral.)

Remark. The unit for the work in the last exercise is in joules (i.e., $kg \cdot m^{2}/s^{2}$, which is often denoted as $J$).

Exercise. Solve 3a and 3b of Exam 1, Winter 2017.

Exercise. Solve 9a, b, and c of Exam 1, Winter 2017.

Exercise. Solve 9 of Exam 1, Winter 2016.

Exercise. Solve 9 of Exam 1, Fall 2015.

Monday, September 30, 2019

Parametrization and arc length

Parametrization: case study. Consider our favorite example $y = x^{2}$. We may consider the curve from $(0, 0)$ to $(1, 1)$. Naturally, you think about a particle moving along the curve. We may consider the particle to be $(x(t), y(t)) = (t, t^{2})$ because then it will satisfy $y(t) = x(t)^{2}$. Notice that $$\frac{y'(t)}{x'(t)} = 2x,$$ which is equal to $y'(x) = 2x.$

In general, when $y$ is a differentialble function in $x$ and $x$ is a differentiable function in $t$ so that
  • $y = y(x)$;
  • $x = x(t)$.
Then we have $y(t) = y(x(t))$, so $y'(t) = y'(x(t))x'(t)$ by Chain Rule. Hence, we get $$y'(x) = y'(x(t)) = \frac{y'(t)}{x'(t)},$$ as long as $x'(t) \neq 0.$ In the above example, we had $x(t) = t$ and $y(x) = x^{2}.$ This formula can be remembered as: $$\frac{dy}{dx} = \frac{dy/dt}{dx/dt}.$$ This gives a nice way to take derivatives.

Example. Consider the implicit function $y(x)$ that is given by the unit circle $x^{2} + y^{2} = 1.$ We can locally compute $y'(x)$ as follows: first, consider the parametrization given by
  • $x(t) = \cos(t)$ and
  • $y(t) = \sin(t)$.
Then $y'(\cos(t)) = y'(x(t)) = x'(t)/y'(t) = -\sin(t)/\cos(t) = -y(t)/x(t),$ so you can see that $y'(x) = -y/x$ when $x \neq 0$.

Arc length: case studyYou know the length from $(0,0)$ to $(1,1)$ along the line $y = x$. Can you compute the length from $(0,0)$ to $(1,1)$ along the curve $y = x^{2}$?

Write $f(x) = x^{2}$. To compute the length, let's break the interval $[0, 1]$ into pieces. Each subinterval would have length $\Delta x$ and you can estimate the length you want by summing up lengths of line segments $\sqrt{(\Delta x)^{2} +(f(x + \Delta x) - f(x))^{2}}.$ Note that $$\sqrt{(\Delta x)^{2} +(f(x + \Delta x) - f(x))^{2}} = \sqrt{1 + \left(\dfrac{f(x + \Delta x) - f(x)}{\Delta x}\right)^{2}}\Delta x,$$ so when you sum them up and take $\Delta x \rightarrow 0$, you should get $$\textbf{Arc length} = \int_{0}^{1}\sqrt{1 + f'(x)^{2}}dx = \int_{0}^{1}\sqrt{1 + 4x^{2}} dx.$$

In general, if you have a smooth function $y = f(x)$, then $$\textbf{Arc length from } x = a \textbf{ to }  x = b \text{ is } \int_{a}^{b}\sqrt{1 + f'(x)^{2}}dx.$$

If you have a parametrization $(x(t), y(t)),$ again, thinking $y(t) = y(x(t))$, you may apply the change of variable in the above formula. That is, you consider $x = x(t)$ so that $dx = x'(t)dt$. Find $t = c$ such that $x(c) = a$ and $t = d$ such that $x(d) = b$, you get
\[\int_{c}^{d}\sqrt{1 + (y'(t)/x'(t))^{2}}x'(t)dt = \int_{c}^{d}\sqrt{x'(t)^{2} + y'(t)^{2}}dt.\]

You can consider the above as the arc length of the particle $(x(t), y(t))$ from time $t = c$ to $t = d$.

Memorization trick. Given a particle $(x(t), y(t))$, its velocity is $(x'(t), y'(t))$ and its speed is the size of the velocity, which is $\sqrt{x'(t)^{2} + y'(t)^{2}}$. You notice that:

Arc length is the integral of speed!

Exercise. Using arc length of the parametrization $(2\cos(t), 2\sin(t))$ of the circle of radius $2$ for $0 \leq t \leq 2\pi$, derive the usual fact that its circumference is equal to $4\pi$.

Exercise. Solve #4b of Exam 1, Winter 2017.

Exercise. Solve #6c of Exam 1, Fall 2016.

Exercise. Solve #3 of Exam 1, Fall 2015.

Exercise. Solve #8 of Exam 1, Fall 2015.

Wednesday, September 25, 2019

Area, volume, and mass

It is somewhat impossible to explain this concept without drawing pictures, so I am just going to let your book take care of the conceptual explanations.

Exercise. Read Sections 8.1, 8.2, and 8.4.

Instead, we will work on problems in class.

Friday, September 20, 2019

Improper integral (with singularity)

Recall from the last time that the integral $$\int_{1}^{\infty}\frac{1}{x^{p}}dx$$ is finite exactly for $p > 1.$ To turn it around, we may ask the same question for the following integral: $$\int_{0}^{1} \frac{1}{x^{p}} dx.$$ First, we need to know what we are talking about, namely, we have the problematic point $x = 0,$ because we cannot put that on the denominator of the integrand. (Such a point is called a "singularity".) What do we do? We just avoid it slightly and approach the singularity instead: we define $$\int_{0}^{1} \frac{1}{x^{p}} dx = \lim_{\epsilon \rightarrow 0+} \int_{\epsilon}^{1} \frac{1}{x^{p}} dx.$$ Using the 1st fundamental theorem of calculus, you will realize that the integral is finite precisely when $p < 1.$

Exercise. Do all the problems in this problem set!

Thursday, September 19, 2019

Improper integrals (with point at infinity)

Motivation. We will eventually talk about infinite sums in this course, and they are quite tricky. For example, consider $$1 + \frac{1}{2} + \frac{1}{3} + \cdots.$$ It looks like each time we add something smaller than the previous term, but in fact, we have $$1 + \frac{1}{2} + \frac{1}{3} + \cdots = \infty.$$ How do we know? First, do the following exercise:

Exercise. By drawing a good picture, explain that $$1 + \frac{1}{2} + \frac{1}{3} + \cdots \geq \int_{1}^{\infty}\frac{1}{x}dx.$$ (Hint: the numbers we add will be the areas of certain boxes.)

Now, we have $$\begin{align*} \int_{1}^{\infty}\frac{1}{x}dx &= \lim_{r \rightarrow \infty}\int_{1}^{r}\frac{1}{x}dx \\ &= \lim_{r \rightarrow \infty}\left.\ln(|x|)\right|_{1}^{r} \\&= \lim_{r \rightarrow \infty}\ln(r) \\&= \infty. \end{align*}$$ This lets us see that the infinite sum is infinite.

Exercise. Determine whether the following sum is finite or infinite: $$1 + \frac{1}{2^{2}} + \frac{1}{3^{2}} + \cdots.$$ This will be a part of somewhat general behavior:

Exercise. Figure out exactly which real number $p$ makes the following integral finite: $$\int_{1}^{\infty}\frac{1}{x^{p}}dx.$$ The finite integrals will be called converegent, while the infinite integrals will be called divergent.

Exercise. Read Section 7.6.

Exercise. Determine whether the following integral is convergent or divergent: $$\int_{1}^{\infty} \frac{1}{(x+4)^{2}}dx.$$ (Hint: Use substitution trick.)

Exercise. Determine whether the following integral is convergent or divergent: $$\int_{1}^{\infty} \frac{x}{(x+4)^{2}}dx.$$ (Hint: Use substitution trick and then split the integral into two.)

Exponential function. One improper integral involving $\infty$ that comes up a lot is the exponential decay. Namely, the function $e^{-x}$ decays so fast that $$\int_{1}^{\infty} e^{-x}dx$$ is finite.

Exercise. Explain why $$\frac{1}{x^{2}} \leq e^{-x}$$ for large enough $x.$ Using this information, show that the following integral is finite: $$\int_{1}^{\infty} e^{-x}dx.$$ (Hint: Try to think about using L'H on $x^{2}/e^{x}.$)

Exercise. Compute $$\int_{1}^{\infty} e^{-x}dx$$ as an exact value.

Exercise. Figure out which $a$ makes the following integral finite: $$\int_{1}^{\infty} e^{ax}dx.$$ (Hint: For $a \geq 0,$ note that $e^{ax} \geq 1$ for all $x.$)

Exercise. Determine the convergence of the following integral: $$\int_{3}^{\infty} x^{3}e^{-x}dx.$$ (Hint: Recall that $e^{x} \geq x^{5}$ for large enough $x.$ Why does this help?)

Exercise. Determine the convergence of the following integral: $$\int_{3}^{\infty} \ln(x)(e^{-x} + x^{-1})dx.$$ (Hint: Try to split the integral.)

Exercise. Determine the convergence of the following integral: $$\int_{3}^{\infty} x^{-3000}e^{x}dx.$$ (Hint: $e^{x} \geq x^{3000}$ eventually in $x$.)

Exercise. Determine the convergence of the following integral: $$\int_{3}^{\infty} \sin^{2}(x)x^{-2}dx.$$ (Hint: $-1 \leq \sin(x) \leq 1$.)

Wednesday, September 18, 2019

L'Hôpital's rule

Motivation. Consider the problem of computing the following limit: $$\lim_{x \rightarrow 0}\frac{\sin(x)}{x}.$$ How should you go about it? My favorite answer is to see this as a derivative. Namely, we have $$\begin{align*}\lim_{x \rightarrow 0}\frac{\sin(x)}{x} &= \lim_{x \rightarrow 0}\frac{\sin(x) - \sin(0)}{x - 0} \\ &= \left.\frac{d}{dx}\right|_{0} \sin(x) \\ &= \left. \cos(x)\right|_{x=0} \\ &= 1.\end{align*}$$ But then it might not be so straight forward to figure out the limit like $$\lim_{t \rightarrow 0}\frac{\sin(x)}{\sin(\sin(x^{3}))}.$$ This is why we learn L'Hôpital's rule:

Exercise. Read p.253, especially two boxes outlined in blue: these are L'Hôpital's rules.

Exercise. Compute $$\lim_{x \rightarrow 0}\frac{\sin(x)}{\sin(\sin(x^{3}))}.$$

Exercise (Hard). Compute $$\lim_{x \rightarrow 0+}x^{x}.$$

Exercise. Compute $$\lim_{x \rightarrow \infty}\frac{x^{2} + x + 1}{\ln(x)}.$$

Exercise. Compute $$\lim_{x \rightarrow \infty}\frac{x^{2} + x + 1}{3^{x}}.$$

Exercise. Compute $$\lim_{t \rightarrow \infty}(1 + t)^{t}.$$

Monday, September 16, 2019

Numerical approximations

You should be convinced by now that not every integral can be computed by means of computing an antiderivative of the integrand. For instance, it is quite difficult to just compute $$\int_{0}^{1} e^{-x^{2}} dx,$$ even though this integral arises many times in statistics. Hence, you need to learn about various ways to numerically approximate such an integral.

Left sums and right sums. Since I cannot draw here, I will first assign you some reading.

Exercise. Read p.377, and compute $\mathrm{LEFT}(4)$ and $\mathrm{RIGHT}(4)$ for the integral $$\int_{0}^{1} e^{-x^{2}} dx.$$ Which one is bigger? Can you generalize this pattern?

What's the most important about left sums and right sums is how to compare them when the integrand is either given by an increasing function or a decreasing function with positivity condition.

(1) If $f(x)$ is positive (i.e., $f > 0$) and increasing (e.g., $f' > 0$), then $$\mathrm{LEFT}(n) \leq \int_{a}^{b} f(x) dx \leq \mathrm{RIGHT}(n);$$ (2) If $f(x)$ is positive (i.e., $f > 0$) and decreasing (e.g., $f' < 0$), then $$\mathrm{RIGHT}(n) \leq \int_{a}^{b} f(x) dx \leq \mathrm{LEFT}(n).$$ To see these, it is the best to draw pictures.

Exercise. What happens if $f(x)$ is negative?

Exercise. Estimate $$\int_{0}^{1} x^{2} dx$$ by bounding it with $\mathrm{LEFT}(5)$ and $\mathrm{RIGHT}(5).$ Compare the bounds with the actual answer $1/3.$

Exercise. Can you apply the same method as in the previous exercise for estimating $$\int_{0}^{\pi} \sin(x) dx?$$ If not, how would you modify your method?

Midpoint sums and trapezoid sums. As in p.377, the midpoint sums are given by summing up the rectangles whose heights were taken in the middle of subintervals. Trapezoid sums are defined by Figure 7.7 on p.378.

Exercise. Figure out why the trapezoid sum is the average of the left sum and the right sum, namely, explain why the following formula holds: $$\mathrm{TRAP}(n) = \frac{\mathrm{LEFT}(n) + \mathrm{RIGHT}(n)}{2}.$$

Exercise. Compute $\mathrm{MID}(4)$ and $\mathrm{TRAP}(4)$ for the integral $$\int_{0}^{1} e^{x} dx.$$ Which one is bigger? Can you generalize this pattern?

Midpoint sums and trapezoid sums have some story related to concavity.

(1) If $f(x)$ is concave up (e.g., $f'' > 0$), then $$\mathrm{MID}(n) \leq \int_{a}^{b} f(x) dx \leq \mathrm{TRAP}(n);$$ (2) If $f(x)$ is concave down (e.g., $f'' < 0$), then $$\mathrm{TRAP}(n) \leq \int_{a}^{b} f(x) dx \leq \mathrm{MID}(n).$$ To see these, it is the best to draw pictures, or you can just read:

Exercise. Read p.379 to understand why the above stories are true.

Exercise. Do #1 on Team HW 1.

Wednesday, September 11, 2019

Partial Fraction method

This covers only a part (p.366 ~ 368) of Section 7.4 because the rest will not be on the exam.

Fun fact. I once tried to find some new facts behind this method during my undergraduate years, but pretty much everything I could imagine was known to the math community. However, I got more interest in abstract algebra because of this method.

Starting example. Consider computing the following indefinite integral: $$\int \frac{2x + 3}{(x + 1)(x + 2)}dx.$$ At first, you might freeze, but once you FOIL the bottom, you get $$\int \frac{2x + 3}{(x + 1)(x + 2)}dx = \int \frac{2x + 3}{x^{2} + 3x + 2}dx.$$ Now, you might notice that you could take $u = x^{2} + 3x + 2$ so that $du = (2x + 3)dx.$ This lets us compute $$\begin{align*}\int \frac{2x + 3}{(x + 1)(x + 2)}dx &= \int \frac{2x + 3}{x^{2} + 3x + 2}dx \\ &= \int \frac{1}{u}du \\ &=  \ln(|u|) + c \\ &= \ln(|x^{2} + 3x + 2|) + c,\end{align*}$$ where $c$ is an arbitrary constant.

Let's tweak the problem. What if you need to compute $$\int \frac{1}{(x + 1)(x + 2)}dx$$ instead? Our previous trick does not work well, so we need find a different method. Well, note that $$\frac{1}{x + 1} - \frac{1}{x + 2} = \frac{(x+2) - (x+1)}{(x+1)(x+2)} = \frac{1}{(x + 1)(x + 2)}.$$ What's so big deal? The right-hand side was our integrand, and the left-hand side has something we can integrate! Thus, we have $$\int \frac{1}{(x + 1)(x + 2)} dx = \int \frac{1}{x + 1} - \frac{1}{x + 2}dx = \ln(|x+1|) - \ln(|x+2|) + c,$$ where $c$ is the integrating constant.

A more systematic method (a.k.a Partial Fraction method). How could we find such magical decomposition into partial fractions? Well, write $$\begin{align*}\frac{1}{(x + 1)(x + 2)} &= \frac{A}{x+1} + \frac{B}{x + 2} \\ &= \frac{A(x+2) + B(x+1)}{(x+1)(x+2)} \\ &= \frac{(A+B)x+(2A + B)}{(x+1)(x+2)}. \end{align*}$$ Comparing the numerators of the left-hand side and the right-hand side, we get $$0x + 1 = 1 = (A+B)x + (2A + B).$$ This means that

  • $A + B = 0$ and
  • $2A + B = 1.$
Subtracting the first equation from the second equation, we get $A = (2A + B) - (A + B) = 1 - 0 = 1.$ But then from the first equation, we see that $B = -1.$ This establishes $$\frac{1}{(x + 1)(x + 2)}  = \frac{A}{x+1} + \frac{B}{x + 2} = \frac{1}{x+1} - \frac{1}{x + 2}.$$ Let's do some exercises.

Exercise. Compute the following integral using the Partial Fraction method: $$\int \frac{2x + 3}{x^{2} + 3x + 2}dx.$$

Exercise. Compute $$\int \frac{2x + 3}{x^{2} - 3x + 2}dx.$$

Exercise. Compute $$\int \frac{2x + 3}{x^{2} + 3x + 2}dx.$$

Exercise (Hard). Compute $$\int \frac{2x + 3}{x^{2} + 2x + 2}dx.$$ (Hint: I don't know how to do this with the Partial Fraction method. I would first take care of $2x + 2$ much of the numerator using the substitution trick. For the rest, note that our integrand becomes $1/(1 + (x+1)^{2}) = \frac{d}{dx} \arctan(x + 1).$)


Exercise. Do #1 (c) on Exam 1 (Winter 2019).

Hints for Team HW 1

I am writing a guideline for Team HW 1, which may help you do the problems without too much pain.

Disclaimer. I do type things in a quite hasty manner, so I tend to make mistakes. If I do, you should discuss with me to figure out what the correct approach should be. If you merely copy what I say without understanding, it will backfire you on your exam!

For #1, there are notations that are not available in the reading. This is unfortunate, but for this, read the beginning of Section 7.5 of your book (more specifically, understand the notations $\mathrm{LEFT}(n)$ and $\mathrm{RIGHT}(n)$ on p.377). Then take a look at the problem again.

One thing you need to remember is that for POSITIVE function $f(x)$ on an interval $[a, b],$ we have the following phenomena.

(1) If $f(x)$ is increasing (i.e., $f'(x) \geq 0$ for all $x$) and positive (i.e., $f(x) > 0$ for all $x$), then $$\mathrm{LEFT}(n) \leq \int_{a}^{b} f(x) dx \leq \mathrm{RIGHT}(n).$$

(2) If $f(x)$ is decreasing (i.e., $f'(x) \leq 0$ for all $x$) positive (i.e., $f(x) > 0$ for all $x$), then $$\mathrm{RIGHT}(n) \leq \int_{a}^{b} f(x) dx \leq \mathrm{LEFT}(n).$$

Exercise. Explain why (1) and (2) should be true as stated (Hint: draw a picture).

Exercise. What happens to (1) and (2) if $f(x)$ is negative?

Hints for #1. For #1 (a) and (b), try to violate the statements by drawing a good picture. If you realize you cannot violate one at all, chances are that the statement is true. Otherwise, you will have a counterexample to say that the statement is false.

For #1 (c), I would think of $h(x) = g(x) - f(x)$ as a single function. Then

  • $h(2) = g(2) - f(2) = 0$ and
  • $h'(x) = g'(x) - f'(x) > 0$ for all $x,$ so $h(x)$ must be strictly increasing.
Our integrand is $xh(x)$ and its derivative is $h(x) + xh'(x)$ by the product rule.

For #1 (d), we have $h(t) = G(100 - t^{2}),$ for a suitable choice of $G(t).$ By chain rule, we have $$h'(t) = -2tG'(100 - t^{2}).$$ Use 2nd FTC to find $G'(t)$ and replace $t$ with $100 - t^{2}$ to compute $G'(100 - t^{2}).$


Hints for #2. For #2 (a), recall the definition of the average value. Since this appears in the team homework, maybe the definition will appear on the exam. (This is a mere guess, so please don't count on me.)

For #2 (b), we just try our guess: how about $$G(t) = \int_{0}^{t}g(x) dx.$$ Since 2nd FTC gives $G'(t) = g(t),$ you might feel like this is correct. No! We are supposed to have $G(0) = 18.4.$ (Do you see why?) How do we fix one thing about our wrong answer to make it correct? Think about it.

For #2 (c), let $c$ be the number (amount) of wasps that Conner brings each day (as I think the problem seems to suggest that he brings them back and forth--I could be wrong), so $200c$ grasshoppers will be killed each day. The total number of grasshoppers at the time $7 \leq t \leq 10$ will be $R(t) = G(t) - 200c(t - 7).$ (Can you see why?) We want $R(10) = 0,$ so using this (with the information given by the graph), deduce what $c$ ought to be.

For #2 (d), note that $R(t)$ is given for $7 \leq t \leq 10.$ Noting that Conner brings no wasps for the time $0 \leq t < 7,$ think about what $R(t)$ should be. (Hint: this should be easy to you.) For concavity, you might want to recall your knowledge about the second derivatives, which is available on p.196 of your book.

Hints for #3. First, you need to retain your Calculus 1 knowledge to pass your first Gateways, so say that's our motivation to stop Darth Integrator.

For #3 (a), note that $p(x)$ looks quite continuous, so it should be continuous at $x = 3/4.$

For #3 (b), let $T$ be the area of the triangle with the vertices $(0, 0), (c, 0), (c, p(c)).$ Then the problem is saying that $$\frac{1}{7}\int_{0}^{5/2}p(x)dx = T + \int_{c}^{5/2}p(x)dx.$$ Using the explicit descriptions about $p(x)$ given in #3 (a) (with your answer for specific $a$), you can compute the integrals above, and presumably it will give you an equation in $c.$ Then you should try to solve that equation to get $c,$ but since the problem is saying you should approximate, maybe it will be hard to do solve that equation in $c$ with your hand. (Then use the calculator.)

Taking integration by parts

In this posting, we will learn another trick to compute an integral (definite or indefinite). It is called "integration by parts" because we are going to divide the integration into two parts. In your book, this is discussed in Section 7.2.

Motivating example. Let's try to compute the following indefinite integral $$\int \ln(x) dx.$$ That is, we want to classify all $F(x)$ such that $F'(x) = \ln(x).$ How would we do that? Well, if you have thought about it long enough you will realize that the following function works: $F(x) = x\ln(x) - x,$ or this with any constant added to it. Indeed, you can check that by product rule (Section 3.3), we have $$F'(x) = \ln(x) + x(1/x) - 1 = \ln(x) + 1 - 1 = \ln(x),$$ so we are good.

Q. How on earth would we be able to come up with such an antiderivative?

This is where we introduce a new trick. We really try to think about the integrand as a part of something else. Write $$\ln(x) = F'(x) = u'(x)v(x),$$ for some nicely differentiable functions $u, v.$ Note that the product consists of a derivative function and a function. If we add $u(x)v'(x),$ we have $$F'(x) + u(x)v'(x) = u'(x)v(x) + u(x)v'(x) = \frac{d}{dx} (u(x)v(x))$$ so that we have $$\ln(x) = F'(x) = \frac{d}{dx} (u(x)v(x)) - u(x)v'(x).$$ Integrating both sides, we have $$\int \ln(x) dx = u(x)v(x) - \int u(x)v'(x) dx.$$ What's such a big deal?

Philosophy. The integration by parts is a trick that once you realize $\ln(x) = u'(x)v(x)$ for smart choices of $u(x)$ and $v(x),$ you get $$\int \ln(x) dx = u(x)v(x) - \int u(x)v'(x) dx$$ so that the computation of the left-hand side reduces to the computation of $\int u(x)v'(x) dx.$ If the last integral is easy to compute, then you win!

Exercise. Choose $u'(x) = 1$ and $v(x) = \ln(x)$ to finish the computation above.

Exercise. Compute $\int t \sin(t) dt.$

Exercise (Hard). Compute $\int \sin^{2}(t) dt.$

Exercise. Compute $\int_{e}^{3} x \ln(x) dx.$

Exercise. Compute $\int x^{2} \ln(x^{3}) dx.$

Exercise. For any positive integer $n,$ compute $\int x^{n} \ln(x) dx.$ (Hint: compute $\int x^{n} \ln(x^{n+1}) dx$ first using the substitution $u = x^{n+1},$ and use $(n+1) \ln(x) = \ln(x^{n+1}).$)

Exercise (Hard). Compute $\int e^{t}\cos(2t) dt.$

Exercise. Do #1 (a) on Exam 1 (Winter 2019).

Exercise. Do #3 on Exam 1 (Winter 2019).

Exercise. Do #1 (c) on Exam 1 (Fall 2018).

Monday, September 9, 2019

Substitution trick

What we will cover here is usually called "$u$-substitution". It is a neat way to make a hard integral into an easier one. Let's start with an example. Say we want to compute the indefinite integral $$\int x(x^{2} + 1)^{2} dx.$$ We like smashing problems with my bare hands, so let's just brute-force compute. Since $$x(x^{2} + 1)^{2} = x(x^{4} + 2x^{2} + 1) = x^{5} + 2x^{3} + x,$$ we have $$\begin{align*} \int x(x^{2} + 1)^{2} dx &= \int (x^{5} + 2x^{3} + x) dx \\ &= \frac{x^{6}}{6} + \frac{x^{4}}{2} + \frac{x^{2}}{2} + c,\end{align*}$$ where $c$ is an arbitrary constant.

OK. Let me tell you a different trick. Write $u = x^{2} + 1.$ Now, we want to write the integral in the perspective of $u.$

Step 1. Our integral needs to have $du$ at the end not $dx.$

How do we do this? Since $u = x^{2} + 1,$ we have $$\frac{du}{dx} = 2x.$$ Thus, we have $du = 2xdx.$

Step 2. Rewrite the integral completely in $u,$ and compute it in $u.$

We compute $$\begin{align*} \int x(x^{2} + 1)^{2} dx &= \int u^{2} xdx \\ &= \int \frac{u^{2}}{2} \cdot 2xdx \\ &= \int \frac{u^{2}}{2}du \\ &= \frac{u^{3}}{6} + c,\end{align*}$$ for an arbitrary constant $c.$

Step 3. For indefinite integrals, write the answer in $x.$

Hence, continuing our previous computation, our answer will come down to $$\frac{(x^{2} + 1)^{3}}{6} + c,$$ for an arbitrary constant $c.$

Exercise. Why do two answers we got look different? Or, are they the same?

Exercise. Compute $$\int_{-1}^{2} x(x^{2} + 1)^{2} dx.$$ (Hint: when you go to Step 2 above, make sure that the bounds $x = -1$ and $x = 2$ go to $u = 2$ and $u = 5,$ using $u = x^{2} + 1.$)

Exercise. Compute $$\int_{-1}^{1}\frac{e^{t} - e^{-t}}{e^{t} + e^{-t}} dt$$

Exercise. Compute $$\int \frac{e^{t} - e^{-t}}{e^{t} + e^{-t}} dt.$$

Exercise. Compute $$\int_{-1}^{1} \frac{\tan(x)}{\cos^{2}(x)} dx.$$

Exercise. Compute $$\int \frac{\tan(x)}{\cos(x)} dx.$$

Exercise. Read Section 7.1 of your book.

Exercise. Do #1 (b) on Exam 1 (Winter 2019).

Exercise. Do #1 (d) on Exam 1 (Fall 2018).

Exercise. Do #4 (a) on Exam 1 (Fall 2018).

Thursday, September 5, 2019

2nd Fundamental Theorem of Calculus

Warning. Most of people's biggest motivation is grade. Let me tell you what you are NOT supposed to do on the exam: $$\int_{1}^{x}\cos(x)dx.$$ What's the trouble? First, since the integral has bounds, it is a definite integral. In the way that we have treated integral, we need to treat $x$ like an arbitrary fixed real number. However, that makes no sense for $dx$ to certain mathematicians, especially geometors, who always writes $$df(t) = f'(t) dt,$$ so if $x$ is constant, then $dx$ would be zero to them, making the whole integral zero.

Remark. You don't really need to understand what I said about why geometors might hate writing $x$ on the bound and then use it for integrating variable (a.k.a. "dummy variable"). What's important is that you must NOT write such expression because many graders like geometry!

What's better? Use two different letters, for instance, we may write $$\int_{1}^{x} \cos(t)dt.$$ Now, note that we can define a function $F(x)$ in $x$ by saying $$F(x) = \int_{1}^{x}\cos(t)dt.$$ Is this legit? If you plug in a real number in $x,$ the right-hand side will give you exactly one real number. Hence, yes, it is legit. More explicitly, we have $$F(x) = \int_{1}^{x}\cos(t)dt = -\sin(x) + \sin(1),$$ applying 1st FTC. In particular, we have $F'(x) = \cos(x).$

Exercise. Let $$F(x) = \int_{0}^{x} \frac{1}{\cos^{2}(t)}dt$$ with $-\pi/2< x < \pi/2.$ What is $F'(x)$?

Exercise. Let $$F(x) = \int_{0}^{x} t^{2} + 5t^{4}dt.$$ What is $F'(x)$?

Exercise. Let $$F(x) = \int_{-x}^{x} \frac{1}{e^{t}}dt.$$  What is $F'(x)$?

Q. Now, suppose that $$F(x) = \int_{0}^{x} \cos(t^{2} + \cos(t))dt.$$ How would you compute $F'(x)$?

Well, if you have gone through the above exercises you might guess that the answer is: $$F'(x) = \cos(x^{2} + \cos(x)).$$ Unfortunately,the methods that you used for the above exercises do NOT apply to give you this conclusion.

What can we do? This is where you need to meticulously dig into the details of definitions of a derivative and an integral. (If you enjoy this process, you might consider majoring/minoring in mathematics.) Luckily p. 336 and 337 of your book does this, so if you are interested read this. Anyways, our guess is correct:

2nd Fundamental Theorem of Calculus (cf. Theorem 6.2 on p.336). For any continous function $f(x)$, we have $$\frac{d}{dx}\int_{a}^{x}f(t)dt = f(x).$$ Now, we can do the following exercise.

Exercise. Let $$F(x) = \int_{0}^{x} \cos(t^{2} + \cos(t))dt.$$ What is $F'(x)$? (Hint: Use 2nd FTC.)

Exercise. Let $$F(x) = \int_{0}^{x^{2}} \cos(t^{2})dt.$$ What is $F'(x)$? (Hint: Use 2nd FTC.)

Exercise. Compute $$\frac{d}{dx}\int_{0}^{\cos(x)} 3000^{t^{2}}dt.$$

Exercise. Compute $$\frac{d}{dx}\int_{-x}^{\cos(x)} 3000^{t^{3}}dt.$$

Monday, September 2, 2019

Definite integrals vs. indefinite integrals

Recall that 1st FTC says if you find a function $F(x)$ such that $F'(x) = f(x),$ then we can compute $$\int_{a}^{b}f(x)dx = F(b) - F(a).$$ For example, when $f(x) = \sin(x),$ we may find $F(x) = -\cos(x)$ to compute $$\int_{0}^{\pi}\sin(x)dx = -\cos(\pi) - (-\cos(0)) = -(-1) - (-1) = 1 + 1 = 2.$$ However, what if we use $F(x) = -\cos(x) + 3000$ instead? We still have $$F'(x) = -(-\sin(x)) + 0 = \sin(x) = f(x),$$ so does 1st FTC work for this $F(x)$ as well? In fact, it does work. If we apply 1st FTC with this $F(x) = -\cos(x) + 3000,$ we have $$\begin{align*}\int_{0}^{\pi}\sin(x)dx &= -\cos(\pi) + 3000 - (-\cos(0) + 3000) \\ &= -(-1) + 3000 - (-1 + 3000) \\ &= 1 - 3000 + 1 + 3000 \\ &= 2.\end{align*}$$ Aha! That $3000$ cancelled out with another $3000.$ Notice that we could use $F(x) = -\cos(x) + c$ for any constant $c.$ In fact, this is the full list of the functions $F(x)$ such that $F'(x) = -\cos(x).$

Tip. When you find a single $F(x)$ with $F'(x) = f(x),$ then the full list of the functions whose derivative is $f(x)$ is given by $F(x) + c$ with all constants $c.$

Exercise (cf. p.322). What are the functions whose derivatives are $0$? (Hint: intuitively, these are functions with no variation. Such functions should be called constant.)

Takeaway. The derivative determines a function up to a change in constant (or geometrically, change in height or vertical shift).

We denote by $$\int \sin(x) dx$$ the list of all antiderivates of $\sin(x).$ We have seen that this list can be given as $$\int \sin(x) dx = -\cos(x) + c$$ where $c$ is any fixed constant. This list is called the indefinite integral of $\sin(x).$ Note that this is NOT a definite integral. That is, when we are given two other values $a$ and $b,$ then $$\int_{a}^{b}\sin(x)dx = -\cos(b) + \cos(a),$$ which is a real number.

Exercise. Compute $$\int x^{3000} dx.$$

Exercise. Compute $$\int_{-3000}^{3000} x^{321} dx.$$

Exercise (cf. p.323). There are two things wrong about the following formula where $n$ is any integer: $$\int x^{n} dx = \frac{x^{n+1}}{n+1}.$$ What are they?

Hard exercise. There is one thing wrong about the following formula: $$\int \frac{1}{x} dx = \ln(x) + c,$$ where $c$ is any fixed constant. What is it? (Hint: if you get stuck, read p.324. Make sure you understand the answer. Please consult me if it is too difficult.)

Exercise. Compute $$\int_{1}^{e}\frac{1}{x}dx.$$

Exercise. Compute $$\int_{-e}^{-1}\frac{1}{x}dx.$$

Very bad exercise. Compute $$\int \left(\int \cos(x) dx\right) dx.$$ (Note: this is NOT what people call a "double integral", which is dealt in Math 215. Please just take this as a joke and skip this problem. The correct answer is will be given by $\int \sin(x) + c dx,$ where $c$ can be any fixed constant.)

Exercise. Compute $$\int_{-1}^{1}2x + 3x^{2} + 4x^{3} + 5x^{4}dx.$$ (Hint: recall odd and even functions.)

Exercise. Compute $$\int 2x + 3x^{2} + 4x^{3} + 5x^{4}dx.$$

Exercise. Compute the derivative $$\frac{d}{dx} \tan(x).$$ Then read Example 4 on p.326.

Average value

Reference. I will refer to the textbook for this class using indicators such as relevant section numbers or page numbers. However, the contents here are NOT directly from the book, so I am not violating any copyright, to my best judgement.

Recall from Section 4.6 of your book that if you are given the position function $s(t)$ in time $t \geq 0$ of a moving object, the velocity function $v(t)$ is given by the derivative of the position function $$v(t) = s'(t).$$ Note that the velocity is different from the average velocity. If the moving object starts to move at time $t = a$ and stop at time $t = b,$ its average velocity on the time interval is $$\frac{s(b) - s(a)}{b - a}.$$ But look! By 1st FTC (p.293), we have
$$\frac{s(b) - s(a)}{b - a} = \frac{1}{b-a}\int_{a}^{b}s'(t)dt = \frac{1}{b-a}\int_{a}^{b}v(t)dt.$$ Why do we bother to observe this? Note that the first fraction is given by the values of the position function $s(t)$, NOT the velocity function $v(t).$ With the last expression, we now can immediately write a formula of the average velocity, using the velocity function!

More generally, the average value of the (piece-wise continuous) function $f(x)$ defined on the interval $[a, b]$ is defined as $$\frac{1}{b-a}\int_{a}^{b}f(x)dx.$$ Is this definition reasonable? When you are introduced a new word for a new notion, it is important for you to sit down and think about why people call the notion with such a word!

Exercise. Read p.308-309.

Odd functions and even functions

Reference. I will refer to the textbook for this class using indicators such as relevant section numbers or page numbers. However, the contents here are NOT directly from the book, so I am not violating any copyright, to my best judgement.

The answer to the last exercise of the previous posting is as follows: $$\int_{-1}^{1} x dx = \int_{-1}^{1}x^{3} dx = \int_{-1}^{1}x^{5} dx = \int_{-1}^{1}x^{7} dx = 0.$$ In general, you may note that $$\int_{-a}^{a}x^{n}dx = 0$$ for any odd positive integer $n$ regardless of what $a$ is. The function $f(x) = x^{n}$ satisfies $f(-x) = -f(x)$ when $n$ is odd. This means that the graph $y = f(x)$ is symmetric with respect to the origin $(0, 0).$ (Can you see why?) Such function (i.e., the one with $f(-x) = -f(x)$) is said to be odd.

Odd continuous function cancellation (p.306). If $f(x)$ is an odd continuous function defined on $[-a, a],$ then $$\int_{-a}^{a}f(x)dx = 0.$$ Why is this useful? Here is an exercise where you can use this:

Exercise. Compute $$\int_{-3000}^{3000}\sin(\sin(x))dx.$$ (Hint: show that $f(x) = \sin(\sin(x))$ is an odd function.)

Q. Can we use this cancellation trick to the integral $$\int_{-1}^{1}x^{2} dx?$$ No! Draw the picture of the graph $y = x^{2}$ and consider the region under the graph from $x = -1$ to $x = 1$. The entire region is above the $x$-axis, so we can see that the answer is positive. However, instead of cancellation, you may notice the "doubling" effect: $$\int_{-1}^{1}x^{2} dx = 2\int_{0}^{1}x^{2} dx.$$ Using 1st FTC, we can quickly compute $\int_{0}^{1}x^{2} dx = 1/3,$ so the answer to the above computation is $2 \cdot (1/3) = 2/3.$

In general, we can see that $$\int_{-a}^{a} x^{n} dx = 2 \int_{0}^{a} x^{n} dx,$$ for any even positive integer $n$ regardless of what $a$ we choose. The function $f(x) = x^{n}$ satisfies $f(-x) = f(x)$ when $n$ is even. This means that the the graph $y = f(x)$ is symmetric with respect to the $y$-axis. (Can you see why?) Such a function (i.e., the one with $f(-x) = f(x)$) is said to be even.

Exercise. Compute $$\int_{-3000}^{3000} e^{|x|} + \sin(2x)e^{\cos(x)} dx.$$ (Hint: first, note that $\sin(2x)e^{\cos(x)}$ is odd. Then note that $e^{|x|}$ is even and also that $|x| = x$ when $x \geq 0.$)


Saturday, August 31, 2019

1st Fundamental Theorem of Calculus

About the notes. These are lecture notes for my teaching: Math 116 Section 024 Fall 2019 at the University of Michigan. They are written up particularly for myself to keep track, so the students should not take this as a mandatory reading but just a reminder that where we are heading.

Reference. I will refer to the textbook for this class using indicators such as section numbers or page numbers.

(Section 5.2) What is a definite integral? A definite integral of a function $f(x)$ in $x$ is a signed area of the region between the graph $y = f(x)$ of the function and the $x$-axis. For example, the integral $$\int_{0}^{1}x dx$$ means the area given by the region surrounded by
  • the graph $y = x$ and
  • the $x$-axis (which also can be written as $y = 0$) with the bounds
  • $x=0$ and $x=1.$
Thus, the integral is given by the area of a triangle whose base is $b = 1$ and height is $h = 1.$ This lets us compute $$\int_{0}^{1}x dx = \frac{1}{2} \cdot bh = \frac{1}{2}.$$ However, note that $$\int_{-1}^{0}x dx = -\frac{1}{2},$$ because the triangle is underneath the $x$-axis. This is why I said that the definite integral is the signed area. Positive and negative areas can cancel each other out: $$\int_{-1}^{1}x dx = 0.$$

Exercise. Can you see why the following is true? Draw a picture (p.124, Figure 2.61) to understand: $$\int_{-1}^{1}|x| dx = 1.$$

Pedantry. For the functions $f(x),$ we will mostly consider continuous functions, or at the worst piece-wise continuous functions. Often, the function $f(x)$ will be assumed to be differentiatiable, but recall that this actually implies that $f(x)$ is continuous. (Section 2.6 Theorem 2.1.)

(Section 5.3) 1st Fundamental Theorem of Calculus. Sure, you know how to compute the area of a triangle, but what about non-triangular regions? For example, how can we compute $$\int_{0}^{1} x^{2} dx,$$ which is not given by a region bounded by straight lines? If you try to draw a picture, you can see that $$0 < \int_{0}^{1}x^{2} dx < \frac{1}{2},$$ but it is quite challenging to actually compute this. The following theorem helps in this situation.

Theorem (5.1, 1st FTC). For any continuous function $f(x)$ defined on an interval $[a, b]$ on the real line, if you find a differentiable function $F(x)$ such that $F'(x) = f(x),$ then $$\int_{a}^{b}f'(x)dx = F(b) - F(a).$$

Let's use this 1st FTC to compute the integral $$\int_{0}^{1} x^{2} dx.$$ First, our function $f(x) = x^{2}$ is continuous on $[0, 1]$ because it is given by a polynomial. We need to find $F(x)$ such that if we differentiate it, we get $f(x) = x^{2}$ back. If you think hard, one candidate is $$F(x) = \frac{{x}^{3}}{3}.$$ Let's check! We have $$F'(x) = 3 \cdot \frac{x^{2}}{3} = x^{2} = f(x).$$ Bingo, so we can use the 1st FTC to have $$\int_{0}^{1} x^{2} dx = \int_{0}^{1} f(x) dx = F(1) - F(0) = \frac{1}{3} - \frac{0}{3} = \frac{1}{3}.$$

Exercise. What goes wrong if we use $$F(x) = \frac{x^{3}}{3} + 3000$$ instead? (Hint: nothing goes wrong, but you really need to see this by repeating the process.)

Exercise. Compute $\int_{-1}^{-1}\sin(x)dx.$ (Hint: draw a good graph of $y = \sin(x).$ You will see some cancellation.)

Exercise. Compute $\int_{-1}^{-1}e^{x}dx.$

Exercise. Compute $\int_{-1}^{-1}3000^{x}dx.$ (Hint: for 1st FTC, you cannot use $F(x) = 3000^{x}$ because $F'(x) = 3000^{x} \ln(3000).$ Thus, you should modify this $F(x)$ by dividing it by $\ln(3000).$)

Read. Some properties about the integrals are summarized as 
  • Theorem 5.3 (p.304) and
  • Theorem 5.4 (p.307)
I think these are quite natural once you accept the definition of "signed area", so I won't refer to this when I teach. It is much better to practice using these properties when you solve problems rather than memorizing them.

Quote. "The best way to learn mathematics is to solve problems with it."

Area between two graphs (p.305). We can compute the area of a more complicated region. For instance, consider the region surrounded by
  • $y = x,$
  • $y = x^{2},$
  • from $x = 0$ to $x = 1.$
Since the graph $y = x$ is above the graph $y = x^{2}$ from $x = 0$ to $x = 1$ (i.e., on the interval $[0, 1]$), the area of the given region can be computed as follows: $$\int_{0}^{1} x dx - \int_{0}^{1} x^{2} dx = \int_{0}^{1} x - x^{2} dx = \left.\left(\frac{x^{2}}{2} - \frac{x^{3}}{3}\right)\right|_{0}^{1} = \frac{1}{2} - \frac{1}{3} = \frac{1}{6}.$$ Note the new notation I used to indicate that I am using the 1st FTC. If I take an exam, I would still write "FTC" nearby to let the grader know that I know what I am doing. (Not always, this sometimes counts as a point.)

Exercise. Suppose that we are doing that same problem but change the last condition defining the region to the following:
  • from $x = 0$ to $x = 2.$
1. Explain why the following integral is NOT going to compute the correct area: $$\int_{0}^{2} x - x^{2} dx.$$ 2. Write out an expression involving two integrals that wil compute the correct area.

3. Compute the integral.

Exercise. Compute the area of the region surrounded by
  • $y = |x|,$
  • $y = x^{2},$
  • from $x = 0$ to $x = 1.$
(Hint: draw a picture. See p.124, Figure 2.61.)

Exercise. Compute $$\int_{0}^{\pi}\sin(x)dx.$$ (Hint: 1st FTC with $f(x) = \sin(x)$ and $F(x) = -\cos(x).$ Can you tell why you need the minus sign?)

Exercise. Compute $$\int_{0}^{2\pi}\sin(x)dx.$$ (Hint: draw picture and cancel things out!)

Exercise. Compute $$\int_{0}^{\pi}\cos(x)dx.$$ (Hint: draw picture and cancel things out!)

Exercise. Compute $$\int_{0}^{\pi/2}\cos(x)dx.$$

Exercise. Compute $$\int_{0}^{\pi/2}\cos(2x)dx.$$ (Possible hint: draw picture and cancel things out! If the drawing is too difficult, then use 1st FTC with $f(x) = \cos(2x)$ and $F(x) = \sin(2x)/2.$ Can you see why you need to divide by $2$?)

Exercise. Compute the following integrals:
  • $\int_{-1}^{1}xdx,$
  • $\int_{-1}^{1}x^{3}dx,$
  • $\int_{-1}^{1}x^{5}dx,$
  • $\int_{-1}^{1}x^{7}dx.$
(Hint: draw picture and cancel things out!)