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.$)