06 Calculus: Integrals

image.png լուսանկարի հղումը, Հեղինակ՝ Սաղսարա

📚 Նյութը

YouTube links in this section were auto-extracted. If you spot a mistake, please let me know!

Դասախոսություն

Գործնական

🏡 Տնային

Note
  1. ❗❗❗ DON’T CHECK THE SOLUTIONS BEFORE TRYING TO DO THE HOMEWORK BY YOURSELF❗❗❗
  2. Please don’t hesitate to ask questions, never forget about the 🍊karalyok🍊 principle!
  3. The harder the problem is, the more 🧀cheeses🧀 it has.
  4. Problems with 🎁 are just extra bonuses. It would be good to try to solve them, but also it’s not the highest priority task.
  5. If the problem involve many boring calculations, feel free to skip them - important part is understanding the concepts.
  6. Submit your solutions here (even if it’s unfinished)

📖 Textbook reading (Section 6)

It appears you don't have a PDF plugin for this browser. No biggie... you can click here to download the PDF file.

If link above doesn’t work, just go to this link. PDF page - 91, book page - 85.

The five problems below are extracted from Section 6.6 of the Armenian course notes. They span the integration techniques covered in this chapter: power-rule antiderivatives, integration by parts, u-substitution, and trig substitution. (Խնդիր 6.5-ը հատկապես համով ա։)

Indefinite Integrals

01 Compute Antiderivatives (textbook 6.1)

Find \(\displaystyle \int f(x)\, dx\):

  1. \(f(x) = 3x^2\)
  2. \(f(x) = x + 6 \cos x\)
  3. \(f(x) = \dfrac{3}{x} - 1\)
  4. \(f(x) = \dfrac{4x}{1 - 2x^2}\)
  5. \(f(x) = \tan x\)

a. Power rule: \(\int 3 x^2 \, dx = x^3 + c\).

b. Linearity + table: \(\int (x + 6 \cos x) \, dx = \dfrac{x^2}{2} + 6 \sin x + c\).

c. Linearity + the \(\int \frac{1}{x} dx = \ln|x|\) rule: \(\int \big(\tfrac{3}{x} - 1\big) \, dx = 3 \ln|x| - x + c\).

d. u-substitution. Let \(u = 1 - 2 x^2\). Then \(du = -4 x \, dx\), so \(4 x \, dx = -du\): \[\int \frac{4 x}{1 - 2 x^2} \, dx \;=\; \int \frac{-du}{u} \;=\; -\ln|u| + c \;=\; -\ln|1 - 2 x^2| + c\]

e. u-substitution. Rewrite \(\tan x = \frac{\sin x}{\cos x}\) and let \(u = \cos x\), so \(du = -\sin x \, dx\): \[\int \tan x \, dx \;=\; \int \frac{\sin x}{\cos x} \, dx \;=\; \int \frac{-du}{u} \;=\; -\ln|\cos x| + c\]

The u-substitution pattern. Both (d) and (e) use the same trick: spot a chunk of the integrand that is the derivative of another chunk (up to a constant), name that chunk \(u\), and the integral collapses to \(\int \frac{du}{u}\). This is the integration counterpart of the chain rule: every chain-rule derivative you’ve ever computed implies a u-substitution integral.

Definite Integrals

02 Spaceship Distance (textbook 6.2)

A spaceship flies from Earth to the Moon. At time \(x\) hours after launch, its velocity is

\[v(x) = x^5 + x^2 \quad \text{(thousand km/h)}\]

  1. How far does it travel during the first \(3\) hours?
  2. What is its average velocity over those \(3\) hours?

a. Distance. Distance is the integral of velocity:

\[\begin{aligned} \int_0^3 (x^5 + x^2) \, dx &= \frac{x^6}{6} + \frac{x^3}{3} \;\Big|_0^3 \\ &= \frac{729}{6} + \frac{27}{3} \\ &= \frac{243}{2} + 9 \;=\; \frac{261}{2} \;=\; 130.5 \text{ thousand km} \end{aligned}\]

b. Average velocity. Distance divided by time: \[\bar v = \frac{130.5 \text{ thousand km}}{3 \text{ h}} = 43.5 \text{ thousand km/h}\]

Sanity check. At \(x = 3\) the velocity is \(3^5 + 3^2 = 252\) thousand km/h, and at \(x = 0\) it’s \(0\). The average (\(43.5\)) is much closer to \(0\) than to \(252\). That makes sense: \(v(x)\) grows like \(x^5\) and is small for most of the interval before exploding near \(x = 3\).

Pedagogical takeaway. The average value of a function \(f\) on \([a, b]\) is \(\frac{1}{b - a} \int_a^b f(x) \, dx\). For a velocity, this is the constant speed that would cover the same distance in the same time, i.e., the everyday meaning of “average speed.” Problem 03 below gives a purely geometric version of this same idea.

03 Equal Areas (textbook 6.3)

Below is the graph of \(f(x) = -x \ln(x^2)\) on \([0, 1]\):

Green region (under the curve) and blue rectangle (over [0,1]) have equal areas; find the rectangle’s height.

The green region (under the curve, above the \(x\)-axis) and the blue rectangle (over \([0, 1]\)) have the same area. What is the height of the blue rectangle?

The blue rectangle has width \(1\) and unknown height \(h\), so its area is just \(h\). Set this equal to the area under the curve:

\[h \;=\; \int_0^1 -x \ln(x^2) \, dx\]

Since \(\ln(x^2) = 2 \ln x\) for \(x > 0\): \[\int_0^1 -x \ln(x^2) \, dx \;=\; \int_0^1 -2 x \ln x \, dx\]

Integrate by parts. Choose \(u = \ln x\) (so \(u\) gets simpler when differentiated) and \(dv = -2 x \, dx\). Then \(du = \frac{1}{x} dx\) and \(v = -x^2\):

\[\begin{aligned} \int -2 x \ln x \, dx &= u v - \int v \, du \\ &= -x^2 \ln x - \int \!\!\big(-x^2\big) \cdot \tfrac{1}{x} \, dx \\ &= -x^2 \ln x + \int x \, dx \\ &= -x^2 \ln x + \frac{x^2}{2} + c \end{aligned}\]

Evaluate from \(0\) to \(1\).

  • At \(x = 1\): \(-1 \cdot \ln 1 + \frac{1}{2} = 0 + \frac{1}{2} = \frac{1}{2}\).
  • At \(x \to 0^+\): \(\frac{x^2}{2} \to 0\) trivially. For \(-x^2 \ln x\): \(\ln x \to -\infty\) but \(x^2 \to 0\) faster (polynomial beats logarithm), so the product \(\to 0\).

Therefore: \[h = \frac{1}{2} - 0 = \boxed{\frac{1}{2}}\]

The deeper point. The height of the “equal-area rectangle” is exactly the average value of \(f\) on \([0, 1]\): \[\bar f = \frac{1}{b - a} \int_a^b f(x) \, dx = \frac{1}{1 - 0} \cdot \frac{1}{2} = \frac{1}{2}\] This is the geometric content of the mean value theorem for integrals: a constant function set to the average value encloses the same area as the original function. Pictorially, you can think of the blue rectangle as the green region “flattened” while preserving its area.

04 Convolution (textbook 6.4)

There are several ways to combine two functions into a new one. One that plays a central role in machine learning is called convolution.

The convolution of two functions \(f\) and \(g\), denoted \(f * g\), is defined by:

\[(f * g)(x) \;=\; \int_{-1}^{1} f(y) \, g(x - y) \, dy\]

(Here \(x\) is fixed; the integration variable is \(y\).)

Compute \((f * g)(0)\) for \(f(x) = x^2\) and

\[g(x) \;=\; \begin{cases} 1 & \text{if } x > 0 \\ 0 & \text{if } x \le 0 \end{cases}\]

Hint: Plug in \(g\)’s formula, then split \([-1, 1]\) into the regions where \(g(x-y) = 0\) and where \(g(x-y) = 1\).

At \(x = 0\) the integrand becomes \(f(y) \cdot g(-y) = y^2 \cdot g(-y)\). We need to know where \(g(-y)\) equals \(1\) vs \(0\):

  • \(g(-y) = 1\) when \(-y > 0\), i.e., \(y < 0\)
  • \(g(-y) = 0\) when \(-y \le 0\), i.e., \(y \ge 0\)

So on \([-1, 1]\), the integrand is \(y^2\) for \(y \in [-1, 0]\) and \(0\) for \(y \in [0, 1]\). Split the integral:

\[\begin{aligned} (f * g)(0) &= \int_{-1}^{0} y^2 \cdot 1 \, dy + \int_{0}^{1} y^2 \cdot 0 \, dy \\ &= \int_{-1}^{0} y^2 \, dy + 0 \\ &= \frac{y^3}{3} \;\Big|_{-1}^{0} \;=\; 0 - \frac{(-1)^3}{3} \;=\; \frac{1}{3} \end{aligned}\]

So \((f * g)(0) = \dfrac{1}{3}\).

Why ML cares about convolution. This integral form generalizes the discrete convolution that defines a convolutional neural network (CNN) layer: \[(f * g)[n] \;=\; \sum_i f[i] \, g[n - i]\] Image processing operations like blurring, edge detection, and feature extraction are all convolutions with specific kernels \(g\). The continuous version above is the bridge between signal processing (continuous time / 1D) and machine learning (discrete pixels / 2D).

Geometric intuition. \(g(x - y)\) as a function of \(y\) is \(g\) flipped and shifted by \(x\). So convolution is “slide a flipped copy of \(g\) along \(f\), and at each position record the integrated overlap.” For our specific \(g\) (the unit step at \(0\)), \(g(-y)\) as a function of \(y\) is the unit step on \(y < 0\), so \((f * g)(0)\) just integrates \(f\) over the half-line that survives the masking.

05 Area of a Circle (textbook 6.5)

Note

The textbook author writes: “Խնդիր 6.5-ը հատկապես համով ա։” (“Problem 6.5 is especially delicious.”) See if you can taste it.

Derive the area formula of a circle of radius \(r\) from first principles. Start with the unit circle \(x^2 + y^2 = 1\).

  1. Express \(y\) in terms of \(x\); over what interval does \(x\) vary?
  2. Which function \(f(x)\)’s integral do you need?
  3. Use the substitution \(x = \sin t\). What interval does \(t\) vary over?
  4. What expression appears under the integral sign?
  5. Use the identity \(\cos^2 t = \dfrac{1 + \cos(2t)}{2}\) to evaluate it.
  6. What is the area of the unit circle?
  7. What linear transformation do you apply to get a circle of radius \(r\)?
  8. By what factor does the area scale?

a. From \(x^2 + y^2 = 1\): \(y = \pm \sqrt{1 - x^2}\), with \(x \in [-1, 1]\).

b. The area of the upper half-disk is \(\int_{-1}^{1} \sqrt{1 - x^2} \, dx\), so the full unit disk area is twice that. We need the integral of \(f(x) = \sqrt{1 - x^2}\).

c. With \(x = \sin t\): as \(x\) runs from \(-1\) to \(1\), \(t\) runs from \(-\dfrac{\pi}{2}\) to \(\dfrac{\pi}{2}\) (the principal branch of \(\arcsin\)). Also \(dx = \cos t \, dt\).

d. The integrand becomes: \[\sqrt{1 - \sin^2 t} \cdot \cos t \, dt \;=\; \sqrt{\cos^2 t} \cdot \cos t \, dt \;=\; \cos t \cdot \cos t \, dt \;=\; \cos^2 t \, dt\] (The simplification \(\sqrt{\cos^2 t} = \cos t\) uses \(\cos t \ge 0\) on \([-\pi/2, \pi/2]\).)

e. Use the half-angle identity and integrate: \[\begin{aligned} \int_{-\pi/2}^{\pi/2} \cos^2 t \, dt &= \int_{-\pi/2}^{\pi/2} \frac{1 + \cos(2t)}{2} \, dt \\ &= \frac{t}{2} + \frac{\sin(2t)}{4} \;\Big|_{-\pi/2}^{\pi/2} \\ &= \Big(\tfrac{\pi}{4} + 0\Big) - \Big(\!-\tfrac{\pi}{4} + 0\Big) \;=\; \frac{\pi}{2} \end{aligned}\]

f. Upper half-disk area \(= \dfrac{\pi}{2}\), so unit disk area \(= \pi\).

g. To get a circle of radius \(r\), apply the scaling \((x, y) \mapsto (r x, r y)\), a linear map with matrix \(\begin{pmatrix} r & 0 \\ 0 & r \end{pmatrix} = r I\).

h. A linear map scales areas by \(|\det|\). Here \(\det(r I) = r^2\), so the area of the radius-\(r\) disk is: \[\pi \cdot r^2 \;=\; \boxed{\pi r^2}\]

Why this is the “delicious” problem. In one neat derivation you’ve used:

  1. Geometry: parametrize \(y\) as a function of \(x\)
  2. Definite integrals: set up the area integral
  3. Trig substitution: \(x = \sin t\) transforms a square-root into something integrable
  4. Trig identity: the half-angle formula linearizes \(\cos^2 t\)
  5. Linear algebra: the determinant of the scaling matrix tells us how area changes

The formula \(A = \pi r^2\) (which most students memorize at age 10) turns out to package all five threads. This is the kind of problem the course is built around: familiar fact, derived from scratch, weaving multiple subjects together.

🛠️ Գործնական

🎲 42 (06)

Flag Counter