<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">

 <title>Calculus Self-Learning</title>
 <link href="https://calculus-self-learning.pages.dev/atom.xml" rel="self"/>
 <link href="https://calculus-self-learning.pages.dev/"/>
 <updated>2026-12-05T04:05:49+00:00</updated>
 <id>https://calculus-self-learning.pages.dev</id>
 <author>
   <name>Nguyễn Lê Linh</name>
   <email></email>
 </author>

 
 <entry>
   <title>Tổng kết: một công thức cho mọi định lý</title>
   <link href="https://calculus-self-learning.pages.dev/contents/vi/chapter15/15_06_Tong_ket_mot_cong_thuc_cho_moi_dinh_ly/"/>
   <updated>2026-12-01T00:00:00+00:00</updated>
   <id>https://calculus-self-learning.pages.dev/contents/vi/chapter15/15_06_Tong_ket_mot_cong_thuc_cho_moi_dinh_ly</id>
   <content type="html">&lt;div class=&quot;textbook-objectives&quot;&gt;

  &lt;p&gt;&lt;strong&gt;Mục tiêu bài học.&lt;/strong&gt; Sau bài này bạn có thể:&lt;/p&gt;

  &lt;ul&gt;
    &lt;li&gt;xếp năm định lý lớn của giải tích vào cùng một khuôn “tích phân của đạo hàm trên miền bằng tích phân trên biên”;&lt;/li&gt;
    &lt;li&gt;đọc dạng chung $\int_{\partial\Omega}\omega=\int_\Omega d\omega$ ở mức giới thiệu;&lt;/li&gt;
    &lt;li&gt;liên hệ $\operatorname{curl}\nabla=0$, $\operatorname{div}\operatorname{curl}=0$ với $d^2=0$;&lt;/li&gt;
    &lt;li&gt;viết bốn phương trình Maxwell ở dạng tích phân và dạng vi phân.&lt;/li&gt;
  &lt;/ul&gt;

&lt;/div&gt;

&lt;h2 id=&quot;vì-sao-cần-bài-này&quot;&gt;Vì sao cần bài này&lt;/h2&gt;

&lt;p&gt;Từ chương 4 tới đây ta đã gặp năm định lý trông rất khác nhau. Thật ra chúng là một: mỗi định lý nói rằng cộng “đạo hàm” bên trong một miền thì bằng cộng hàm trên biên của miền, vì các đóng góp bên trong triệt tiêu nhau. Nhìn thấy điều này giúp nhớ, giúp kiểm tra dấu, và mở đường sang hình học vi phân.&lt;/p&gt;

&lt;h2 id=&quot;bảng-tổng-kết&quot;&gt;Bảng tổng kết&lt;/h2&gt;

&lt;table&gt;
  &lt;thead&gt;
    &lt;tr&gt;
      &lt;th&gt;Định lý&lt;/th&gt;
      &lt;th&gt;Miền $\Omega$&lt;/th&gt;
      &lt;th&gt;Biên $\partial\Omega$&lt;/th&gt;
      &lt;th&gt;Công thức&lt;/th&gt;
    &lt;/tr&gt;
  &lt;/thead&gt;
  &lt;tbody&gt;
    &lt;tr&gt;
      &lt;td&gt;Newton–Leibniz (bài 04_03)&lt;/td&gt;
      &lt;td&gt;đoạn $[a,b]$&lt;/td&gt;
      &lt;td&gt;hai điểm $a$, $b$&lt;/td&gt;
      &lt;td&gt;$\int_a^bf&apos;\,dx=f(b)-f(a)$&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Tích phân đường của gradient (bài 14_04)&lt;/td&gt;
      &lt;td&gt;đường cong $C$&lt;/td&gt;
      &lt;td&gt;hai đầu $A$, $B$&lt;/td&gt;
      &lt;td&gt;$\int_C\nabla f\cdot dr=f(B)-f(A)$&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Green (bài 14_05)&lt;/td&gt;
      &lt;td&gt;miền phẳng $D$&lt;/td&gt;
      &lt;td&gt;đường cong kín&lt;/td&gt;
      &lt;td&gt;$\oint P\,dx+Q\,dy=\iint(Q_x-P_y)\,dA$&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Stokes (bài 15_04)&lt;/td&gt;
      &lt;td&gt;mặt $S$&lt;/td&gt;
      &lt;td&gt;đường cong kín&lt;/td&gt;
      &lt;td&gt;$\oint F\cdot dr=\iint\operatorname{curl}F\cdot n\,dS$&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Gauss (bài 15_05)&lt;/td&gt;
      &lt;td&gt;khối $E$&lt;/td&gt;
      &lt;td&gt;mặt kín&lt;/td&gt;
      &lt;td&gt;$\iint F\cdot n\,dS=\iiint\operatorname{div}F\,dV$&lt;/td&gt;
    &lt;/tr&gt;
  &lt;/tbody&gt;
&lt;/table&gt;

&lt;p&gt;Trong mỗi dòng: bên trái là tích phân trên biên (có hướng), bên phải là tích phân của một “đạo hàm” ($f&apos;$, $\nabla$, curl, div) trên miền. Chứng minh của mọi định lý đều cùng một ý: chia miền thành ô nhỏ, áp dụng định lý cơ bản của giải tích trên mỗi ô, các mặt chung triệt tiêu.&lt;/p&gt;

&lt;h2 id=&quot;dạng-vi-phân-và-công-thức-chung&quot;&gt;Dạng vi phân và công thức chung&lt;/h2&gt;

&lt;p&gt;Không đi vào chi tiết kỹ thuật, ta có thể mô tả ngôn ngữ thống nhất như sau.&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;strong&gt;Dạng 0&lt;/strong&gt; là hàm $f$. &lt;strong&gt;Dạng 1&lt;/strong&gt; là biểu thức $P\,dx+Q\,dy+R\,dz$, thứ ta tích phân trên đường cong. &lt;strong&gt;Dạng 2&lt;/strong&gt; là $A\,dy\wedge dz+B\,dz\wedge dx+C\,dx\wedge dy$, thứ ta tích phân trên mặt (tương ứng với thông lượng của $(A,B,C)$). &lt;strong&gt;Dạng 3&lt;/strong&gt; là $g\,dx\wedge dy\wedge dz$, thứ ta tích phân trên khối.&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Đạo hàm ngoài&lt;/strong&gt; $d$ biến dạng $k$ thành dạng $k+1$: $df=f_xdx+f_ydy+f_zdz$ (gradient); $d$ của một dạng 1 cho dạng 2 ứng với curl; $d$ của một dạng 2 cho dạng 3 ứng với div. Quy tắc tính: $dx\wedge dx=0$ và $dy\wedge dx=-dx\wedge dy$.&lt;/li&gt;
&lt;/ul&gt;

&lt;div class=&quot;textbook-theorem&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Định lý 1 (Stokes tổng quát, phát biểu không chứng minh).&lt;/strong&gt; Với $\Omega$ là “đa tạp” có hướng, bị chặn, chiều $k$, với biên $\partial\Omega$ định hướng tương thích, và $\omega$ là dạng $k-1$ trơn:&lt;/p&gt;

\[\int_{\partial\Omega}\omega=\int_\Omega d\omega.\]

&lt;/div&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Ví dụ 1 (Green là trường hợp $k=2$).&lt;/strong&gt; $\omega=P\,dx+Q\,dy$. Khi đó $d\omega=dP\wedge dx+dQ\wedge dy=(P_y\,dy)\wedge dx+(Q_x\,dx)\wedge dy=(Q_x-P_y)\,dx\wedge dy$ (các số hạng $dx\wedge dx$, $dy\wedge dy$ bằng 0). Công thức chung cho đúng định lý Green.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Ví dụ 2 ($d^2=0$).&lt;/strong&gt; Với hàm $f$ hai biến: $d(df)=d(f_x\,dx+f_y\,dy)=(f_{xy}-f_{yx})\,dx\wedge dy=0$ theo Schwarz. Trong ba chiều, $d^2=0$ chính là hai đồng nhất thức $\operatorname{curl}\nabla f=0$ và $\operatorname{div}\operatorname{curl}F=0$ của bài 14_01. Đối ngẫu hình học: &lt;strong&gt;biên của biên là rỗng&lt;/strong&gt; ($\partial\partial\Omega=\varnothing$), ví dụ biên của quả cầu là mặt cầu, và mặt cầu không có biên. Kết hợp với định lý 1: $\int_\Omega d(d\omega)=\int_{\partial\Omega}d\omega=\int_{\partial\partial\Omega}\omega=0$.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Ví dụ 3 (Một phép tính, hai cách).&lt;/strong&gt; Thông lượng của $\operatorname{curl}F$ ra khỏi mặt cầu: theo Gauss bằng $\iiint\operatorname{div}\operatorname{curl}F=0$; theo Stokes, mặt cầu không có biên nên bằng 0. Hai cách là hai mặt của $d^2=0$ và $\partial^2=\varnothing$.&lt;/p&gt;
&lt;/div&gt;

&lt;h2 id=&quot;ứng-dụng-bốn-phương-trình-maxwell&quot;&gt;Ứng dụng: bốn phương trình Maxwell&lt;/h2&gt;

&lt;table&gt;
  &lt;thead&gt;
    &lt;tr&gt;
      &lt;th&gt;Định luật&lt;/th&gt;
      &lt;th&gt;Dạng tích phân&lt;/th&gt;
      &lt;th&gt;Dạng vi phân (qua Gauss hoặc Stokes)&lt;/th&gt;
    &lt;/tr&gt;
  &lt;/thead&gt;
  &lt;tbody&gt;
    &lt;tr&gt;
      &lt;td&gt;Gauss cho điện&lt;/td&gt;
      &lt;td&gt;$\iint_SE\cdot n\,dS=Q/\varepsilon_0$&lt;/td&gt;
      &lt;td&gt;$\operatorname{div}E=\rho/\varepsilon_0$&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Không có đơn cực từ&lt;/td&gt;
      &lt;td&gt;$\iint_SB\cdot n\,dS=0$&lt;/td&gt;
      &lt;td&gt;$\operatorname{div}B=0$&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Faraday&lt;/td&gt;
      &lt;td&gt;$\oint_CE\cdot dr=-\tfrac{d}{dt}\iint_SB\cdot n\,dS$&lt;/td&gt;
      &lt;td&gt;$\operatorname{curl}E=-\partial_tB$&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Ampère–Maxwell&lt;/td&gt;
      &lt;td&gt;$\oint_CB\cdot dr=\mu_0I+\mu_0\varepsilon_0\tfrac{d}{dt}\iint_SE\cdot n\,dS$&lt;/td&gt;
      &lt;td&gt;$\operatorname{curl}B=\mu_0J+\mu_0\varepsilon_0\partial_tE$&lt;/td&gt;
    &lt;/tr&gt;
  &lt;/tbody&gt;
&lt;/table&gt;

&lt;p&gt;Từ dạng vi phân, lấy curl của phương trình Faraday và dùng $\operatorname{curl}\operatorname{curl}=\nabla\operatorname{div}-\Delta$ (bài 14_01, bài tập 5) trong chân không, ta được phương trình sóng $\partial_t^2E=\tfrac1{\mu_0\varepsilon_0}\Delta E$ với tốc độ $1/\sqrt{\mu_0\varepsilon_0}\approx3\times10^8$ m/s: ánh sáng là sóng điện từ.&lt;/p&gt;

&lt;h2 id=&quot;bài-tập&quot;&gt;Bài tập&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Cơ bản.&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;Mỗi tích phân sau nên dùng định lý nào? (a) $\oint_C$ trên đường tròn trong mặt phẳng; (b) thông lượng ra khỏi mặt khối lập phương; (c) lưu thông dọc mép một chiếc ô.&lt;/li&gt;
  &lt;li&gt;Tính $d\omega$ với $\omega=x\,dy-y\,dx$, và suy ra công thức diện tích của bài 14_05.&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Đáp án&lt;/summary&gt;

  &lt;ol&gt;
    &lt;li&gt;(a) Green; (b) Gauss; (c) Stokes (mép ô là biên của mặt ô).&lt;/li&gt;
    &lt;li&gt;$d\omega=dx\wedge dy-dy\wedge dx=2\,dx\wedge dy$, nên $\oint\omega=2\cdot$ diện tích.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;p&gt;&lt;strong&gt;Trung bình.&lt;/strong&gt;&lt;/p&gt;

&lt;ol start=&quot;3&quot;&gt;
  &lt;li&gt;Với $\omega=P\,dx+Q\,dy+R\,dz$, tính $d\omega$ và nhận ra các hệ số là ba thành phần của $\operatorname{curl}F$.&lt;/li&gt;
  &lt;li&gt;Dùng Ampère tính từ trường bên trong một dây dẫn hình trụ bán kính $a$ mang dòng $I$ phân bố đều, ở khoảng cách $r&amp;lt;a$ tới trục.&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Đáp án&lt;/summary&gt;

  &lt;ol start=&quot;3&quot;&gt;
    &lt;li&gt;$d\omega=(R_y-Q_z)\,dy\wedge dz+(P_z-R_x)\,dz\wedge dx+(Q_x-P_y)\,dx\wedge dy$.&lt;/li&gt;
    &lt;li&gt;Dòng qua đĩa bán kính $r$ là $I\,r^2/a^2$, nên $B\cdot2\pi r=\mu_0Ir^2/a^2$, $B=\dfrac{\mu_0Ir}{2\pi a^2}$.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;p&gt;&lt;strong&gt;Nâng cao.&lt;/strong&gt;&lt;/p&gt;

&lt;ol start=&quot;5&quot;&gt;
  &lt;li&gt;Kiểm tra $\partial\partial=\varnothing$ cho tam giác có hướng $[A,B,C]$: biên là $[B,C]-[A,C]+[A,B]$; tính biên của biên với $\partial[P,Q]=Q-P$.&lt;/li&gt;
  &lt;li&gt;Lấy div của phương trình Ampère–Maxwell và dùng định luật Gauss để suy ra $\partial_t\rho+\operatorname{div}J=0$. Ý nghĩa vật lý?&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Gợi ý&lt;/summary&gt;

  &lt;ol start=&quot;5&quot;&gt;
    &lt;li&gt;$(C-B)-(C-A)+(B-A)=0$.&lt;/li&gt;
    &lt;li&gt;$\operatorname{div}\operatorname{curl}B=0$ cho $0=\mu_0\operatorname{div}J+\mu_0\varepsilon_0\partial_t\operatorname{div}E=\mu_0(\operatorname{div}J+\partial_t\rho)$: bảo toàn điện tích, cùng dạng phương trình liên tục ở bài 15_05. Số hạng của Maxwell là cần thiết để điều này đúng.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;h2 id=&quot;tóm-tắt&quot;&gt;Tóm tắt&lt;/h2&gt;

&lt;div class=&quot;content-box summary-box textbook-block&quot;&gt;
  &lt;ul&gt;
    &lt;li&gt;Năm định lý (Newton–Leibniz, gradient, Green, Stokes, Gauss) đều có dạng: tích phân đạo hàm trên miền bằng tích phân trên biên.&lt;/li&gt;
    &lt;li&gt;Ngôn ngữ chung: $\int_{\partial\Omega}\omega=\int_\Omega d\omega$.&lt;/li&gt;
    &lt;li&gt;$d^2=0$ ứng với $\operatorname{curl}\nabla=0$, $\operatorname{div}\operatorname{curl}=0$; biên của biên là rỗng.&lt;/li&gt;
    &lt;li&gt;Phương trình Maxwell chuyển qua lại giữa dạng tích phân và dạng vi phân nhờ Gauss và Stokes.&lt;/li&gt;
  &lt;/ul&gt;
&lt;/div&gt;
</content>
 </entry>
 
 <entry>
   <title>Định lý Gauss (divergence)</title>
   <link href="https://calculus-self-learning.pages.dev/contents/vi/chapter15/15_05_Dinh_ly_Gauss/"/>
   <updated>2026-12-01T00:00:00+00:00</updated>
   <id>https://calculus-self-learning.pages.dev/contents/vi/chapter15/15_05_Dinh_ly_Gauss</id>
   <content type="html">&lt;div class=&quot;textbook-objectives&quot;&gt;

  &lt;p&gt;&lt;strong&gt;Mục tiêu bài học.&lt;/strong&gt; Sau bài này bạn có thể:&lt;/p&gt;

  &lt;ul&gt;
    &lt;li&gt;phát biểu và chứng minh định lý Gauss cho khối đơn giản;&lt;/li&gt;
    &lt;li&gt;tính thông lượng qua mặt kín bằng tích phân ba, và ngược lại;&lt;/li&gt;
    &lt;li&gt;chứng minh định luật Gauss cho điện tích điểm với mặt kín bất kỳ;&lt;/li&gt;
    &lt;li&gt;dẫn phương trình liên tục và phương trình nhiệt.&lt;/li&gt;
  &lt;/ul&gt;

&lt;/div&gt;

&lt;h2 id=&quot;vì-sao-cần-bài-này&quot;&gt;Vì sao cần bài này&lt;/h2&gt;

&lt;p&gt;Bài 14_01 nói div là thông lượng ra trên một đơn vị thể tích của một hộp nhỏ. Cộng mọi hộp nhỏ trong một khối: thông lượng qua các mặt chung triệt tiêu, chỉ còn thông lượng qua mặt ngoài. Đó là định lý Gauss, công cụ chính để dẫn các phương trình của vật lý từ định luật bảo toàn.&lt;/p&gt;

&lt;h2 id=&quot;định-lý&quot;&gt;Định lý&lt;/h2&gt;

&lt;div class=&quot;textbook-theorem&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Định lý 1 (Gauss).&lt;/strong&gt; Cho $E$ là khối bị chặn với biên $S$ trơn từng mảnh, định hướng bằng pháp tuyến ngoài, và $F$ có đạo hàm riêng liên tục trên một miền mở chứa $E$. Khi đó&lt;/p&gt;

\[\iint_SF\cdot n\,dS=\iiint_E\operatorname{div}F\,dV.\]

&lt;/div&gt;

&lt;div class=&quot;textbook-proof&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Chứng minh (khối “đơn giản” theo cả ba trục).&lt;/strong&gt; Do tuyến tính, chứng minh riêng cho $F=(0,0,R)$: $\iint_SRn_z\,dS=\iiint_ER_z\,dV$; hai thành phần kia tương tự.&lt;/p&gt;

  &lt;p&gt;Viết $E=\lbrace(x,y)\in D,\ u_1(x,y)\le z\le u_2(x,y)\rbrace$. Theo định lý 1 bài 13_04 và định lý cơ bản của giải tích,&lt;/p&gt;

\[\iiint_ER_z\,dV=\iint_D\big[R(x,y,u_2)-R(x,y,u_1)\big]\,dA.\]

  &lt;p&gt;Biên gồm mặt trên $z=u_2$, với $n\,dS=(-u_{2x},-u_{2y},1)\,dA$ (hướng lên là hướng ra ngoài), cho $\iint_DR(x,y,u_2)\,dA$; mặt dưới $z=u_1$ với pháp tuyến ngoài hướng xuống, $n\,dS=(u_{1x},u_{1y},-1)\,dA$, cho $-\iint_DR(x,y,u_1)\,dA$; mặt bên (nếu có) thẳng đứng nên $n_z=0$. Cộng lại được điều phải chứng minh.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;reel-video&quot;&gt;
  &lt;video controls=&quot;&quot; playsinline=&quot;&quot; preload=&quot;metadata&quot; src=&quot;/public/videos/reels/gauss-source-flux.mp4&quot;&gt;&lt;/video&gt;
  &lt;p class=&quot;reel-caption&quot;&gt;Định lý Gauss bằng nguồn điểm: thông lượng ra khỏi mặt kín bằng tổng nguồn bên trong, không phụ thuộc bán kính hay hình dạng mặt; nguồn ngoài cho 0, giếng và lưỡng cực, trọng trường g(r) của hành tinh, F = (x, y, z) với div = 3, và phương trình liên tục (video không lời, khoảng 3 phút 8 giây).&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Ví dụ 1.&lt;/strong&gt; $F=(x,y,z)$ ra khỏi quả cầu bán kính $R$: $\operatorname{div}F=3$, nên thông lượng là $3\cdot\tfrac43\pi R^3=4\pi R^3$, khớp ví dụ 1 bài 15_03.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Ví dụ 2 (Mặt khó, khối dễ).&lt;/strong&gt; $F=\big(xy,\ y^2+e^{xz^2},\ \sin(xy)\big)$ ra khỏi khối $E$ giới hạn bởi trụ parabol $z=1-x^2$ và các mặt phẳng $z=0$, $y=0$, $y+z=2$. Tính trên bốn mặt rất khó, nhưng $\operatorname{div}F=y+2y=3y$:&lt;/p&gt;

\[\int_{-1}^1\int_0^{1-x^2}\int_0^{2-z}3y\,dy\,dz\,dx=\frac{184}{35}\approx5.257.\]

&lt;/div&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Ví dụ 3 (Định luật Gauss).&lt;/strong&gt; $E=\dfrac{q}{4\pi\varepsilon_0}\dfrac{r}{\lVert r\rVert^3}$ có div bằng 0 ngoài gốc (bài 14_01). Cho $S$ là mặt kín bất kỳ bao gốc, và $S_\varepsilon$ mặt cầu nhỏ quanh gốc nằm trong $S$. Áp dụng Gauss trên khối giữa hai mặt (biên gồm $S$ hướng ra và $S_\varepsilon$ hướng vào tâm): thông lượng qua $S$ trừ thông lượng ra khỏi $S_\varepsilon$ bằng 0. Vậy thông lượng qua $S$ là $q/\varepsilon_0$ (bài 15_03), với mọi hình dạng của $S$. Nếu $S$ không bao gốc, thông lượng bằng 0.&lt;/p&gt;
&lt;/div&gt;

&lt;h2 id=&quot;ứng-dụng-phương-trình-liên-tục-và-phương-trình-nhiệt&quot;&gt;Ứng dụng: phương trình liên tục và phương trình nhiệt&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Phương trình liên tục.&lt;/strong&gt; Chất lỏng mật độ $\rho(x,t)$, vận tốc $v$. Khối lượng trong một miền cố định $E$ chỉ thay đổi do chất lỏng chảy qua biên:&lt;/p&gt;

\[\frac{d}{dt}\iiint_E\rho\,dV=-\iint_S\rho v\cdot n\,dS=-\iiint_E\operatorname{div}(\rho v)\,dV.\]

&lt;p&gt;Đưa đạo hàm vào trong: $\iiint_E\big(\rho_t+\operatorname{div}(\rho v)\big)dV=0$ cho &lt;strong&gt;mọi&lt;/strong&gt; $E$. Một hàm liên tục có tích phân bằng 0 trên mọi quả cầu nhỏ thì bằng 0 (lấy trung bình trên quả cầu co về một điểm), nên $\rho_t+\operatorname{div}(\rho v)=0$.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Phương trình nhiệt.&lt;/strong&gt; Năng lượng nhiệt $c\rho T$, dòng nhiệt $q=-k\nabla T$ (Fourier). Lập luận y hệt cho $c\rho\,T_t=\operatorname{div}(k\nabla T)$, tức $T_t=\alpha\,\Delta T$ với $\alpha=k/(c\rho)$, phương trình ở bài 10_05.&lt;/p&gt;

&lt;h2 id=&quot;bài-tập&quot;&gt;Bài tập&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Cơ bản.&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;Thông lượng của $F=(x^3,y^3,z^3)$ ra khỏi mặt cầu đơn vị.&lt;/li&gt;
  &lt;li&gt;Thông lượng của $F=(x,y,z)$ ra khỏi mặt khối lập phương $[0,1]^3$.&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Đáp án&lt;/summary&gt;

  &lt;ol&gt;
    &lt;li&gt;$\operatorname{div}F=3\rho^2$: $\int_0^13\rho^2\cdot\rho^2\,d\rho\cdot4\pi=\tfrac{12\pi}5$.&lt;/li&gt;
    &lt;li&gt;$\operatorname{div}F=3$, thể tích 1: bằng $3$.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;p&gt;&lt;strong&gt;Trung bình.&lt;/strong&gt;&lt;/p&gt;

&lt;ol start=&quot;3&quot;&gt;
  &lt;li&gt;Thông lượng của $F=(z,y,x)$ ra khỏi mặt cầu đơn vị.&lt;/li&gt;
  &lt;li&gt;Chứng minh thể tích $V(E)=\tfrac13\iint_Sr\cdot n\,dS$ và kiểm tra với quả cầu.&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Đáp án&lt;/summary&gt;

  &lt;ol start=&quot;3&quot;&gt;
    &lt;li&gt;$\operatorname{div}F=1$: $\tfrac{4\pi}3$.&lt;/li&gt;
    &lt;li&gt;$\operatorname{div}r=3$. Với quả cầu: $r\cdot n=R$, nên $\tfrac13R\cdot4\pi R^2=\tfrac43\pi R^3$.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;p&gt;&lt;strong&gt;Nâng cao.&lt;/strong&gt;&lt;/p&gt;

&lt;ol start=&quot;5&quot;&gt;
  &lt;li&gt;(Đồng nhất thức Green.) Chứng minh $\iiint_E\big(u\,\Delta v+\nabla u\cdot\nabla v\big)dV=\iint_Su\,\nabla v\cdot n\,dS$.&lt;/li&gt;
  &lt;li&gt;Dùng bài 5 chứng minh: nếu $\Delta w=0$ trong $E$ và $w=0$ trên $S$ thì $w=0$ trong $E$. Suy ra bài toán Dirichlet $\Delta u=f$ trong $E$, $u=g$ trên $S$ có nhiều nhất một nghiệm.&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Gợi ý&lt;/summary&gt;

  &lt;ol start=&quot;5&quot;&gt;
    &lt;li&gt;Áp dụng Gauss cho $F=u\nabla v$, dùng $\operatorname{div}(u\nabla v)=u\Delta v+\nabla u\cdot\nabla v$ (bài 14_01, bài tập 3).&lt;/li&gt;
    &lt;li&gt;Với $u=v=w$: $\iiint\lVert\nabla w\rVert^2=0$, nên $\nabla w=0$, $w$ hằng, mà $w=0$ trên biên. Hiệu hai nghiệm thoả bài toán thuần nhất.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;h2 id=&quot;tóm-tắt&quot;&gt;Tóm tắt&lt;/h2&gt;

&lt;div class=&quot;content-box summary-box textbook-block&quot;&gt;
  &lt;ul&gt;
    &lt;li&gt;Gauss: $\iint_SF\cdot n\,dS=\iiint_E\operatorname{div}F\,dV$, pháp tuyến ngoài.&lt;/li&gt;
    &lt;li&gt;Chứng minh: định lý cơ bản của giải tích theo từng trục, mặt bên không đóng góp.&lt;/li&gt;
    &lt;li&gt;Định luật Gauss: thông lượng điện trường qua mọi mặt kín bao điện tích là $q/\varepsilon_0$.&lt;/li&gt;
    &lt;li&gt;Bảo toàn kết hợp Gauss cho phương trình liên tục và phương trình nhiệt.&lt;/li&gt;
  &lt;/ul&gt;
&lt;/div&gt;
</content>
 </entry>
 
 <entry>
   <title>Định lý Stokes</title>
   <link href="https://calculus-self-learning.pages.dev/contents/vi/chapter15/15_04_Dinh_ly_Stokes/"/>
   <updated>2026-12-01T00:00:00+00:00</updated>
   <id>https://calculus-self-learning.pages.dev/contents/vi/chapter15/15_04_Dinh_ly_Stokes</id>
   <content type="html">&lt;div class=&quot;textbook-objectives&quot;&gt;

  &lt;p&gt;&lt;strong&gt;Mục tiêu bài học.&lt;/strong&gt; Sau bài này bạn có thể:&lt;/p&gt;

  &lt;ul&gt;
    &lt;li&gt;phát biểu định lý Stokes với quy tắc bàn tay phải cho hướng;&lt;/li&gt;
    &lt;li&gt;chứng minh định lý cho mặt là đồ thị, đưa về định lý Green;&lt;/li&gt;
    &lt;li&gt;dùng định lý theo cả hai chiều: tính tích phân đường bằng tích phân mặt và ngược lại;&lt;/li&gt;
    &lt;li&gt;giải thích vì sao thông lượng của curl chỉ phụ thuộc biên.&lt;/li&gt;
  &lt;/ul&gt;

&lt;/div&gt;

&lt;h2 id=&quot;vì-sao-cần-bài-này&quot;&gt;Vì sao cần bài này&lt;/h2&gt;

&lt;p&gt;Định lý Green (bài 14_05) nói lưu thông quanh biên một miền phẳng bằng tổng curl bên trong. Stokes là cùng ý tưởng cho mặt cong trong không gian: một tấm màng xà phòng căng trên vòng dây, mọi xoáy nhỏ trên màng triệt tiêu nhau, chỉ còn lưu thông dọc vòng dây.&lt;/p&gt;

&lt;h2 id=&quot;định-lý&quot;&gt;Định lý&lt;/h2&gt;

&lt;p&gt;Mặt có hướng $S$ với biên $C$ được &lt;strong&gt;định hướng tương thích&lt;/strong&gt; nếu khi đi dọc $C$ với đầu theo hướng $n$, mặt $S$ nằm bên trái (quy tắc bàn tay phải: bốn ngón theo $C$, ngón cái theo $n$).&lt;/p&gt;

&lt;div class=&quot;textbook-theorem&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Định lý 1 (Stokes).&lt;/strong&gt; Cho $S$ là mặt có hướng, trơn từng mảnh, với biên $C$ là đường cong kín trơn từng khúc định hướng tương thích, và $F$ có đạo hàm riêng liên tục trên một miền mở chứa $S$. Khi đó&lt;/p&gt;

\[\oint_CF\cdot dr=\iint_S(\operatorname{curl}F)\cdot n\,dS.\]

&lt;/div&gt;

&lt;div class=&quot;textbook-proof&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Chứng minh (mặt là đồ thị $z=g(x,y)$ trên miền $D$ thoả định lý Green, hướng lên).&lt;/strong&gt; Do tuyến tính, chỉ cần xét $F=(P,0,0)$; hai thành phần kia tương tự.&lt;/p&gt;

  &lt;p&gt;&lt;em&gt;Vế phải.&lt;/em&gt; $\operatorname{curl}(P,0,0)=(0,P_z,-P_y)$, và $n\,dS=(-g_x,-g_y,1)\,dA$, nên vế phải là $\iint_D\big(-P_zg_y-P_y\big)\,dA$, với $P$ lấy tại $(x,y,g(x,y))$.&lt;/p&gt;

  &lt;p&gt;&lt;em&gt;Vế trái.&lt;/em&gt; Nếu $(x(t),y(t))$ chạy trên biên $\partial D$ theo chiều dương thì $C$ là $(x(t),y(t),g(x(t),y(t)))$, và $\oint_CP\,dx=\oint_{\partial D}p(x,y)\,dx$ với $p(x,y)=P(x,y,g(x,y))$. Theo Green, bằng $-\iint_Dp_y\,dA$. Quy tắc chuỗi: $p_y=P_y+P_zg_y$. Vậy vế trái là $\iint_D(-P_y-P_zg_y)\,dA$, bằng vế phải.&lt;/p&gt;

  &lt;p&gt;Mặt tổng quát được ghép từ các mảnh như vậy; tích phân dọc các đường ghép bị đi hai lần ngược chiều nên triệt tiêu.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;reel-video&quot;&gt;
  &lt;video controls=&quot;&quot; playsinline=&quot;&quot; preload=&quot;metadata&quot; src=&quot;/public/videos/reels/stokes-soap-film.mp4&quot;&gt;&lt;/video&gt;
  &lt;p class=&quot;reel-caption&quot;&gt;Định lý Stokes: mọi màng xà phòng căng trên cùng một vòng dây đều có cùng thông lượng curl, bằng lưu số quanh biên (video không lời, khoảng 2 phút).&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;interactive-frame&quot;&gt;
  &lt;div class=&quot;interactive-frame-head&quot;&gt;
    &lt;div class=&quot;interactive-frame-title&quot;&gt;Hai vế của định lý Stokes&lt;/div&gt;
    &lt;div class=&quot;interactive-frame-desc&quot;&gt;Đổi mặt bằng h và k; lưu số trên biên và thông lượng của curl vẫn bằng nhau.&lt;/div&gt;
  &lt;/div&gt;
  &lt;iframe src=&quot;/interactives/chapter15/stokes-vs-line.html&quot; title=&quot;Hai vế của định lý Stokes&quot; loading=&quot;lazy&quot; style=&quot;height: 700px;&quot;&gt;&lt;/iframe&gt;
  &lt;div class=&quot;interactive-frame-foot&quot;&gt;
    &lt;a href=&quot;/interactives/chapter15/stokes-vs-line.html&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;Mở minh hoạ ở cửa sổ riêng&lt;/a&gt;
  &lt;/div&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Ví dụ 1 (Kiểm tra).&lt;/strong&gt; $F=(-y,x,0)$, $S$ là nửa mặt cầu trên bán kính 1, $C$ là đường tròn đơn vị ngược chiều kim đồng hồ. Vế trái $=2\pi$ (bài 14_03). $\operatorname{curl}F=(0,0,2)$, thông lượng qua nửa mặt cầu hướng ra ngoài là $2\cdot\pi$ (ví dụ 2 bài 15_03). Hai vế bằng nhau. Thông lượng qua đĩa phẳng $x^2+y^2\le1$ cũng là $2\pi$: cùng biên, cùng kết quả.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Ví dụ 2 (Dùng mặt thay đường).&lt;/strong&gt; $\oint_CF\cdot dr$ với $F=(-y^2,x,z^2)$, $C$ là giao của mặt phẳng $y+z=2$ với trụ $x^2+y^2=1$, ngược chiều kim đồng hồ nhìn từ trên. $\operatorname{curl}F=(0,0,1+2y)$. Chọn $S$ là phần mặt phẳng $z=2-y$ trong trụ, hướng lên; $n\,dS=(0,1,1)\,dA$:&lt;/p&gt;

\[\iint_D(1+2y)\,dA=\pi+0=\pi.\]

  &lt;p&gt;(Kiểm tra số bằng tham số hoá $C$: tích phân bằng $3.14159\ldots$.)&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Ví dụ 3 (Dùng đường thay mặt).&lt;/strong&gt; $\iint_S\operatorname{curl}F\cdot n\,dS$ với $F=(xz,yz,xy)$, $S$ là phần mặt cầu $x^2+y^2+z^2=4$ trong trụ $x^2+y^2=1$, phía trên mặt phẳng $xy$, hướng ra ngoài. Biên là đường tròn $x^2+y^2=1$ ở $z=\sqrt3$: $r=(\cos t,\sin t,\sqrt3)$. $F\cdot r&apos;=-\sqrt3\cos t\sin t+\sqrt3\sin t\cos t=0$, nên kết quả bằng 0.&lt;/p&gt;
&lt;/div&gt;

&lt;p&gt;&lt;strong&gt;Hệ quả.&lt;/strong&gt; Nếu $S_1$, $S_2$ cùng biên $C$ (cùng hướng) thì $\iint_{S_1}\operatorname{curl}F\cdot n=\iint_{S_2}\operatorname{curl}F\cdot n$. Trên mặt kín (không có biên), thông lượng của curl bằng 0. Và nếu $\operatorname{curl}F=0$ trên toàn $\mathbb R^3$ thì $\oint_CF\cdot dr=0$ với mọi đường kín (căng một mặt trên $C$), nên $F$ bảo toàn (bài 14_04).&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Ý nghĩa của curl.&lt;/strong&gt; Với đĩa nhỏ $S_\varepsilon$ tâm $a$, pháp tuyến $n$: $\oint_{\partial S_\varepsilon}F\cdot dr\approx(\operatorname{curl}F(a)\cdot n)\,\pi\varepsilon^2$. Vậy $\operatorname{curl}F\cdot n$ là lưu thông trên một đơn vị diện tích trong mặt phẳng vuông góc với $n$, và $\operatorname{curl}F$ chỉ trục quay mạnh nhất.&lt;/p&gt;

&lt;h2 id=&quot;ứng-dụng-điện-từ-học&quot;&gt;Ứng dụng: điện từ học&lt;/h2&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;strong&gt;Faraday.&lt;/strong&gt; $\oint_CE\cdot dr=-\dfrac{d}{dt}\iint_SB\cdot n\,dS$: từ thông biến thiên qua vòng dây sinh suất điện động (nguyên lý máy phát điện). Theo Stokes, vế trái là $\iint\operatorname{curl}E\cdot n$, và vì đúng với mọi mặt: $\operatorname{curl}E=-\partial B/\partial t$.&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Ampère.&lt;/strong&gt; $\oint_CB\cdot dr=\mu_0I$ (dòng điện qua mặt). Với dây thẳng dài, đối xứng cho $B$ có độ lớn không đổi trên đường tròn bán kính $r$, nên $B\cdot2\pi r=\mu_0I$, $B=\dfrac{\mu_0I}{2\pi r}$.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2 id=&quot;bài-tập&quot;&gt;Bài tập&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Cơ bản.&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;Kiểm tra định lý Stokes cho $F=(y,-x,0)$ trên đĩa đơn vị trong mặt phẳng $z=0$, hướng lên.&lt;/li&gt;
  &lt;li&gt;Dùng Stokes tính $\oint_CF\cdot dr$ với $F=(z,x,y)$, $C$ là đường tròn đơn vị trong mặt phẳng $z=0$, ngược chiều kim đồng hồ.&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Đáp án&lt;/summary&gt;

  &lt;ol&gt;
    &lt;li&gt;Vế trái $-2\pi$ (bài 14_03, bài tập 3). $\operatorname{curl}F=(0,0,-2)$, thông lượng $-2\pi$.&lt;/li&gt;
    &lt;li&gt;$\operatorname{curl}F=(1,1,1)$; qua đĩa với $n=(0,0,1)$: $\pi$.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;p&gt;&lt;strong&gt;Trung bình.&lt;/strong&gt;&lt;/p&gt;

&lt;ol start=&quot;3&quot;&gt;
  &lt;li&gt;Tính $\iint_S\operatorname{curl}F\cdot n\,dS$ với $F=(y,z,x)$ và $S$ là nửa mặt cầu trên bán kính 1, hướng ra ngoài, bằng cách thay $S$ bằng đĩa.&lt;/li&gt;
  &lt;li&gt;Chứng minh $\iint_S\operatorname{curl}F\cdot n\,dS=0$ cho mọi mặt cầu $S$, theo hai cách (Stokes và $\operatorname{div}\operatorname{curl}=0$ với định lý Gauss ở bài sau).&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Đáp án&lt;/summary&gt;

  &lt;ol start=&quot;3&quot;&gt;
    &lt;li&gt;$\operatorname{curl}F=(-1,-1,-1)$; qua đĩa hướng lên: $-\pi$.&lt;/li&gt;
    &lt;li&gt;Cắt mặt cầu theo xích đạo: hai nửa có cùng biên nhưng hướng ngược nhau, hai tích phân đường triệt tiêu. Hoặc $\iiint\operatorname{div}\operatorname{curl}F\,dV=0$.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;p&gt;&lt;strong&gt;Nâng cao.&lt;/strong&gt;&lt;/p&gt;

&lt;ol start=&quot;5&quot;&gt;
  &lt;li&gt;Hoàn thành chứng minh định lý 1 cho thành phần $F=(0,0,R)$.&lt;/li&gt;
  &lt;li&gt;Chứng minh: nếu $\operatorname{curl}F=0$ trên $\mathbb R^3$ bỏ trục $z$, chưa chắc $F$ bảo toàn. Gợi ý: mở rộng ví dụ 2 của bài 14_04.&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Gợi ý&lt;/summary&gt;

  &lt;ol start=&quot;5&quot;&gt;
    &lt;li&gt;Vế phải: $\operatorname{curl}(0,0,R)=(R_y,-R_x,0)$, $n\,dS=(-g_x,-g_y,1)dA$, cho $\iint(-R_yg_x+R_xg_y)\,dA$. Vế trái: $\oint R\,dz=\oint r(x,y)(g_x\,dx+g_y\,dy)$, với $r=R(x,y,g)$; áp dụng Green và quy tắc chuỗi, các số hạng $g_{xy}$ triệt tiêu nhờ Schwarz.&lt;/li&gt;
    &lt;li&gt;$F=\big(\tfrac{-y}{x^2+y^2},\tfrac{x}{x^2+y^2},0\big)$: curl bằng 0 nhưng lưu thông quanh trục $z$ bằng $2\pi$. Không có mặt nào căng trên vòng đó mà không cắt trục.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;h2 id=&quot;tóm-tắt&quot;&gt;Tóm tắt&lt;/h2&gt;

&lt;div class=&quot;content-box summary-box textbook-block&quot;&gt;
  &lt;ul&gt;
    &lt;li&gt;Stokes: $\oint_CF\cdot dr=\iint_S\operatorname{curl}F\cdot n\,dS$, hướng theo quy tắc bàn tay phải.&lt;/li&gt;
    &lt;li&gt;Chứng minh: với mặt là đồ thị, đưa về Green bằng quy tắc chuỗi.&lt;/li&gt;
    &lt;li&gt;Thông lượng của curl chỉ phụ thuộc biên; trên mặt kín bằng 0.&lt;/li&gt;
    &lt;li&gt;Ứng dụng: định luật Faraday và Ampère; $B=\mu_0I/(2\pi r)$ quanh dây thẳng.&lt;/li&gt;
  &lt;/ul&gt;
&lt;/div&gt;
</content>
 </entry>
 
 <entry>
   <title>Tích phân mặt loại hai và thông lượng</title>
   <link href="https://calculus-self-learning.pages.dev/contents/vi/chapter15/15_03_Tich_phan_mat_loai_hai_va_thong_luong/"/>
   <updated>2026-12-01T00:00:00+00:00</updated>
   <id>https://calculus-self-learning.pages.dev/contents/vi/chapter15/15_03_Tich_phan_mat_loai_hai_va_thong_luong</id>
   <content type="html">&lt;div class=&quot;textbook-objectives&quot;&gt;

  &lt;p&gt;&lt;strong&gt;Mục tiêu bài học.&lt;/strong&gt; Sau bài này bạn có thể:&lt;/p&gt;

  &lt;ul&gt;
    &lt;li&gt;chọn hướng cho mặt và hiểu vì sao dải Möbius không chọn được;&lt;/li&gt;
    &lt;li&gt;tính thông lượng $\iint_SF\cdot n\,dS$ qua mặt tham số, đồ thị và mặt cầu;&lt;/li&gt;
    &lt;li&gt;giải thích thông lượng bằng lượng chất lỏng chảy qua mặt trong một đơn vị thời gian.&lt;/li&gt;
  &lt;/ul&gt;

&lt;/div&gt;

&lt;h2 id=&quot;vì-sao-cần-bài-này&quot;&gt;Vì sao cần bài này&lt;/h2&gt;

&lt;p&gt;Đặt một tấm lưới vào dòng nước: mỗi giây bao nhiêu nước chảy qua? Chỉ thành phần vận tốc vuông góc với lưới mới đưa nước qua, và ta phải nói rõ “qua” theo chiều nào. Đại lượng đó là thông lượng, trung tâm của định luật Gauss trong điện học và của định lý Stokes, Gauss ở hai bài sau.&lt;/p&gt;

&lt;h2 id=&quot;mặt-có-hướng&quot;&gt;Mặt có hướng&lt;/h2&gt;

&lt;div class=&quot;textbook-definition&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Định nghĩa.&lt;/strong&gt; Mặt $S$ &lt;strong&gt;định hướng được&lt;/strong&gt; nếu có thể chọn pháp tuyến đơn vị $n$ biến thiên liên tục trên toàn mặt. Một lựa chọn như vậy là một &lt;strong&gt;hướng&lt;/strong&gt; của $S$. Mặt kín (biên của một khối) thường được định hướng bằng &lt;strong&gt;pháp tuyến ngoài&lt;/strong&gt;.&lt;/p&gt;
&lt;/div&gt;

&lt;p&gt;Dải Möbius (một băng giấy xoắn nửa vòng rồi dán hai đầu) không định hướng được: đi một vòng dọc dải, pháp tuyến quay về chỉ ngược chiều ban đầu. Không thể nói thông lượng “qua” dải Möbius.&lt;/p&gt;

&lt;h2 id=&quot;thông-lượng&quot;&gt;Thông lượng&lt;/h2&gt;

&lt;div class=&quot;textbook-definition&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Định nghĩa.&lt;/strong&gt; &lt;strong&gt;Thông lượng&lt;/strong&gt; của trường liên tục $F$ qua mặt có hướng $S$ là&lt;/p&gt;

\[\iint_SF\cdot dS=\iint_SF\cdot n\,dS.\]

  &lt;p&gt;Nếu $r:D\to\mathbb R^3$ là tham số hoá với $r_u\times r_v$ cùng chiều $n$ thì $n\,dS=(r_u\times r_v)\,du\,dv$, nên&lt;/p&gt;

\[\iint_SF\cdot dS=\iint_DF(r(u,v))\cdot(r_u\times r_v)\,du\,dv.\]

&lt;/div&gt;

&lt;p&gt;Đổi hướng thì thông lượng đổi dấu. Với đồ thị $z=g(x,y)$ hướng lên ($r_x\times r_y=(-g_x,-g_y,1)$):&lt;/p&gt;

\[\iint_SF\cdot dS=\iint_D\big(-Pg_x-Qg_y+R\big)\,dA.\]

&lt;p&gt;Với $F$ là vận tốc chất lỏng, $F\cdot n\,\Delta S$ xấp xỉ thể tích chảy qua mảnh $\Delta S$ trong một đơn vị thời gian (thể tích hình hộp xiên đáy $\Delta S$, cạnh $F$).&lt;/p&gt;

&lt;div class=&quot;interactive-frame&quot;&gt;
  &lt;div class=&quot;interactive-frame-head&quot;&gt;
    &lt;div class=&quot;interactive-frame-title&quot;&gt;Thông lượng qua mặt&lt;/div&gt;
    &lt;div class=&quot;interactive-frame-desc&quot;&gt;Các ô tô màu theo dấu F · n; tổng của chúng là thông lượng.&lt;/div&gt;
  &lt;/div&gt;
  &lt;iframe src=&quot;/interactives/chapter15/surface-flux.html&quot; title=&quot;Thông lượng qua mặt&quot; loading=&quot;lazy&quot; style=&quot;height: 720px;&quot;&gt;&lt;/iframe&gt;
  &lt;div class=&quot;interactive-frame-foot&quot;&gt;
    &lt;a href=&quot;/interactives/chapter15/surface-flux.html&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;Mở minh hoạ ở cửa sổ riêng&lt;/a&gt;
  &lt;/div&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Ví dụ 1.&lt;/strong&gt; $F=(x,y,z)$ qua mặt cầu bán kính $R$, hướng ra ngoài. Trên mặt cầu $n=r/R$, nên $F\cdot n=R$ và thông lượng là $R\cdot4\pi R^2=4\pi R^3$.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Ví dụ 2 (Mưa).&lt;/strong&gt; Mưa rơi thẳng đứng đều, $F=(0,0,-1)$. Thông lượng (hướng xuống) qua nửa mặt cầu trên bán kính $R$: với $n$ hướng vào trong, $F\cdot n=\cos\varphi$, nên thông lượng là $\int_0^{2\pi}\int_0^{\pi/2}\cos\varphi\,R^2\sin\varphi\,d\varphi\,d\theta=\pi R^2$. Mái vòm nhận đúng lượng mưa như cái đĩa bóng của nó.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Ví dụ 3 (Đồ thị).&lt;/strong&gt; $F=(y,x,z)$ qua paraboloid $z=1-x^2-y^2$, $z\ge0$, hướng lên. $g_x=-2x$, $g_y=-2y$:&lt;/p&gt;

\[\iint_D\big(2xy+2xy+1-x^2-y^2\big)\,dA=0+\int_0^{2\pi}\int_0^1(1-r^2)\,r\,dr\,d\theta=\frac\pi2.\]

  &lt;p&gt;(Số hạng $4xy$ có tích phân 0 trên hình tròn do đối xứng.)&lt;/p&gt;
&lt;/div&gt;

&lt;h2 id=&quot;ứng-dụng-điện-tích-điểm&quot;&gt;Ứng dụng: điện tích điểm&lt;/h2&gt;

&lt;p&gt;Điện tích $q$ ở gốc tạo điện trường $E=\dfrac{q}{4\pi\varepsilon_0}\dfrac{r}{\lVert r\rVert^3}$. Trên mặt cầu bán kính $R$, $E\cdot n=\dfrac q{4\pi\varepsilon_0R^2}$, nên thông lượng ra là $\dfrac q{4\pi\varepsilon_0R^2}\cdot4\pi R^2=\dfrac q{\varepsilon_0}$, &lt;strong&gt;không phụ thuộc $R$&lt;/strong&gt;: số “đường sức” đi ra là cố định. Bài 15_05 chứng minh điều này cho mọi mặt kín bao điện tích (định luật Gauss).&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Nhiệt.&lt;/strong&gt; Theo định luật Fourier, dòng nhiệt là $q=-k\nabla T$. Thông lượng của $q$ qua thành nồi là công suất nhiệt thoát ra ngoài (W).&lt;/p&gt;

&lt;h2 id=&quot;bài-tập&quot;&gt;Bài tập&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Cơ bản.&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;Thông lượng của $F=(0,0,z)$ ra khỏi mặt cầu đơn vị.&lt;/li&gt;
  &lt;li&gt;Thông lượng của $F=(x,y,0)$ ra khỏi mặt bên của trụ $x^2+y^2=1$, $0\le z\le2$.&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Đáp án&lt;/summary&gt;

  &lt;ol&gt;
    &lt;li&gt;$F\cdot n=z^2$: $\iint z^2\,dS=\tfrac{4\pi}3$ (bài 15_02).&lt;/li&gt;
    &lt;li&gt;$F\cdot n=x^2+y^2=1$: bằng diện tích $4\pi$.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;p&gt;&lt;strong&gt;Trung bình.&lt;/strong&gt;&lt;/p&gt;

&lt;ol start=&quot;3&quot;&gt;
  &lt;li&gt;Thông lượng của $F=(1,1,1)$ qua tam giác $x+y+z=1$, $x,y,z\ge0$, hướng lên.&lt;/li&gt;
  &lt;li&gt;Thông lượng của $F=(0,0,1)$ ra khỏi mặt cầu đơn vị (cả mặt kín). Giải thích kết quả.&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Đáp án&lt;/summary&gt;

  &lt;ol start=&quot;3&quot;&gt;
    &lt;li&gt;$g=1-x-y$: $-P(-1)-Q(-1)+R=3$, nhân diện tích $D$ là $\tfrac12$: $\tfrac32$.&lt;/li&gt;
    &lt;li&gt;Nửa trên cho $\pi$, nửa dưới cho $-\pi$: tổng 0. Trường đều đi vào bao nhiêu thì đi ra bấy nhiêu.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;p&gt;&lt;strong&gt;Nâng cao.&lt;/strong&gt;&lt;/p&gt;

&lt;ol start=&quot;5&quot;&gt;
  &lt;li&gt;Chứng minh thông lượng của $F=\dfrac{r}{\lVert r\rVert^3}$ qua một mảnh mặt cầu tâm gốc bằng góc khối (diện tích của mảnh chiếu lên mặt cầu đơn vị).&lt;/li&gt;
  &lt;li&gt;Viết tham số hoá dải Möbius $r(u,v)=\big((1+\tfrac v2\cos\tfrac u2)\cos u,\,(1+\tfrac v2\cos\tfrac u2)\sin u,\,\tfrac v2\sin\tfrac u2\big)$ và kiểm tra rằng tại $v=0$, $r_u\times r_v$ ở $u=0$ và $u=2\pi$ ngược chiều nhau.&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Gợi ý&lt;/summary&gt;

  &lt;ol start=&quot;5&quot;&gt;
    &lt;li&gt;Trên mặt cầu bán kính $R$, $F\cdot n=1/R^2$ và $dS=R^2\,d\Omega$, nên thông lượng $=\iint d\Omega$.&lt;/li&gt;
    &lt;li&gt;Tại $v=0$: $r_u=(-\sin u,\cos u,0)$, $r_v=\tfrac12(\cos\tfrac u2\cos u,\cos\tfrac u2\sin u,\sin\tfrac u2)$. Ở $u=0$: $r_v=(\tfrac12,0,0)$; ở $u=2\pi$: $r_v=(-\tfrac12,0,0)$, trong khi $r_u=(0,1,0)$ như nhau, nên tích có hướng đổi dấu.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;h2 id=&quot;tóm-tắt&quot;&gt;Tóm tắt&lt;/h2&gt;

&lt;div class=&quot;content-box summary-box textbook-block&quot;&gt;
  &lt;ul&gt;
    &lt;li&gt;Mặt có hướng: chọn pháp tuyến đơn vị liên tục; dải Möbius không làm được.&lt;/li&gt;
    &lt;li&gt;Thông lượng $\iint F\cdot n\,dS=\iint F(r)\cdot(r_u\times r_v)\,du\,dv$; đổi hướng thì đổi dấu.&lt;/li&gt;
    &lt;li&gt;Đồ thị hướng lên: $\iint(-Pg_x-Qg_y+R)\,dA$.&lt;/li&gt;
    &lt;li&gt;Điện tích điểm: thông lượng qua mặt cầu là $q/\varepsilon_0$, không phụ thuộc bán kính.&lt;/li&gt;
  &lt;/ul&gt;
&lt;/div&gt;
</content>
 </entry>
 
 <entry>
   <title>Tích phân mặt loại một</title>
   <link href="https://calculus-self-learning.pages.dev/contents/vi/chapter15/15_02_Tich_phan_mat_loai_mot/"/>
   <updated>2026-12-01T00:00:00+00:00</updated>
   <id>https://calculus-self-learning.pages.dev/contents/vi/chapter15/15_02_Tich_phan_mat_loai_mot</id>
   <content type="html">&lt;div class=&quot;textbook-objectives&quot;&gt;

  &lt;p&gt;&lt;strong&gt;Mục tiêu bài học.&lt;/strong&gt; Sau bài này bạn có thể:&lt;/p&gt;

  &lt;ul&gt;
    &lt;li&gt;tính $\iint_Sf\,dS$ bằng một tham số hoá của mặt;&lt;/li&gt;
    &lt;li&gt;dùng tính đối xứng để rút gọn tích phân trên mặt cầu;&lt;/li&gt;
    &lt;li&gt;tính khối lượng, trọng tâm, mômen quán tính của vỏ mỏng.&lt;/li&gt;
  &lt;/ul&gt;

&lt;/div&gt;

&lt;h2 id=&quot;vì-sao-cần-bài-này&quot;&gt;Vì sao cần bài này&lt;/h2&gt;

&lt;p&gt;Tích phân đường loại một (bài 14_02) cộng một đại lượng dọc sợi dây. Tích phân mặt loại một làm điều tương tự trên một tấm vỏ mỏng: khối lượng của vỏ trứng có độ dày thay đổi, điện tích trên mặt vật dẫn, nhiệt độ trung bình trên bề mặt Trái Đất.&lt;/p&gt;

&lt;h2 id=&quot;định-nghĩa&quot;&gt;Định nghĩa&lt;/h2&gt;

&lt;div class=&quot;textbook-definition&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Định nghĩa.&lt;/strong&gt; Cho mặt trơn $S$ tham số hoá bởi $r:D\to\mathbb R^3$ và $f$ liên tục trên $S$:&lt;/p&gt;

\[\iint_Sf\,dS=\iint_Df(r(u,v))\,\lVert r_u\times r_v\rVert\,du\,dv.\]

&lt;/div&gt;

&lt;p&gt;Với $f=1$ ta được diện tích (bài 15_01). Như với tích phân loại một trên đường cong, giá trị không phụ thuộc tham số hoá: đổi tham số $(u,v)=\Phi(s,t)$ thì $r_s\times r_t=(r_u\times r_v)\det J_\Phi$, và công thức đổi biến (bài 13_03) hấp thụ $\lvert\det J_\Phi\rvert$.&lt;/p&gt;

&lt;p&gt;Hai trường hợp hay dùng: mặt cầu, $dS=R^2\sin\varphi\,d\varphi\,d\theta$; đồ thị $z=g(x,y)$, $dS=\sqrt{1+g_x^2+g_y^2}\,dA$.&lt;/p&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Ví dụ 1 (Đối xứng).&lt;/strong&gt; $\iint_Sz^2\,dS$ trên mặt cầu đơn vị. Do đối xứng, $\iint x^2=\iint y^2=\iint z^2$, và tổng là $\iint1\,dS=4\pi$ (vì $x^2+y^2+z^2=1$ trên $S$). Vậy $\iint_Sz^2\,dS=\tfrac{4\pi}3$, không cần tích phân.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Ví dụ 2.&lt;/strong&gt; $\iint_Sz\,dS$ trên nửa mặt cầu $z\ge0$ bán kính $R$:&lt;/p&gt;

\[\int_0^{2\pi}\int_0^{\pi/2}R\cos\varphi\cdot R^2\sin\varphi\,d\varphi\,d\theta=2\pi R^3\cdot\frac12=\pi R^3.\]

  &lt;p&gt;Chia cho diện tích $2\pi R^2$: trọng tâm của vỏ bán cầu ở độ cao $\bar z=R/2$, đúng giữa (hệ quả của định lý Archimedes, bài 15_01). So với bán cầu đặc, $\bar z=\tfrac38R$.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Ví dụ 3 (Đồ thị).&lt;/strong&gt; $\iint_Sy\,dS$ với $S$: $z=x+y^2$, $0\le x\le1$, $0\le y\le2$. $dS=\sqrt{1+1+4y^2}\,dA$:&lt;/p&gt;

\[\int_0^1\int_0^2y\sqrt{2+4y^2}\,dy\,dx=\Big[\frac{(2+4y^2)^{3/2}}{12}\Big]_0^2=\frac{18^{3/2}-2^{3/2}}{12}=\frac{13\sqrt2}3\approx6.13.\]

&lt;/div&gt;

&lt;h2 id=&quot;ứng-dụng&quot;&gt;Ứng dụng&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Mômen quán tính của vỏ cầu.&lt;/strong&gt; Vỏ cầu mỏng đồng chất bán kính $R$, khối lượng $M$: theo ví dụ 1 (phóng to theo $R$), $\iint(x^2+y^2)\,dS=\tfrac23\iint(x^2+y^2+z^2)\,dS=\tfrac23R^2\cdot4\pi R^2$. Nhân với mật độ $\tfrac M{4\pi R^2}$: $I_z=\tfrac23MR^2$, khớp bài 13_05 (bài tập 6). Quả bóng rỗng khó quay hơn quả cầu đặc cùng khối lượng ($\tfrac25MR^2$).&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Nhiệt độ trung bình.&lt;/strong&gt; Trung bình của $f$ trên $S$ là $\tfrac1{A(S)}\iint_Sf\,dS$. Một mô hình đơn giản cho nhiệt độ bề mặt hành tinh là $T=T_0-T_1\cos^2\varphi$ với $T_1&amp;gt;0$ ($T_0$ ở xích đạo $\varphi=\pi/2$, lạnh hơn $T_1$ ở hai cực); theo ví dụ 1, trung bình là $T_0-\tfrac13T_1$, gần nhiệt độ xích đạo hơn nhiệt độ cực. Chú ý: trung bình theo diện tích, không theo vĩ độ; vùng gần xích đạo chiếm nhiều diện tích hơn.&lt;/p&gt;

&lt;h2 id=&quot;bài-tập&quot;&gt;Bài tập&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Cơ bản.&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;$\iint_S(x^2+y^2)\,dS$ trên mặt cầu đơn vị.&lt;/li&gt;
  &lt;li&gt;$\iint_Sz\,dS$ trên mặt trụ $x^2+y^2=1$, $0\le z\le2$.&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Đáp án&lt;/summary&gt;

  &lt;ol&gt;
    &lt;li&gt;$\tfrac23\cdot4\pi=\tfrac{8\pi}3$.&lt;/li&gt;
    &lt;li&gt;$dS=d\theta\,dz$: $2\pi\int_0^2z\,dz=4\pi$.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;p&gt;&lt;strong&gt;Trung bình.&lt;/strong&gt;&lt;/p&gt;

&lt;ol start=&quot;3&quot;&gt;
  &lt;li&gt;$\iint_Sz^2\,dS$ trên nửa mặt cầu $z\ge0$ bán kính $R$.&lt;/li&gt;
  &lt;li&gt;$\iint_Sxyz\,dS$ trên mặt cầu đơn vị. Giải thích không cần tính.&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Đáp án&lt;/summary&gt;

  &lt;ol start=&quot;3&quot;&gt;
    &lt;li&gt;$\int_0^{2\pi}\int_0^{\pi/2}R^2\cos^2\varphi\,R^2\sin\varphi\,d\varphi\,d\theta=\tfrac{2\pi R^4}3$.&lt;/li&gt;
    &lt;li&gt;Bằng 0: đổi $x\to-x$ giữ nguyên mặt cầu nhưng đổi dấu hàm.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;p&gt;&lt;strong&gt;Nâng cao.&lt;/strong&gt;&lt;/p&gt;

&lt;ol start=&quot;5&quot;&gt;
  &lt;li&gt;Tính $\iint_S\dfrac{dS}{\lVert X-P\rVert}$ với $S$ là mặt cầu đơn vị và $P=(0,0,d)$, $d&amp;gt;1$. (Đây là thế năng hấp dẫn của vỏ cầu tại một điểm ngoài.)&lt;/li&gt;
  &lt;li&gt;Chứng minh trọng tâm của vỏ bán cầu ở $R/2$ bằng định lý đới cầu (bài 15_01), không cần tích phân $z$.&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Gợi ý&lt;/summary&gt;

  &lt;ol start=&quot;5&quot;&gt;
    &lt;li&gt;$\lVert X-P\rVert^2=1+d^2-2d\cos\varphi$. Đặt $w=\cos\varphi$: $2\pi\int_{-1}^1\tfrac{dw}{\sqrt{1+d^2-2dw}}=\tfrac{2\pi}{d}\big[(d+1)-(d-1)\big]=\tfrac{4\pi}d$: như thể toàn bộ khối lượng $4\pi$ tập trung ở tâm (Newton).&lt;/li&gt;
    &lt;li&gt;Diện tích phân bố đều theo $z$ trên $[0,R]$ (mỗi lát dày $dz$ có diện tích $2\pi R\,dz$), nên trung bình của $z$ là $R/2$.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;h2 id=&quot;tóm-tắt&quot;&gt;Tóm tắt&lt;/h2&gt;

&lt;div class=&quot;content-box summary-box textbook-block&quot;&gt;
  &lt;ul&gt;
    &lt;li&gt;$\iint_Sf\,dS=\iint_Df(r)\lVert r_u\times r_v\rVert\,du\,dv$, không phụ thuộc tham số hoá.&lt;/li&gt;
    &lt;li&gt;Mặt cầu: $dS=R^2\sin\varphi\,d\varphi\,d\theta$; đồ thị: $dS=\sqrt{1+g_x^2+g_y^2}\,dA$.&lt;/li&gt;
    &lt;li&gt;Đối xứng giúp tính nhanh: $\iint x^2=\iint y^2=\iint z^2$ trên mặt cầu.&lt;/li&gt;
    &lt;li&gt;Vỏ bán cầu có $\bar z=R/2$; vỏ cầu có $I=\tfrac23MR^2$.&lt;/li&gt;
  &lt;/ul&gt;
&lt;/div&gt;
</content>
 </entry>
 
 <entry>
   <title>Mặt tham số và diện tích mặt</title>
   <link href="https://calculus-self-learning.pages.dev/contents/vi/chapter15/15_01_Mat_tham_so_va_dien_tich_mat/"/>
   <updated>2026-12-01T00:00:00+00:00</updated>
   <id>https://calculus-self-learning.pages.dev/contents/vi/chapter15/15_01_Mat_tham_so_va_dien_tich_mat</id>
   <content type="html">&lt;div class=&quot;textbook-objectives&quot;&gt;

  &lt;p&gt;&lt;strong&gt;Mục tiêu bài học.&lt;/strong&gt; Sau bài này bạn có thể:&lt;/p&gt;

  &lt;ul&gt;
    &lt;li&gt;tham số hoá mặt cầu, mặt trụ, mặt nón, đồ thị $z=g(x,y)$ và mặt xuyến;&lt;/li&gt;
    &lt;li&gt;tính vectơ pháp tuyến $r_u\times r_v$ và mặt phẳng tiếp xúc;&lt;/li&gt;
    &lt;li&gt;tính diện tích mặt bằng $\iint\lVert r_u\times r_v\rVert\,du\,dv$.&lt;/li&gt;
  &lt;/ul&gt;

&lt;/div&gt;

&lt;h2 id=&quot;vì-sao-cần-bài-này&quot;&gt;Vì sao cần bài này&lt;/h2&gt;

&lt;p&gt;Chương 14 tích phân dọc đường cong (một tham số). Để tính thông lượng chất lỏng qua một tấm lưới, điện tích trên một vỏ cầu hay lượng nhiệt thoát qua thành nồi, ta cần tích phân trên &lt;strong&gt;mặt&lt;/strong&gt; (hai tham số). Bước đầu tiên là mô tả mặt và đo diện tích của nó.&lt;/p&gt;

&lt;h2 id=&quot;mặt-tham-số&quot;&gt;Mặt tham số&lt;/h2&gt;

&lt;div class=&quot;textbook-definition&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Định nghĩa.&lt;/strong&gt; Một &lt;strong&gt;mặt tham số&lt;/strong&gt; là ảnh của hàm $r(u,v)=(x(u,v),y(u,v),z(u,v))$ với $(u,v)$ thuộc miền $D\subset\mathbb R^2$. Các vectơ $r_u=\partial r/\partial u$ và $r_v=\partial r/\partial v$ tiếp xúc với mặt; nếu $r_u\times r_v\ne0$, mặt &lt;strong&gt;trơn&lt;/strong&gt; tại đó và $r_u\times r_v$ là một &lt;strong&gt;vectơ pháp tuyến&lt;/strong&gt;.&lt;/p&gt;
&lt;/div&gt;

&lt;ul&gt;
  &lt;li&gt;Mặt cầu bán kính $R$: $r(\varphi,\theta)=(R\sin\varphi\cos\theta,\,R\sin\varphi\sin\theta,\,R\cos\varphi)$, $0\le\varphi\le\pi$, $0\le\theta\le2\pi$.&lt;/li&gt;
  &lt;li&gt;Mặt trụ: $r(\theta,z)=(R\cos\theta,R\sin\theta,z)$.&lt;/li&gt;
  &lt;li&gt;Đồ thị $z=g(x,y)$: $r(x,y)=(x,y,g(x,y))$.&lt;/li&gt;
  &lt;li&gt;Mặt xuyến: $r(u,v)=\big((a+b\cos v)\cos u,\,(a+b\cos v)\sin u,\,b\sin v\big)$, $0&amp;lt;b&amp;lt;a$.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2 id=&quot;diện-tích-mặt&quot;&gt;Diện tích mặt&lt;/h2&gt;

&lt;div class=&quot;textbook-theorem&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Định lý 1.&lt;/strong&gt; Diện tích của mặt trơn $S$ tham số hoá một-một bởi $r:D\to\mathbb R^3$ là&lt;/p&gt;

\[A(S)=\iint_D\lVert r_u\times r_v\rVert\,du\,dv.\]

  &lt;p&gt;Với đồ thị $z=g(x,y)$: $A(S)=\iint_D\sqrt{1+g_x^2+g_y^2}\,dA$.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-proof&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Lý do.&lt;/strong&gt; Như bài 13_03, ô nhỏ $[u,u+\Delta u]\times[v,v+\Delta v]$ có ảnh gần với hình bình hành cạnh $r_u\Delta u$ và $r_v\Delta v$, diện tích $\lVert r_u\times r_v\rVert\Delta u\Delta v$. Cộng lại và cho lưới mịn dần được tích phân (đây là định nghĩa diện tích mặt; người ta chứng minh nó không phụ thuộc cách tham số hoá, nhờ công thức đổi biến). Với đồ thị, $r_x=(1,0,g_x)$, $r_y=(0,1,g_y)$, nên $r_x\times r_y=(-g_x,-g_y,1)$ có độ dài $\sqrt{1+g_x^2+g_y^2}$.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Ví dụ 1 (Mặt cầu).&lt;/strong&gt; $r_\varphi=(R\cos\varphi\cos\theta,R\cos\varphi\sin\theta,-R\sin\varphi)$, $r_\theta=(-R\sin\varphi\sin\theta,R\sin\varphi\cos\theta,0)$. Tính ra $r_\varphi\times r_\theta=R\sin\varphi\cdot r$, độ dài $R^2\sin\varphi$. Vậy&lt;/p&gt;

\[A=\int_0^{2\pi}\int_0^\pi R^2\sin\varphi\,d\varphi\,d\theta=4\pi R^2.\]

  &lt;p&gt;Pháp tuyến cùng phương với $r$: hướng ra ngoài tâm, như hình học dự đoán.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Ví dụ 2 (Paraboloid).&lt;/strong&gt; Phần $z=x^2+y^2$ với $z\le1$: $\sqrt{1+4x^2+4y^2}$ trên hình tròn đơn vị, trong toạ độ cực&lt;/p&gt;

\[A=\int_0^{2\pi}\int_0^1\sqrt{1+4r^2}\,r\,dr\,d\theta=\frac\pi6\big(5\sqrt5-1\big)\approx5.33.\]

&lt;/div&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Ví dụ 3 (Mặt xuyến).&lt;/strong&gt; Tính được $\lVert r_u\times r_v\rVert=b(a+b\cos v)$, nên $A=\int_0^{2\pi}\int_0^{2\pi}b(a+b\cos v)\,du\,dv=4\pi^2ab$: bằng chu vi đường tròn nhỏ $2\pi b$ nhân quãng đường tâm của nó đi được $2\pi a$ (định lý Pappus).&lt;/p&gt;
&lt;/div&gt;

&lt;h2 id=&quot;ứng-dụng-định-lý-của-archimedes-và-bản-đồ&quot;&gt;Ứng dụng: định lý của Archimedes và bản đồ&lt;/h2&gt;

&lt;p&gt;Phần mặt cầu bán kính $R$ nằm giữa hai mặt phẳng song song cách nhau $h$ (một &lt;strong&gt;đới cầu&lt;/strong&gt;, ứng với $\varphi_1\le\varphi\le\varphi_2$) có diện tích&lt;/p&gt;

\[\int_0^{2\pi}\int_{\varphi_1}^{\varphi_2}R^2\sin\varphi\,d\varphi\,d\theta=2\pi R^2(\cos\varphi_1-\cos\varphi_2)=2\pi Rh,\]

&lt;p&gt;chỉ phụ thuộc $h$, không phụ thuộc vị trí đới. Đó cũng là diện tích phần mặt trụ bao quanh cùng chiều cao. Archimedes tự hào nhất về kết quả này. Hệ quả: phép chiếu ngang từ mặt cầu lên mặt trụ tiếp xúc (phép chiếu trụ diện tích bằng nhau của Lambert) bảo toàn diện tích, dù làm méo hình dạng gần hai cực.&lt;/p&gt;

&lt;h2 id=&quot;bài-tập&quot;&gt;Bài tập&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Cơ bản.&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;Diện tích phần mặt phẳng $z=2x+y$ nằm trên hình vuông $[0,1]^2$.&lt;/li&gt;
  &lt;li&gt;Diện tích mặt trụ bán kính $R$, cao $h$ (không kể hai đáy).&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Đáp án&lt;/summary&gt;

  &lt;ol&gt;
    &lt;li&gt;$\sqrt{1+4+1}=\sqrt6$.&lt;/li&gt;
    &lt;li&gt;$\lVert r_\theta\times r_z\rVert=R$: $2\pi Rh$.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;p&gt;&lt;strong&gt;Trung bình.&lt;/strong&gt;&lt;/p&gt;

&lt;ol start=&quot;3&quot;&gt;
  &lt;li&gt;Diện tích phần mặt cầu bán kính 2 nằm trên mặt phẳng $z=1$.&lt;/li&gt;
  &lt;li&gt;Diện tích mặt nón $z=\sqrt{x^2+y^2}$, $0\le z\le1$.&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Đáp án&lt;/summary&gt;

  &lt;ol start=&quot;3&quot;&gt;
    &lt;li&gt;Đới cầu có $h=1$: $2\pi\cdot2\cdot1=4\pi$.&lt;/li&gt;
    &lt;li&gt;$\sqrt{1+g_x^2+g_y^2}=\sqrt2$ trên hình tròn đơn vị: $\sqrt2\pi$.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;p&gt;&lt;strong&gt;Nâng cao.&lt;/strong&gt;&lt;/p&gt;

&lt;ol start=&quot;5&quot;&gt;
  &lt;li&gt;Với $E=r_u\cdot r_u$, $F=r_u\cdot r_v$, $G=r_v\cdot r_v$, chứng minh $\lVert r_u\times r_v\rVert^2=EG-F^2$.&lt;/li&gt;
  &lt;li&gt;Chứng minh mặt phẳng tiếp xúc của mặt tham số tại $r(u_0,v_0)$ có phương trình $(X-r(u_0,v_0))\cdot(r_u\times r_v)=0$, và kiểm tra với ví dụ 1.&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Gợi ý&lt;/summary&gt;

  &lt;ol start=&quot;5&quot;&gt;
    &lt;li&gt;Đồng nhất thức Lagrange: $\lVert a\times b\rVert^2=\lVert a\rVert^2\lVert b\rVert^2-(a\cdot b)^2$ (bài 09_01: $\lVert a\times b\rVert=\lVert a\rVert\lVert b\rVert\sin\theta$).&lt;/li&gt;
    &lt;li&gt;Các đường cong $u\mapsto r(u,v_0)$ và $v\mapsto r(u_0,v)$ có tiếp tuyến $r_u$, $r_v$, nằm trong mặt phẳng tiếp xúc, nên pháp tuyến là tích có hướng. Với mặt cầu, mặt phẳng tiếp xúc vuông góc bán kính.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;h2 id=&quot;tóm-tắt&quot;&gt;Tóm tắt&lt;/h2&gt;

&lt;div class=&quot;content-box summary-box textbook-block&quot;&gt;
  &lt;ul&gt;
    &lt;li&gt;Mặt tham số $r(u,v)$; $r_u$, $r_v$ tiếp xúc, $r_u\times r_v$ pháp tuyến.&lt;/li&gt;
    &lt;li&gt;Diện tích $\iint\lVert r_u\times r_v\rVert\,du\,dv$; với đồ thị là $\iint\sqrt{1+g_x^2+g_y^2}\,dA$.&lt;/li&gt;
    &lt;li&gt;Mặt cầu: $dS=R^2\sin\varphi\,d\varphi\,d\theta$, diện tích $4\pi R^2$.&lt;/li&gt;
    &lt;li&gt;Đới cầu cao $h$ có diện tích $2\pi Rh$ (Archimedes).&lt;/li&gt;
  &lt;/ul&gt;
&lt;/div&gt;
</content>
 </entry>
 
 <entry>
   <title>Định lý Green</title>
   <link href="https://calculus-self-learning.pages.dev/contents/vi/chapter14/14_05_Dinh_ly_Green/"/>
   <updated>2026-12-01T00:00:00+00:00</updated>
   <id>https://calculus-self-learning.pages.dev/contents/vi/chapter14/14_05_Dinh_ly_Green</id>
   <content type="html">&lt;div class=&quot;textbook-objectives&quot;&gt;

  &lt;p&gt;&lt;strong&gt;Mục tiêu bài học.&lt;/strong&gt; Sau bài này bạn có thể:&lt;/p&gt;

  &lt;ul&gt;
    &lt;li&gt;phát biểu và chứng minh định lý Green cho miền vừa loại I vừa loại II;&lt;/li&gt;
    &lt;li&gt;chuyển tích phân đường trên đường cong kín thành tích phân kép, và ngược lại;&lt;/li&gt;
    &lt;li&gt;tính diện tích bằng $\tfrac12\oint x\,dy-y\,dx$ và công thức dây giày;&lt;/li&gt;
    &lt;li&gt;áp dụng cho miền có lỗ.&lt;/li&gt;
  &lt;/ul&gt;

&lt;/div&gt;

&lt;h2 id=&quot;vì-sao-cần-bài-này&quot;&gt;Vì sao cần bài này&lt;/h2&gt;

&lt;p&gt;Bài 14_01 cho thấy curl là lưu thông trên một đơn vị diện tích của một ô nhỏ. Cộng tất cả các ô nhỏ trong một miền: lưu thông qua các cạnh chung triệt tiêu (mỗi cạnh được đi hai lần ngược chiều), chỉ còn lại biên ngoài. Đó là định lý Green, phiên bản hai chiều của định lý cơ bản của giải tích.&lt;/p&gt;

&lt;h2 id=&quot;định-lý&quot;&gt;Định lý&lt;/h2&gt;

&lt;p&gt;Đường cong kín $C$ bao miền $D$ có &lt;strong&gt;hướng dương&lt;/strong&gt; nếu khi đi dọc $C$, miền $D$ nằm bên trái (với hình tròn: ngược chiều kim đồng hồ).&lt;/p&gt;

&lt;div class=&quot;textbook-theorem&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Định lý 1 (Green).&lt;/strong&gt; Cho $D$ là miền bị chặn có biên $C$ trơn từng khúc, hướng dương, và $P$, $Q$ có đạo hàm riêng liên tục trên một miền mở chứa $D$. Khi đó&lt;/p&gt;

\[\oint_CP\,dx+Q\,dy=\iint_D(Q_x-P_y)\,dA.\]

&lt;/div&gt;

&lt;div class=&quot;textbook-proof&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Chứng minh (miền vừa loại I vừa loại II).&lt;/strong&gt; Ta chứng minh riêng $\oint_CP\,dx=-\iint_DP_y\,dA$ và $\oint_CQ\,dy=\iint_DQ_x\,dA$.&lt;/p&gt;

  &lt;p&gt;Viết $D=\lbrace a\le x\le b,\ g_1(x)\le y\le g_2(x)\rbrace$. Theo Fubini và định lý cơ bản của giải tích,&lt;/p&gt;

\[\iint_DP_y\,dA=\int_a^b\big[P(x,g_2(x))-P(x,g_1(x))\big]dx.\]

  &lt;p&gt;Biên gồm: cạnh dưới $y=g_1(x)$ đi từ $a$ tới $b$, cho $\int_a^bP(x,g_1(x))\,dx$; cạnh trên đi ngược từ $b$ về $a$, cho $-\int_a^bP(x,g_2(x))\,dx$; hai cạnh đứng (nếu có) có $dx=0$. Cộng lại, $\oint_CP\,dx=-\iint_DP_y\,dA$.&lt;/p&gt;

  &lt;p&gt;Viết $D$ dạng loại II và lập luận tương tự (lần này biên phải đi lên, biên trái đi xuống) được $\oint_CQ\,dy=\iint_DQ_x\,dA$. Cộng hai đẳng thức. Miền tổng quát hơn được cắt thành các miền như vậy; tích phân trên các đường cắt bị đi hai lần ngược chiều nên triệt tiêu.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;reel-video&quot;&gt;
  &lt;video controls=&quot;&quot; playsinline=&quot;&quot; preload=&quot;metadata&quot; src=&quot;/public/videos/reels/green-theorem-cancellation.mp4&quot;&gt;&lt;/video&gt;
  &lt;p class=&quot;reel-caption&quot;&gt;Định lý Green: triệt tiêu cạnh trong. Lưới các vòng nhỏ, cạnh chung của hai ô kề nhau đi ngược chiều nên triệt tiêu, chỉ còn vòng ngoài; lưới bậc thang xấp xỉ hình tròn; đi vòng tròn với bánh xe đo xoáy, công thức diện tích elip, trường gradient cho 0, trường có lỗ và dạng thông lượng (video không lời, khoảng 3 phút 2 giây).&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Ví dụ 1.&lt;/strong&gt; $\oint_Cx^4\,dx+xy\,dy$ với $C$ là tam giác $(0,0)\to(1,0)\to(0,1)\to(0,0)$. $Q_x-P_y=y$, nên tích phân bằng $\int_0^1\int_0^{1-x}y\,dy\,dx=\int_0^1\tfrac{(1-x)^2}2\,dx=\tfrac16$, gọn hơn tính trên ba cạnh.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Ví dụ 2.&lt;/strong&gt; $\oint_C(3y-e^{\sin x})\,dx+(7x+\sqrt{y^4+1})\,dy$ trên đường tròn $x^2+y^2=9$. Tính trực tiếp gần như không được, nhưng $Q_x-P_y=7-3=4$, nên tích phân bằng $4\cdot9\pi=36\pi$.&lt;/p&gt;
&lt;/div&gt;

&lt;h2 id=&quot;diện-tích-bằng-tích-phân-đường&quot;&gt;Diện tích bằng tích phân đường&lt;/h2&gt;

&lt;p&gt;Chọn $P$, $Q$ với $Q_x-P_y=1$, ví dụ $P=-\tfrac y2$, $Q=\tfrac x2$:&lt;/p&gt;

\[\text{Diện tích }D=\frac12\oint_Cx\,dy-y\,dx.\]

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Ví dụ 3.&lt;/strong&gt; Elip $x=a\cos t$, $y=b\sin t$: $x\,y&apos;-y\,x&apos;=ab\cos^2t+ab\sin^2t=ab$, nên diện tích là $\tfrac12\int_0^{2\pi}ab\,dt=\pi ab$, khớp bài 13_03.&lt;/p&gt;
&lt;/div&gt;

&lt;p&gt;&lt;strong&gt;Công thức dây giày.&lt;/strong&gt; Với đa giác đỉnh $(x_1,y_1),\dots,(x_n,y_n)$ theo chiều dương, áp dụng công thức trên từng cạnh thẳng được&lt;/p&gt;

\[\text{Diện tích}=\frac12\sum_{i=1}^n(x_iy_{i+1}-x_{i+1}y_i),\qquad(x_{n+1},y_{n+1})=(x_1,y_1).\]

&lt;p&gt;Hình chữ nhật $(0,0)$, $(4,0)$, $(4,3)$, $(0,3)$: $\tfrac12(0+12+12+0)=12$. Công thức này dùng trong đồ hoạ máy tính và hệ thông tin địa lý (GIS) để tính diện tích thửa đất từ toạ độ đỉnh.&lt;/p&gt;

&lt;h2 id=&quot;miền-có-lỗ&quot;&gt;Miền có lỗ&lt;/h2&gt;

&lt;p&gt;Nếu $D$ có lỗ, biên gồm đường ngoài (ngược chiều kim đồng hồ) và đường trong (cùng chiều kim đồng hồ), sao cho $D$ luôn ở bên trái; định lý vẫn đúng (cắt $D$ thành các miền không có lỗ).&lt;/p&gt;

&lt;p&gt;Với trường $F=\big(\tfrac{-y}{x^2+y^2},\tfrac{x}{x^2+y^2}\big)$ của bài 14_04, $Q_x-P_y=0$ ngoài gốc. Cho $C$ là đường kín bất kỳ bao gốc và $C_\varepsilon$ là đường tròn nhỏ bán kính $\varepsilon$. Áp dụng Green trên miền giữa hai đường: $\oint_CF\cdot dr-\oint_{C_\varepsilon}F\cdot dr=0$, nên $\oint_CF\cdot dr=2\pi$ với &lt;strong&gt;mọi&lt;/strong&gt; đường như vậy. Đây là cơ sở của khái niệm “số vòng quấn” và của định lý thặng dư trong giải tích phức.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Hệ quả.&lt;/strong&gt; Trên miền đơn liên (không có lỗ), nếu $P_y=Q_x$ thì mọi đường kín $C$ bao miền $D$ nằm trong miền đó, nên $\oint_CF\cdot dr=\iint_D0\,dA=0$, và $F$ bảo toàn (bài 14_04, định lý 2). (Với đường kín tự cắt, chia thành các vòng đơn.)&lt;/p&gt;

&lt;h2 id=&quot;ứng-dụng-máy-đo-diện-tích-planimeter&quot;&gt;Ứng dụng: máy đo diện tích (planimeter)&lt;/h2&gt;

&lt;p&gt;Máy đo diện tích cơ học có một bánh xe nhỏ lăn khi người dùng rê đầu bút quanh biên một hình trên bản đồ. Cơ cấu được thiết kế sao cho số vòng quay của bánh xe tỉ lệ với $\oint x\,dy-y\,dx$ (hay một tích phân tương đương), nên theo Green nó cho ngay diện tích, dù hình có biên phức tạp đến đâu.&lt;/p&gt;

&lt;h2 id=&quot;bài-tập&quot;&gt;Bài tập&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Cơ bản.&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;$\oint_Cy^2\,dx+3xy\,dy$ với $C$ là biên hình vuông $[0,1]^2$ theo chiều dương.&lt;/li&gt;
  &lt;li&gt;Dùng $\tfrac12\oint x\,dy-y\,dx$ tính diện tích hình tròn bán kính $r$.&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Đáp án&lt;/summary&gt;

  &lt;ol&gt;
    &lt;li&gt;$Q_x-P_y=3y-2y=y$: $\iint y\,dA=\tfrac12$.&lt;/li&gt;
    &lt;li&gt;$\tfrac12\int_0^{2\pi}r^2\,dt=\pi r^2$.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;p&gt;&lt;strong&gt;Trung bình.&lt;/strong&gt;&lt;/p&gt;

&lt;ol start=&quot;3&quot;&gt;
  &lt;li&gt;$\oint_C\dfrac{-y\,dx+x\,dy}{x^2+y^2}$ trên elip $\tfrac{x^2}4+y^2=1$ theo chiều dương.&lt;/li&gt;
  &lt;li&gt;Diện tích tam giác $(0,0)$, $(3,0)$, $(1,2)$ bằng công thức dây giày.&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Đáp án&lt;/summary&gt;

  &lt;ol start=&quot;3&quot;&gt;
    &lt;li&gt;Elip bao gốc, nên bằng $2\pi$.&lt;/li&gt;
    &lt;li&gt;$\tfrac12\big[(0\cdot0-3\cdot0)+(3\cdot2-1\cdot0)+(1\cdot0-0\cdot2)\big]=3$, khớp đáy $3$ cao $2$.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;p&gt;&lt;strong&gt;Nâng cao.&lt;/strong&gt;&lt;/p&gt;

&lt;ol start=&quot;5&quot;&gt;
  &lt;li&gt;(Dạng thông lượng.) Với pháp tuyến ngoài $n$ của $C$, chứng minh $\oint_CF\cdot n\,ds=\iint_D\operatorname{div}F\,dA$.&lt;/li&gt;
  &lt;li&gt;Chứng minh công thức dây giày từ $\tfrac12\oint x\,dy-y\,dx$ bằng cách tính trên một cạnh thẳng từ $(x_i,y_i)$ tới $(x_{i+1},y_{i+1})$.&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Gợi ý&lt;/summary&gt;

  &lt;ol start=&quot;5&quot;&gt;
    &lt;li&gt;Với $T=(x&apos;,y&apos;)/\lVert r&apos;\rVert$, pháp tuyến ngoài là $n=(y&apos;,-x&apos;)/\lVert r&apos;\rVert$. Khi đó $F\cdot n\,ds=P\,dy-Q\,dx$; áp dụng Green với cặp $(-Q,P)$: $\iint(P_x+Q_y)\,dA$.&lt;/li&gt;
    &lt;li&gt;Trên cạnh $r=(x_i,y_i)+t(\Delta x,\Delta y)$: $x\,y&apos;-y\,x&apos;=x_i\Delta y-y_i\Delta x=x_iy_{i+1}-x_{i+1}y_i$, hằng số theo $t$.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;h2 id=&quot;tóm-tắt&quot;&gt;Tóm tắt&lt;/h2&gt;

&lt;div class=&quot;content-box summary-box textbook-block&quot;&gt;
  &lt;ul&gt;
    &lt;li&gt;Green: $\oint_CP\,dx+Q\,dy=\iint_D(Q_x-P_y)\,dA$, biên hướng dương.&lt;/li&gt;
    &lt;li&gt;Ý nghĩa: tổng các lưu thông nhỏ; cạnh trong triệt tiêu.&lt;/li&gt;
    &lt;li&gt;Diện tích $=\tfrac12\oint x\,dy-y\,dx$; công thức dây giày cho đa giác.&lt;/li&gt;
    &lt;li&gt;Miền có lỗ: thêm biên trong; trường xoáy quanh gốc cho $2\pi$ với mọi vòng bao gốc.&lt;/li&gt;
    &lt;li&gt;Trên miền đơn liên, $P_y=Q_x$ kéo theo bảo toàn.&lt;/li&gt;
  &lt;/ul&gt;
&lt;/div&gt;
</content>
 </entry>
 
 <entry>
   <title>Trường bảo toàn và hàm thế</title>
   <link href="https://calculus-self-learning.pages.dev/contents/vi/chapter14/14_04_Truong_bao_toan_va_ham_the/"/>
   <updated>2026-12-01T00:00:00+00:00</updated>
   <id>https://calculus-self-learning.pages.dev/contents/vi/chapter14/14_04_Truong_bao_toan_va_ham_the</id>
   <content type="html">&lt;div class=&quot;textbook-objectives&quot;&gt;

  &lt;p&gt;&lt;strong&gt;Mục tiêu bài học.&lt;/strong&gt; Sau bài này bạn có thể:&lt;/p&gt;

  &lt;ul&gt;
    &lt;li&gt;dùng định lý cơ bản $\int_C\nabla f\cdot dr=f(B)-f(A)$;&lt;/li&gt;
    &lt;li&gt;chứng minh trường độc lập đường đi thì có hàm thế;&lt;/li&gt;
    &lt;li&gt;kiểm tra $P_y=Q_x$ và tìm hàm thế bằng tích phân từng phần biến;&lt;/li&gt;
    &lt;li&gt;nhận ra vai trò của miền (phản ví dụ trường xoáy quanh gốc).&lt;/li&gt;
  &lt;/ul&gt;

&lt;/div&gt;

&lt;h2 id=&quot;vì-sao-cần-bài-này&quot;&gt;Vì sao cần bài này&lt;/h2&gt;

&lt;p&gt;Ví dụ 3 của bài 14_03 cho thấy công của trọng lực chỉ phụ thuộc điểm đầu và điểm cuối. Trường như vậy gọi là bảo toàn, và nó có “thế năng”. Nhận ra trường bảo toàn giúp tính tích phân đường chỉ bằng một phép trừ, và là cơ sở của định luật bảo toàn năng lượng.&lt;/p&gt;

&lt;h2 id=&quot;định-lý-cơ-bản&quot;&gt;Định lý cơ bản&lt;/h2&gt;

&lt;div class=&quot;textbook-theorem&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Định lý 1.&lt;/strong&gt; Nếu $f$ có đạo hàm riêng liên tục và $C$ là đường trơn từng khúc từ $A$ tới $B$ thì&lt;/p&gt;

\[\int_C\nabla f\cdot dr=f(B)-f(A).\]

&lt;/div&gt;

&lt;div class=&quot;textbook-proof&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Chứng minh.&lt;/strong&gt; Theo quy tắc chuỗi, $\tfrac{d}{dt}f(r(t))=\nabla f(r(t))\cdot r&apos;(t)$. Vậy $\int_a^b\nabla f(r(t))\cdot r&apos;(t)\,dt=f(r(b))-f(r(a))$ theo định lý cơ bản của giải tích. Với đường trơn từng khúc, cộng các khúc thì các giá trị trung gian triệt tiêu.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-definition&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Định nghĩa.&lt;/strong&gt; Trường $F$ trên miền mở liên thông $D$ là &lt;strong&gt;bảo toàn&lt;/strong&gt; nếu $F=\nabla f$ với một hàm $f$ nào đó, gọi là &lt;strong&gt;hàm thế&lt;/strong&gt; (trong vật lý thế năng thường là $-f$).&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-theorem&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Định lý 2.&lt;/strong&gt; Với $F$ liên tục trên miền mở liên thông $D$, ba điều sau tương đương:&lt;/p&gt;

  &lt;ol&gt;
    &lt;li&gt;$F$ bảo toàn;&lt;/li&gt;
    &lt;li&gt;$\int_CF\cdot dr$ chỉ phụ thuộc điểm đầu và điểm cuối của $C$;&lt;/li&gt;
    &lt;li&gt;$\oint_CF\cdot dr=0$ với mọi đường kín $C$ trong $D$.&lt;/li&gt;
  &lt;/ol&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-proof&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Chứng minh.&lt;/strong&gt; (1)⇒(2) là định lý 1. (2)⇔(3): một đường kín là hai đường $C_1$ từ $A$ tới $B$ và $-C_2$ quay về; $\oint=\int_{C_1}-\int_{C_2}$, bằng 0 khi và chỉ khi hai tích phân bằng nhau.&lt;/p&gt;

  &lt;p&gt;(2)⇒(1): cố định $A\in D$ và đặt $f(X)=\int_A^XF\cdot dr$ theo đường bất kỳ trong $D$ (định nghĩa tốt nhờ (2)). Với $X=(x,y)$ và $h$ nhỏ, đi tới $X$ rồi theo đoạn ngang tới $(x+h,y)$ (nằm trong $D$ vì $D$ mở):&lt;/p&gt;

\[\frac{f(x+h,y)-f(x,y)}h=\frac1h\int_0^hP(x+s,y)\,ds\to P(x,y),\]

  &lt;p&gt;theo định lý cơ bản của giải tích và tính liên tục của $P$. Vậy $f_x=P$; tương tự với đoạn dọc, $f_y=Q$.&lt;/p&gt;
&lt;/div&gt;

&lt;h2 id=&quot;phép-thử-curl&quot;&gt;Phép thử curl&lt;/h2&gt;

&lt;p&gt;Nếu $F=(P,Q)=\nabla f$ với $f$ có đạo hàm riêng cấp hai liên tục, thì theo định lý Schwarz $P_y=f_{xy}=f_{yx}=Q_x$. Trong không gian, điều kiện là $\operatorname{curl}F=0$ (bài 14_01). Điều kiện này &lt;strong&gt;cần&lt;/strong&gt;, nhưng &lt;strong&gt;chỉ đủ khi miền không có lỗ&lt;/strong&gt; (đơn liên); bài 14_05 chứng minh điều đó bằng định lý Green.&lt;/p&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Ví dụ 1.&lt;/strong&gt; $F=(2xy+1,\ x^2+3y^2)$. $P_y=2x=Q_x$. Tích phân $P$ theo $x$: $f=x^2y+x+g(y)$; so $f_y=x^2+g&apos;(y)$ với $Q$: $g&apos;=3y^2$, $g=y^3$. Vậy $f=x^2y+x+y^3$ và mọi tích phân từ $(0,0)$ tới $(1,2)$ bằng $f(1,2)-f(0,0)=2+1+8=11$.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Ví dụ 2 (Phản ví dụ).&lt;/strong&gt; $F=\Big(\dfrac{-y}{x^2+y^2},\dfrac{x}{x^2+y^2}\Big)$ trên mặt phẳng bỏ gốc. Tính trực tiếp: $Q_x=P_y=\dfrac{y^2-x^2}{(x^2+y^2)^2}$. Nhưng trên đường tròn đơn vị $F=(-\sin t,\cos t)$ và $F\cdot r&apos;=1$, nên $\oint F\cdot dr=2\pi\ne0$: $F$ không bảo toàn. Ở địa phương $F=\nabla\theta$ (góc cực), nhưng $\theta$ tăng thêm $2\pi$ mỗi vòng quanh gốc nên không phải hàm đơn trị trên cả miền. Lỗ ở gốc là thủ phạm.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Ví dụ 3 (Vận tốc thoát).&lt;/strong&gt; Lực hấp dẫn $F=-GMm\,\dfrac{r}{\lVert r\rVert^3}=\nabla\Big(\dfrac{GMm}{\lVert r\rVert}\Big)$. Công từ mặt đất ($\lVert r\rVert=R$) ra vô cùng là $0-\dfrac{GMm}R$. Muốn thoát, động năng ban đầu phải bù được: $\tfrac12mv^2=\dfrac{GMm}R$, $v=\sqrt{2GM/R}$. Với $GM=3.986\times10^{14}\,\text{m}^3/\text{s}^2$ và $R=6.371\times10^6$ m: $v\approx11.2$ km/s.&lt;/p&gt;
&lt;/div&gt;

&lt;h2 id=&quot;ứng-dụng-bảo-toàn-năng-lượng&quot;&gt;Ứng dụng: bảo toàn năng lượng&lt;/h2&gt;

&lt;p&gt;Nếu $F=-\nabla V$ và $m\ddot r=F$ thì $\tfrac{d}{dt}\big(\tfrac12m\lVert\dot r\rVert^2+V(r)\big)=m\dot r\cdot\ddot r+\nabla V\cdot\dot r=\dot r\cdot(F-F)=0$: động năng cộng thế năng không đổi. Trong học máy, trường $-\nabla L$ của gradient descent liên tục (gradient flow) là bảo toàn; $L$ giảm ngặt dọc đường đi ($\tfrac{d}{dt}L=-\lVert\nabla L\rVert^2$), nên quỹ đạo không thể quay vòng.&lt;/p&gt;

&lt;h2 id=&quot;bài-tập&quot;&gt;Bài tập&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Cơ bản.&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;$F=(3x^2y,\ x^3+2y)$ có bảo toàn không? Nếu có, tìm hàm thế.&lt;/li&gt;
  &lt;li&gt;Tính $\int_C e^x\cos y\,dx-e^x\sin y\,dy$ từ $(0,0)$ tới $(1,\pi)$.&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Đáp án&lt;/summary&gt;

  &lt;ol&gt;
    &lt;li&gt;$P_y=3x^2=Q_x$; $f=x^3y+y^2$.&lt;/li&gt;
    &lt;li&gt;$f=e^x\cos y$: $e\cdot(-1)-1=-e-1$.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;p&gt;&lt;strong&gt;Trung bình.&lt;/strong&gt;&lt;/p&gt;

&lt;ol start=&quot;3&quot;&gt;
  &lt;li&gt;$F=(yz,\ xz,\ xy+2z)$. Tìm hàm thế và tính công từ $(0,0,0)$ tới $(1,1,2)$.&lt;/li&gt;
  &lt;li&gt;$F=(y,-x)$ có bảo toàn không? Kiểm tra bằng hai cách.&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Đáp án&lt;/summary&gt;

  &lt;ol start=&quot;3&quot;&gt;
    &lt;li&gt;$f=xyz+z^2$; công $=2+4=6$.&lt;/li&gt;
    &lt;li&gt;Không: $P_y=1\ne Q_x=-1$; và $\oint$ trên đường tròn đơn vị bằng $-2\pi$ (bài 14_03, bài tập 3).&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;p&gt;&lt;strong&gt;Nâng cao.&lt;/strong&gt;&lt;/p&gt;

&lt;ol start=&quot;5&quot;&gt;
  &lt;li&gt;Trên nửa mặt phẳng $x&amp;gt;0$, chứng minh trường của ví dụ 2 bảo toàn và tìm hàm thế.&lt;/li&gt;
  &lt;li&gt;Chứng minh trực tiếp (không dùng Green): nếu $P_y=Q_x$ trên cả mặt phẳng thì $f(x,y)=\int_0^xP(s,0)\,ds+\int_0^yQ(x,t)\,dt$ là hàm thế.&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Gợi ý&lt;/summary&gt;

  &lt;ol start=&quot;5&quot;&gt;
    &lt;li&gt;$f=\arctan(y/x)$: $f_x=\tfrac{-y}{x^2+y^2}$, $f_y=\tfrac{x}{x^2+y^2}$.&lt;/li&gt;
    &lt;li&gt;$f_y=Q$ ngay. $f_x=P(x,0)+\int_0^yQ_x(x,t)\,dt=P(x,0)+\int_0^yP_y(x,t)\,dt=P(x,y)$ (đạo hàm dưới dấu tích phân, cần $Q_x$ liên tục).&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;h2 id=&quot;tóm-tắt&quot;&gt;Tóm tắt&lt;/h2&gt;

&lt;div class=&quot;content-box summary-box textbook-block&quot;&gt;
  &lt;ul&gt;
    &lt;li&gt;$\int_C\nabla f\cdot dr=f(B)-f(A)$.&lt;/li&gt;
    &lt;li&gt;Bảo toàn ⇔ độc lập đường đi ⇔ tích phân trên mọi vòng kín bằng 0.&lt;/li&gt;
    &lt;li&gt;Điều kiện cần $P_y=Q_x$ ($\operatorname{curl}F=0$), đủ trên miền không có lỗ.&lt;/li&gt;
    &lt;li&gt;Tìm hàm thế: tích phân $P$ theo $x$, rồi chỉnh hàm của $y$.&lt;/li&gt;
  &lt;/ul&gt;
&lt;/div&gt;
</content>
 </entry>
 
 <entry>
   <title>Tích phân đường loại hai</title>
   <link href="https://calculus-self-learning.pages.dev/contents/vi/chapter14/14_03_Tich_phan_duong_loai_hai/"/>
   <updated>2026-12-01T00:00:00+00:00</updated>
   <id>https://calculus-self-learning.pages.dev/contents/vi/chapter14/14_03_Tich_phan_duong_loai_hai</id>
   <content type="html">&lt;div class=&quot;textbook-objectives&quot;&gt;

  &lt;p&gt;&lt;strong&gt;Mục tiêu bài học.&lt;/strong&gt; Sau bài này bạn có thể:&lt;/p&gt;

  &lt;ul&gt;
    &lt;li&gt;tính công $\int_CF\cdot dr$ của trường lực dọc một đường cong có hướng;&lt;/li&gt;
    &lt;li&gt;viết tích phân dưới dạng $\int_CP\,dx+Q\,dy$ và liên hệ với tích phân loại một;&lt;/li&gt;
    &lt;li&gt;chứng minh đổi chiều đường đi thì tích phân đổi dấu;&lt;/li&gt;
    &lt;li&gt;nhận ra khi tích phân phụ thuộc đường đi.&lt;/li&gt;
  &lt;/ul&gt;

&lt;/div&gt;

&lt;h2 id=&quot;vì-sao-cần-bài-này&quot;&gt;Vì sao cần bài này&lt;/h2&gt;

&lt;p&gt;Ở vật lý phổ thông, công là lực nhân quãng đường. Khi lực thay đổi theo vị trí và đường đi cong, ta cộng các phần công nhỏ $F\cdot\Delta r$. Khác tích phân loại một, ở đây &lt;strong&gt;chiều đi&lt;/strong&gt; quan trọng: đi xuôi gió và ngược gió cho công trái dấu.&lt;/p&gt;

&lt;h2 id=&quot;định-nghĩa&quot;&gt;Định nghĩa&lt;/h2&gt;

&lt;div class=&quot;textbook-definition&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Định nghĩa.&lt;/strong&gt; Cho đường cong có hướng $C$ với tham số hoá $r:[a,b]\to\mathbb R^n$ (đi từ $r(a)$ tới $r(b)$) và trường liên tục $F$. &lt;strong&gt;Tích phân đường loại hai&lt;/strong&gt; là&lt;/p&gt;

\[\int_CF\cdot dr=\int_a^bF(r(t))\cdot r&apos;(t)\,dt.\]

  &lt;p&gt;Trong mặt phẳng, với $F=(P,Q)$, $r=(x(t),y(t))$, ta viết $\int_CP\,dx+Q\,dy=\int_a^b\big(P\,x&apos;(t)+Q\,y&apos;(t)\big)dt$.&lt;/p&gt;
&lt;/div&gt;

&lt;p&gt;Với $T=r&apos;/\lVert r&apos;\rVert$ là vectơ tiếp tuyến đơn vị, $F\cdot r&apos;\,dt=(F\cdot T)\lVert r&apos;\rVert\,dt$, nên $\int_CF\cdot dr=\int_C(F\cdot T)\,ds$: tích phân loại một của thành phần tiếp tuyến của lực.&lt;/p&gt;

&lt;div class=&quot;textbook-theorem&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Định lý 1.&lt;/strong&gt; Gọi $-C$ là $C$ đi theo chiều ngược lại. Khi đó $\int_{-C}F\cdot dr=-\int_CF\cdot dr$. Đổi tham số hoá cùng chiều thì giá trị không đổi.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-proof&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Chứng minh.&lt;/strong&gt; Tham số hoá $-C$ bằng $\tilde r(u)=r(a+b-u)$, $u\in[a,b]$, nên $\tilde r&apos;(u)=-r&apos;(a+b-u)$. Đổi biến $t=a+b-u$:&lt;/p&gt;

\[\int_a^bF(\tilde r(u))\cdot\tilde r&apos;(u)\,du=-\int_a^bF(r(a+b-u))\cdot r&apos;(a+b-u)\,du=-\int_a^bF(r(t))\cdot r&apos;(t)\,dt.\]

  &lt;p&gt;Với đổi tham số $t=\varphi(u)$, $\varphi&apos;&amp;gt;0$, phép đổi biến như bài 14_02 nhưng không có trị tuyệt đối cho cùng giá trị.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;interactive-frame&quot;&gt;
  &lt;div class=&quot;interactive-frame-head&quot;&gt;
    &lt;div class=&quot;interactive-frame-title&quot;&gt;Công dọc đường đi&lt;/div&gt;
    &lt;div class=&quot;interactive-frame-desc&quot;&gt;Uốn đường đi giữa A và B; so trường bảo toàn với không bảo toàn.&lt;/div&gt;
  &lt;/div&gt;
  &lt;iframe src=&quot;/interactives/chapter14/line-integral-work.html&quot; title=&quot;Công dọc đường đi&quot; loading=&quot;lazy&quot; style=&quot;height: 720px;&quot;&gt;&lt;/iframe&gt;
  &lt;div class=&quot;interactive-frame-foot&quot;&gt;
    &lt;a href=&quot;/interactives/chapter14/line-integral-work.html&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;Mở minh hoạ ở cửa sổ riêng&lt;/a&gt;
  &lt;/div&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Ví dụ 1 (Lưu thông).&lt;/strong&gt; $F=(-y,x)$ dọc đường tròn đơn vị ngược chiều kim đồng hồ, $r=(\cos t,\sin t)$: $F\cdot r&apos;=\sin^2t+\cos^2t=1$, nên $\oint_CF\cdot dr=2\pi$. Lực luôn cùng hướng chuyển động, công dương trên cả vòng kín.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Ví dụ 2 (Phụ thuộc đường đi).&lt;/strong&gt; $F=(x^2,xy)$ từ $(0,0)$ tới $(1,1)$.&lt;/p&gt;

  &lt;ul&gt;
    &lt;li&gt;Đoạn thẳng $r=(t,t)$: $\int_0^1(t^2+t^2)\,dt=\tfrac23$.&lt;/li&gt;
    &lt;li&gt;Parabol $r=(t,t^2)$, $r&apos;=(1,2t)$: $\int_0^1(t^2+t\cdot t^2\cdot2t)\,dt=\tfrac13+\tfrac25=\tfrac{11}{15}$.&lt;/li&gt;
  &lt;/ul&gt;

  &lt;p&gt;Hai đường cùng điểm đầu, điểm cuối mà công khác nhau. Bài 14_04 cho biết khi nào điều này không xảy ra.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Ví dụ 3 (Trọng lực).&lt;/strong&gt; $F=(0,0,-mg)$. Với mọi đường $r(t)$ từ độ cao $h_1$ tới $h_2$: $F\cdot r&apos;=-mg\,z&apos;(t)$, nên công là $-mg(h_2-h_1)$, chỉ phụ thuộc độ cao đầu cuối. Ví dụ đi xuống theo đường xoắn ốc hay rơi thẳng cho cùng công.&lt;/p&gt;
&lt;/div&gt;

&lt;h2 id=&quot;ứng-dụng&quot;&gt;Ứng dụng&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Lực không bảo toàn.&lt;/strong&gt; Lực ma sát luôn ngược chiều vận tốc, độ lớn $\mu N$: $F\cdot T=-\mu N$, nên công là $-\mu N\cdot(\text{độ dài đường đi})$. Đường dài hơn tốn công hơn, và công trên vòng kín khác 0.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Lưu thông của dòng chảy.&lt;/strong&gt; Với trường vận tốc $v$, $\oint_Cv\cdot dr$ là lưu thông quanh $C$. Lưu thông khác 0 quanh cánh máy bay là nguồn gốc lực nâng (định lý Kutta–Joukowski).&lt;/p&gt;

&lt;h2 id=&quot;bài-tập&quot;&gt;Bài tập&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Cơ bản.&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;$\int_Cy\,dx+x\,dy$ với $C$ là đoạn từ $(0,0)$ tới $(1,2)$.&lt;/li&gt;
  &lt;li&gt;$\oint_CF\cdot dr$ với $F=(x,y)$ trên đường tròn đơn vị.&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Đáp án&lt;/summary&gt;

  &lt;ol&gt;
    &lt;li&gt;$r=(t,2t)$: $\int_0^1(2t+2t)\,dt=2$.&lt;/li&gt;
    &lt;li&gt;$F\cdot r&apos;=-\cos t\sin t+\sin t\cos t=0$: bằng 0. Lực hướng tâm vuông góc với chuyển động.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;p&gt;&lt;strong&gt;Trung bình.&lt;/strong&gt;&lt;/p&gt;

&lt;ol start=&quot;3&quot;&gt;
  &lt;li&gt;$\oint_C(y\,dx-x\,dy)$ trên đường tròn đơn vị ngược chiều kim đồng hồ.&lt;/li&gt;
  &lt;li&gt;$\int_Cy^2\,dx+x\,dy$ dọc $y=x^2$ từ $(0,0)$ tới $(1,1)$.&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Đáp án&lt;/summary&gt;

  &lt;ol start=&quot;3&quot;&gt;
    &lt;li&gt;$-\sin^2t-\cos^2t=-1$: tổng $-2\pi$.&lt;/li&gt;
    &lt;li&gt;$r=(t,t^2)$: $\int_0^1(t^4+2t^2)\,dt=\tfrac15+\tfrac23=\tfrac{13}{15}$.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;p&gt;&lt;strong&gt;Nâng cao.&lt;/strong&gt;&lt;/p&gt;

&lt;ol start=&quot;5&quot;&gt;
  &lt;li&gt;Lực đàn hồi $F=-k\,r$. Chứng minh công từ $A$ tới $B$ dọc mọi đường là $-\tfrac k2\big(\lVert B\rVert^2-\lVert A\rVert^2\big)$.&lt;/li&gt;
  &lt;li&gt;Chứng minh $\big\lvert\int_CF\cdot dr\big\rvert\le M\cdot L$, với $M=\max_C\lVert F\rVert$ và $L$ là độ dài $C$.&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Gợi ý&lt;/summary&gt;

  &lt;ol start=&quot;5&quot;&gt;
    &lt;li&gt;$F\cdot r&apos;=-k\,r\cdot r&apos;=-\tfrac k2\tfrac{d}{dt}\lVert r\rVert^2$; tích phân.&lt;/li&gt;
    &lt;li&gt;$\lvert F\cdot T\rvert\le\lVert F\rVert\le M$, nên $\lvert\int(F\cdot T)\,ds\rvert\le\int M\,ds=ML$.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;h2 id=&quot;tóm-tắt&quot;&gt;Tóm tắt&lt;/h2&gt;

&lt;div class=&quot;content-box summary-box textbook-block&quot;&gt;
  &lt;ul&gt;
    &lt;li&gt;$\int_CF\cdot dr=\int_a^bF(r(t))\cdot r&apos;(t)\,dt=\int_CP\,dx+Q\,dy=\int_C(F\cdot T)\,ds$.&lt;/li&gt;
    &lt;li&gt;Đổi chiều thì đổi dấu; đổi tham số cùng chiều thì không đổi.&lt;/li&gt;
    &lt;li&gt;Nói chung tích phân phụ thuộc đường đi; trọng lực và lực đàn hồi là ngoại lệ.&lt;/li&gt;
    &lt;li&gt;Lưu thông $\oint v\cdot dr$ đo độ xoáy của dòng chảy dọc một vòng.&lt;/li&gt;
  &lt;/ul&gt;
&lt;/div&gt;
</content>
 </entry>
 
 <entry>
   <title>Tích phân đường loại một</title>
   <link href="https://calculus-self-learning.pages.dev/contents/vi/chapter14/14_02_Tich_phan_duong_loai_mot/"/>
   <updated>2026-12-01T00:00:00+00:00</updated>
   <id>https://calculus-self-learning.pages.dev/contents/vi/chapter14/14_02_Tich_phan_duong_loai_mot</id>
   <content type="html">&lt;div class=&quot;textbook-objectives&quot;&gt;

  &lt;p&gt;&lt;strong&gt;Mục tiêu bài học.&lt;/strong&gt; Sau bài này bạn có thể:&lt;/p&gt;

  &lt;ul&gt;
    &lt;li&gt;tính $\int_Cf\,ds$ bằng một tham số hoá $r(t)$ của đường cong;&lt;/li&gt;
    &lt;li&gt;chứng minh kết quả không phụ thuộc tham số hoá;&lt;/li&gt;
    &lt;li&gt;tính khối lượng và trọng tâm của một dây kim loại.&lt;/li&gt;
  &lt;/ul&gt;

&lt;/div&gt;

&lt;h2 id=&quot;vì-sao-cần-bài-này&quot;&gt;Vì sao cần bài này&lt;/h2&gt;

&lt;p&gt;Một sợi dây cong có mật độ thay đổi: khối lượng của nó là bao nhiêu? Ta cần cộng mật độ dọc theo đường cong, với “phần tử độ dài” $ds$ thay cho $dx$. Tích phân đường loại một là phiên bản dọc đường cong của tích phân thường.&lt;/p&gt;

&lt;h2 id=&quot;định-nghĩa&quot;&gt;Định nghĩa&lt;/h2&gt;

&lt;div class=&quot;textbook-definition&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Định nghĩa.&lt;/strong&gt; Cho đường cong trơn $C$ với tham số hoá $r:[a,b]\to\mathbb R^n$, $r&apos;(t)\ne0$, và $f$ liên tục trên $C$. &lt;strong&gt;Tích phân đường loại một&lt;/strong&gt; (theo độ dài cung) là&lt;/p&gt;

\[\int_Cf\,ds=\int_a^bf(r(t))\,\lVert r&apos;(t)\rVert\,dt.\]

&lt;/div&gt;

&lt;p&gt;Đó là giới hạn của tổng $\sum f(r(t_i^*))\,\Delta s_i$, với $\Delta s_i\approx\lVert r&apos;(t_i)\rVert\Delta t$ là độ dài một đoạn cung nhỏ (bài 06_02 và 09_03). Với $f=1$ ta được độ dài của $C$.&lt;/p&gt;

&lt;div class=&quot;textbook-theorem&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Định lý 1.&lt;/strong&gt; $\int_Cf\,ds$ không phụ thuộc tham số hoá: nếu $t=\varphi(u)$ với $\varphi:[\alpha,\beta]\to[a,b]$ khả vi liên tục, song ánh, $\varphi&apos;\ne0$, và $\tilde r(u)=r(\varphi(u))$, thì hai công thức cho cùng giá trị (kể cả khi $\varphi$ đảo chiều).&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-proof&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Chứng minh.&lt;/strong&gt; $\tilde r&apos;(u)=r&apos;(\varphi(u))\varphi&apos;(u)$, nên $\lVert\tilde r&apos;(u)\rVert=\lVert r&apos;(\varphi(u))\rVert\,\lvert\varphi&apos;(u)\rvert$. Nếu $\varphi&apos;&amp;gt;0$, đổi biến $t=\varphi(u)$:&lt;/p&gt;

\[\int_\alpha^\beta f(\tilde r(u))\lVert\tilde r&apos;(u)\rVert\,du=\int_\alpha^\beta f(r(\varphi(u)))\lVert r&apos;(\varphi(u))\rVert\varphi&apos;(u)\,du=\int_a^bf(r(t))\lVert r&apos;(t)\rVert\,dt.\]

  &lt;p&gt;Nếu $\varphi&apos;&amp;lt;0$ thì $\varphi(\alpha)=b$, $\varphi(\beta)=a$; dấu trừ của $\lvert\varphi&apos;\rvert=-\varphi&apos;$ bù cho việc đảo cận, kết quả như cũ.&lt;/p&gt;
&lt;/div&gt;

&lt;p&gt;Như vậy tích phân loại một &lt;strong&gt;không phụ thuộc chiều đi&lt;/strong&gt;: khối lượng của dây không đổi dù ta đo từ đầu nào.&lt;/p&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Ví dụ 1.&lt;/strong&gt; $\int_C(x^2+y^2)\,ds$ với $C$ là đường tròn bán kính 2. Trên $C$, $f=4$ và độ dài là $4\pi$, nên tích phân bằng $16\pi$. (Tham số hoá $r=(2\cos t,2\sin t)$, $\lVert r&apos;\rVert=2$: $\int_0^{2\pi}4\cdot2\,dt=16\pi$.)&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Ví dụ 2.&lt;/strong&gt; $\int_Cx\,ds$ với $C$ là parabol $y=x^2$, $0\le x\le1$. Tham số $r=(t,t^2)$, $\lVert r&apos;\rVert=\sqrt{1+4t^2}$:&lt;/p&gt;

\[\int_0^1t\sqrt{1+4t^2}\,dt=\frac1{12}\big(5^{3/2}-1\big)\approx0.848.\]

&lt;/div&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Ví dụ 3 (Đường xoắn ốc).&lt;/strong&gt; $r=(\cos t,\sin t,t)$, $0\le t\le2\pi$: $\lVert r&apos;\rVert=\sqrt2$. Độ dài $2\sqrt2\pi$, và $\int_Cz\,ds=\sqrt2\int_0^{2\pi}t\,dt=2\sqrt2\pi^2\approx27.9$.&lt;/p&gt;
&lt;/div&gt;

&lt;h2 id=&quot;ứng-dụng-dây-kim-loại&quot;&gt;Ứng dụng: dây kim loại&lt;/h2&gt;

&lt;p&gt;Dây có mật độ (khối lượng trên độ dài) $\rho$ có khối lượng $m=\int_C\rho\,ds$ và trọng tâm $\bar x=\tfrac1m\int_Cx\rho\,ds$ (tương tự cho $\bar y$, $\bar z$).&lt;/p&gt;

&lt;p&gt;Dây nửa đường tròn bán kính $R$, đồng chất, $r=(R\cos\theta,R\sin\theta)$, $0\le\theta\le\pi$: $m=\pi R\rho$, và&lt;/p&gt;

\[\bar y=\frac{1}{\pi R}\int_0^\pi R\sin\theta\cdot R\,d\theta=\frac{2R}\pi.\]

&lt;p&gt;So với nửa đĩa đặc (bài 13_06, $\bar y=\tfrac{4R}{3\pi}\approx0.42R$), trọng tâm của dây cao hơn ($\approx0.64R$) vì toàn bộ khối lượng ở mép.&lt;/p&gt;

&lt;h2 id=&quot;bài-tập&quot;&gt;Bài tập&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Cơ bản.&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;$\int_C(x+y)\,ds$ với $C$ là đoạn thẳng từ $(0,0)$ tới $(1,1)$.&lt;/li&gt;
  &lt;li&gt;$\int_Cxy\,ds$ với $C$ là đoạn từ $(0,0)$ tới $(2,1)$.&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Đáp án&lt;/summary&gt;

  &lt;ol&gt;
    &lt;li&gt;$r=(t,t)$, $\lVert r&apos;\rVert=\sqrt2$: $\int_0^12t\sqrt2\,dt=\sqrt2$.&lt;/li&gt;
    &lt;li&gt;$r=(2t,t)$, $\lVert r&apos;\rVert=\sqrt5$: $\int_0^12t^2\sqrt5\,dt=\tfrac{2\sqrt5}3$.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;p&gt;&lt;strong&gt;Trung bình.&lt;/strong&gt;&lt;/p&gt;

&lt;ol start=&quot;3&quot;&gt;
  &lt;li&gt;Khối lượng của dây phần tư đường tròn đơn vị trong góc phần tư thứ nhất, mật độ $\rho=xy$.&lt;/li&gt;
  &lt;li&gt;Tính độ dài của đường $r=(t^2,\tfrac23t^3)$, $0\le t\le1$.&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Đáp án&lt;/summary&gt;

  &lt;ol start=&quot;3&quot;&gt;
    &lt;li&gt;$\int_0^{\pi/2}\cos\theta\sin\theta\,d\theta=\tfrac12$.&lt;/li&gt;
    &lt;li&gt;$\lVert r&apos;\rVert=\sqrt{4t^2+4t^4}=2t\sqrt{1+t^2}$; $\int_0^12t\sqrt{1+t^2}\,dt=\tfrac23(2\sqrt2-1)\approx1.219$.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;p&gt;&lt;strong&gt;Nâng cao.&lt;/strong&gt;&lt;/p&gt;

&lt;ol start=&quot;5&quot;&gt;
  &lt;li&gt;Chứng minh: nếu $C$ được tham số hoá theo độ dài cung ($\lVert r&apos;(s)\rVert=1$) thì $\int_Cf\,ds=\int_0^Lf(r(s))\,ds$. Vì sao đây là cách tham số hoá “tự nhiên”?&lt;/li&gt;
  &lt;li&gt;Tìm trọng tâm của dây xoắn ốc ở ví dụ 3 (mật độ đều).&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Gợi ý&lt;/summary&gt;

  &lt;ol start=&quot;5&quot;&gt;
    &lt;li&gt;Thay $\lVert r&apos;\rVert=1$ vào định nghĩa. Tham số là chính quãng đường đã đi, không phụ thuộc tốc độ đi.&lt;/li&gt;
    &lt;li&gt;$m\propto2\sqrt2\pi$; $\int\cos t\,dt=\int\sin t\,dt=0$ trên $[0,2\pi]$, nên $\bar x=\bar y=0$; $\bar z=\tfrac{2\sqrt2\pi^2}{2\sqrt2\pi}=\pi$.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;h2 id=&quot;tóm-tắt&quot;&gt;Tóm tắt&lt;/h2&gt;

&lt;div class=&quot;content-box summary-box textbook-block&quot;&gt;
  &lt;ul&gt;
    &lt;li&gt;$\int_Cf\,ds=\int_a^bf(r(t))\lVert r&apos;(t)\rVert\,dt$.&lt;/li&gt;
    &lt;li&gt;Không phụ thuộc tham số hoá và chiều đi.&lt;/li&gt;
    &lt;li&gt;$f=1$ cho độ dài; $f=\rho$ cho khối lượng; $x\rho$ cho trọng tâm.&lt;/li&gt;
    &lt;li&gt;Dây nửa đường tròn có $\bar y=\tfrac{2R}\pi$.&lt;/li&gt;
  &lt;/ul&gt;
&lt;/div&gt;
</content>
 </entry>
 
 <entry>
   <title>Trường vectơ, divergence và curl</title>
   <link href="https://calculus-self-learning.pages.dev/contents/vi/chapter14/14_01_Truong_vecto_divergence_va_curl/"/>
   <updated>2026-12-01T00:00:00+00:00</updated>
   <id>https://calculus-self-learning.pages.dev/contents/vi/chapter14/14_01_Truong_vecto_divergence_va_curl</id>
   <content type="html">&lt;div class=&quot;textbook-objectives&quot;&gt;

  &lt;p&gt;&lt;strong&gt;Mục tiêu bài học.&lt;/strong&gt; Sau bài này bạn có thể:&lt;/p&gt;

  &lt;ul&gt;
    &lt;li&gt;đọc hình ảnh một trường vectơ và vẽ vài mũi tên của nó;&lt;/li&gt;
    &lt;li&gt;tính $\operatorname{div}F$ và $\operatorname{curl}F$;&lt;/li&gt;
    &lt;li&gt;giải thích div là “nguồn” và curl là “xoáy” bằng thông lượng và lưu thông qua một ô nhỏ;&lt;/li&gt;
    &lt;li&gt;chứng minh $\operatorname{curl}\nabla f=0$ và $\operatorname{div}\operatorname{curl}F=0$.&lt;/li&gt;
  &lt;/ul&gt;

&lt;/div&gt;

&lt;h2 id=&quot;vì-sao-cần-bài-này&quot;&gt;Vì sao cần bài này&lt;/h2&gt;

&lt;p&gt;Gió, dòng nước, lực hấp dẫn, điện trường: mỗi điểm trong không gian gắn với một vectơ. Muốn biết chất lỏng đang phun ra hay hút vào ở một điểm, hay một bánh xe nhỏ đặt vào dòng chảy có quay không, ta cần hai phép toán: divergence và curl. Chúng là nền của các định lý Green, Stokes, Gauss (chương 15).&lt;/p&gt;

&lt;h2 id=&quot;định-nghĩa&quot;&gt;Định nghĩa&lt;/h2&gt;

&lt;div class=&quot;textbook-definition&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Định nghĩa.&lt;/strong&gt; Một &lt;strong&gt;trường vectơ&lt;/strong&gt; trên miền $D\subset\mathbb R^3$ là hàm $F=(P,Q,R):D\to\mathbb R^3$. Với các đạo hàm riêng tồn tại,&lt;/p&gt;

\[\operatorname{div}F=\nabla\cdot F=P_x+Q_y+R_z,\qquad\operatorname{curl}F=\nabla\times F=(R_y-Q_z,\ P_z-R_x,\ Q_x-P_y).\]

  &lt;p&gt;Trong mặt phẳng, $F=(P,Q)$ có $\operatorname{div}F=P_x+Q_y$ và &lt;strong&gt;curl vô hướng&lt;/strong&gt; $Q_x-P_y$ (thành phần $z$ của curl).&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;reel-video&quot;&gt;
  &lt;video controls=&quot;&quot; playsinline=&quot;&quot; preload=&quot;metadata&quot; src=&quot;/public/videos/reels/field-flow-div-curl.mp4&quot;&gt;&lt;/video&gt;
  &lt;p class=&quot;reel-caption&quot;&gt;Hạt trôi trong ba trường vectơ (xoáy, nguồn, trượt); bánh xe nhỏ đo curl, vòng chất lỏng đo div (video không lời, khoảng 2 phút).&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;interactive-frame&quot;&gt;
  &lt;div class=&quot;interactive-frame-head&quot;&gt;
    &lt;div class=&quot;interactive-frame-title&quot;&gt;Trường vectơ, divergence và curl&lt;/div&gt;
    &lt;div class=&quot;interactive-frame-desc&quot;&gt;Thả hạt để xem đường dòng; kéo vòng tròn nhỏ để đo div và curl.&lt;/div&gt;
  &lt;/div&gt;
  &lt;iframe src=&quot;/interactives/chapter14/vector-field.html&quot; title=&quot;Trường vectơ, divergence và curl&quot; loading=&quot;lazy&quot; style=&quot;height: 720px;&quot;&gt;&lt;/iframe&gt;
  &lt;div class=&quot;interactive-frame-foot&quot;&gt;
    &lt;a href=&quot;/interactives/chapter14/vector-field.html&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;Mở minh hoạ ở cửa sổ riêng&lt;/a&gt;
  &lt;/div&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Ví dụ 1.&lt;/strong&gt; $F=(x,y)$: mũi tên chỉ ra xa gốc, dài dần. $\operatorname{div}F=2$, curl $=0$: một nguồn đều, không xoáy.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Ví dụ 2.&lt;/strong&gt; $F=(-y,x)$: mũi tên vòng quanh gốc ngược chiều kim đồng hồ. $\operatorname{div}F=0$, curl $=1-(-1)=2$. Đây là vận tốc của vật rắn quay với tốc độ góc $\omega=1$, và curl bằng $2\omega$.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Ví dụ 3.&lt;/strong&gt; $F=(xy,yz,zx)$: $\operatorname{div}F=y+z+x$ và $\operatorname{curl}F=(0-y,\ 0-z,\ 0-x)=(-y,-z,-x)$.&lt;/p&gt;
&lt;/div&gt;

&lt;h2 id=&quot;ý-nghĩa-thông-lượng-và-lưu-thông-qua-một-ô-nhỏ&quot;&gt;Ý nghĩa: thông lượng và lưu thông qua một ô nhỏ&lt;/h2&gt;

&lt;p&gt;Xét hình vuông nhỏ cạnh $h$ tâm $(a,b)$ trong mặt phẳng. &lt;strong&gt;Thông lượng ra&lt;/strong&gt; qua cạnh phải xấp xỉ $P(a+\tfrac h2,b)\,h$, qua cạnh trái là $-P(a-\tfrac h2,b)\,h$; cộng lại xấp xỉ $P_x\,h^2$. Hai cạnh trên dưới cho $Q_y\,h^2$. Vậy&lt;/p&gt;

\[\frac{\text{thông lượng ra}}{\text{diện tích}}\to P_x+Q_y=\operatorname{div}F\quad(h\to0).\]

&lt;p&gt;Tương tự, &lt;strong&gt;lưu thông&lt;/strong&gt; (tổng thành phần tiếp tuyến dọc biên, đi ngược chiều kim đồng hồ) là $\big[Q(a+\tfrac h2,b)-Q(a-\tfrac h2,b)\big]h-\big[P(a,b+\tfrac h2)-P(a,b-\tfrac h2)\big]h\approx(Q_x-P_y)h^2$. Div dương: nguồn; div âm: điểm hút; curl khác 0: xoáy. Bài 14_05 biến các xấp xỉ này thành đẳng thức (định lý Green).&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Minh hoạ: curl là lưu thông trên một ô nhỏ&lt;/strong&gt;&lt;/p&gt;

&lt;div class=&quot;reel-video&quot;&gt;
  &lt;video controls=&quot;&quot; playsinline=&quot;&quot; preload=&quot;metadata&quot; src=&quot;/public/videos/reels/curl-circulation-square.mp4&quot;&gt;&lt;/video&gt;
  &lt;p class=&quot;reel-caption&quot;&gt;Cho một chấm sáng đi một vòng quanh hình vuông nhỏ và cộng phần của F theo hướng đi trên từng cạnh; thu nhỏ ô thì tỉ số lưu thông / diện tích tiến tới $\operatorname{curl}F=\partial Q/\partial x-\partial P/\partial y$ (có lời thuyết minh, khoảng 3 phút 05 giây).&lt;/p&gt;
&lt;/div&gt;

&lt;h2 id=&quot;hai-đồng-nhất-thức&quot;&gt;Hai đồng nhất thức&lt;/h2&gt;

&lt;div class=&quot;textbook-theorem&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Định lý 1.&lt;/strong&gt; Nếu $f$ và các thành phần của $F$ có đạo hàm riêng cấp hai liên tục thì&lt;/p&gt;

\[\operatorname{curl}(\nabla f)=0,\qquad\operatorname{div}(\operatorname{curl}F)=0.\]

&lt;/div&gt;

&lt;div class=&quot;textbook-proof&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Chứng minh.&lt;/strong&gt; Với $\nabla f=(f_x,f_y,f_z)$, thành phần đầu của curl là $f_{zy}-f_{yz}=0$ theo định lý Schwarz (bài 10_05); hai thành phần kia tương tự. Với $F=(P,Q,R)$:&lt;/p&gt;

\[\operatorname{div}\operatorname{curl}F=(R_y-Q_z)_x+(P_z-R_x)_y+(Q_x-P_y)_z=(R_{yx}-R_{xy})+(P_{zy}-P_{yz})+(Q_{xz}-Q_{zx})=0.\]

&lt;/div&gt;

&lt;p&gt;Hệ quả: một trường có curl khác 0 không thể là gradient của hàm nào. Đây là phép thử nhanh cho trường bảo toàn ở bài 14_04.&lt;/p&gt;

&lt;h2 id=&quot;ứng-dụng&quot;&gt;Ứng dụng&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Vật lý: trường hấp dẫn.&lt;/strong&gt; Một khối lượng $M$ ở gốc tạo trường $F=-GM\,\dfrac{r}{\lVert r\rVert^3}$. Với $r=(x,y,z)$, $\rho=\lVert r\rVert$: $\partial_x(x/\rho^3)=1/\rho^3-3x^2/\rho^5$; cộng ba thành phần được $3/\rho^3-3\rho^2/\rho^5=0$. Vậy $\operatorname{div}F=0$ ở mọi nơi trừ gốc: không có “nguồn” nào ngoài khối lượng. Chương 15 cho thấy thông lượng qua mọi mặt kín bao gốc đều bằng $-4\pi GM$.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Chất lỏng.&lt;/strong&gt; Chất lỏng không nén được có trường vận tốc $\operatorname{div}v=0$. Curl của vận tốc gọi là độ xoáy (vorticity); với vật rắn quay $v=\omega\times r$ thì $\operatorname{curl}v=2\omega$.&lt;/p&gt;

&lt;h2 id=&quot;bài-tập&quot;&gt;Bài tập&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Cơ bản.&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;Tính div và curl vô hướng của $F=(x^2y,\,xy^2)$.&lt;/li&gt;
  &lt;li&gt;Tính div và curl của $F=(yz,xz,xy)$.&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Đáp án&lt;/summary&gt;

  &lt;ol&gt;
    &lt;li&gt;$\operatorname{div}F=2xy+2xy=4xy$; curl $=y^2-x^2$.&lt;/li&gt;
    &lt;li&gt;$\operatorname{div}F=0$, $\operatorname{curl}F=(x-x,\,y-y,\,z-z)=0$; thật ra $F=\nabla(xyz)$.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;p&gt;&lt;strong&gt;Trung bình.&lt;/strong&gt;&lt;/p&gt;

&lt;ol start=&quot;3&quot;&gt;
  &lt;li&gt;Chứng minh $\operatorname{div}(fF)=f\operatorname{div}F+\nabla f\cdot F$.&lt;/li&gt;
  &lt;li&gt;Tìm $a$ để $F=(ax+y,\,x-3y)$ có divergence bằng 0. Khi đó trường có xoáy không?&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Đáp án&lt;/summary&gt;

  &lt;ol start=&quot;3&quot;&gt;
    &lt;li&gt;Quy tắc tích cho từng số hạng: $(fP)_x=f_xP+fP_x$, rồi cộng.&lt;/li&gt;
    &lt;li&gt;$a-3=0$, $a=3$. Curl $=1-1=0$: không xoáy.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;p&gt;&lt;strong&gt;Nâng cao.&lt;/strong&gt;&lt;/p&gt;

&lt;ol start=&quot;5&quot;&gt;
  &lt;li&gt;Chứng minh thành phần $x$ của $\operatorname{curl}(\operatorname{curl}F)$ bằng $\partial_x(\operatorname{div}F)-\Delta P$, với $\Delta P=P_{xx}+P_{yy}+P_{zz}$.&lt;/li&gt;
  &lt;li&gt;Với $\omega=(0,0,\omega)$ và $v=\omega\times r$, chứng minh $\operatorname{curl}v=2\omega$ và $\operatorname{div}v=0$.&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Gợi ý&lt;/summary&gt;

  &lt;ol start=&quot;5&quot;&gt;
    &lt;li&gt;Thành phần $x$ là $(Q_x-P_y)_y-(P_z-R_x)_z=Q_{xy}+R_{xz}-P_{yy}-P_{zz}$; cộng và trừ $P_{xx}$.&lt;/li&gt;
    &lt;li&gt;$v=(-\omega y,\omega x,0)$; curl $=(0,0,\omega+\omega)$, div $=0$.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;h2 id=&quot;tóm-tắt&quot;&gt;Tóm tắt&lt;/h2&gt;

&lt;div class=&quot;content-box summary-box textbook-block&quot;&gt;
  &lt;ul&gt;
    &lt;li&gt;$\operatorname{div}F=P_x+Q_y+R_z$ là thông lượng ra trên một đơn vị diện tích (thể tích): nguồn hay điểm hút.&lt;/li&gt;
    &lt;li&gt;$\operatorname{curl}F=\nabla\times F$ là lưu thông trên một đơn vị diện tích: độ xoáy.&lt;/li&gt;
    &lt;li&gt;$\operatorname{curl}\nabla f=0$, $\operatorname{div}\operatorname{curl}F=0$ (định lý Schwarz).&lt;/li&gt;
    &lt;li&gt;Trường hấp dẫn có div bằng 0 ngoài khối lượng; vật rắn quay có curl bằng $2\omega$.&lt;/li&gt;
  &lt;/ul&gt;
&lt;/div&gt;
</content>
 </entry>
 
 <entry>
   <title>Ứng dụng của tích phân bội</title>
   <link href="https://calculus-self-learning.pages.dev/contents/vi/chapter13/13_06_Ung_dung_cua_tich_phan_boi/"/>
   <updated>2026-12-01T00:00:00+00:00</updated>
   <id>https://calculus-self-learning.pages.dev/contents/vi/chapter13/13_06_Ung_dung_cua_tich_phan_boi</id>
   <content type="html">&lt;div class=&quot;textbook-objectives&quot;&gt;

  &lt;p&gt;&lt;strong&gt;Mục tiêu bài học.&lt;/strong&gt; Sau bài này bạn có thể:&lt;/p&gt;

  &lt;ul&gt;
    &lt;li&gt;tính khối lượng, trọng tâm và mômen quán tính của tấm phẳng có mật độ thay đổi;&lt;/li&gt;
    &lt;li&gt;tính xác suất và kỳ vọng từ mật độ đồng thời;&lt;/li&gt;
    &lt;li&gt;chứng minh $\int_0^\infty e^{-x^2}dx=\tfrac{\sqrt\pi}2$ và chuẩn hoá phân phối chuẩn hai chiều.&lt;/li&gt;
  &lt;/ul&gt;

&lt;/div&gt;

&lt;h2 id=&quot;vì-sao-cần-bài-này&quot;&gt;Vì sao cần bài này&lt;/h2&gt;

&lt;p&gt;Tích phân bội là ngôn ngữ chung của cơ học (khối lượng, trọng tâm, quán tính) và xác suất (mật độ, kỳ vọng). Bài này cũng chứa một trong những phép tính đẹp nhất của giải tích: tích phân Gauss, không tính được bằng nguyên hàm sơ cấp nhưng dễ dàng khi lên hai chiều.&lt;/p&gt;

&lt;h2 id=&quot;khối-lượng-và-trọng-tâm&quot;&gt;Khối lượng và trọng tâm&lt;/h2&gt;

&lt;p&gt;Tấm phẳng chiếm miền $D$ với mật độ $\rho(x,y)$ có&lt;/p&gt;

\[m=\iint_D\rho\,dA,\qquad\bar x=\frac1m\iint_Dx\rho\,dA,\qquad\bar y=\frac1m\iint_Dy\rho\,dA,\qquad I_0=\iint_D(x^2+y^2)\rho\,dA.\]

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Ví dụ 1.&lt;/strong&gt; Tấm tam giác đỉnh $(0,0)$, $(1,0)$, $(0,2)$, mật độ $\rho=1+3x+y$. Miền $0\le x\le1$, $0\le y\le2-2x$:&lt;/p&gt;

\[m=\int_0^1\int_0^{2-2x}(1+3x+y)\,dy\,dx=\frac83,\qquad\bar x=\frac38,\qquad\bar y=\frac{11}{16}.\]

  &lt;p&gt;(Kiểm tra bằng tổng Riemann với lưới $2000\times2000$ cho $2.6676$, $0.3750$, $0.6877$.) Trọng tâm hình học của tam giác là $(\tfrac13,\tfrac23)$; mật độ lớn hơn ở phía $x$, $y$ lớn kéo trọng tâm về phía đó.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Ví dụ 2.&lt;/strong&gt; Nửa đĩa đồng chất $x^2+y^2\le R^2$, $y\ge0$: theo đối xứng $\bar x=0$, và&lt;/p&gt;

\[\bar y=\frac{1}{\pi R^2/2}\int_0^\pi\int_0^Rr\sin\theta\cdot r\,dr\,d\theta=\frac{2}{\pi R^2}\cdot\frac{R^3}3\cdot2=\frac{4R}{3\pi}.\]

&lt;/div&gt;

&lt;h2 id=&quot;xác-suất-và-kỳ-vọng&quot;&gt;Xác suất và kỳ vọng&lt;/h2&gt;

&lt;p&gt;Nếu $(X,Y)$ có mật độ đồng thời $p\ge0$ với $\iint p\,dA=1$ thì $P((X,Y)\in D)=\iint_Dp\,dA$ và $E[g(X,Y)]=\iint g\,p\,dA$.&lt;/p&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Ví dụ 3.&lt;/strong&gt; $p=4xy$ trên $[0,1]^2$. Kiểm tra: $\iint4xy\,dA=4\cdot\tfrac12\cdot\tfrac12=1$. $E[X]=\iint x\cdot4xy\,dA=4\cdot\tfrac13\cdot\tfrac12=\tfrac23$. $P(X+Y\le1)=\int_0^1\int_0^{1-x}4xy\,dy\,dx=\int_0^12x(1-x)^2\,dx=\tfrac16$.&lt;/p&gt;
&lt;/div&gt;

&lt;h2 id=&quot;tích-phân-gauss&quot;&gt;Tích phân Gauss&lt;/h2&gt;

&lt;div class=&quot;textbook-theorem&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Định lý 1.&lt;/strong&gt; $\displaystyle\int_0^\infty e^{-x^2}dx=\frac{\sqrt\pi}2$, do đó $\displaystyle\int_{-\infty}^\infty e^{-x^2/2}dx=\sqrt{2\pi}$.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-proof&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Chứng minh.&lt;/strong&gt; Đặt $I(R)=\int_0^Re^{-x^2}dx$; tích phân suy rộng hội tụ (bài 05_05), gọi giới hạn là $I$. Theo bài 13_01 (hàm tách biến), $I(R)^2=\iint_{S_R}e^{-(x^2+y^2)}dA$ với $S_R=[0,R]^2$. Gọi $Q_R$ là phần tư hình tròn bán kính $R$ trong góc phần tư thứ nhất. Vì $Q_R\subset S_R\subset Q_{R\sqrt2}$ và hàm dương,&lt;/p&gt;

\[\iint_{Q_R}e^{-(x^2+y^2)}dA\le I(R)^2\le\iint_{Q_{R\sqrt2}}e^{-(x^2+y^2)}dA.\]

  &lt;p&gt;Bằng toạ độ cực, $\iint_{Q_\rho}e^{-(x^2+y^2)}dA=\int_0^{\pi/2}\int_0^\rho e^{-r^2}r\,dr\,d\theta=\tfrac\pi4(1-e^{-\rho^2})$. Hai vế ngoài cùng tiến tới $\tfrac\pi4$ khi $R\to\infty$, nên $I^2=\tfrac\pi4$, $I=\tfrac{\sqrt\pi}2$. Công thức thứ hai: tính đối xứng và đổi biến $x=\sqrt2\,u$.&lt;/p&gt;
&lt;/div&gt;

&lt;p&gt;Hệ quả: $\Gamma(\tfrac12)=\sqrt\pi$ (bài 05_06), và mật độ chuẩn hai chiều $p=\tfrac1{2\pi}e^{-(x^2+y^2)/2}$ có tổng xác suất $\tfrac1{2\pi}\int_0^{2\pi}\int_0^\infty e^{-r^2/2}r\,dr\,d\theta=1$.&lt;/p&gt;

&lt;h2 id=&quot;bài-tập&quot;&gt;Bài tập&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Cơ bản.&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;Tấm $[0,1]^2$, mật độ $x+y$. Tính khối lượng và $\bar x$.&lt;/li&gt;
  &lt;li&gt;Trọng tâm của phần tư đĩa đồng chất bán kính $R$ trong góc phần tư thứ nhất.&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Đáp án&lt;/summary&gt;

  &lt;ol&gt;
    &lt;li&gt;$m=1$, $\bar x=\tfrac13+\tfrac14=\tfrac7{12}$.&lt;/li&gt;
    &lt;li&gt;$\big(\tfrac{4R}{3\pi},\tfrac{4R}{3\pi}\big)$.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;p&gt;&lt;strong&gt;Trung bình.&lt;/strong&gt;&lt;/p&gt;

&lt;ol start=&quot;3&quot;&gt;
  &lt;li&gt;$p=ce^{-x-2y}$ với $x,y\ge0$. Tìm $c$ và $P(X&amp;gt;Y)$.&lt;/li&gt;
  &lt;li&gt;Mômen quán tính quanh tâm của đĩa đồng chất bán kính $R$, khối lượng $M$.&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Đáp án&lt;/summary&gt;

  &lt;ol start=&quot;3&quot;&gt;
    &lt;li&gt;$\int e^{-x}\int e^{-2y}=\tfrac12$ nên $c=2$. $P(X&amp;gt;Y)=\int_0^\infty e^{-x}(1-e^{-2x})\,dx=1-\tfrac13=\tfrac23$.&lt;/li&gt;
    &lt;li&gt;$\tfrac M{\pi R^2}\cdot2\pi\int_0^Rr^3dr=\tfrac12MR^2$.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;p&gt;&lt;strong&gt;Nâng cao.&lt;/strong&gt;&lt;/p&gt;

&lt;ol start=&quot;5&quot;&gt;
  &lt;li&gt;Với $(X,Y)$ có mật độ chuẩn hai chiều chuẩn tắc, tính $E[X^2+Y^2]$ và $P(X^2+Y^2\le r^2)$.&lt;/li&gt;
  &lt;li&gt;Dùng định lý 1 tính $\int_{-\infty}^\infty x^2e^{-x^2}dx$.&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Gợi ý&lt;/summary&gt;

  &lt;ol start=&quot;5&quot;&gt;
    &lt;li&gt;$E=\int_0^\infty r^2e^{-r^2/2}r\,dr=2$; $P=1-e^{-r^2/2}$.&lt;/li&gt;
    &lt;li&gt;Từng phần với $u=x$, $dv=xe^{-x^2}dx$: $\tfrac12\int e^{-x^2}dx=\tfrac{\sqrt\pi}2$.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;h2 id=&quot;tóm-tắt&quot;&gt;Tóm tắt&lt;/h2&gt;

&lt;div class=&quot;content-box summary-box textbook-block&quot;&gt;
  &lt;ul&gt;
    &lt;li&gt;Khối lượng $\iint\rho$, trọng tâm $\tfrac1m\iint x\rho$, mômen quán tính $\iint r^2\rho$.&lt;/li&gt;
    &lt;li&gt;Xác suất và kỳ vọng là tích phân của mật độ đồng thời.&lt;/li&gt;
    &lt;li&gt;Tích phân Gauss: bình phương lên rồi dùng toạ độ cực, $\int_0^\infty e^{-x^2}=\tfrac{\sqrt\pi}2$.&lt;/li&gt;
    &lt;li&gt;Phân phối chuẩn hai chiều được chuẩn hoá bằng cùng phép tính.&lt;/li&gt;
  &lt;/ul&gt;
&lt;/div&gt;
</content>
 </entry>
 
 <entry>
   <title>Toạ độ trụ và toạ độ cầu</title>
   <link href="https://calculus-self-learning.pages.dev/contents/vi/chapter13/13_05_Toa_do_tru_va_toa_do_cau/"/>
   <updated>2026-12-01T00:00:00+00:00</updated>
   <id>https://calculus-self-learning.pages.dev/contents/vi/chapter13/13_05_Toa_do_tru_va_toa_do_cau</id>
   <content type="html">&lt;div class=&quot;textbook-objectives&quot;&gt;

  &lt;p&gt;&lt;strong&gt;Mục tiêu bài học.&lt;/strong&gt; Sau bài này bạn có thể:&lt;/p&gt;

  &lt;ul&gt;
    &lt;li&gt;viết $dV=r\,dr\,d\theta\,dz$ (trụ) và $dV=\rho^2\sin\varphi\,d\rho\,d\varphi\,d\theta$ (cầu), và chứng minh công thức thứ hai;&lt;/li&gt;
    &lt;li&gt;chọn hệ toạ độ phù hợp với đối xứng của khối;&lt;/li&gt;
    &lt;li&gt;tính mômen quán tính của các vật đối xứng.&lt;/li&gt;
  &lt;/ul&gt;

&lt;/div&gt;

&lt;h2 id=&quot;vì-sao-cần-bài-này&quot;&gt;Vì sao cần bài này&lt;/h2&gt;

&lt;p&gt;Ống, bánh xe, quả cầu, hình nón: mô tả các khối này bằng $x,y,z$ cho cận rất rối, còn bằng toạ độ trụ hay toạ độ cầu (bài 09_04) thì cận là hằng số. Tích phân trở nên ngắn gọn, nếu ta nhớ thêm hệ số Jacobian.&lt;/p&gt;

&lt;h2 id=&quot;toạ-độ-trụ&quot;&gt;Toạ độ trụ&lt;/h2&gt;

&lt;p&gt;$x=r\cos\theta$, $y=r\sin\theta$, $z=z$. Jacobian bằng $r$ (toạ độ cực, thêm $z$ không đổi), nên&lt;/p&gt;

\[dV=r\,dr\,d\theta\,dz.\]

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Ví dụ 1.&lt;/strong&gt; $\iiint_E(x^2+y^2)\,dV$ với $E$ là trụ $r\le1$, $0\le z\le2$: $\int_0^2\int_0^{2\pi}\int_0^1r^2\cdot r\,dr\,d\theta\,dz=2\cdot2\pi\cdot\tfrac14=\pi$.&lt;/p&gt;
&lt;/div&gt;

&lt;h2 id=&quot;toạ-độ-cầu&quot;&gt;Toạ độ cầu&lt;/h2&gt;

&lt;p&gt;$x=\rho\sin\varphi\cos\theta$, $y=\rho\sin\varphi\sin\theta$, $z=\rho\cos\varphi$, với $\rho\ge0$, $0\le\varphi\le\pi$, $0\le\theta&amp;lt;2\pi$.&lt;/p&gt;

&lt;div class=&quot;textbook-theorem&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Định lý 1.&lt;/strong&gt; $\dfrac{\partial(x,y,z)}{\partial(\rho,\varphi,\theta)}=\rho^2\sin\varphi$, nên $dV=\rho^2\sin\varphi\,d\rho\,d\varphi\,d\theta$.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-proof&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Chứng minh.&lt;/strong&gt; Ma trận Jacobi là&lt;/p&gt;

\[\begin{pmatrix}\sin\varphi\cos\theta&amp;amp;\rho\cos\varphi\cos\theta&amp;amp;-\rho\sin\varphi\sin\theta\\\sin\varphi\sin\theta&amp;amp;\rho\cos\varphi\sin\theta&amp;amp;\rho\sin\varphi\cos\theta\\\cos\varphi&amp;amp;-\rho\sin\varphi&amp;amp;0\end{pmatrix}.\]

  &lt;p&gt;Khai triển theo hàng cuối:&lt;/p&gt;

\[\cos\varphi\cdot\big(\rho^2\sin\varphi\cos\varphi\cos^2\theta+\rho^2\sin\varphi\cos\varphi\sin^2\theta\big)+\rho\sin\varphi\cdot\big(\rho\sin^2\varphi\cos^2\theta+\rho\sin^2\varphi\sin^2\theta\big)\]

\[=\rho^2\sin\varphi\cos^2\varphi+\rho^2\sin^3\varphi=\rho^2\sin\varphi.\]

  &lt;p&gt;Vì $\sin\varphi\ge0$ trên $[0,\pi]$, $\lvert J\rvert=\rho^2\sin\varphi$. Về hình học: ô nhỏ có ba cạnh $d\rho$, $\rho\,d\varphi$ và $\rho\sin\varphi\,d\theta$ (bán kính vĩ tuyến là $\rho\sin\varphi$), vuông góc từng đôi.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Ví dụ 2.&lt;/strong&gt; Thể tích hình cầu: $\int_0^{2\pi}\int_0^\pi\int_0^R\rho^2\sin\varphi\,d\rho\,d\varphi\,d\theta=2\pi\cdot2\cdot\tfrac{R^3}3=\tfrac43\pi R^3$, gọn hơn nhiều so với bài 13_03.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Ví dụ 3 (Nón kem).&lt;/strong&gt; Khối nằm trên nón $z=\sqrt{x^2+y^2}$ (tức $\varphi\le\pi/4$) và trong cầu $\rho\le1$:&lt;/p&gt;

\[V=\int_0^{2\pi}\int_0^{\pi/4}\int_0^1\rho^2\sin\varphi\,d\rho\,d\varphi\,d\theta=2\pi\Big(1-\frac{\sqrt2}2\Big)\frac13=\frac{\pi(2-\sqrt2)}3\approx0.613.\]

&lt;/div&gt;

&lt;h2 id=&quot;ứng-dụng-mômen-quán-tính-vật-lý&quot;&gt;Ứng dụng: mômen quán tính (vật lý)&lt;/h2&gt;

&lt;p&gt;Mômen quán tính quanh trục $z$ là $I_z=\iiint_E(x^2+y^2)\,\rho_m\,dV$, đo độ “khó quay” của vật.&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;strong&gt;Bánh xe&lt;/strong&gt; (trụ đặc bán kính $R$, cao $h$, khối lượng $M$, mật độ đều $\tfrac M{\pi R^2h}$): $I_z=\tfrac M{\pi R^2h}\cdot2\pi h\int_0^Rr^3\,dr=\tfrac12MR^2$.&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Quả cầu đặc&lt;/strong&gt; bán kính $R$, khối lượng $M$: $x^2+y^2=\rho^2\sin^2\varphi$, nên $\iiint(x^2+y^2)\,dV=\int_0^R\rho^4d\rho\int_0^\pi\sin^3\varphi\,d\varphi\int_0^{2\pi}d\theta=\tfrac{R^5}5\cdot\tfrac43\cdot2\pi$. Nhân với mật độ $\tfrac{3M}{4\pi R^3}$: $I_z=\tfrac25MR^2$.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Quả cầu có $I$ nhỏ hơn bánh xe cùng khối lượng và bán kính, nên lăn xuống dốc nhanh hơn.&lt;/p&gt;

&lt;h2 id=&quot;bài-tập&quot;&gt;Bài tập&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Cơ bản.&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;Thể tích trụ $r\le2$, $0\le z\le3$ bằng toạ độ trụ.&lt;/li&gt;
  &lt;li&gt;$\iiint_{\rho\le1}(x^2+y^2+z^2)\,dV$.&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Đáp án&lt;/summary&gt;

  &lt;ol&gt;
    &lt;li&gt;$3\cdot2\pi\cdot2=12\pi$.&lt;/li&gt;
    &lt;li&gt;$\int\rho^4\sin\varphi=\tfrac15\cdot2\cdot2\pi=\tfrac{4\pi}5$.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;p&gt;&lt;strong&gt;Trung bình.&lt;/strong&gt;&lt;/p&gt;

&lt;ol start=&quot;3&quot;&gt;
  &lt;li&gt;Khối lượng quả cầu bán kính 1 với mật độ bằng khoảng cách tới tâm.&lt;/li&gt;
  &lt;li&gt;Thể tích phần hình cầu $x^2+y^2+z^2\le4$ nằm ngoài trụ $x^2+y^2\le1$.&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Đáp án&lt;/summary&gt;

  &lt;ol start=&quot;3&quot;&gt;
    &lt;li&gt;$\int_0^1\rho^3d\rho\cdot2\cdot2\pi=\pi$.&lt;/li&gt;
    &lt;li&gt;Phần trong trụ: $2\pi\int_0^12\sqrt{4-r^2}\,r\,dr=\tfrac{4\pi(8-3\sqrt3)}3$. Lấy $\tfrac{32\pi}3$ trừ đi: $4\sqrt3\pi\approx21.77$.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;p&gt;&lt;strong&gt;Nâng cao.&lt;/strong&gt;&lt;/p&gt;

&lt;ol start=&quot;5&quot;&gt;
  &lt;li&gt;Tính $\iiint_{\rho\le R}\dfrac{dV}{\sqrt{x^2+y^2+z^2}}$. Vì sao tích phân hội tụ dù hàm không bị chặn tại tâm?&lt;/li&gt;
  &lt;li&gt;Chứng minh mômen quán tính của vỏ cầu mỏng bán kính $R$, khối lượng $M$ là $\tfrac23MR^2$ (lấy đạo hàm theo $R$ của $\iiint_{\rho\le R}(x^2+y^2)\,dV$).&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Gợi ý&lt;/summary&gt;

  &lt;ol start=&quot;5&quot;&gt;
    &lt;li&gt;$\int_0^R\rho\,d\rho\cdot4\pi=2\pi R^2$. Hệ số $\rho^2$ trong $dV$ triệt tiêu điểm kỳ dị $1/\rho$.&lt;/li&gt;
    &lt;li&gt;$\tfrac{d}{dR}\tfrac{8\pi R^5}{15}=\tfrac{8\pi R^4}3$ là tích phân trên vỏ dày $dR$; khối lượng vỏ là $4\pi R^2\,dR\cdot$ mật độ. Chia ra: $I=\tfrac{8\pi R^4/3}{4\pi R^2}M=\tfrac23MR^2$.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;h2 id=&quot;tóm-tắt&quot;&gt;Tóm tắt&lt;/h2&gt;

&lt;div class=&quot;content-box summary-box textbook-block&quot;&gt;
  &lt;ul&gt;
    &lt;li&gt;Toạ độ trụ: $dV=r\,dr\,d\theta\,dz$, hợp với trụ, ống, khối tròn xoay.&lt;/li&gt;
    &lt;li&gt;Toạ độ cầu: $dV=\rho^2\sin\varphi\,d\rho\,d\varphi\,d\theta$, hợp với cầu và nón.&lt;/li&gt;
    &lt;li&gt;Chọn hệ toạ độ để cận là hằng số.&lt;/li&gt;
    &lt;li&gt;Mômen quán tính: bánh xe $\tfrac12MR^2$, quả cầu đặc $\tfrac25MR^2$.&lt;/li&gt;
  &lt;/ul&gt;
&lt;/div&gt;
</content>
 </entry>
 
 <entry>
   <title>Tích phân ba</title>
   <link href="https://calculus-self-learning.pages.dev/contents/vi/chapter13/13_04_Tich_phan_ba/"/>
   <updated>2026-12-01T00:00:00+00:00</updated>
   <id>https://calculus-self-learning.pages.dev/contents/vi/chapter13/13_04_Tich_phan_ba</id>
   <content type="html">&lt;div class=&quot;textbook-objectives&quot;&gt;

  &lt;p&gt;&lt;strong&gt;Mục tiêu bài học.&lt;/strong&gt; Sau bài này bạn có thể:&lt;/p&gt;

  &lt;ul&gt;
    &lt;li&gt;tính tích phân ba trên hộp bằng ba tích phân lặp;&lt;/li&gt;
    &lt;li&gt;mô tả khối $E=\lbrace(x,y)\in D,\ u_1(x,y)\le z\le u_2(x,y)\rbrace$ và đặt cận từ hình vẽ;&lt;/li&gt;
    &lt;li&gt;viết lại tích phân lặp theo thứ tự khác.&lt;/li&gt;
  &lt;/ul&gt;

&lt;/div&gt;

&lt;h2 id=&quot;vì-sao-cần-bài-này&quot;&gt;Vì sao cần bài này&lt;/h2&gt;

&lt;p&gt;Khối lượng của một vật có mật độ thay đổi, điện tích trong một vùng không gian, xác suất của ba biến ngẫu nhiên: đều là tích phân trên khối ba chiều. Ý tưởng giống hệt tích phân kép; khó khăn chính là đặt cận.&lt;/p&gt;

&lt;h2 id=&quot;định-nghĩa-và-định-lý-fubini&quot;&gt;Định nghĩa và định lý Fubini&lt;/h2&gt;

&lt;p&gt;Tích phân ba $\iiint_Ef\,dV$ định nghĩa bằng tổng Riemann trên các hộp nhỏ, như tích phân kép. Với $f$ liên tục trên hộp $B=[a,b]\times[c,d]\times[r,s]$, định lý Fubini (chứng minh y hệt bài 13_01) cho&lt;/p&gt;

\[\iiint_Bf\,dV=\int_r^s\int_c^d\int_a^bf(x,y,z)\,dx\,dy\,dz,\]

&lt;p&gt;và có thể đổi sang bất kỳ thứ tự nào trong sáu thứ tự.&lt;/p&gt;

&lt;div class=&quot;textbook-theorem&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Định lý 1.&lt;/strong&gt; Nếu $E=\lbrace(x,y)\in D,\ u_1(x,y)\le z\le u_2(x,y)\rbrace$ với $u_1$, $u_2$ liên tục và $f$ liên tục trên $E$ thì&lt;/p&gt;

\[\iiint_Ef\,dV=\iint_D\Big(\int_{u_1(x,y)}^{u_2(x,y)}f(x,y,z)\,dz\Big)dA.\]

&lt;/div&gt;

&lt;p&gt;Chứng minh giống định lý 1 của bài 13_02: mở rộng $f$ bằng 0 ra một hộp chứa $E$ rồi áp dụng Fubini. Khi $f=1$: $\iiint_E1\,dV=\iint_D(u_2-u_1)\,dA$ là thể tích, đúng như ở bài 13_02.&lt;/p&gt;

&lt;div class=&quot;interactive-frame&quot;&gt;
  &lt;div class=&quot;interactive-frame-head&quot;&gt;
    &lt;div class=&quot;interactive-frame-title&quot;&gt;Cận theo z và hình chiếu D&lt;/div&gt;
    &lt;div class=&quot;interactive-frame-desc&quot;&gt;Kéo điểm trong D; đường thẳng đứng cho cận trong theo z.&lt;/div&gt;
  &lt;/div&gt;
  &lt;iframe src=&quot;/interactives/chapter13/triple-integral-regions.html&quot; title=&quot;Cận theo z và hình chiếu D&quot; loading=&quot;lazy&quot; style=&quot;height: 740px;&quot;&gt;&lt;/iframe&gt;
  &lt;div class=&quot;interactive-frame-foot&quot;&gt;
    &lt;a href=&quot;/interactives/chapter13/triple-integral-regions.html&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;Mở minh hoạ ở cửa sổ riêng&lt;/a&gt;
  &lt;/div&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Ví dụ 1.&lt;/strong&gt; $\iiint_{[0,1]\times[0,2]\times[0,3]}xyz\,dV=\tfrac12\cdot2\cdot\tfrac92=\tfrac92.$&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Ví dụ 2 (Tứ diện).&lt;/strong&gt; $E$: $x,y,z\ge0$, $x+y+z\le1$. Theo $z$ trước: $0\le z\le1-x-y$ trên tam giác $D$: $0\le y\le1-x$, $0\le x\le1$. Thể tích là $\tfrac16$ (bài 13_02, bài tập 5). Tính $\iiint_Ez\,dV$ bằng cách cắt theo $z$: lát cắt ở độ cao $z$ là tam giác diện tích $\tfrac{(1-z)^2}2$, nên&lt;/p&gt;

\[\iiint_Ez\,dV=\int_0^1z\,\frac{(1-z)^2}2\,dz=\frac12\Big(\frac12-\frac23+\frac14\Big)=\frac1{24}.\]

&lt;/div&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Ví dụ 3.&lt;/strong&gt; Khối giữa paraboloid $z=x^2+y^2$ và mặt phẳng $z=4$. Hình chiếu $D$ là hình tròn $r\le2$, và $x^2+y^2\le z\le4$:&lt;/p&gt;

\[V=\iint_D(4-x^2-y^2)\,dA=\int_0^{2\pi}\int_0^2(4-r^2)\,r\,dr\,d\theta=2\pi(8-4)=8\pi.\]

&lt;/div&gt;

&lt;h2 id=&quot;ứng-dụng-khối-lượng-và-trọng-tâm&quot;&gt;Ứng dụng: khối lượng và trọng tâm&lt;/h2&gt;

&lt;p&gt;Vật chiếm khối $E$ với mật độ $\rho(x,y,z)$ có khối lượng $m=\iiint_E\rho\,dV$ và trọng tâm $\bar x=\tfrac1m\iiint_Ex\rho\,dV$ (tương tự cho $\bar y$, $\bar z$).&lt;/p&gt;

&lt;p&gt;Khối lập phương $[0,1]^3$ có mật độ $\rho=x+y+z$ (nặng dần về một góc): $m=\tfrac32$; $\iiint x(x+y+z)\,dV=\tfrac13+\tfrac14+\tfrac14=\tfrac56$, nên $\bar x=\tfrac{5/6}{3/2}=\tfrac59$, và cùng giá trị cho $\bar y$, $\bar z$ do đối xứng. Trọng tâm lệch khỏi tâm $(\tfrac12,\tfrac12,\tfrac12)$ về phía góc nặng.&lt;/p&gt;

&lt;h2 id=&quot;bài-tập&quot;&gt;Bài tập&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Cơ bản.&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;$\iiint_{[0,1]^3}(x+y+z)\,dV$.&lt;/li&gt;
  &lt;li&gt;$\iiint_{[0,1]\times[0,1]\times[0,2]}xy^2z\,dV$.&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Đáp án&lt;/summary&gt;

  &lt;ol&gt;
    &lt;li&gt;$3\cdot\tfrac12=\tfrac32$.&lt;/li&gt;
    &lt;li&gt;$\tfrac12\cdot\tfrac13\cdot2=\tfrac13$.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;p&gt;&lt;strong&gt;Trung bình.&lt;/strong&gt;&lt;/p&gt;

&lt;ol start=&quot;3&quot;&gt;
  &lt;li&gt;Tính thể tích khối trong góc phần tám thứ nhất dưới mặt phẳng $2x+3y+z=6$.&lt;/li&gt;
  &lt;li&gt;Tính $\iiint_Ex\,dV$ cho tứ diện của ví dụ 2.&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Đáp án&lt;/summary&gt;

  &lt;ol start=&quot;3&quot;&gt;
    &lt;li&gt;Tứ diện có các giao điểm với trục là $3$, $2$, $6$: thể tích $\tfrac{3\cdot2\cdot6}6=6$.&lt;/li&gt;
    &lt;li&gt;$\tfrac1{24}$, do tính đối xứng giữa $x$ và $z$.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;p&gt;&lt;strong&gt;Nâng cao.&lt;/strong&gt;&lt;/p&gt;

&lt;ol start=&quot;5&quot;&gt;
  &lt;li&gt;Viết lại $\int_0^1\int_0^x\int_0^yf\,dz\,dy\,dx$ theo thứ tự $dx\,dy\,dz$.&lt;/li&gt;
  &lt;li&gt;Chứng minh thể tích của “đơn hình” $x_1,\dots,x_n\ge0$, $x_1+\dots+x_n\le1$ là $\tfrac1{n!}$.&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Gợi ý&lt;/summary&gt;

  &lt;ol start=&quot;5&quot;&gt;
    &lt;li&gt;Miền là $0\le z\le y\le x\le1$: $\int_0^1\int_z^1\int_y^1f\,dx\,dy\,dz$.&lt;/li&gt;
    &lt;li&gt;Quy nạp: lát cắt ở $x_n=t$ là đơn hình $(n-1)$ chiều phóng theo tỉ lệ $1-t$, thể tích $\tfrac{(1-t)^{n-1}}{(n-1)!}$; tích phân theo $t$ được $\tfrac1{n!}$.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;h2 id=&quot;tóm-tắt&quot;&gt;Tóm tắt&lt;/h2&gt;

&lt;div class=&quot;content-box summary-box textbook-block&quot;&gt;
  &lt;ul&gt;
    &lt;li&gt;Tích phân ba trên hộp: ba tích phân lặp, thứ tự bất kỳ.&lt;/li&gt;
    &lt;li&gt;Khối tổng quát: $z$ giữa hai mặt trên hình chiếu $D$, rồi tích phân kép trên $D$.&lt;/li&gt;
    &lt;li&gt;Có thể cắt theo lát (theo $z$) khi diện tích lát dễ tính.&lt;/li&gt;
    &lt;li&gt;Khối lượng $\iiint\rho\,dV$, trọng tâm $\tfrac1m\iiint x\rho\,dV$.&lt;/li&gt;
  &lt;/ul&gt;
&lt;/div&gt;
</content>
 </entry>
 
 <entry>
   <title>Đổi biến và Jacobian</title>
   <link href="https://calculus-self-learning.pages.dev/contents/vi/chapter13/13_03_Doi_bien_va_Jacobian/"/>
   <updated>2026-12-01T00:00:00+00:00</updated>
   <id>https://calculus-self-learning.pages.dev/contents/vi/chapter13/13_03_Doi_bien_va_Jacobian</id>
   <content type="html">&lt;div class=&quot;textbook-objectives&quot;&gt;

  &lt;p&gt;&lt;strong&gt;Mục tiêu bài học.&lt;/strong&gt; Sau bài này bạn có thể:&lt;/p&gt;

  &lt;ul&gt;
    &lt;li&gt;phát biểu công thức đổi biến và giải thích vì sao xuất hiện $\lvert J\rvert$;&lt;/li&gt;
    &lt;li&gt;tính tích phân trên hình tròn, hình vành khăn bằng toạ độ cực;&lt;/li&gt;
    &lt;li&gt;chọn phép đổi biến tuyến tính để biến miền xiên thành hình chữ nhật.&lt;/li&gt;
  &lt;/ul&gt;

&lt;/div&gt;

&lt;h2 id=&quot;vì-sao-cần-bài-này&quot;&gt;Vì sao cần bài này&lt;/h2&gt;

&lt;p&gt;Một biến, phép thế $x=g(u)$ cho $dx=g&apos;(u)\,du$. Hai biến, một ô nhỏ $du\,dv$ bị phép đổi biến kéo giãn thành hình bình hành, và hệ số co giãn diện tích là $\lvert\det J\rvert$. Với miền tròn, toạ độ cực biến bài toán khó thành dễ; với các miền xiên, đổi biến tuyến tính làm điều tương tự.&lt;/p&gt;

&lt;h2 id=&quot;công-thức-đổi-biến&quot;&gt;Công thức đổi biến&lt;/h2&gt;

&lt;div class=&quot;textbook-theorem&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Định lý 1.&lt;/strong&gt; Cho $T(u,v)=(x(u,v),y(u,v))$ có đạo hàm riêng liên tục, song ánh từ miền $S$ lên $D$, với Jacobian $J=\dfrac{\partial(x,y)}{\partial(u,v)}=\det\begin{pmatrix}x_u&amp;amp;x_v\\y_u&amp;amp;y_v\end{pmatrix}\ne0$ (trừ trên tập diện tích 0). Với $f$ liên tục trên $D$:&lt;/p&gt;

\[\iint_Df(x,y)\,dx\,dy=\iint_Sf(T(u,v))\,\lvert J(u,v)\rvert\,du\,dv.\]

&lt;/div&gt;

&lt;div class=&quot;textbook-proof&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Ý chính của chứng minh.&lt;/strong&gt; Ô chữ nhật nhỏ $[u,u+\Delta u]\times[v,v+\Delta v]$ bị $T$ biến thành một miền gần với hình bình hành có cạnh $T_u\Delta u$ và $T_v\Delta v$ (xấp xỉ tuyến tính $T(a+h)\approx T(a)+J_T(a)h$, bài 11_01). Diện tích hình bình hành là $\lvert\det(T_u,T_v)\rvert\Delta u\Delta v=\lvert J\rvert\Delta u\Delta v$. Do đó tổng Riemann $\sum f(T(u_i,v_j))\lvert J\rvert\Delta u\Delta v$ trên $S$ xấp xỉ tổng Riemann của $f$ trên $D$; đánh giá sai số đều (nhờ đạo hàm riêng liên tục) cho thấy hai giới hạn bằng nhau.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;reel-video&quot;&gt;
  &lt;video controls=&quot;&quot; playsinline=&quot;&quot; preload=&quot;metadata&quot; src=&quot;/public/videos/reels/jacobian-area-scaling.mp4&quot;&gt;&lt;/video&gt;
  &lt;p class=&quot;reel-caption&quot;&gt;Định thức Jacobi là hệ số phóng diện tích: từ phép biến đổi tuyến tính, phép cong, đến tích phân Gauss bằng toạ độ cực; lưới cực với dA = r dr dθ, ví dụ ∬(x² + y²) dA và nửa cầu, định thức âm làm lật hướng, và phép đổi biến u = x + y, v = y − x (video không lời, khoảng 3 phút 1 giây).&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;interactive-frame&quot;&gt;
  &lt;div class=&quot;interactive-frame-head&quot;&gt;
    &lt;div class=&quot;interactive-frame-title&quot;&gt;Lưới đổi biến và hệ số |J|&lt;/div&gt;
    &lt;div class=&quot;interactive-frame-desc&quot;&gt;Toạ độ cực, phép tuyến tính, (u² − v², 2uv): so diện tích ô ảnh với |J|·ΔuΔv.&lt;/div&gt;
  &lt;/div&gt;
  &lt;iframe src=&quot;/interactives/chapter13/change-of-variables.html&quot; title=&quot;Lưới đổi biến và hệ số |J|&quot; loading=&quot;lazy&quot; style=&quot;height: 720px;&quot;&gt;&lt;/iframe&gt;
  &lt;div class=&quot;interactive-frame-foot&quot;&gt;
    &lt;a href=&quot;/interactives/chapter13/change-of-variables.html&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;Mở minh hoạ ở cửa sổ riêng&lt;/a&gt;
  &lt;/div&gt;
&lt;/div&gt;

&lt;h2 id=&quot;toạ-độ-cực&quot;&gt;Toạ độ cực&lt;/h2&gt;

&lt;p&gt;Với $x=r\cos\theta$, $y=r\sin\theta$, $J=r$ (bài 11_01), nên&lt;/p&gt;

\[dA=r\,dr\,d\theta.\]

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Ví dụ 1.&lt;/strong&gt; $\iint_{x^2+y^2\le4}(x^2+y^2)\,dA=\int_0^{2\pi}\int_0^2r^2\cdot r\,dr\,d\theta=2\pi\cdot4=8\pi.$&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Ví dụ 2 (Thể tích hình cầu).&lt;/strong&gt; Hình cầu bán kính $R$ gồm hai nửa, mỗi nửa nằm dưới $z=\sqrt{R^2-x^2-y^2}$ trên hình tròn bán kính $R$:&lt;/p&gt;

\[V=2\int_0^{2\pi}\int_0^R\sqrt{R^2-r^2}\,r\,dr\,d\theta=4\pi\Big[-\tfrac13(R^2-r^2)^{3/2}\Big]_0^R=\frac43\pi R^3.\]

&lt;/div&gt;

&lt;h2 id=&quot;đổi-biến-tuyến-tính&quot;&gt;Đổi biến tuyến tính&lt;/h2&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Ví dụ 3.&lt;/strong&gt; $\iint_D(x+y)^2\,dA$, $D$ là hình vuông xoay $\lvert x+y\rvert\le1$, $\lvert x-y\rvert\le1$. Đặt $u=x+y$, $v=x-y$, tức $x=\tfrac{u+v}2$, $y=\tfrac{u-v}2$:&lt;/p&gt;

\[J=\det\begin{pmatrix}\tfrac12&amp;amp;\tfrac12\\\tfrac12&amp;amp;-\tfrac12\end{pmatrix}=-\tfrac12,\qquad\iint_D(x+y)^2\,dA=\int_{-1}^1\int_{-1}^1u^2\cdot\tfrac12\,du\,dv=\tfrac23.\]

&lt;/div&gt;

&lt;h2 id=&quot;ứng-dụng&quot;&gt;Ứng dụng&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Diện tích elip.&lt;/strong&gt; Với $x=au$, $y=bv$, elip $\tfrac{x^2}{a^2}+\tfrac{y^2}{b^2}\le1$ là ảnh của hình tròn đơn vị và $J=ab$, nên diện tích là $\pi ab$. Đây là ví dụ đơn giản nhất của nhận xét: phép biến đổi tuyến tính $A$ nhân mọi diện tích với $\lvert\det A\rvert$ (Đại số tuyến tính).&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Vật lý.&lt;/strong&gt; Đĩa bán kính $R$ có mật độ $\sigma=k\sqrt{x^2+y^2}$ (đặc hơn ở mép) có khối lượng $\int_0^{2\pi}\int_0^Rkr\cdot r\,dr\,d\theta=\tfrac23\pi kR^3$.&lt;/p&gt;

&lt;h2 id=&quot;bài-tập&quot;&gt;Bài tập&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Cơ bản.&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;$\iint_{x^2+y^2\le1}e^{-(x^2+y^2)}\,dA$.&lt;/li&gt;
  &lt;li&gt;$\iint_{1\le x^2+y^2\le4}\dfrac{dA}{x^2+y^2}$.&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Đáp án&lt;/summary&gt;

  &lt;ol&gt;
    &lt;li&gt;$2\pi\int_0^1e^{-r^2}r\,dr=\pi(1-e^{-1})$.&lt;/li&gt;
    &lt;li&gt;$2\pi\int_1^2\tfrac{dr}r=2\pi\ln2$.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;p&gt;&lt;strong&gt;Trung bình.&lt;/strong&gt;&lt;/p&gt;

&lt;ol start=&quot;3&quot;&gt;
  &lt;li&gt;$\iint_Dxy\,dA$, $D$ là phần tư hình tròn đơn vị trong góc phần tư thứ nhất.&lt;/li&gt;
  &lt;li&gt;Chứng minh $\dfrac{\partial(x,y)}{\partial(u,v)}\cdot\dfrac{\partial(u,v)}{\partial(x,y)}=1$ và dùng nó tính Jacobian của phép đổi biến ở ví dụ 3 theo cách khác.&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Đáp án&lt;/summary&gt;

  &lt;ol start=&quot;3&quot;&gt;
    &lt;li&gt;$\int_0^{\pi/2}\cos\theta\sin\theta\,d\theta\int_0^1r^3dr=\tfrac12\cdot\tfrac14=\tfrac18$.&lt;/li&gt;
    &lt;li&gt;Theo quy tắc chuỗi, tích hai ma trận Jacobi là ma trận đơn vị; lấy định thức. $\tfrac{\partial(u,v)}{\partial(x,y)}=\det\begin{pmatrix}1&amp;amp;1\\1&amp;amp;-1\end{pmatrix}=-2$, nên $J=-\tfrac12$.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;p&gt;&lt;strong&gt;Nâng cao.&lt;/strong&gt;&lt;/p&gt;

&lt;ol start=&quot;5&quot;&gt;
  &lt;li&gt;Tính $\iint_De^{(x-y)/(x+y)}\,dA$ với $D$ là tam giác $x,y\ge0$, $x+y\le1$.&lt;/li&gt;
  &lt;li&gt;Vì sao trong công thức có $\lvert J\rvert$ chứ không phải $J$, trong khi một biến ta viết $dx=g&apos;(u)\,du$ có dấu?&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Gợi ý&lt;/summary&gt;

  &lt;ol start=&quot;5&quot;&gt;
    &lt;li&gt;$u=x-y$, $v=x+y$, $\lvert J\rvert=\tfrac12$, miền $0\le v\le1$, $-v\le u\le v$: $\tfrac12\int_0^1v(e-e^{-1})\,dv=\tfrac{e-e^{-1}}4\approx0.588$.&lt;/li&gt;
    &lt;li&gt;Một biến, dấu được bù bởi việc đảo cận ($\int_a^b=-\int_b^a$). Tích phân kép trên miền không có hướng, nên ta dùng diện tích, luôn dương.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;h2 id=&quot;tóm-tắt&quot;&gt;Tóm tắt&lt;/h2&gt;

&lt;div class=&quot;content-box summary-box textbook-block&quot;&gt;
  &lt;ul&gt;
    &lt;li&gt;$dx\,dy=\lvert J\rvert\,du\,dv$; $\lvert J\rvert$ là hệ số co giãn diện tích.&lt;/li&gt;
    &lt;li&gt;Toạ độ cực: $dA=r\,dr\,d\theta$, hợp với miền tròn và hàm của $x^2+y^2$.&lt;/li&gt;
    &lt;li&gt;Đổi biến tuyến tính biến hình bình hành thành hình chữ nhật.&lt;/li&gt;
    &lt;li&gt;Phép biến đổi tuyến tính $A$ nhân diện tích với $\lvert\det A\rvert$.&lt;/li&gt;
  &lt;/ul&gt;
&lt;/div&gt;
</content>
 </entry>
 
 <entry>
   <title>Tích phân kép trên miền tổng quát</title>
   <link href="https://calculus-self-learning.pages.dev/contents/vi/chapter13/13_02_Tich_phan_kep_tren_mien_tong_quat/"/>
   <updated>2026-12-01T00:00:00+00:00</updated>
   <id>https://calculus-self-learning.pages.dev/contents/vi/chapter13/13_02_Tich_phan_kep_tren_mien_tong_quat</id>
   <content type="html">&lt;div class=&quot;textbook-objectives&quot;&gt;

  &lt;p&gt;&lt;strong&gt;Mục tiêu bài học.&lt;/strong&gt; Sau bài này bạn có thể:&lt;/p&gt;

  &lt;ul&gt;
    &lt;li&gt;mô tả miền phẳng dạng loại I ($y$ giữa hai đồ thị) hoặc loại II ($x$ giữa hai đồ thị);&lt;/li&gt;
    &lt;li&gt;xác định cận từ hình vẽ và tính tích phân lặp;&lt;/li&gt;
    &lt;li&gt;đảo thứ tự lấy tích phân;&lt;/li&gt;
    &lt;li&gt;tính xác suất của cặp biến ngẫu nhiên.&lt;/li&gt;
  &lt;/ul&gt;

&lt;/div&gt;

&lt;h2 id=&quot;vì-sao-cần-bài-này&quot;&gt;Vì sao cần bài này&lt;/h2&gt;

&lt;p&gt;Miền thực tế hiếm khi là hình chữ nhật: tấm hình tam giác, vùng giữa hai đường cong, sự kiện $X&amp;lt;Y$. Ta cần cách đặt cận, và đôi khi đổi thứ tự lấy tích phân biến một tích phân không tính được thành dễ dàng.&lt;/p&gt;

&lt;h2 id=&quot;miền-loại-i-và-loại-ii&quot;&gt;Miền loại I và loại II&lt;/h2&gt;

&lt;div class=&quot;textbook-definition&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Định nghĩa.&lt;/strong&gt; Miền &lt;strong&gt;loại I&lt;/strong&gt;: $D=\lbrace a\le x\le b,\ g_1(x)\le y\le g_2(x)\rbrace$. Miền &lt;strong&gt;loại II&lt;/strong&gt;: $D=\lbrace c\le y\le d,\ h_1(y)\le x\le h_2(y)\rbrace$. Với $f$ xác định trên $D$, đặt $\iint_Df\,dA=\iint_R\tilde f\,dA$, với $R\supset D$ là hình chữ nhật và $\tilde f$ bằng $f$ trên $D$, bằng 0 ngoài $D$.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-theorem&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Định lý 1.&lt;/strong&gt; Nếu $f$ liên tục trên miền loại I với $g_1$, $g_2$ liên tục thì&lt;/p&gt;

\[\iint_Df\,dA=\int_a^b\int_{g_1(x)}^{g_2(x)}f(x,y)\,dy\,dx,\]

  &lt;p&gt;và tương tự cho miền loại II.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-proof&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Chứng minh (phác thảo).&lt;/strong&gt; Áp dụng Fubini cho $\tilde f$ trên $R=[a,b]\times[c,d]$: với $x$ cố định, $\tilde f(x,\cdot)$ bằng $f(x,\cdot)$ trên $[g_1(x),g_2(x)]$ và bằng 0 ngoài đó, nên tích phân trong là $\int_{g_1(x)}^{g_2(x)}f\,dy$. Hàm $\tilde f$ chỉ gián đoạn trên hai đồ thị $y=g_k(x)$, là các tập có diện tích 0; định lý Fubini vẫn đúng trong trường hợp này (chứng minh trong giáo trình giải tích thực).&lt;/p&gt;
&lt;/div&gt;

&lt;p&gt;&lt;strong&gt;Cách đặt cận (loại I).&lt;/strong&gt; Vẽ miền. Cố định một $x$, kẻ đường thẳng đứng xuyên miền: nó vào miền tại $y=g_1(x)$ và ra tại $y=g_2(x)$. Rồi cho $x$ chạy từ giá trị nhỏ nhất tới lớn nhất trên miền.&lt;/p&gt;

&lt;div class=&quot;interactive-frame&quot;&gt;
  &lt;div class=&quot;interactive-frame-head&quot;&gt;
    &lt;div class=&quot;interactive-frame-title&quot;&gt;Cận của tích phân kép và đổi thứ tự&lt;/div&gt;
    &lt;div class=&quot;interactive-frame-desc&quot;&gt;Kéo đường cắt dọc hoặc ngang để đọc cận trong; hai thứ tự cho cùng kết quả.&lt;/div&gt;
  &lt;/div&gt;
  &lt;iframe src=&quot;/interactives/chapter13/double-integral.html&quot; title=&quot;Cận của tích phân kép và đổi thứ tự&quot; loading=&quot;lazy&quot; style=&quot;height: 700px;&quot;&gt;&lt;/iframe&gt;
  &lt;div class=&quot;interactive-frame-foot&quot;&gt;
    &lt;a href=&quot;/interactives/chapter13/double-integral.html&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;Mở minh hoạ ở cửa sổ riêng&lt;/a&gt;
  &lt;/div&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Ví dụ 1.&lt;/strong&gt; $\iint_D(x+2y)\,dA$, $D$ là miền giữa $y=2x^2$ và $y=1+x^2$. Hai đường cắt nhau tại $x=\pm1$, và $1+x^2\ge2x^2$ trên $[-1,1]$:&lt;/p&gt;

\[\int_{-1}^1\int_{2x^2}^{1+x^2}(x+2y)\,dy\,dx=\int_{-1}^1\big(-3x^4-x^3+2x^2+x+1\big)dx=-\frac65+\frac43+2=\frac{32}{15}.\]

&lt;/div&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Ví dụ 2 (Đảo thứ tự).&lt;/strong&gt; $\int_0^1\int_x^1\sin(y^2)\,dy\,dx$: $\sin(y^2)$ không có nguyên hàm sơ cấp. Miền là tam giác $0\le x\le y\le1$; viết lại loại II:&lt;/p&gt;

\[\int_0^1\int_0^y\sin(y^2)\,dx\,dy=\int_0^1y\sin(y^2)\,dy=\frac{1-\cos1}2\approx0.2298.\]

&lt;/div&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Ví dụ 3 (Diện tích).&lt;/strong&gt; Diện tích miền $D$ là $\iint_D1\,dA$. Miền giữa $y=x^2$ và $y=x$: $\int_0^1(x-x^2)\,dx=\tfrac16$.&lt;/p&gt;
&lt;/div&gt;

&lt;h2 id=&quot;ứng-dụng-xác-suất-của-cặp-biến-ngẫu-nhiên&quot;&gt;Ứng dụng: xác suất của cặp biến ngẫu nhiên&lt;/h2&gt;

&lt;p&gt;Nếu $(X,Y)$ có mật độ đồng thời $p(x,y)$ thì $P\big((X,Y)\in D\big)=\iint_Dp\,dA$.&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;$X$, $Y$ độc lập, đều trên $[0,1]$ ($p=1$ trên hình vuông): $P(Y\le X^2)=\int_0^1x^2\,dx=\tfrac13$.&lt;/li&gt;
  &lt;li&gt;Thời gian chờ hai sự kiện $X$, $Y$ độc lập, phân phối mũ, $p=e^{-x-y}$ với $x,y\ge0$: $P(X&amp;lt;Y)=\int_0^\infty\int_x^\infty e^{-x-y}\,dy\,dx=\int_0^\infty e^{-2x}\,dx=\tfrac12$, như tính đối xứng dự đoán.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2 id=&quot;bài-tập&quot;&gt;Bài tập&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Cơ bản.&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;$\iint_Dxy\,dA$ với $D$ là tam giác $0\le y\le x\le1$.&lt;/li&gt;
  &lt;li&gt;Diện tích miền giữa $y=x^2$ và $y=2x$.&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Đáp án&lt;/summary&gt;

  &lt;ol&gt;
    &lt;li&gt;$\int_0^1x\cdot\tfrac{x^2}2\,dx=\tfrac18$.&lt;/li&gt;
    &lt;li&gt;$\int_0^2(2x-x^2)\,dx=\tfrac43$.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;p&gt;&lt;strong&gt;Trung bình.&lt;/strong&gt;&lt;/p&gt;

&lt;ol start=&quot;3&quot;&gt;
  &lt;li&gt;Tính $\int_0^1\int_{\sqrt y}^1e^{x^3}\,dx\,dy$ bằng cách đảo thứ tự.&lt;/li&gt;
  &lt;li&gt;Tính $\int_0^2\int_{y/2}^1e^{x^2}\,dx\,dy$.&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Đáp án&lt;/summary&gt;

  &lt;ol start=&quot;3&quot;&gt;
    &lt;li&gt;Miền $0\le y\le x^2$, $0\le x\le1$: $\int_0^1x^2e^{x^3}\,dx=\tfrac{e-1}3$.&lt;/li&gt;
    &lt;li&gt;Miền $0\le y\le2x$, $0\le x\le1$: $\int_0^12xe^{x^2}\,dx=e-1$.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;p&gt;&lt;strong&gt;Nâng cao.&lt;/strong&gt;&lt;/p&gt;

&lt;ol start=&quot;5&quot;&gt;
  &lt;li&gt;Tính thể tích tứ diện $x,y,z\ge0$, $x+y+z\le1$ bằng tích phân kép của $1-x-y$.&lt;/li&gt;
  &lt;li&gt;$X$, $Y$ độc lập, đều trên $[0,1]$. Tính $P(X+Y\le1)$ và $P(XY\le\tfrac12)$.&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Gợi ý&lt;/summary&gt;

  &lt;ol start=&quot;5&quot;&gt;
    &lt;li&gt;$\int_0^1\int_0^{1-x}(1-x-y)\,dy\,dx=\int_0^1\tfrac{(1-x)^2}2\,dx=\tfrac16$.&lt;/li&gt;
    &lt;li&gt;$\tfrac12$. $P(XY&amp;gt;\tfrac12)=\int_{1/2}^1\big(1-\tfrac1{2x}\big)dx=\tfrac12-\tfrac{\ln2}2$, nên $P(XY\le\tfrac12)=\tfrac12+\tfrac{\ln2}2\approx0.847$.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;h2 id=&quot;tóm-tắt&quot;&gt;Tóm tắt&lt;/h2&gt;

&lt;div class=&quot;content-box summary-box textbook-block&quot;&gt;
  &lt;ul&gt;
    &lt;li&gt;Miền loại I: $y$ chạy giữa hai đồ thị theo $x$; loại II ngược lại.&lt;/li&gt;
    &lt;li&gt;Đặt cận bằng cách kẻ đường cắt xuyên miền.&lt;/li&gt;
    &lt;li&gt;Đảo thứ tự có thể biến tích phân không tính được thành dễ.&lt;/li&gt;
    &lt;li&gt;Xác suất của $(X,Y)$ là tích phân kép của mật độ đồng thời.&lt;/li&gt;
  &lt;/ul&gt;
&lt;/div&gt;
</content>
 </entry>
 
 <entry>
   <title>Tích phân kép trên hình chữ nhật và định lý Fubini</title>
   <link href="https://calculus-self-learning.pages.dev/contents/vi/chapter13/13_01_Tich_phan_kep_tren_hinh_chu_nhat_va_dinh_ly_Fubini/"/>
   <updated>2026-12-01T00:00:00+00:00</updated>
   <id>https://calculus-self-learning.pages.dev/contents/vi/chapter13/13_01_Tich_phan_kep_tren_hinh_chu_nhat_va_dinh_ly_Fubini</id>
   <content type="html">&lt;div class=&quot;textbook-objectives&quot;&gt;

  &lt;p&gt;&lt;strong&gt;Mục tiêu bài học.&lt;/strong&gt; Sau bài này bạn có thể:&lt;/p&gt;

  &lt;ul&gt;
    &lt;li&gt;định nghĩa tích phân kép bằng tổng Riemann và hiểu nó là thể tích dưới mặt;&lt;/li&gt;
    &lt;li&gt;tính tích phân kép bằng hai tích phân lặp (định lý Fubini) và chứng minh định lý cho hàm liên tục;&lt;/li&gt;
    &lt;li&gt;chọn thứ tự lấy tích phân cho dễ tính.&lt;/li&gt;
  &lt;/ul&gt;

&lt;/div&gt;

&lt;h2 id=&quot;vì-sao-cần-bài-này&quot;&gt;Vì sao cần bài này&lt;/h2&gt;

&lt;p&gt;Tích phân một biến cộng các giá trị dọc một đoạn. Nhiều đại lượng phân bố trên một vùng phẳng: khối lượng tấm kim loại có mật độ thay đổi, lượng mưa trên một tỉnh, xác suất của cặp biến ngẫu nhiên. Tích phân kép cộng chúng lại, và định lý Fubini đưa việc tính về hai tích phân một biến quen thuộc.&lt;/p&gt;

&lt;h2 id=&quot;định-nghĩa&quot;&gt;Định nghĩa&lt;/h2&gt;

&lt;div class=&quot;textbook-definition&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Định nghĩa.&lt;/strong&gt; Cho $f$ bị chặn trên hình chữ nhật $R=[a,b]\times[c,d]$. Chia $R$ thành các ô $R_{ij}$ diện tích $\Delta A_{ij}$ và chọn điểm $(x_{ij}^*,y_{ij}^*)\in R_{ij}$. Nếu tổng Riemann&lt;/p&gt;

\[\sum_{i,j}f(x_{ij}^*,y_{ij}^*)\,\Delta A_{ij}\]

  &lt;p&gt;có giới hạn khi đường kính lớn nhất của các ô tiến tới 0, không phụ thuộc cách chọn điểm, giới hạn đó là &lt;strong&gt;tích phân kép&lt;/strong&gt; $\iint_Rf\,dA$.&lt;/p&gt;
&lt;/div&gt;

&lt;p&gt;Nếu $f\ge0$, mỗi số hạng là thể tích một cột hộp nhỏ, nên $\iint_Rf\,dA$ là thể tích khối dưới mặt $z=f(x,y)$. Mọi hàm liên tục trên $R$ đều khả tích (chứng minh như một biến, dùng tính liên tục đều).&lt;/p&gt;

&lt;h2 id=&quot;định-lý-fubini&quot;&gt;Định lý Fubini&lt;/h2&gt;

&lt;div class=&quot;textbook-theorem&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Định lý 1 (Fubini).&lt;/strong&gt; Nếu $f$ liên tục trên $R=[a,b]\times[c,d]$ thì&lt;/p&gt;

\[\iint_Rf\,dA=\int_a^b\Big(\int_c^df(x,y)\,dy\Big)dx=\int_c^d\Big(\int_a^bf(x,y)\,dx\Big)dy.\]

&lt;/div&gt;

&lt;div class=&quot;textbook-proof&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Chứng minh.&lt;/strong&gt; Đặt $F(x)=\int_c^df(x,y)\,dy$; $F$ liên tục vì $f$ liên tục đều. Cho $\varepsilon&amp;gt;0$. Do $f$ liên tục đều trên $R$, có $\delta&amp;gt;0$ sao cho $\lvert f(p)-f(q)\rvert&amp;lt;\varepsilon$ khi $\lVert p-q\rVert&amp;lt;\delta$. Lấy lưới chia $[a,b]$ bởi các $x_i$ và $[c,d]$ bởi các $y_j$ với các ô có đường kính nhỏ hơn $\delta$, chọn điểm $(x_i^*,y_j^*)$. Với mỗi $i$,&lt;/p&gt;

\[\Big\lvert\sum_jf(x_i^*,y_j^*)\Delta y_j-F(x_i^*)\Big\rvert=\Big\lvert\sum_j\int_{y_{j-1}}^{y_j}\big(f(x_i^*,y_j^*)-f(x_i^*,y)\big)dy\Big\rvert\le\varepsilon(d-c).\]

  &lt;p&gt;Nhân với $\Delta x_i$ rồi cộng: tổng Riemann kép khác $\sum_iF(x_i^*)\Delta x_i$ không quá $\varepsilon(d-c)(b-a)$. Khi lưới mịn dần, tổng Riemann kép tiến tới $\iint_Rf\,dA$ còn $\sum_iF(x_i^*)\Delta x_i$ tiến tới $\int_a^bF\,dx$. Vì $\varepsilon$ tuỳ ý, hai giới hạn bằng nhau. Thứ tự còn lại chứng minh tương tự.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;reel-video&quot;&gt;
  &lt;video controls=&quot;&quot; playsinline=&quot;&quot; preload=&quot;metadata&quot; src=&quot;/public/videos/reels/fubini-slicing.mp4&quot;&gt;&lt;/video&gt;
  &lt;p class=&quot;reel-caption&quot;&gt;Định lý Fubini bằng lát cắt: thể tích dưới z = x²y được xấp xỉ bằng các cột rồi cắt thành lát theo x hoặc theo y, cả hai cho cùng kết quả 4; ví dụ sin(x + y), giá trị trung bình, chọn thứ tự, miền tam giác, xác suất, nguyên lý Cavalieri và một phản ví dụ (video không lời, khoảng 3 phút 1 giây).&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Ví dụ 1.&lt;/strong&gt; $\iint_{[0,2]\times[1,2]}x^2y\,dA=\int_0^2x^2dx\cdot\int_1^2y\,dy=\dfrac83\cdot\dfrac32=4.$ Khi $f(x,y)=g(x)h(y)$, tích phân kép tách thành tích hai tích phân.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Ví dụ 2.&lt;/strong&gt; $\displaystyle\iint_{[0,\pi/2]^2}\sin(x+y)\,dA=\int_0^{\pi/2}\big[-\cos(x+y)\big]_{y=0}^{\pi/2}dx=\int_0^{\pi/2}(\cos x+\sin x)\,dx=2.$&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Ví dụ 3 (Chọn thứ tự).&lt;/strong&gt; $\iint_{[0,1]^2}xe^{xy}\,dA$. Lấy theo $y$ trước: $\int_0^1\big[e^{xy}\big]_{y=0}^{1}dx=\int_0^1(e^x-1)\,dx=e-2$. Nếu lấy theo $x$ trước phải tích phân từng phần và gặp $\int(e^y/y)\,dy$ không có nguyên hàm sơ cấp, dù kết quả cuối vẫn như nhau.&lt;/p&gt;
&lt;/div&gt;

&lt;h2 id=&quot;ứng-dụng&quot;&gt;Ứng dụng&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Giá trị trung bình.&lt;/strong&gt; Trung bình của $f$ trên $R$ là $\dfrac1{\text{diện tích }R}\iint_Rf\,dA$. Nếu nhiệt độ trên tấm $[0,2]\times[1,2]$ là $x^2y$ độ thì nhiệt độ trung bình là $4/2=2$ độ.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Vật lý.&lt;/strong&gt; Với mật độ điện tích mặt $\sigma(x,y)$ trên tấm $R$, tổng điện tích là $\iint_R\sigma\,dA$; với lượng mưa $p(x,y)$ (mm) trên một vùng, tổng lượng nước là $\iint p\,dA$.&lt;/p&gt;

&lt;h2 id=&quot;bài-tập&quot;&gt;Bài tập&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Cơ bản.&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;$\iint_{[0,1]\times[0,2]}(x+y)\,dA$.&lt;/li&gt;
  &lt;li&gt;$\iint_{[0,1]^2}xy^2\,dA$.&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Đáp án&lt;/summary&gt;

  &lt;ol&gt;
    &lt;li&gt;$\int_0^1(2x+2)\,dx=3$.&lt;/li&gt;
    &lt;li&gt;$\tfrac12\cdot\tfrac13=\tfrac16$.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;p&gt;&lt;strong&gt;Trung bình.&lt;/strong&gt;&lt;/p&gt;

&lt;ol start=&quot;3&quot;&gt;
  &lt;li&gt;$\iint_{[1,2]\times[0,1]}ye^{xy}\,dA$ (chọn thứ tự hợp lý).&lt;/li&gt;
  &lt;li&gt;Tính thể tích khối dưới $z=4-x^2-y^2$ trên $[0,1]^2$.&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Đáp án&lt;/summary&gt;

  &lt;ol start=&quot;3&quot;&gt;
    &lt;li&gt;Lấy theo $x$ trước: $\int_0^1(e^{2y}-e^y)\,dy=\tfrac{e^2-1}2-(e-1)=\tfrac{(e-1)^2}2\approx1.476$.&lt;/li&gt;
    &lt;li&gt;$4-\tfrac13-\tfrac13=\tfrac{10}3$.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;p&gt;&lt;strong&gt;Nâng cao.&lt;/strong&gt;&lt;/p&gt;

&lt;ol start=&quot;5&quot;&gt;
  &lt;li&gt;Với $f=\dfrac{x^2-y^2}{(x^2+y^2)^2}$ trên $[0,1]^2$, chứng minh hai tích phân lặp bằng $\pi/4$ và $-\pi/4$. Vì sao không mâu thuẫn với định lý Fubini?&lt;/li&gt;
  &lt;li&gt;Chứng minh $\iint_{[a,b]\times[c,d]}g(x)h(y)\,dA=\int_a^bg\,dx\cdot\int_c^dh\,dy$ với $g$, $h$ liên tục.&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Gợi ý&lt;/summary&gt;

  &lt;ol start=&quot;5&quot;&gt;
    &lt;li&gt;$\int_0^1f\,dy=\big[\tfrac{y}{x^2+y^2}\big]_0^1=\tfrac1{1+x^2}$, rồi $\int_0^1\tfrac{dx}{1+x^2}=\tfrac\pi4$; đổi vai trò $x$, $y$ được $-\tfrac\pi4$. Hàm không bị chặn gần gốc, nên không liên tục trên $R$, và $\iint\lvert f\rvert\,dA=\infty$.&lt;/li&gt;
    &lt;li&gt;Theo Fubini, tích phân trong $\int_c^dg(x)h(y)\,dy=g(x)\int_c^dh$, rồi đưa hằng số ra ngoài.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;h2 id=&quot;tóm-tắt&quot;&gt;Tóm tắt&lt;/h2&gt;

&lt;div class=&quot;content-box summary-box textbook-block&quot;&gt;
  &lt;ul&gt;
    &lt;li&gt;Tích phân kép là giới hạn tổng Riemann; với $f\ge0$ là thể tích dưới mặt.&lt;/li&gt;
    &lt;li&gt;Fubini: với $f$ liên tục, tích phân kép bằng tích phân lặp theo thứ tự bất kỳ.&lt;/li&gt;
    &lt;li&gt;Chọn thứ tự để tích phân trong dễ tính; hàm tách biến cho tích hai tích phân.&lt;/li&gt;
    &lt;li&gt;Phản ví dụ cho thấy cần giả thiết (liên tục, hay $\iint\lvert f\rvert&amp;lt;\infty$).&lt;/li&gt;
  &lt;/ul&gt;
&lt;/div&gt;
</content>
 </entry>
 
 <entry>
   <title>Nhiều ràng buộc và ý nghĩa của nhân tử</title>
   <link href="https://calculus-self-learning.pages.dev/contents/vi/chapter12/12_05_Nhieu_rang_buoc_va_y_nghia_cua_nhan_tu/"/>
   <updated>2026-12-01T00:00:00+00:00</updated>
   <id>https://calculus-self-learning.pages.dev/contents/vi/chapter12/12_05_Nhieu_rang_buoc_va_y_nghia_cua_nhan_tu</id>
   <content type="html">&lt;div class=&quot;textbook-objectives&quot;&gt;

  &lt;p&gt;&lt;strong&gt;Mục tiêu bài học.&lt;/strong&gt; Sau bài này bạn có thể:&lt;/p&gt;

  &lt;ul&gt;
    &lt;li&gt;giải bài toán cực trị với hai ràng buộc bằng $\nabla f=\lambda\nabla g+\mu\nabla h$;&lt;/li&gt;
    &lt;li&gt;chứng minh $\lambda=dM/dc$, với $M(c)$ là giá trị tối ưu;&lt;/li&gt;
    &lt;li&gt;giải thích nhân tử là giá bóng (kinh tế) và lực liên kết (cơ học).&lt;/li&gt;
  &lt;/ul&gt;

&lt;/div&gt;

&lt;h2 id=&quot;vì-sao-cần-bài-này&quot;&gt;Vì sao cần bài này&lt;/h2&gt;

&lt;p&gt;Bài 12_03 xem $\lambda$ như một ẩn phụ. Thực ra nó mang thông tin quý: nếu nới ràng buộc thêm một đơn vị thì giá trị tối ưu tăng bao nhiêu. Trong kinh tế đó là giá bóng của nguồn lực; trong tối ưu, nó dẫn tới bài toán đối ngẫu và điều kiện KKT.&lt;/p&gt;

&lt;h2 id=&quot;hai-ràng-buộc&quot;&gt;Hai ràng buộc&lt;/h2&gt;

&lt;div class=&quot;textbook-theorem&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Định lý 1.&lt;/strong&gt; Giả sử $f$, $g$, $h$ (ba biến) có đạo hàm riêng liên tục, $f$ đạt cực trị địa phương trên tập $\lbrace g=c_1,\ h=c_2\rbrace$ tại $a$, và $\nabla g(a)$, $\nabla h(a)$ không cùng phương. Khi đó có $\lambda$, $\mu$ với&lt;/p&gt;

\[\nabla f(a)=\lambda\nabla g(a)+\mu\nabla h(a).\]

&lt;/div&gt;

&lt;div class=&quot;textbook-proof&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Chứng minh (phác thảo).&lt;/strong&gt; Khi hai gradient không cùng phương, định lý hàm ẩn cho hệ (bài 11_03) cho thấy gần $a$ tập ràng buộc là một đường cong khả vi $r(t)$, $r(0)=a$, với vectơ tiếp tuyến $T=r&apos;(0)\ne0$. Như bài 12_03, $\nabla f(a)\cdot T=0$, và từ $g(r(t))=c_1$, $h(r(t))=c_2$: $\nabla g(a)\cdot T=\nabla h(a)\cdot T=0$. Các vectơ vuông góc với $T$ trong $\mathbb R^3$ tạo thành một mặt phẳng; $\nabla g(a)$ và $\nabla h(a)$ độc lập nên sinh ra mặt phẳng đó, và $\nabla f(a)$ thuộc mặt phẳng đó.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Ví dụ 1.&lt;/strong&gt; Tìm giá trị lớn nhất của $f=x+2y+3z$ trên giao của mặt phẳng $x-y+z=1$ và mặt trụ $x^2+y^2=1$ (một elip, đóng và bị chặn).&lt;/p&gt;

  &lt;p&gt;Hệ $(1,2,3)=\lambda(1,-1,1)+\mu(2x,2y,0)$. Thành phần $z$: $\lambda=3$. Khi đó $2\mu x=-2$, $2\mu y=5$, nên $x=-1/\mu$, $y=5/(2\mu)$. Từ $x^2+y^2=1$: $\mu=\pm\sqrt{29}/2$. Thay $z=1-x+y$: $f=3-2x+5y=3\pm\sqrt{29}$. Lớn nhất $3+\sqrt{29}\approx8.385$, nhỏ nhất $3-\sqrt{29}$.&lt;/p&gt;
&lt;/div&gt;

&lt;h2 id=&quot;ý-nghĩa-của-nhân-tử&quot;&gt;Ý nghĩa của nhân tử&lt;/h2&gt;

&lt;div class=&quot;textbook-theorem&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Định lý 2 (Định lý bao).&lt;/strong&gt; Gọi $x^*(c)$ là điểm tối ưu của $f$ trên $g=c$ với nhân tử $\lambda(c)$, và $M(c)=f(x^*(c))$. Nếu $x^*(c)$ khả vi theo $c$ thì&lt;/p&gt;

\[M&apos;(c)=\lambda(c).\]

&lt;/div&gt;

&lt;div class=&quot;textbook-proof&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Chứng minh.&lt;/strong&gt; Theo quy tắc chuỗi, $M&apos;(c)=\nabla f(x^*)\cdot\dfrac{dx^*}{dc}=\lambda\,\nabla g(x^*)\cdot\dfrac{dx^*}{dc}$. Mặt khác $g(x^*(c))=c$ với mọi $c$; lấy đạo hàm: $\nabla g(x^*)\cdot\dfrac{dx^*}{dc}=1$. Vậy $M&apos;(c)=\lambda$.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Ví dụ 2 (Giá bóng).&lt;/strong&gt; Ở ví dụ 3 bài 12_03, $U=\sqrt{xy}$, ngân sách $2x+3y=B$. Nghiệm $x=B/4$, $y=B/6$ nên $M(B)=B/\sqrt{24}$ và $M&apos;(B)=1/\sqrt{24}\approx0.204$, đúng bằng $\lambda$ đã tìm. Thêm 1 đơn vị tiền thì thoả dụng tối đa tăng khoảng $0.204$: đó là &lt;strong&gt;thoả dụng biên của thu nhập&lt;/strong&gt;.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Ví dụ 3.&lt;/strong&gt; Tối đa $xy$ với $x+y=c$: $y=\lambda$, $x=\lambda$, nên $x=y=c/2$, $\lambda=c/2$. Giá trị tối ưu $M(c)=c^2/4$ có $M&apos;(c)=c/2=\lambda$.&lt;/p&gt;
&lt;/div&gt;

&lt;h2 id=&quot;ứng-dụng&quot;&gt;Ứng dụng&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Kinh tế.&lt;/strong&gt; Trong bài toán sản xuất tối đa lợi nhuận với nguồn lực giới hạn (giờ máy, nguyên liệu), nhân tử của mỗi ràng buộc là giá trị biên của nguồn lực đó: số tiền tối đa đáng trả để có thêm một đơn vị.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Cơ học.&lt;/strong&gt; Một hạt trượt không ma sát trên dây có dạng $g=c$. Phương trình chuyển động là $m\ddot x=-\nabla V+\lambda\nabla g$; số hạng $\lambda\nabla g$ là phản lực của dây, vuông góc với dây, và $\lambda$ đo độ lớn của nó.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Tối ưu (giới thiệu KKT).&lt;/strong&gt; Với ràng buộc bất đẳng thức $g\le c$ khi tối đa hoá $f$: hoặc ràng buộc không chặt và $\nabla f=0$; hoặc ràng buộc chặt và $\nabla f=\lambda\nabla g$ với $\lambda\ge0$ (nới $c$ không thể làm giá trị tối ưu giảm). Đó là các điều kiện Karush–Kuhn–Tucker, trọng tâm của khoá Tối ưu.&lt;/p&gt;

&lt;h2 id=&quot;bài-tập&quot;&gt;Bài tập&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Cơ bản.&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;Tìm giá trị nhỏ nhất của $x^2+y^2+z^2$ với $x+y=2$, $y+z=2$.&lt;/li&gt;
  &lt;li&gt;Tối thiểu $x^2+y^2$ với $x+y=c$. Kiểm tra $M&apos;(c)=\lambda$.&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Đáp án&lt;/summary&gt;

  &lt;ol&gt;
    &lt;li&gt;$2x=\lambda$, $2y=\lambda+\mu$, $2z=\mu$ cho $y=x+z$; giải được $x=z=2/3$, $y=4/3$, giá trị $8/3$.&lt;/li&gt;
    &lt;li&gt;$x=y=c/2$, $\lambda=c$, $M=c^2/2$, $M&apos;=c=\lambda$.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;p&gt;&lt;strong&gt;Trung bình.&lt;/strong&gt;&lt;/p&gt;

&lt;ol start=&quot;3&quot;&gt;
  &lt;li&gt;Tìm điểm gần gốc nhất trên đường giao của $x+y+z=1$ và $x-y=0$.&lt;/li&gt;
  &lt;li&gt;Ở ví dụ 1, thay $x-y+z=1$ bằng $x-y+z=1+\varepsilon$. Giá trị lớn nhất thay đổi xấp xỉ bao nhiêu?&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Đáp án&lt;/summary&gt;

  &lt;ol start=&quot;3&quot;&gt;
    &lt;li&gt;$\nabla f=(2x,2y,2z)=\lambda(1,1,1)+\mu(1,-1,0)$; $x=y$ buộc $\mu=0$, nên $x=y=z=1/3$, khoảng cách bình phương $1/3$.&lt;/li&gt;
    &lt;li&gt;Nhân tử của ràng buộc mặt phẳng là $\lambda=3$, nên tăng khoảng $3\varepsilon$ (kiểm tra: $f=3(1+\varepsilon)-2x+5y$).&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;p&gt;&lt;strong&gt;Nâng cao.&lt;/strong&gt;&lt;/p&gt;

&lt;ol start=&quot;5&quot;&gt;
  &lt;li&gt;Mở rộng định lý 2 cho hai ràng buộc: $\partial M/\partial c_1=\lambda$, $\partial M/\partial c_2=\mu$.&lt;/li&gt;
  &lt;li&gt;Tối đa $f=x+y$ với $x^2+y^2\le1$ và với $x^2+y^2\le r^2$. Kiểm tra $\lambda\ge0$ và $\lambda=dM/d(r^2)$.&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Gợi ý&lt;/summary&gt;

  &lt;ol start=&quot;5&quot;&gt;
    &lt;li&gt;Như chứng minh định lý 2: $\nabla g\cdot\partial x^*/\partial c_1=1$, $\nabla h\cdot\partial x^*/\partial c_1=0$.&lt;/li&gt;
    &lt;li&gt;Ràng buộc chặt, $x=y=r/\sqrt2$, $M=r\sqrt2$; $1=2\lambda x$ cho $\lambda=\tfrac1{r\sqrt2}&amp;gt;0$. Với $s=r^2$: $M=\sqrt{2s}$, $dM/ds=\tfrac1{\sqrt{2s}}=\lambda$.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;h2 id=&quot;tóm-tắt&quot;&gt;Tóm tắt&lt;/h2&gt;

&lt;div class=&quot;content-box summary-box textbook-block&quot;&gt;
  &lt;ul&gt;
    &lt;li&gt;Hai ràng buộc: $\nabla f=\lambda\nabla g+\mu\nabla h$ khi hai gradient độc lập.&lt;/li&gt;
    &lt;li&gt;Định lý bao: nhân tử là đạo hàm của giá trị tối ưu theo mức ràng buộc.&lt;/li&gt;
    &lt;li&gt;Giá bóng (kinh tế), phản lực (cơ học).&lt;/li&gt;
    &lt;li&gt;Ràng buộc bất đẳng thức dẫn tới điều kiện KKT với $\lambda\ge0$.&lt;/li&gt;
  &lt;/ul&gt;
&lt;/div&gt;
</content>
 </entry>
 
 <entry>
   <title>Bình phương tối thiểu và hồi quy tuyến tính</title>
   <link href="https://calculus-self-learning.pages.dev/contents/vi/chapter12/12_04_Binh_phuong_toi_thieu_va_hoi_quy_tuyen_tinh/"/>
   <updated>2026-12-01T00:00:00+00:00</updated>
   <id>https://calculus-self-learning.pages.dev/contents/vi/chapter12/12_04_Binh_phuong_toi_thieu_va_hoi_quy_tuyen_tinh</id>
   <content type="html">&lt;div class=&quot;textbook-objectives&quot;&gt;

  &lt;p&gt;&lt;strong&gt;Mục tiêu bài học.&lt;/strong&gt; Sau bài này bạn có thể:&lt;/p&gt;

  &lt;ul&gt;
    &lt;li&gt;dẫn phương trình chuẩn của đường thẳng bình phương tối thiểu từ $\nabla E=0$;&lt;/li&gt;
    &lt;li&gt;viết bài toán dạng ma trận $A^\top A\beta=A^\top y$ và chứng minh nghiệm là cực tiểu toàn cục;&lt;/li&gt;
    &lt;li&gt;giải thích nghiệm như phép chiếu vuông góc;&lt;/li&gt;
    &lt;li&gt;hiểu hồi quy ridge thay đổi phương trình thế nào.&lt;/li&gt;
  &lt;/ul&gt;

&lt;/div&gt;

&lt;h2 id=&quot;vì-sao-cần-bài-này&quot;&gt;Vì sao cần bài này&lt;/h2&gt;

&lt;p&gt;Có dữ liệu $(x_i,y_i)$ và muốn tìm đường thẳng $y=ax+b$ “khớp nhất”. Ta chọn $a$, $b$ để tổng bình phương sai số nhỏ nhất. Đây là bài toán cực trị hai biến của bài 12_01, và là mô hình học máy đơn giản nhất.&lt;/p&gt;

&lt;h2 id=&quot;phương-trình-chuẩn&quot;&gt;Phương trình chuẩn&lt;/h2&gt;

&lt;p&gt;Với $n$ điểm dữ liệu, sai số là&lt;/p&gt;

\[E(a,b)=\sum_{i=1}^n(y_i-ax_i-b)^2.\]

&lt;p&gt;Đặt $\partial E/\partial a=\partial E/\partial b=0$:&lt;/p&gt;

\[-2\sum x_i(y_i-ax_i-b)=0,\qquad-2\sum(y_i-ax_i-b)=0,\]

&lt;p&gt;tức là &lt;strong&gt;phương trình chuẩn&lt;/strong&gt;&lt;/p&gt;

\[a\sum x_i^2+b\sum x_i=\sum x_iy_i,\qquad a\sum x_i+nb=\sum y_i.\]

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Ví dụ 1.&lt;/strong&gt; Dữ liệu $(0,1)$, $(1,3)$, $(2,4)$, $(3,4)$: $n=4$, $\sum x=6$, $\sum y=12$, $\sum x^2=14$, $\sum xy=23$. Hệ $14a+6b=23$, $6a+4b=12$ cho $a=1$, $b=1.5$: đường $y=x+1.5$. Các phần dư $-0.5$, $0.5$, $0.5$, $-0.5$ có tổng bằng 0 và $E=1$.&lt;/p&gt;
&lt;/div&gt;

&lt;h2 id=&quot;dạng-ma-trận-và-cực-tiểu-toàn-cục&quot;&gt;Dạng ma trận và cực tiểu toàn cục&lt;/h2&gt;

&lt;p&gt;Đặt $A$ là ma trận $n\times2$ có hàng $(x_i,1)$, $\beta=(a,b)^\top$. Khi đó $E(\beta)=\lVert y-A\beta\rVert^2$ và phương trình chuẩn là $A^\top A\beta=A^\top y$. Cùng dạng này dùng cho mọi mô hình tuyến tính theo tham số (nhiều biến, đa thức).&lt;/p&gt;

&lt;div class=&quot;textbook-theorem&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Định lý 1.&lt;/strong&gt; Nếu các cột của $A$ độc lập tuyến tính thì $A^\top A$ khả nghịch và $\beta^*=(A^\top A)^{-1}A^\top y$ là điểm cực tiểu toàn cục duy nhất của $E$.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-proof&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Chứng minh.&lt;/strong&gt; Với $v\ne0$, $v^\top A^\top Av=\lVert Av\rVert^2&amp;gt;0$ vì $Av\ne0$ (các cột độc lập), nên $A^\top A$ xác định dương, do đó khả nghịch. Gọi $\beta^*$ là nghiệm của phương trình chuẩn, $r=y-A\beta^*$; khi đó $A^\top r=0$. Với mọi $h$:&lt;/p&gt;

\[E(\beta^*+h)=\lVert r-Ah\rVert^2=\lVert r\rVert^2-2h^\top A^\top r+\lVert Ah\rVert^2=E(\beta^*)+\lVert Ah\rVert^2.\]

  &lt;p&gt;Vì $\lVert Ah\rVert^2&amp;gt;0$ khi $h\ne0$, $\beta^*$ là cực tiểu toàn cục duy nhất.&lt;/p&gt;
&lt;/div&gt;

&lt;p&gt;&lt;strong&gt;Hình học.&lt;/strong&gt; $A^\top r=0$ nghĩa là phần dư vuông góc với mọi cột của $A$. Vậy $A\beta^*$ là &lt;strong&gt;hình chiếu vuông góc&lt;/strong&gt; của $y$ lên không gian cột của $A$: điểm gần $y$ nhất trong không gian đó. Hai cách nhìn (giải tích: đạo hàm bằng 0; hình học: chiếu vuông góc) cho cùng một nghiệm.&lt;/p&gt;

&lt;div class=&quot;interactive-frame&quot;&gt;
  &lt;div class=&quot;interactive-frame-head&quot;&gt;
    &lt;div class=&quot;interactive-frame-title&quot;&gt;Khớp đường thẳng bằng bình phương tối thiểu&lt;/div&gt;
    &lt;div class=&quot;interactive-frame-desc&quot;&gt;Kéo điểm dữ liệu, chỉnh a, b và so với nghiệm tối ưu; thử thêm ridge.&lt;/div&gt;
  &lt;/div&gt;
  &lt;iframe src=&quot;/interactives/chapter12/least-squares.html&quot; title=&quot;Khớp đường thẳng bằng bình phương tối thiểu&quot; loading=&quot;lazy&quot; style=&quot;height: 720px;&quot;&gt;&lt;/iframe&gt;
  &lt;div class=&quot;interactive-frame-foot&quot;&gt;
    &lt;a href=&quot;/interactives/chapter12/least-squares.html&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;Mở minh hoạ ở cửa sổ riêng&lt;/a&gt;
  &lt;/div&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Ví dụ 2 (Qua gốc toạ độ).&lt;/strong&gt; Mô hình $y=ax$ (ví dụ định luật Hooke $F=kx$): $E=\sum(y_i-ax_i)^2$, $E&apos;(a)=0$ cho $a=\dfrac{\sum x_iy_i}{\sum x_i^2}$.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Ví dụ 3 (Đa thức).&lt;/strong&gt; Mô hình $y=ax^2+b$ với dữ liệu $(0,1)$, $(1,2)$, $(2,5)$: hàng của $A$ là $(x_i^2,1)$. Phương trình chuẩn $17a+5b=22$, $5a+3b=8$ cho $a=b=1$; dữ liệu nằm đúng trên $y=x^2+1$ nên $E=0$. Mô hình “tuyến tính” là tuyến tính theo &lt;em&gt;tham số&lt;/em&gt;, không nhất thiết theo $x$.&lt;/p&gt;
&lt;/div&gt;

&lt;h2 id=&quot;ứng-dụng-hồi-quy-ridge-học-máy&quot;&gt;Ứng dụng: hồi quy ridge (học máy)&lt;/h2&gt;

&lt;p&gt;Khi có nhiều đặc trưng hoặc dữ liệu nhiễu, người ta phạt hệ số lớn: $E_\lambda=\lVert y-A\beta\rVert^2+\lambda a^2$ (thường không phạt hệ số tự do $b$). Đạo hàm cho&lt;/p&gt;

\[\big(A^\top A+\lambda\operatorname{diag}(1,0)\big)\beta=A^\top y.\]

&lt;p&gt;Với dữ liệu ví dụ 1 và $\lambda=1$: $15a+6b=23$, $6a+4b=12$, nên $a=5/6\approx0.833$, $b=1.75$. Độ dốc bị “co” về 0, đổi lại mô hình ít nhạy với nhiễu hơn. Ngoài ra, nếu sai số dữ liệu có phân phối chuẩn, bình phương tối thiểu chính là ước lượng hợp lý cực đại (khoá Xác suất).&lt;/p&gt;

&lt;h2 id=&quot;bài-tập&quot;&gt;Bài tập&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Cơ bản.&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;Tìm đường thẳng bình phương tối thiểu cho $(1,1)$, $(2,2)$, $(3,2)$.&lt;/li&gt;
  &lt;li&gt;Tìm $a$ tốt nhất cho mô hình $y=ax$ với $(1,2)$, $(2,3)$, $(3,7)$.&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Đáp án&lt;/summary&gt;

  &lt;ol&gt;
    &lt;li&gt;$14a+6b=11$, $6a+3b=5$: $a=1/2$, $b=2/3$.&lt;/li&gt;
    &lt;li&gt;$a=(2+6+21)/14=29/14$.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;p&gt;&lt;strong&gt;Trung bình.&lt;/strong&gt;&lt;/p&gt;

&lt;ol start=&quot;3&quot;&gt;
  &lt;li&gt;Chứng minh: khi mô hình có hệ số tự do $b$, tổng các phần dư bằng 0 và đường thẳng đi qua điểm trung bình $(\bar x,\bar y)$.&lt;/li&gt;
  &lt;li&gt;Chứng minh Hessian của $E(a,b)$ là $2\begin{pmatrix}\sum x_i^2&amp;amp;\sum x_i\\\sum x_i&amp;amp;n\end{pmatrix}$ và nó xác định dương khi các $x_i$ không bằng nhau hết.&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Đáp án&lt;/summary&gt;

  &lt;ol start=&quot;3&quot;&gt;
    &lt;li&gt;Phương trình $\partial E/\partial b=0$ là $\sum(y_i-ax_i-b)=0$; chia cho $n$: $\bar y=a\bar x+b$.&lt;/li&gt;
    &lt;li&gt;Lấy đạo hàm phương trình chuẩn. $D=4\big(n\sum x_i^2-(\sum x_i)^2\big)=4n\sum(x_i-\bar x)^2&amp;gt;0$ và phần tử đầu dương.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;p&gt;&lt;strong&gt;Nâng cao.&lt;/strong&gt;&lt;/p&gt;

&lt;ol start=&quot;5&quot;&gt;
  &lt;li&gt;Chứng minh $A^\top A+\lambda I$ khả nghịch với mọi $\lambda&amp;gt;0$, kể cả khi các cột của $A$ phụ thuộc tuyến tính.&lt;/li&gt;
  &lt;li&gt;Dữ liệu $(x_i,y_i)$ với $y_i&amp;gt;0$ được cho là theo $y=ce^{kx}$. Đưa việc tìm $c$, $k$ về bình phương tối thiểu tuyến tính. Cách làm này tối thiểu hoá đại lượng nào?&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Gợi ý&lt;/summary&gt;

  &lt;ol start=&quot;5&quot;&gt;
    &lt;li&gt;$v^\top(A^\top A+\lambda I)v=\lVert Av\rVert^2+\lambda\lVert v\rVert^2&amp;gt;0$ khi $v\ne0$.&lt;/li&gt;
    &lt;li&gt;$\ln y=\ln c+kx$: hồi quy $\ln y_i$ theo $x_i$. Nó tối thiểu sai số bình phương của $\ln y$, không phải của $y$; điểm có $y$ nhỏ được coi trọng tương đối hơn.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;h2 id=&quot;tóm-tắt&quot;&gt;Tóm tắt&lt;/h2&gt;

&lt;div class=&quot;content-box summary-box textbook-block&quot;&gt;
  &lt;ul&gt;
    &lt;li&gt;Đường bình phương tối thiểu: giải $\nabla E=0$, được phương trình chuẩn.&lt;/li&gt;
    &lt;li&gt;Dạng ma trận $A^\top A\beta=A^\top y$; nghiệm là cực tiểu toàn cục vì $E(\beta^*+h)=E(\beta^*)+\lVert Ah\rVert^2$.&lt;/li&gt;
    &lt;li&gt;Hình học: $A\beta^*$ là hình chiếu vuông góc của $y$ lên không gian cột.&lt;/li&gt;
    &lt;li&gt;Ridge thêm $\lambda$ vào đường chéo, làm co hệ số và luôn khả nghịch.&lt;/li&gt;
  &lt;/ul&gt;
&lt;/div&gt;
</content>
 </entry>
 
 <entry>
   <title>Cực trị có điều kiện, nhân tử Lagrange</title>
   <link href="https://calculus-self-learning.pages.dev/contents/vi/chapter12/12_03_Cuc_tri_co_dieu_kien_nhan_tu_Lagrange/"/>
   <updated>2026-12-01T00:00:00+00:00</updated>
   <id>https://calculus-self-learning.pages.dev/contents/vi/chapter12/12_03_Cuc_tri_co_dieu_kien_nhan_tu_Lagrange</id>
   <content type="html">&lt;div class=&quot;textbook-objectives&quot;&gt;

  &lt;p&gt;&lt;strong&gt;Mục tiêu bài học.&lt;/strong&gt; Sau bài này bạn có thể:&lt;/p&gt;

  &lt;ul&gt;
    &lt;li&gt;giải bài toán cực trị của $f$ với ràng buộc $g=c$ bằng hệ $\nabla f=\lambda\nabla g$, $g=c$;&lt;/li&gt;
    &lt;li&gt;chứng minh điều kiện Lagrange và hiểu nó qua hình ảnh đường mức tiếp xúc;&lt;/li&gt;
    &lt;li&gt;nhận ra khi phương pháp thất bại ($\nabla g=0$).&lt;/li&gt;
  &lt;/ul&gt;

&lt;/div&gt;

&lt;h2 id=&quot;vì-sao-cần-bài-này&quot;&gt;Vì sao cần bài này&lt;/h2&gt;

&lt;p&gt;Hầu hết bài toán tối ưu có ràng buộc: tối đa thoả dụng trong ngân sách, tối đa thể tích với lượng vật liệu cho trước, tối thiểu năng lượng trên một mặt. Thế ràng buộc vào để khử biến thường rối hoặc không làm được. Lagrange cho một điều kiện hình học gọn gàng và đối xứng.&lt;/p&gt;

&lt;h2 id=&quot;định-lý-lagrange&quot;&gt;Định lý Lagrange&lt;/h2&gt;

&lt;div class=&quot;textbook-theorem&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Định lý 1.&lt;/strong&gt; Giả sử $f$, $g$ có đạo hàm riêng liên tục, $f$ đạt cực trị địa phương trên tập $\lbrace g=c\rbrace$ tại $a$, và $\nabla g(a)\ne0$. Khi đó có số $\lambda$ (nhân tử Lagrange) sao cho&lt;/p&gt;

\[\nabla f(a)=\lambda\nabla g(a).\]

&lt;/div&gt;

&lt;div class=&quot;textbook-proof&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Chứng minh (hai biến).&lt;/strong&gt; Vì $\nabla g(a)\ne0$, theo định lý hàm ẩn (bài 11_03), gần $a$ tập $g=c$ là đồ thị của một hàm khả vi ($y=\varphi(x)$ hoặc $x=\psi(y)$), nên có thể tham số hoá bởi đường cong khả vi $r(t)$ với $r(0)=a$, $r&apos;(0)\ne0$. Hàm $t\mapsto f(r(t))$ đạt cực trị tại $t=0$, nên $\nabla f(a)\cdot r&apos;(0)=0$. Mặt khác $g(r(t))=c$ cho $\nabla g(a)\cdot r&apos;(0)=0$. Trong mặt phẳng, hai vectơ cùng vuông góc với vectơ khác 0 $r&apos;(0)$ thì song song; vì $\nabla g(a)\ne0$, có $\lambda$ với $\nabla f(a)=\lambda\nabla g(a)$.&lt;/p&gt;

  &lt;p&gt;Trong ba biến, lập luận tương tự cho mọi đường cong trên mặt $g=c$ qua $a$: $\nabla f(a)$ vuông góc với mặt phẳng tiếp xúc, tức song song với pháp tuyến $\nabla g(a)$.&lt;/p&gt;
&lt;/div&gt;

&lt;p&gt;Hình ảnh: đi dọc đường ràng buộc, giá trị $f$ tăng hay giảm khi ta cắt ngang các đường mức của $f$. Tại cực trị, đường ràng buộc &lt;em&gt;tiếp xúc&lt;/em&gt; với một đường mức, nên hai pháp tuyến $\nabla f$ và $\nabla g$ song song.&lt;/p&gt;

&lt;div class=&quot;reel-video&quot;&gt;
  &lt;video controls=&quot;&quot; playsinline=&quot;&quot; preload=&quot;metadata&quot; src=&quot;/public/videos/reels/lagrange-tangent-contours.mp4&quot;&gt;&lt;/video&gt;
  &lt;p class=&quot;reel-caption&quot;&gt;Đường mức xy = c phồng dần cho tới khi vừa chạm elip x²/4 + y² = 1; tại điểm chạm ∇f song song ∇g (video không lời, khoảng 2 phút).&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;interactive-frame&quot;&gt;
  &lt;div class=&quot;interactive-frame-head&quot;&gt;
    &lt;div class=&quot;interactive-frame-title&quot;&gt;Nhân tử Lagrange&lt;/div&gt;
    &lt;div class=&quot;interactive-frame-desc&quot;&gt;Đi dọc ràng buộc; tại cực trị ∇f song song với ∇g.&lt;/div&gt;
  &lt;/div&gt;
  &lt;iframe src=&quot;/interactives/chapter12/lagrange.html&quot; title=&quot;Nhân tử Lagrange&quot; loading=&quot;lazy&quot; style=&quot;height: 700px;&quot;&gt;&lt;/iframe&gt;
  &lt;div class=&quot;interactive-frame-foot&quot;&gt;
    &lt;a href=&quot;/interactives/chapter12/lagrange.html&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;Mở minh hoạ ở cửa sổ riêng&lt;/a&gt;
  &lt;/div&gt;
&lt;/div&gt;

&lt;p&gt;&lt;strong&gt;Cách giải.&lt;/strong&gt; Giải hệ $\nabla f=\lambda\nabla g$, $g=c$ (ba phương trình, ba ẩn $x,y,\lambda$ trong hai biến). So sánh $f$ tại các nghiệm; nếu tập ràng buộc đóng, bị chặn thì giá trị lớn nhất, nhỏ nhất nằm trong số đó (cùng các điểm có $\nabla g=0$, nếu có).&lt;/p&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Ví dụ 1.&lt;/strong&gt; Cực trị của $f=x^2+2y^2$ trên đường tròn $x^2+y^2=1$. Hệ: $2x=2\lambda x$, $4y=2\lambda y$. Nếu $x\ne0$ thì $\lambda=1$, kéo theo $y=0$, $x=\pm1$, $f=1$. Nếu $x=0$ thì $y=\pm1$ ($\lambda=2$), $f=2$. Lớn nhất $2$, nhỏ nhất $1$.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Ví dụ 2 (Hộp thể tích lớn nhất).&lt;/strong&gt; Tối đa $V=xyz$ với diện tích $2(xy+yz+zx)=24$, $x,y,z&amp;gt;0$. Hệ:&lt;/p&gt;

\[yz=2\lambda(y+z),\quad xz=2\lambda(x+z),\quad xy=2\lambda(x+y).\]

  &lt;p&gt;Nhân phương trình đầu với $x$, phương trình thứ hai với $y$ và trừ: $2\lambda z(x-y)=0$. Vì $\lambda\ne0$ (nếu không thì $yz=0$), $x=y$; tương tự $y=z$. Từ ràng buộc $6x^2=24$, $x=2$: hình lập phương cạnh $2$, $V=8$.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Ví dụ 3 (Thoả dụng và ngân sách).&lt;/strong&gt; Tối đa $U=x^{1/2}y^{1/2}$ với $2x+3y=60$. Hệ $U_x=2\lambda$, $U_y=3\lambda$ cho $\dfrac{U_x}{U_y}=\dfrac yx=\dfrac23$: tỉ lệ thay thế biên (bài 11_03) bằng tỉ lệ giá. Vậy $y=2x/3$, $4x=60$, $x=15$, $y=10$, $\lambda=U_x/2\approx0.204$. Ý nghĩa của $\lambda$ ở bài 12_05.&lt;/p&gt;
&lt;/div&gt;

&lt;h2 id=&quot;khi-phương-pháp-thất-bại&quot;&gt;Khi phương pháp thất bại&lt;/h2&gt;

&lt;p&gt;Điều kiện $\nabla g(a)\ne0$ là cần thiết. Tối thiểu $f=x$ trên đường $y^2=x^3$: vì $x^3=y^2\ge0$ nên $x\ge0$, nhỏ nhất tại $(0,0)$. Nhưng $\nabla f=(1,0)$ và $\nabla g=(-3x^2,2y)=(0,0)$ tại gốc, nên không có $\lambda$ nào. Phải luôn kiểm tra riêng các điểm $\nabla g=0$.&lt;/p&gt;

&lt;h2 id=&quot;bài-tập&quot;&gt;Bài tập&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Cơ bản.&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;Cực trị của $x+y$ trên $x^2+y^2=2$.&lt;/li&gt;
  &lt;li&gt;Giá trị nhỏ nhất của $x^2+y^2$ trên đường thẳng $x+2y=5$.&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Đáp án&lt;/summary&gt;

  &lt;ol&gt;
    &lt;li&gt;$1=2\lambda x=2\lambda y$ nên $x=y=\pm1$: lớn nhất $2$, nhỏ nhất $-2$.&lt;/li&gt;
    &lt;li&gt;$(x,y)=\lambda(1,2)/2$ nên $y=2x$, $x=1$, $y=2$, giá trị $5$.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;p&gt;&lt;strong&gt;Trung bình.&lt;/strong&gt;&lt;/p&gt;

&lt;ol start=&quot;3&quot;&gt;
  &lt;li&gt;Tìm điểm trên mặt phẳng $x+2y+2z=9$ gần gốc nhất.&lt;/li&gt;
  &lt;li&gt;Tìm giá trị lớn nhất của $xy$ trên elip $\dfrac{x^2}8+\dfrac{y^2}2=1$.&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Đáp án&lt;/summary&gt;

  &lt;ol start=&quot;3&quot;&gt;
    &lt;li&gt;$(x,y,z)$ tỉ lệ với $(1,2,2)$: $(1,2,2)$, khoảng cách $3$.&lt;/li&gt;
    &lt;li&gt;$y=\lambda x/4$, $x=\lambda y$ cho $\lambda=\pm2$; với $x=2y$: $y^2=1$, giá trị lớn nhất $xy=2$ tại $\pm(2,1)$.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;p&gt;&lt;strong&gt;Nâng cao.&lt;/strong&gt;&lt;/p&gt;

&lt;ol start=&quot;5&quot;&gt;
  &lt;li&gt;Dùng Lagrange chứng minh bất đẳng thức AM-GM cho ba số dương: $xyz\le\big(\tfrac{x+y+z}3\big)^3$.&lt;/li&gt;
  &lt;li&gt;Giải thích bằng hình vẽ đường mức vì sao trong ví dụ 1, điểm $(\pm1,0)$ cho giá trị nhỏ nhất.&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Gợi ý&lt;/summary&gt;

  &lt;ol start=&quot;5&quot;&gt;
    &lt;li&gt;Tối đa $xyz$ với $x+y+z=S$: $yz=xz=xy=\lambda$ cho $x=y=z=S/3$. Tập ràng buộc với $x,y,z\ge0$ là tam giác đóng và $xyz=0$ trên cạnh, nên đó là giá trị lớn nhất.&lt;/li&gt;
    &lt;li&gt;Đường mức $x^2+2y^2=k$ là elip dẹt theo trục $y$. Elip nhỏ nhất chạm đường tròn có $k=1$, chạm tại $(\pm1,0)$; elip lớn nhất còn chạm có $k=2$, tại $(0,\pm1)$.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;h2 id=&quot;tóm-tắt&quot;&gt;Tóm tắt&lt;/h2&gt;

&lt;div class=&quot;content-box summary-box textbook-block&quot;&gt;
  &lt;ul&gt;
    &lt;li&gt;Tại cực trị có điều kiện (với $\nabla g\ne0$): $\nabla f=\lambda\nabla g$.&lt;/li&gt;
    &lt;li&gt;Hình học: đường mức của $f$ tiếp xúc với đường ràng buộc.&lt;/li&gt;
    &lt;li&gt;Giải hệ $\nabla f=\lambda\nabla g$, $g=c$ rồi so sánh giá trị; kiểm tra riêng điểm $\nabla g=0$.&lt;/li&gt;
    &lt;li&gt;Kinh tế: tỉ lệ thay thế biên bằng tỉ lệ giá.&lt;/li&gt;
  &lt;/ul&gt;
&lt;/div&gt;
</content>
 </entry>
 
 <entry>
   <title>Giá trị lớn nhất, nhỏ nhất trên miền đóng</title>
   <link href="https://calculus-self-learning.pages.dev/contents/vi/chapter12/12_02_Gia_tri_lon_nhat_nho_nhat_tren_mien_dong/"/>
   <updated>2026-12-01T00:00:00+00:00</updated>
   <id>https://calculus-self-learning.pages.dev/contents/vi/chapter12/12_02_Gia_tri_lon_nhat_nho_nhat_tren_mien_dong</id>
   <content type="html">&lt;div class=&quot;textbook-objectives&quot;&gt;

  &lt;p&gt;&lt;strong&gt;Mục tiêu bài học.&lt;/strong&gt; Sau bài này bạn có thể:&lt;/p&gt;

  &lt;ul&gt;
    &lt;li&gt;phát biểu và chứng minh định lý Weierstrass cho hàm hai biến;&lt;/li&gt;
    &lt;li&gt;tìm giá trị lớn nhất, nhỏ nhất trên miền đóng bị chặn bằng cách xét bên trong và biên;&lt;/li&gt;
    &lt;li&gt;giải bài toán tối ưu thực tế trên miền không đóng bằng lập luận bổ sung.&lt;/li&gt;
  &lt;/ul&gt;

&lt;/div&gt;

&lt;h2 id=&quot;vì-sao-cần-bài-này&quot;&gt;Vì sao cần bài này&lt;/h2&gt;

&lt;p&gt;Bài 12_01 tìm cực trị &lt;em&gt;địa phương&lt;/em&gt;. Trong thực tế ta cần giá trị lớn nhất, nhỏ nhất &lt;em&gt;toàn cục&lt;/em&gt; trên một miền: nhiệt độ cao nhất trên tấm kim loại, chi phí thấp nhất trong giới hạn kỹ thuật. Giá trị đó có thể nằm trên biên, nơi $\nabla f$ không cần bằng 0.&lt;/p&gt;

&lt;h2 id=&quot;định-lý-weierstrass&quot;&gt;Định lý Weierstrass&lt;/h2&gt;

&lt;p&gt;Một tập $D\subset\mathbb R^2$ là &lt;strong&gt;đóng&lt;/strong&gt; nếu chứa mọi điểm biên của nó, &lt;strong&gt;bị chặn&lt;/strong&gt; nếu nằm trong một hình tròn nào đó.&lt;/p&gt;

&lt;div class=&quot;textbook-theorem&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Định lý 1 (Weierstrass).&lt;/strong&gt; Hàm $f$ liên tục trên tập đóng, bị chặn $D$ đạt giá trị lớn nhất và nhỏ nhất trên $D$.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-proof&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Chứng minh.&lt;/strong&gt; Ta dùng định lý Bolzano–Weierstrass hai chiều: mọi dãy bị chặn trong $\mathbb R^2$ có dãy con hội tụ (lấy dãy con hội tụ theo toạ độ $x$, rồi từ đó dãy con hội tụ theo $y$, như ở bài 01_06).&lt;/p&gt;

  &lt;p&gt;&lt;em&gt;$f$ bị chặn trên.&lt;/em&gt; Nếu không, có $p_n\in D$ với $f(p_n)&amp;gt;n$. Một dãy con $p_{n_k}\to p$; $p\in D$ vì $D$ đóng. Do liên tục, $f(p_{n_k})\to f(p)$ hữu hạn, mâu thuẫn.&lt;/p&gt;

  &lt;p&gt;&lt;em&gt;Đạt giá trị lớn nhất.&lt;/em&gt; Đặt $M=\sup_Df$ và chọn $p_n\in D$ với $f(p_n)&amp;gt;M-1/n$. Một dãy con hội tụ về $p\in D$, và $f(p)=\lim f(p_{n_k})=M$. Giá trị nhỏ nhất: áp dụng cho $-f$.&lt;/p&gt;
&lt;/div&gt;

&lt;p&gt;&lt;strong&gt;Quy trình.&lt;/strong&gt; (1) Tìm các điểm tới hạn bên trong $D$ và tính $f$ tại đó. (2) Tìm giá trị lớn nhất, nhỏ nhất của $f$ trên biên (thường tham số hoá biên thành bài toán một biến). (3) So sánh tất cả các giá trị.&lt;/p&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Ví dụ 1.&lt;/strong&gt; $f=x^2-2xy+2y$ trên hình chữ nhật $[0,3]\times[0,2]$.&lt;/p&gt;

  &lt;ul&gt;
    &lt;li&gt;Bên trong: $\nabla f=(2x-2y,\,-2x+2)=0$ cho $(1,1)$, $f=1$.&lt;/li&gt;
    &lt;li&gt;$y=0$: $f=x^2\in[0,9]$. $x=3$: $f=9-4y\in[1,9]$. $y=2$: $f=(x-2)^2\in[0,4]$. $x=0$: $f=2y\in[0,4]$.&lt;/li&gt;
  &lt;/ul&gt;

  &lt;p&gt;Giá trị lớn nhất $9$ tại $(3,0)$, nhỏ nhất $0$ tại $(0,0)$ và $(2,2)$, đều trên biên.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Ví dụ 2.&lt;/strong&gt; $f=x^2+y^2-2x$ trên đĩa $x^2+y^2\le4$. Bên trong: $(1,0)$, $f=-1$. Trên biên $x^2+y^2=4$: $f=4-2x$ với $x\in[-2,2]$, từ $0$ đến $8$. Lớn nhất $8$ tại $(-2,0)$, nhỏ nhất $-1$ tại $(1,0)$.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Ví dụ 3 (Nhiệt độ trên đĩa).&lt;/strong&gt; $T=x^2+2y^2-x$ trên $x^2+y^2\le1$.&lt;/p&gt;

  &lt;ul&gt;
    &lt;li&gt;Bên trong: $(1/2,0)$, $T=-1/4$.&lt;/li&gt;
    &lt;li&gt;Biên: $y^2=1-x^2$, $T=2-x^2-x$ với $x\in[-1,1]$; đạo hàm $-2x-1=0$ tại $x=-1/2$, $T=9/4$; hai đầu $T(1)=0$, $T(-1)=2$.&lt;/li&gt;
  &lt;/ul&gt;

  &lt;p&gt;Nóng nhất $9/4$ tại $(-1/2,\pm\sqrt3/2)$, lạnh nhất $-1/4$ tại $(1/2,0)$.&lt;/p&gt;
&lt;/div&gt;

&lt;h2 id=&quot;ứng-dụng-hộp-không-nắp&quot;&gt;Ứng dụng: hộp không nắp&lt;/h2&gt;

&lt;p&gt;Hộp chữ nhật không nắp thể tích $32$ có diện tích vật liệu $S=xy+2xz+2yz$ nhỏ nhất bằng bao nhiêu? Thay $z=32/(xy)$: $S=xy+\dfrac{64}{y}+\dfrac{64}{x}$ với $x,y&amp;gt;0$. $\nabla S=0$ cho $y=64/x^2$, $x=64/y^2$, nên $x=y=4$, $z=2$, $S=48$.&lt;/p&gt;

&lt;p&gt;Miền $x,y&amp;gt;0$ không đóng, nên phải lập luận thêm: khi $x$ hoặc $y$ tiến tới $0$ hay $\infty$ thì $S\to\infty$ (nếu $x\to0$ thì $64/x\to\infty$; nếu $x\to\infty$ thì $xy$ hoặc $64/y$ lớn). Vì vậy giá trị nhỏ nhất đạt trên một tập đóng bị chặn kiểu $[\varepsilon,R]^2$, tại điểm tới hạn duy nhất.&lt;/p&gt;

&lt;h2 id=&quot;bài-tập&quot;&gt;Bài tập&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Cơ bản.&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;Giá trị lớn nhất, nhỏ nhất của $f=x+y$ trên hình vuông $[0,1]^2$.&lt;/li&gt;
  &lt;li&gt;Giá trị lớn nhất, nhỏ nhất của $f=xy$ trên đĩa $x^2+y^2\le2$.&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Đáp án&lt;/summary&gt;

  &lt;ol&gt;
    &lt;li&gt;Không có điểm tới hạn; lớn nhất $2$ tại $(1,1)$, nhỏ nhất $0$ tại $(0,0)$.&lt;/li&gt;
    &lt;li&gt;Bên trong: $(0,0)$, $f=0$. Biên $x=\sqrt2\cos t$, $y=\sqrt2\sin t$: $f=\sin2t$. Lớn nhất $1$ tại $\pm(1,1)$, nhỏ nhất $-1$ tại $\pm(1,-1)$.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;p&gt;&lt;strong&gt;Trung bình.&lt;/strong&gt;&lt;/p&gt;

&lt;ol start=&quot;3&quot;&gt;
  &lt;li&gt;$f=x^2+y^2-x-y$ trên tam giác $x,y\ge0$, $x+y\le2$.&lt;/li&gt;
  &lt;li&gt;Chứng minh trong mọi hộp chữ nhật có nắp, thể tích $V$ cố định, hình lập phương có diện tích nhỏ nhất.&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Đáp án&lt;/summary&gt;

  &lt;ol start=&quot;3&quot;&gt;
    &lt;li&gt;Bên trong $(1/2,1/2)$, $f=-1/2$. Cạnh $y=0$: $x^2-x\in[-1/4,2]$; cạnh $x=0$ tương tự; cạnh $x+y=2$: $2(x-1)^2\in[0,2]$. Lớn nhất $2$ tại $(2,0)$, $(0,2)$; nhỏ nhất $-1/2$.&lt;/li&gt;
    &lt;li&gt;$S=2(xy+V/x+V/y)$; $\nabla S=0$ cho $x=y=V^{1/3}$, $z=V^{1/3}$; lập luận biên như ví dụ hộp không nắp.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;p&gt;&lt;strong&gt;Nâng cao.&lt;/strong&gt;&lt;/p&gt;

&lt;ol start=&quot;5&quot;&gt;
  &lt;li&gt;Cho ví dụ hàm liên tục trên đĩa mở $x^2+y^2&amp;lt;1$ không đạt giá trị lớn nhất, và hàm liên tục trên tập đóng không bị chặn không đạt giá trị nhỏ nhất.&lt;/li&gt;
  &lt;li&gt;Chứng minh: nếu $f$ liên tục trên $\mathbb R^2$ và $f(p)\to+\infty$ khi $\lVert p\rVert\to\infty$ thì $f$ đạt giá trị nhỏ nhất.&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Gợi ý&lt;/summary&gt;

  &lt;ol start=&quot;5&quot;&gt;
    &lt;li&gt;$f=x$ trên đĩa mở (giá trị tiến tới 1 nhưng không đạt); $f=e^{-x}$ trên nửa mặt phẳng $x\ge0$ (tiến tới 0 nhưng không đạt).&lt;/li&gt;
    &lt;li&gt;Chọn $R$ để $f&amp;gt;f(0)$ khi $\lVert p\rVert&amp;gt;R$. Trên đĩa đóng bán kính $R$, $f$ đạt nhỏ nhất (định lý 1); giá trị đó $\le f(0)$, nên cũng nhỏ nhất trên cả mặt phẳng.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;h2 id=&quot;tóm-tắt&quot;&gt;Tóm tắt&lt;/h2&gt;

&lt;div class=&quot;content-box summary-box textbook-block&quot;&gt;
  &lt;ul&gt;
    &lt;li&gt;Hàm liên tục trên tập đóng, bị chặn luôn đạt giá trị lớn nhất, nhỏ nhất.&lt;/li&gt;
    &lt;li&gt;Quy trình: điểm tới hạn bên trong, cực trị trên biên, so sánh.&lt;/li&gt;
    &lt;li&gt;Cực trị toàn cục thường nằm trên biên, nơi $\nabla f\ne0$.&lt;/li&gt;
    &lt;li&gt;Miền không đóng: kiểm tra hành vi khi tiến ra biên hoặc vô cùng.&lt;/li&gt;
  &lt;/ul&gt;
&lt;/div&gt;
</content>
 </entry>
 
 <entry>
   <title>Điểm tới hạn và kiểm tra Hessian</title>
   <link href="https://calculus-self-learning.pages.dev/contents/vi/chapter12/12_01_Diem_toi_han_va_kiem_tra_Hessian/"/>
   <updated>2026-12-01T00:00:00+00:00</updated>
   <id>https://calculus-self-learning.pages.dev/contents/vi/chapter12/12_01_Diem_toi_han_va_kiem_tra_Hessian</id>
   <content type="html">&lt;div class=&quot;textbook-objectives&quot;&gt;

  &lt;p&gt;&lt;strong&gt;Mục tiêu bài học.&lt;/strong&gt; Sau bài này bạn có thể:&lt;/p&gt;

  &lt;ul&gt;
    &lt;li&gt;tìm điểm tới hạn bằng cách giải $\nabla f=0$;&lt;/li&gt;
    &lt;li&gt;phân loại cực tiểu, cực đại, điểm yên ngựa bằng $D=f_{xx}f_{yy}-f_{xy}^2$ hoặc trị riêng của Hessian;&lt;/li&gt;
    &lt;li&gt;chứng minh tiêu chuẩn đó từ công thức Taylor bậc hai;&lt;/li&gt;
    &lt;li&gt;nhận ra các trường hợp tiêu chuẩn không kết luận được.&lt;/li&gt;
  &lt;/ul&gt;

&lt;/div&gt;

&lt;h2 id=&quot;vì-sao-cần-bài-này&quot;&gt;Vì sao cần bài này&lt;/h2&gt;

&lt;p&gt;Một biến: cực trị ở chỗ $f&apos;=0$, và dấu $f&apos;&apos;$ cho biết đáy hay đỉnh. Hai biến có thêm khả năng thứ ba: &lt;strong&gt;điểm yên ngựa&lt;/strong&gt;, cong lên theo một hướng và cong xuống theo hướng khác. Trong học sâu, phần lớn điểm tới hạn của hàm mất mát là điểm yên ngựa chứ không phải cực tiểu.&lt;/p&gt;

&lt;h2 id=&quot;điều-kiện-cần&quot;&gt;Điều kiện cần&lt;/h2&gt;

&lt;div class=&quot;textbook-theorem&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Định lý 1 (Fermat).&lt;/strong&gt; Nếu $f$ đạt cực trị địa phương tại điểm trong $a$ và có các đạo hàm riêng tại đó thì $\nabla f(a)=0$.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-proof&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Chứng minh.&lt;/strong&gt; Hàm một biến $g(t)=f(a+te_1)$ đạt cực trị địa phương tại $t=0$ nên $g&apos;(0)=f_x(a)=0$ (định lý Fermat một biến). Tương tự $f_y(a)=0$.&lt;/p&gt;
&lt;/div&gt;

&lt;p&gt;Điểm có $\nabla f=0$ gọi là &lt;strong&gt;điểm tới hạn&lt;/strong&gt; (hay điểm dừng). Điều kiện chỉ là cần: $f=xy$ có $\nabla f(0,0)=0$ nhưng gốc không phải cực trị.&lt;/p&gt;

&lt;h2 id=&quot;kiểm-tra-đạo-hàm-cấp-hai&quot;&gt;Kiểm tra đạo hàm cấp hai&lt;/h2&gt;

&lt;div class=&quot;textbook-theorem&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Định lý 2.&lt;/strong&gt; Giả sử $f$ có đạo hàm riêng cấp hai liên tục gần điểm tới hạn $a$, và đặt $D=f_{xx}f_{yy}-f_{xy}^2$ tại $a$.&lt;/p&gt;

  &lt;ol&gt;
    &lt;li&gt;$D&amp;gt;0$, $f_{xx}&amp;gt;0$: cực tiểu địa phương.&lt;/li&gt;
    &lt;li&gt;$D&amp;gt;0$, $f_{xx}&amp;lt;0$: cực đại địa phương.&lt;/li&gt;
    &lt;li&gt;$D&amp;lt;0$: điểm yên ngựa.&lt;/li&gt;
    &lt;li&gt;$D=0$: chưa kết luận được.&lt;/li&gt;
  &lt;/ol&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-proof&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Chứng minh.&lt;/strong&gt; Theo bài 11_04, vì $\nabla f(a)=0$: $f(a+h)-f(a)=\tfrac12Q(h)+R(h)$ với $Q(h)=h^\top Hh$ và $R(h)/\lVert h\rVert^2\to0$. Viết $h=(p,q)$, $A=f_{xx}$, $B=f_{xy}$, $C=f_{yy}$. Khi $A\ne0$, bù bình phương:&lt;/p&gt;

\[Q=Ap^2+2Bpq+Cq^2=A\Big(p+\frac BAq\Big)^2+\frac DAq^2.\]

  &lt;p&gt;(1) Nếu $A&amp;gt;0$, $D&amp;gt;0$ thì $Q(h)&amp;gt;0$ với $h\ne0$. Trên đường tròn đơn vị, $Q$ liên tục nên đạt giá trị nhỏ nhất $m&amp;gt;0$; do $Q$ thuần nhất bậc hai, $Q(h)\ge m\lVert h\rVert^2$. Khi đó $f(a+h)-f(a)\ge\big(\tfrac m2-\tfrac{\lvert R\rvert}{\lVert h\rVert^2}\big)\lVert h\rVert^2&amp;gt;0$ với $h\ne0$ đủ nhỏ.&lt;/p&gt;

  &lt;p&gt;(2) Áp dụng (1) cho $-f$.&lt;/p&gt;

  &lt;p&gt;(3) Nếu $D&amp;lt;0$ thì $Q$ nhận cả giá trị dương và âm: với $A\ne0$, lấy $q=0$ được $Q=Ap^2$ cùng dấu $A$, lấy $p=-Bq/A$ được $Q=Dq^2/A$ trái dấu $A$; với $A=0$ thì $B\ne0$ và $Q(p,q)=q(2Bp+Cq)$ đổi dấu. Dọc hướng $u$ có $Q(u)&amp;gt;0$, $f(a+tu)-f(a)=t^2\big(\tfrac12Q(u)+R(tu)/t^2\big)&amp;gt;0$ với $t$ nhỏ; tương tự theo hướng có $Q&amp;lt;0$ thì hiệu âm. Vậy $a$ là điểm yên ngựa.&lt;/p&gt;

  &lt;p&gt;(4) Xem ví dụ 2.&lt;/p&gt;
&lt;/div&gt;

&lt;p&gt;Theo ngôn ngữ trị riêng: $H$ đối xứng có hai trị riêng thực $\lambda_1$, $\lambda_2$ với $D=\lambda_1\lambda_2$. Cả hai dương: cực tiểu; cả hai âm: cực đại; trái dấu: yên ngựa. Cách này mở rộng ngay sang $n$ biến.&lt;/p&gt;

&lt;div class=&quot;reel-video&quot;&gt;
  &lt;video controls=&quot;&quot; playsinline=&quot;&quot; preload=&quot;metadata&quot; src=&quot;/public/videos/reels/saddle-point-hessian.mp4&quot;&gt;&lt;/video&gt;
  &lt;p class=&quot;reel-caption&quot;&gt;Điểm yên ngựa và ma trận Hessian: z = x² − y² có mặt phẳng tiếp xúc nằm ngang nhưng cong lên theo x, cong xuống theo y; độ cong theo mọi hướng, ba loại điểm tới hạn, yên ngựa xy, kiểm tra D, ví dụ x³ − 3x + y² và viên bi lăn khỏi yên ngựa (video không lời, khoảng 3 phút 4 giây).&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;interactive-frame&quot;&gt;
  &lt;div class=&quot;interactive-frame-head&quot;&gt;
    &lt;div class=&quot;interactive-frame-title&quot;&gt;Hessian và loại điểm tới hạn&lt;/div&gt;
    &lt;div class=&quot;interactive-frame-desc&quot;&gt;Kéo điểm, xem Hessian, hai trị riêng và màu theo loại; nền xanh lá phủ kín nghĩa là hàm lồi.&lt;/div&gt;
  &lt;/div&gt;
  &lt;iframe src=&quot;/interactives/chapter12/hessian-classifier.html&quot; title=&quot;Hessian và loại điểm tới hạn&quot; loading=&quot;lazy&quot; style=&quot;height: 720px;&quot;&gt;&lt;/iframe&gt;
  &lt;div class=&quot;interactive-frame-foot&quot;&gt;
    &lt;a href=&quot;/interactives/chapter12/hessian-classifier.html&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;Mở minh hoạ ở cửa sổ riêng&lt;/a&gt;
  &lt;/div&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Ví dụ 1.&lt;/strong&gt; $f=x^3-3x+y^2$. $\nabla f=(3x^2-3,2y)=0$ cho $(\pm1,0)$. $H=\operatorname{diag}(6x,2)$.&lt;/p&gt;

  &lt;ul&gt;
    &lt;li&gt;$(1,0)$: $D=12&amp;gt;0$, $f_{xx}=6&amp;gt;0$: cực tiểu, $f=-2$.&lt;/li&gt;
    &lt;li&gt;$(-1,0)$: $D=-12&amp;lt;0$: điểm yên ngựa.&lt;/li&gt;
  &lt;/ul&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Ví dụ 2 ($D=0$).&lt;/strong&gt; $x^4+y^4$ và $x^4-y^4$ đều có $H(0,0)=0$, $D=0$. Hàm thứ nhất có cực tiểu tại gốc, hàm thứ hai có điểm yên ngựa. Bậc hai không đủ thông tin; phải xem bậc cao hơn.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Ví dụ 3.&lt;/strong&gt; $f=x^3+y^3-3xy$. $\nabla f=(3x^2-3y,3y^2-3x)=0$ cho $y=x^2$, $x^4=x$, nên $(0,0)$ và $(1,1)$. $H=\begin{pmatrix}6x&amp;amp;-3\\-3&amp;amp;6y\end{pmatrix}$.&lt;/p&gt;

  &lt;ul&gt;
    &lt;li&gt;$(0,0)$: $D=-9$: điểm yên ngựa.&lt;/li&gt;
    &lt;li&gt;$(1,1)$: $D=36-9=27&amp;gt;0$, $f_{xx}=6&amp;gt;0$: cực tiểu, $f=-1$.&lt;/li&gt;
  &lt;/ul&gt;
&lt;/div&gt;

&lt;h2 id=&quot;ứng-dụng&quot;&gt;Ứng dụng&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Kinh tế: lợi nhuận hai sản phẩm.&lt;/strong&gt; Một công ty có lợi nhuận $P(x,y)=-x^2-y^2+xy+10x+4y$ (triệu đồng) theo sản lượng hai mặt hàng. $\nabla P=(-2x+y+10,\,-2y+x+4)=0$ cho $(x,y)=(8,6)$. $H=\begin{pmatrix}-2&amp;amp;1\\1&amp;amp;-2\end{pmatrix}$, $D=3&amp;gt;0$, $P_{xx}&amp;lt;0$: cực đại, $P(8,6)=52$.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Học máy: điểm yên ngựa.&lt;/strong&gt; Với $n$ tham số, điểm tới hạn là cực tiểu khi cả $n$ trị riêng của Hessian dương. Nếu mỗi dấu “ngẫu nhiên”, xác suất đó cỡ $2^{-n}$, nên ở không gian nhiều chiều điểm yên ngựa phổ biến hơn cực tiểu nhiều. Gradient descent có nhiễu (SGD) thường thoát được điểm yên ngựa theo hướng có trị riêng âm.&lt;/p&gt;

&lt;h2 id=&quot;bài-tập&quot;&gt;Bài tập&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Cơ bản.&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;Tìm và phân loại điểm tới hạn của $f=x^2+y^2-2x+4y$.&lt;/li&gt;
  &lt;li&gt;Chứng minh gốc là điểm yên ngựa của $f=xy$.&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Đáp án&lt;/summary&gt;

  &lt;ol&gt;
    &lt;li&gt;$(1,-2)$, $D=4&amp;gt;0$, $f_{xx}=2&amp;gt;0$: cực tiểu $f=-5$.&lt;/li&gt;
    &lt;li&gt;$H=\begin{pmatrix}0&amp;amp;1\\1&amp;amp;0\end{pmatrix}$, $D=-1&amp;lt;0$. Dọc $y=x$ có $f=x^2&amp;gt;0$, dọc $y=-x$ có $f=-x^2&amp;lt;0$.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;p&gt;&lt;strong&gt;Trung bình.&lt;/strong&gt;&lt;/p&gt;

&lt;ol start=&quot;3&quot;&gt;
  &lt;li&gt;Tìm và phân loại điểm tới hạn của $f=x^2+xy+y^2-3x$.&lt;/li&gt;
  &lt;li&gt;Tìm và phân loại điểm tới hạn của $f=x^3-12x+y^2$.&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Đáp án&lt;/summary&gt;

  &lt;ol start=&quot;3&quot;&gt;
    &lt;li&gt;$2x+y=3$, $x+2y=0$ cho $(2,-1)$; $D=3&amp;gt;0$, $f_{xx}=2$: cực tiểu $f=-3$.&lt;/li&gt;
    &lt;li&gt;$(2,0)$: $D=24&amp;gt;0$, cực tiểu $f=-16$. $(-2,0)$: $D=-24$, điểm yên ngựa.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;p&gt;&lt;strong&gt;Nâng cao.&lt;/strong&gt;&lt;/p&gt;

&lt;ol start=&quot;5&quot;&gt;
  &lt;li&gt;Chứng minh dạng toàn phương $Ap^2+2Bpq+Cq^2$ dương với mọi $(p,q)\ne0$ khi và chỉ khi $A&amp;gt;0$ và $AC-B^2&amp;gt;0$.&lt;/li&gt;
  &lt;li&gt;(Ví dụ của Peano.) $f=(y-x^2)(y-2x^2)$. Chứng minh trên mọi đường thẳng qua gốc, $f$ có cực tiểu tại gốc, nhưng gốc không phải cực tiểu địa phương của $f$.&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Gợi ý&lt;/summary&gt;

  &lt;ol start=&quot;5&quot;&gt;
    &lt;li&gt;Chiều thuận: lấy $(p,q)=(1,0)$ được $A&amp;gt;0$; lấy $p=-Bq/A$, $q=1$ được $D/A&amp;gt;0$. Chiều nghịch: công thức bù bình phương trong chứng minh.&lt;/li&gt;
    &lt;li&gt;Trên $y=mx$ với $m\ne0$: $f=m^2x^2-3mx^3+2x^4&amp;gt;0$ khi $x\ne0$ nhỏ; trên $y=0$: $f=2x^4$; trên $x=0$: $f=y^2$. Nhưng trên $y=1.5x^2$: $f=(0.5x^2)(-0.5x^2)&amp;lt;0$.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;h2 id=&quot;tóm-tắt&quot;&gt;Tóm tắt&lt;/h2&gt;

&lt;div class=&quot;content-box summary-box textbook-block&quot;&gt;
  &lt;ul&gt;
    &lt;li&gt;Điều kiện cần: $\nabla f=0$.&lt;/li&gt;
    &lt;li&gt;$D=f_{xx}f_{yy}-f_{xy}^2$: $D&amp;gt;0$ thì cực trị (dấu $f_{xx}$ quyết định loại), $D&amp;lt;0$ thì yên ngựa, $D=0$ chưa biết.&lt;/li&gt;
    &lt;li&gt;Tương đương: dấu các trị riêng của Hessian.&lt;/li&gt;
    &lt;li&gt;Ở nhiều chiều, điểm yên ngựa phổ biến hơn cực tiểu.&lt;/li&gt;
  &lt;/ul&gt;
&lt;/div&gt;
</content>
 </entry>
 
 <entry>
   <title>Lan truyền ngược là quy tắc chuỗi</title>
   <link href="https://calculus-self-learning.pages.dev/contents/vi/chapter11/11_05_Lan_truyen_nguoc_la_quy_tac_chuoi/"/>
   <updated>2026-12-01T00:00:00+00:00</updated>
   <id>https://calculus-self-learning.pages.dev/contents/vi/chapter11/11_05_Lan_truyen_nguoc_la_quy_tac_chuoi</id>
   <content type="html">&lt;div class=&quot;textbook-objectives&quot;&gt;

  &lt;p&gt;&lt;strong&gt;Mục tiêu bài học.&lt;/strong&gt; Sau bài này bạn có thể:&lt;/p&gt;

  &lt;ul&gt;
    &lt;li&gt;vẽ đồ thị tính toán của một biểu thức và chạy lượt xuôi, lượt ngược;&lt;/li&gt;
    &lt;li&gt;chứng minh quy tắc “cộng gradient qua các nhánh” từ quy tắc chuỗi;&lt;/li&gt;
    &lt;li&gt;tính tay gradient của một nơ-ron logistic và một mạng hai lớp nhỏ;&lt;/li&gt;
    &lt;li&gt;kiểm tra gradient bằng sai phân trung tâm.&lt;/li&gt;
  &lt;/ul&gt;

&lt;/div&gt;

&lt;h2 id=&quot;vì-sao-cần-bài-này&quot;&gt;Vì sao cần bài này&lt;/h2&gt;

&lt;p&gt;Mọi mạng nơ-ron được huấn luyện bằng gradient descent, và gradient được tính bằng thuật toán &lt;strong&gt;lan truyền ngược&lt;/strong&gt; (backpropagation). Thuật toán này không có gì mới ngoài quy tắc chuỗi (bài 11_01), được sắp xếp khéo để tính toàn bộ gradient với chi phí cỡ một lần tính hàm.&lt;/p&gt;

&lt;h2 id=&quot;đồ-thị-tính-toán&quot;&gt;Đồ thị tính toán&lt;/h2&gt;

&lt;p&gt;Một biểu thức được tách thành các phép toán sơ cấp; mỗi nút là một biến trung gian, mỗi cạnh $v\to w$ nghĩa là $w$ được tính trực tiếp từ $v$. &lt;strong&gt;Lượt xuôi&lt;/strong&gt; tính giá trị các nút theo thứ tự. &lt;strong&gt;Lượt ngược&lt;/strong&gt; tính $\bar v=\partial L/\partial v$ (gọi là &lt;em&gt;adjoint&lt;/em&gt; của $v$) từ nút cuối về đầu, bắt đầu với $\bar L=1$.&lt;/p&gt;

&lt;div class=&quot;textbook-theorem&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Định lý 1.&lt;/strong&gt; Trong đồ thị tính toán không có chu trình với đầu ra $L$, với mọi nút $v\ne L$:&lt;/p&gt;

\[\bar v=\sum_{w:\ v\to w}\bar w\,\frac{\partial w}{\partial v},\]

  &lt;p&gt;trong đó $\partial w/\partial v$ là đạo hàm riêng &lt;em&gt;cục bộ&lt;/em&gt; của phép toán tạo ra $w$.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-proof&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Chứng minh.&lt;/strong&gt; Xem $L$ là hàm của $v$ qua các nút con $w_1,\dots,w_k$ của $v$: thay đổi $v$ (giữ nguyên các nút không phụ thuộc $v$) chỉ ảnh hưởng tới $L$ thông qua $w_1,\dots,w_k$. Quy tắc chuỗi nhiều biến trung gian (bài 11_01) cho $\dfrac{\partial L}{\partial v}=\sum_i\dfrac{\partial L}{\partial w_i}\dfrac{\partial w_i}{\partial v}$. Duyệt các nút theo thứ tự tôpô ngược thì mọi $\bar w_i$ đã được tính trước $\bar v$, nên công thức tính được tất cả adjoint (quy nạp theo thứ tự đó).&lt;/p&gt;
&lt;/div&gt;

&lt;p&gt;Mỗi cạnh chỉ được dùng một lần ở lượt ngược, nên chi phí lượt ngược cùng bậc với lượt xuôi, bất kể có bao nhiêu tham số. Nếu tính từng đạo hàm riêng theo chiều xuôi (forward mode) thì cần một lượt cho mỗi tham số.&lt;/p&gt;

&lt;div class=&quot;interactive-frame&quot;&gt;
  &lt;div class=&quot;interactive-frame-head&quot;&gt;
    &lt;div class=&quot;interactive-frame-title&quot;&gt;Đồ thị tính toán: lượt xuôi và lượt ngược&lt;/div&gt;
    &lt;div class=&quot;interactive-frame-desc&quot;&gt;Bấm từng bước để tính giá trị rồi adjoint của mỗi nút.&lt;/div&gt;
  &lt;/div&gt;
  &lt;iframe src=&quot;/interactives/chapter11/computation-graph.html&quot; title=&quot;Đồ thị tính toán: lượt xuôi và lượt ngược&quot; loading=&quot;lazy&quot; style=&quot;height: 720px;&quot;&gt;&lt;/iframe&gt;
  &lt;div class=&quot;interactive-frame-foot&quot;&gt;
    &lt;a href=&quot;/interactives/chapter11/computation-graph.html&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;Mở minh hoạ ở cửa sổ riêng&lt;/a&gt;
  &lt;/div&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Ví dụ 1.&lt;/strong&gt; $f=(x+y)z$ tại $(x,y,z)=(-2,5,-4)$. Lượt xuôi: $q=x+y=3$, $f=qz=-12$. Lượt ngược: $\bar f=1$; $\bar z=q=3$; $\bar q=z=-4$; $\bar x=\bar q\cdot1=-4$, $\bar y=-4$. Phép cộng “chia đều” gradient, phép nhân “đổi chéo” giá trị.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Ví dụ 2 (Nơ-ron logistic).&lt;/strong&gt; $z=wx+b$, $a=\sigma(z)=\dfrac1{1+e^{-z}}$, $L=-[y\ln a+(1-y)\ln(1-a)]$. Vì $\sigma&apos;=\sigma(1-\sigma)$,&lt;/p&gt;

\[\bar z=\Big(-\frac ya+\frac{1-y}{1-a}\Big)a(1-a)=a-y,\qquad\bar w=(a-y)x,\qquad\bar b=a-y.\]

  &lt;p&gt;Với $x=2$, $w=0.5$, $b=-0.5$, $y=1$: $z=0.5$, $a\approx0.6225$, $L\approx0.4741$, $\bar w\approx-0.7551$, $\bar b\approx-0.3775$. Gradient âm nên gradient descent tăng $w$ và $b$, đẩy $a$ về phía 1.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Ví dụ 3 (Mạng hai lớp tính tay).&lt;/strong&gt; Đầu vào $x=(1,2)$, lớp ẩn $h=\operatorname{ReLU}(W x)$ với $W=\begin{pmatrix}1&amp;amp;-1\\0.5&amp;amp;0.5\end{pmatrix}$, đầu ra $\hat y=v\cdot h$ với $v=(2,1)$, mất mát $L=\tfrac12(\hat y-y)^2$, $y=1$.&lt;/p&gt;

  &lt;p&gt;&lt;em&gt;Lượt xuôi:&lt;/em&gt; $Wx=(-1,1.5)$, $h=(0,1.5)$, $\hat y=1.5$, $L=0.125$.&lt;/p&gt;

  &lt;p&gt;&lt;em&gt;Lượt ngược:&lt;/em&gt; $\bar{\hat y}=\hat y-y=0.5$; $\bar v=0.5\,h=(0,0.75)$; $\bar h=0.5\,v=(1,0.5)$; qua ReLU (đạo hàm 0 nếu đầu vào âm, 1 nếu dương): $\overline{Wx}=(0,0.5)$; cuối cùng $\bar W=\overline{Wx}\,x^\top=\begin{pmatrix}0&amp;amp;0\\0.5&amp;amp;1\end{pmatrix}$.&lt;/p&gt;

  &lt;p&gt;Hàng đầu của $\bar W$ bằng 0 vì nơ-ron thứ nhất “tắt” (ReLU của số âm): không có tín hiệu nào chảy ngược qua nó.&lt;/p&gt;
&lt;/div&gt;

&lt;h2 id=&quot;ứng-dụng-kiểm-tra-gradient&quot;&gt;Ứng dụng: kiểm tra gradient&lt;/h2&gt;

&lt;p&gt;Khi tự viết lượt ngược, ta so sánh với sai phân trung tâm $\dfrac{L(\theta+\varepsilon e_i)-L(\theta-\varepsilon e_i)}{2\varepsilon}$, sai số $O(\varepsilon^2)$ (bài 08_06). Với ví dụ 3, $\varepsilon=10^{-6}$ cho $\bar W$ và $\bar v$ khớp tới khoảng $10^{-10}$. Các thư viện như PyTorch, JAX cài sẵn lượt ngược cho từng phép toán sơ cấp và ghép chúng bằng đúng định lý 1.&lt;/p&gt;

&lt;h2 id=&quot;bài-tập&quot;&gt;Bài tập&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Cơ bản.&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;Chạy lượt xuôi và ngược cho $f=(x+2y)^2$ tại $(1,1)$.&lt;/li&gt;
  &lt;li&gt;Tính $\partial L/\partial w$ và $\partial L/\partial b$ cho $\hat y=wx+b$, $L=(\hat y-y)^2$ với $x=3$, $w=1$, $b=0$, $y=2$.&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Đáp án&lt;/summary&gt;

  &lt;ol&gt;
    &lt;li&gt;$q=3$, $f=9$; $\bar q=2q=6$; $\bar x=6$, $\bar y=12$.&lt;/li&gt;
    &lt;li&gt;$\hat y=3$, $L=1$, $\bar{\hat y}=2(\hat y-y)=2$, $\bar w=2x=6$, $\bar b=2$.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;p&gt;&lt;strong&gt;Trung bình.&lt;/strong&gt;&lt;/p&gt;

&lt;ol start=&quot;3&quot;&gt;
  &lt;li&gt;Chứng minh $\sigma&apos;(z)=\sigma(z)(1-\sigma(z))$.&lt;/li&gt;
  &lt;li&gt;Tính $f&apos;(3)$ cho $f=x\cdot x+x$ bằng đồ thị tính toán, trong đó nút $x$ có ba cạnh đi ra.&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Đáp án&lt;/summary&gt;

  &lt;ol start=&quot;3&quot;&gt;
    &lt;li&gt;$\sigma&apos;=\dfrac{e^{-z}}{(1+e^{-z})^2}=\sigma\cdot\dfrac{e^{-z}}{1+e^{-z}}=\sigma(1-\sigma)$.&lt;/li&gt;
    &lt;li&gt;Ba nhánh đóng góp $x+x+1$, tổng $2x+1=7$, đúng như định lý 1 dự đoán.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;p&gt;&lt;strong&gt;Nâng cao.&lt;/strong&gt;&lt;/p&gt;

&lt;ol start=&quot;5&quot;&gt;
  &lt;li&gt;Softmax $p_i=e^{z_i}/\sum_je^{z_j}$, mất mát $L=-\sum_ky_k\ln p_k$ với $\sum_ky_k=1$. Chứng minh $\partial L/\partial z_i=p_i-y_i$.&lt;/li&gt;
  &lt;li&gt;Một mạng có $n$ tham số và hàm mất mát một số thực. So sánh số lượt cần cho forward mode và reverse mode để tính toàn bộ gradient; khi nào forward mode có lợi?&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Gợi ý&lt;/summary&gt;

  &lt;ol start=&quot;5&quot;&gt;
    &lt;li&gt;$\ln p_k=z_k-\ln\sum_je^{z_j}$ nên $\partial\ln p_k/\partial z_i=\delta_{ki}-p_i$; do đó $\partial L/\partial z_i=-\sum_ky_k(\delta_{ki}-p_i)=p_i-y_i$.&lt;/li&gt;
    &lt;li&gt;Forward mode cần $n$ lượt, reverse mode cần một lượt xuôi và một lượt ngược. Forward mode có lợi khi số đầu vào ít hơn số đầu ra (Jacobian “cao và hẹp”).&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;h2 id=&quot;tóm-tắt&quot;&gt;Tóm tắt&lt;/h2&gt;

&lt;div class=&quot;content-box summary-box textbook-block&quot;&gt;
  &lt;ul&gt;
    &lt;li&gt;Lan truyền ngược: tính adjoint $\bar v=\sum\bar w\,\partial w/\partial v$ theo thứ tự tôpô ngược.&lt;/li&gt;
    &lt;li&gt;Đây chính là quy tắc chuỗi; chi phí cùng bậc với một lần tính hàm.&lt;/li&gt;
    &lt;li&gt;Cộng chia đều gradient, nhân đổi chéo giá trị, ReLU tắt thì chặn gradient.&lt;/li&gt;
    &lt;li&gt;Nơ-ron logistic với cross-entropy: $\bar z=a-y$; luôn kiểm tra bằng sai phân trung tâm.&lt;/li&gt;
  &lt;/ul&gt;
&lt;/div&gt;
</content>
 </entry>
 
 <entry>
   <title>Công thức Taylor nhiều biến</title>
   <link href="https://calculus-self-learning.pages.dev/contents/vi/chapter11/11_04_Cong_thuc_Taylor_nhieu_bien/"/>
   <updated>2026-12-01T00:00:00+00:00</updated>
   <id>https://calculus-self-learning.pages.dev/contents/vi/chapter11/11_04_Cong_thuc_Taylor_nhieu_bien</id>
   <content type="html">&lt;div class=&quot;textbook-objectives&quot;&gt;

  &lt;p&gt;&lt;strong&gt;Mục tiêu bài học.&lt;/strong&gt; Sau bài này bạn có thể:&lt;/p&gt;

  &lt;ul&gt;
    &lt;li&gt;viết khai triển Taylor bậc hai $f(a+h)\approx f(a)+\nabla f(a)\cdot h+\tfrac12h^\top H(a)h$;&lt;/li&gt;
    &lt;li&gt;chứng minh công thức bằng cách đưa về một biến;&lt;/li&gt;
    &lt;li&gt;dùng xấp xỉ bậc hai để ước lượng giá trị và hiểu phương pháp Newton.&lt;/li&gt;
  &lt;/ul&gt;

&lt;/div&gt;

&lt;h2 id=&quot;vì-sao-cần-bài-này&quot;&gt;Vì sao cần bài này&lt;/h2&gt;

&lt;p&gt;Xấp xỉ tuyến tính (bài 10_04) là mặt phẳng tiếp xúc; nó không thấy được mặt cong lên hay cong xuống. Xấp xỉ bậc hai thêm độ cong, mô tả bằng ma trận Hessian. Đây là cơ sở để phân loại cực trị ở chương 12 và của phương pháp Newton trong tối ưu.&lt;/p&gt;

&lt;h2 id=&quot;công-thức&quot;&gt;Công thức&lt;/h2&gt;

&lt;p&gt;Với $h=(h_1,h_2)$ và ma trận Hessian $H=\begin{pmatrix}f_{xx}&amp;amp;f_{xy}\\f_{xy}&amp;amp;f_{yy}\end{pmatrix}$ (đối xứng nhờ định lý Schwarz):&lt;/p&gt;

\[h^\top Hh=f_{xx}h_1^2+2f_{xy}h_1h_2+f_{yy}h_2^2.\]

&lt;div class=&quot;textbook-theorem&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Định lý 1 (Taylor bậc hai).&lt;/strong&gt; Nếu $f$ có các đạo hàm riêng cấp hai liên tục gần $a$ thì&lt;/p&gt;

\[f(a+h)=f(a)+\nabla f(a)\cdot h+\tfrac12h^\top H(a)h+R(h),\qquad\frac{R(h)}{\lVert h\rVert^2}\to0\ \text{khi}\ h\to0.\]

&lt;/div&gt;

&lt;div class=&quot;textbook-proof&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Chứng minh.&lt;/strong&gt; Cố định $h$ nhỏ và đặt $g(t)=f(a+th)$, $t\in[0,1]$. Theo quy tắc chuỗi,&lt;/p&gt;

\[g&apos;(t)=\nabla f(a+th)\cdot h,\qquad g&apos;&apos;(t)=h^\top H(a+th)\,h.\]

  &lt;p&gt;(Lấy đạo hàm $g&apos;(t)=f_xh_1+f_yh_2$ thêm lần nữa, rồi gộp $f_{xy}=f_{yx}$.) Công thức Taylor một biến với phần dư Lagrange (bài 08_01) cho $g(1)=g(0)+g&apos;(0)+\tfrac12g&apos;&apos;(\theta)$ với $\theta\in(0,1)$. Do đó&lt;/p&gt;

\[R(h)=\tfrac12h^\top\big(H(a+\theta h)-H(a)\big)h,\qquad\lvert R(h)\rvert\le\tfrac12\lVert H(a+\theta h)-H(a)\rVert\,\lVert h\rVert^2,\]

  &lt;p&gt;với $\lVert\cdot\rVert$ của ma trận là chuẩn toán tử. Các đạo hàm cấp hai liên tục nên $H(a+\theta h)\to H(a)$, vậy $R(h)/\lVert h\rVert^2\to0$.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Ví dụ 1.&lt;/strong&gt; $f=e^x\cos y$ tại $(0,0)$: $f=1$, $\nabla f=(1,0)$, $H=\begin{pmatrix}1&amp;amp;0\\0&amp;amp;-1\end{pmatrix}$. Vậy&lt;/p&gt;

\[e^x\cos y\approx1+x+\tfrac12(x^2-y^2).\]

  &lt;p&gt;Tại $(0.1,0.2)$: xấp xỉ $1.085$, giá trị đúng $1.08314$; xấp xỉ tuyến tính $1.1$ kém hơn nhiều.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Ví dụ 2.&lt;/strong&gt; $f=\ln(1+x+2y)$ tại $(0,0)$: $\nabla f=(1,2)$, $H=-\begin{pmatrix}1&amp;amp;2\\2&amp;amp;4\end{pmatrix}$, nên $f\approx(x+2y)-\tfrac12(x+2y)^2$, đúng là khai triển $\ln(1+u)\approx u-u^2/2$ với $u=x+2y$.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Ví dụ 3 (Xem trước chương 12).&lt;/strong&gt; $f=x^2+xy+y^2$ có $\nabla f(0,0)=0$ và $H=\begin{pmatrix}2&amp;amp;1\\1&amp;amp;2\end{pmatrix}$ với trị riêng $1$ và $3$, đều dương. Gần gốc $f\approx\tfrac12h^\top Hh&amp;gt;0$, nên gốc là cực tiểu.&lt;/p&gt;
&lt;/div&gt;

&lt;h2 id=&quot;ứng-dụng-phương-pháp-newton-tối-ưu-học-máy&quot;&gt;Ứng dụng: phương pháp Newton (tối ưu, học máy)&lt;/h2&gt;

&lt;p&gt;Thay $f$ bằng mô hình bậc hai $m(h)=f(a)+\nabla f\cdot h+\tfrac12h^\top Hh$ rồi cực tiểu mô hình: $\nabla m=\nabla f+Hh=0$, nên&lt;/p&gt;

\[h=-H^{-1}\nabla f.\]

&lt;p&gt;Với $L=(w_1-1)^2+10w_2^2$ từ $(0,1)$ ở bài 11_02: $\nabla L=(-2,20)$, $H=\operatorname{diag}(2,20)$, $h=(1,-1)$, đến ngay cực tiểu $(1,0)$ sau một bước, không phụ thuộc các đường mức dẹt. Cái giá là phải tính và giải hệ với $H$, rất đắt khi có hàng triệu tham số.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Vật lý.&lt;/strong&gt; Gần vị trí cân bằng $\nabla V=0$, thế năng $V\approx V_0+\tfrac12h^\top Hh$, nên mọi dao động nhỏ là dao động điều hoà, với tần số do trị riêng của $H$ quyết định.&lt;/p&gt;

&lt;h2 id=&quot;bài-tập&quot;&gt;Bài tập&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Cơ bản.&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;Viết khai triển bậc hai của $f=x^2y$ tại $(1,1)$ theo $h$, $k$, và tìm phần dư chính xác.&lt;/li&gt;
  &lt;li&gt;Viết khai triển bậc hai của $\sin(x+y)$ tại $(0,0)$.&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Đáp án&lt;/summary&gt;

  &lt;ol&gt;
    &lt;li&gt;$1+2h+k+h^2+2hk$; giá trị đúng $(1+h)^2(1+k)$ hơn đúng $h^2k$.&lt;/li&gt;
    &lt;li&gt;$x+y$ (các số hạng bậc hai bằng 0).&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;p&gt;&lt;strong&gt;Trung bình.&lt;/strong&gt;&lt;/p&gt;

&lt;ol start=&quot;3&quot;&gt;
  &lt;li&gt;Ước lượng $\sqrt{3.1^2+3.9^2}$ bằng xấp xỉ bậc một và bậc hai của $f=\sqrt{x^2+y^2}$ tại $(3,4)$.&lt;/li&gt;
  &lt;li&gt;Thực hiện một bước Newton cho $f=x^4+y^2$ từ $(1,1)$.&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Đáp án&lt;/summary&gt;

  &lt;ol start=&quot;3&quot;&gt;
    &lt;li&gt;$\nabla f=(0.6,0.8)$, $H=\tfrac1{125}\begin{pmatrix}16&amp;amp;-12\\-12&amp;amp;9\end{pmatrix}$. Bậc một: $4.98$; bậc hai: $4.98+0.00196=4.98196$; giá trị đúng $4.98197$.&lt;/li&gt;
    &lt;li&gt;$\nabla f=(4,2)$, $H=\operatorname{diag}(12,2)$, $h=(-1/3,-1)$, điểm mới $(2/3,0)$.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;p&gt;&lt;strong&gt;Nâng cao.&lt;/strong&gt;&lt;/p&gt;

&lt;ol start=&quot;5&quot;&gt;
  &lt;li&gt;Chứng minh: nếu $\nabla f(a)=0$ và $h^\top H(a)h\ge m\lVert h\rVert^2$ với một $m&amp;gt;0$ thì $a$ là cực tiểu địa phương ngặt.&lt;/li&gt;
  &lt;li&gt;Viết khai triển bậc hai của $f=xyz$ tại $(1,1,1)$ và so sánh với $(1+h)(1+k)(1+l)$.&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Gợi ý&lt;/summary&gt;

  &lt;ol start=&quot;5&quot;&gt;
    &lt;li&gt;$f(a+h)-f(a)=\tfrac12h^\top Hh+R\ge\big(\tfrac m2-\tfrac{\lvert R\rvert}{\lVert h\rVert^2}\big)\lVert h\rVert^2&amp;gt;0$ khi $h\ne0$ đủ nhỏ.&lt;/li&gt;
    &lt;li&gt;$1+(h+k+l)+(hk+kl+lh)$; hàm đúng chỉ thêm $hkl$.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;h2 id=&quot;tóm-tắt&quot;&gt;Tóm tắt&lt;/h2&gt;

&lt;div class=&quot;content-box summary-box textbook-block&quot;&gt;
  &lt;ul&gt;
    &lt;li&gt;$f(a+h)\approx f(a)+\nabla f\cdot h+\tfrac12h^\top Hh$, sai số $o(\lVert h\rVert^2)$.&lt;/li&gt;
    &lt;li&gt;Chứng minh: áp dụng Taylor một biến cho $g(t)=f(a+th)$.&lt;/li&gt;
    &lt;li&gt;Tại điểm tới hạn, dấu của $h^\top Hh$ quyết định loại cực trị.&lt;/li&gt;
    &lt;li&gt;Newton: $h=-H^{-1}\nabla f$, chính xác sau một bước với hàm bậc hai.&lt;/li&gt;
  &lt;/ul&gt;
&lt;/div&gt;
</content>
 </entry>
 
 <entry>
   <title>Hàm ẩn</title>
   <link href="https://calculus-self-learning.pages.dev/contents/vi/chapter11/11_03_Ham_an/"/>
   <updated>2026-12-01T00:00:00+00:00</updated>
   <id>https://calculus-self-learning.pages.dev/contents/vi/chapter11/11_03_Ham_an</id>
   <content type="html">&lt;div class=&quot;textbook-objectives&quot;&gt;

  &lt;p&gt;&lt;strong&gt;Mục tiêu bài học.&lt;/strong&gt; Sau bài này bạn có thể:&lt;/p&gt;

  &lt;ul&gt;
    &lt;li&gt;phát biểu và chứng minh định lý hàm ẩn cho phương trình $F(x,y)=0$;&lt;/li&gt;
    &lt;li&gt;tính $y&apos;$, $z_x$, $z_y$ của hàm ẩn mà không cần giải phương trình;&lt;/li&gt;
    &lt;li&gt;nhận ra điều kiện Jacobian khác 0 cho hệ hàm ẩn.&lt;/li&gt;
  &lt;/ul&gt;

&lt;/div&gt;

&lt;h2 id=&quot;vì-sao-cần-bài-này&quot;&gt;Vì sao cần bài này&lt;/h2&gt;

&lt;p&gt;Nhiều quan hệ cho dưới dạng phương trình chứ không phải công thức: đường tròn $x^2+y^2=25$, đường cong bàng quan $U(x,y)=c$, phương trình trạng thái $PV=nRT$. Ta thường không giải được (hoặc không cần giải) $y$ theo $x$, nhưng vẫn muốn biết độ dốc. Ở bài 02_03 ta đã đạo hàm ẩn bằng tay; bài này giải thích khi nào cách làm đó hợp lệ.&lt;/p&gt;

&lt;h2 id=&quot;định-lý-hàm-ẩn&quot;&gt;Định lý hàm ẩn&lt;/h2&gt;

&lt;div class=&quot;textbook-theorem&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Định lý 1 (Hàm ẩn).&lt;/strong&gt; Giả sử $F$ có các đạo hàm riêng liên tục gần $(a,b)$, $F(a,b)=0$ và $F_y(a,b)\ne0$. Khi đó có các khoảng $I\ni a$, $J\ni b$ sao cho với mỗi $x\in I$ có đúng một $y=g(x)\in J$ thoả $F(x,g(x))=0$. Hơn nữa $g$ khả vi và&lt;/p&gt;

\[g&apos;(x)=-\frac{F_x(x,g(x))}{F_y(x,g(x))}.\]

&lt;/div&gt;

&lt;div class=&quot;textbook-proof&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Chứng minh.&lt;/strong&gt; Giả sử $F_y(a,b)&amp;gt;0$ (trường hợp âm tương tự). Do $F_y$ liên tục, có $\delta&amp;gt;0$ để $F_y&amp;gt;0$ trên hình vuông $\lvert x-a\rvert\le\delta$, $\lvert y-b\rvert\le\delta$.&lt;/p&gt;

  &lt;p&gt;&lt;em&gt;Tồn tại và duy nhất.&lt;/em&gt; Hàm $y\mapsto F(a,y)$ tăng ngặt, $F(a,b)=0$, nên $F(a,b-\delta)&amp;lt;0&amp;lt;F(a,b+\delta)$. Do $F$ liên tục, có $\eta\in(0,\delta]$ sao cho với $\lvert x-a\rvert&amp;lt;\eta$ vẫn có $F(x,b-\delta)&amp;lt;0&amp;lt;F(x,b+\delta)$. Với mỗi $x$ như vậy, $y\mapsto F(x,y)$ liên tục, tăng ngặt trên $[b-\delta,b+\delta]$ và đổi dấu, nên theo định lý giá trị trung gian có đúng một nghiệm $y=g(x)$. Lấy $I=(a-\eta,a+\eta)$, $J=(b-\delta,b+\delta)$. Lập luận trên với $\delta$ nhỏ tuỳ ý cho thấy $g$ liên tục tại $a$; tại các điểm khác của $I$ cũng vậy.&lt;/p&gt;

  &lt;p&gt;&lt;em&gt;Đạo hàm.&lt;/em&gt; Với $x$, $x+h\in I$, đặt $k=g(x+h)-g(x)$. Áp dụng định lý giá trị trung bình cho $t\mapsto F(x+th,g(x)+tk)$ trên $[0,1]$:&lt;/p&gt;

\[0=F(x+h,g(x+h))-F(x,g(x))=F_x(P)\,h+F_y(P)\,k\]

  &lt;p&gt;với $P$ nằm trên đoạn nối hai điểm. Vậy $k/h=-F_x(P)/F_y(P)$. Khi $h\to0$, $k\to0$ (vì $g$ liên tục), $P\to(x,g(x))$, và do $F_x$, $F_y$ liên tục ta được công thức.&lt;/p&gt;
&lt;/div&gt;

&lt;p&gt;Nhớ công thức: lấy đạo hàm $F(x,y(x))=0$ theo $x$ bằng quy tắc chuỗi, $F_x+F_yy&apos;=0$.&lt;/p&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Ví dụ 1.&lt;/strong&gt; Đường tròn $x^2+y^2=25$ tại $(3,4)$: $y&apos;=-\tfrac{2x}{2y}=-\tfrac34$. Tại $(5,0)$, $F_y=0$: định lý không áp dụng, và thật vậy gần $(5,0)$ đường tròn không là đồ thị của hàm $y(x)$ (tiếp tuyến thẳng đứng).&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Ví dụ 2 (Lá Descartes).&lt;/strong&gt; $x^3+y^3=6xy$ tại $(3,3)$: $F_x=3x^2-6y=9$, $F_y=3y^2-6x=9$, nên $y&apos;=-1$.&lt;/p&gt;
&lt;/div&gt;

&lt;h2 id=&quot;ba-biến-và-hệ-phương-trình&quot;&gt;Ba biến và hệ phương trình&lt;/h2&gt;

&lt;p&gt;Nếu $F(x,y,z)=0$ và $F_z\ne0$ thì gần điểm đó $z=z(x,y)$ với&lt;/p&gt;

\[z_x=-\frac{F_x}{F_z},\qquad z_y=-\frac{F_y}{F_z}.\]

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Ví dụ 3.&lt;/strong&gt; $x^2+y^2+z^2=14$ tại $(1,2,3)$: $z_x=-x/z=-1/3$, $z_y=-y/z=-2/3$.&lt;/p&gt;
&lt;/div&gt;

&lt;p&gt;Với hệ hai phương trình $F(x,y,u,v)=0$, $G(x,y,u,v)=0$, ta giải được $u$, $v$ theo $x$, $y$ gần một nghiệm nếu Jacobian&lt;/p&gt;

\[\frac{\partial(F,G)}{\partial(u,v)}=\det\begin{pmatrix}F_u&amp;amp;F_v\\G_u&amp;amp;G_v\end{pmatrix}\ne0.\]

&lt;p&gt;Đạo hàm $u_x$, $v_x$ tìm bằng cách đạo hàm hai phương trình theo $x$ và giải hệ tuyến tính $2\times2$; điều kiện Jacobian khác 0 chính là điều kiện để hệ đó có nghiệm duy nhất.&lt;/p&gt;

&lt;h2 id=&quot;ứng-dụng&quot;&gt;Ứng dụng&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Kinh tế: tỉ lệ thay thế biên.&lt;/strong&gt; Đường bàng quan $U(x,y)=x^{1/2}y^{1/2}=c$ có độ dốc $\dfrac{dy}{dx}=-\dfrac{U_x}{U_y}=-\dfrac yx$. Ở điểm $(4,9)$, bỏ một đơn vị hàng $x$ cần thêm khoảng $9/4$ đơn vị hàng $y$ để giữ nguyên mức thoả dụng.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Vật lý: hệ thức vòng.&lt;/strong&gt; Với khí lý tưởng $PV=nRT$:&lt;/p&gt;

\[\frac{\partial P}{\partial V}\cdot\frac{\partial V}{\partial T}\cdot\frac{\partial T}{\partial P}=-\frac{nRT}{V^2}\cdot\frac{nR}{P}\cdot\frac{V}{nR}=-\frac{nRT}{PV}=-1,\]

&lt;p&gt;không phải $1$ như “rút gọn phân số” gợi ý.&lt;/p&gt;

&lt;h2 id=&quot;bài-tập&quot;&gt;Bài tập&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Cơ bản.&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;Tính $y&apos;$ tại $(1,2)$ cho $x^2+xy+y^2=7$.&lt;/li&gt;
  &lt;li&gt;Tính $y&apos;$ tại $(0,1)$ cho $e^y+xy=e$.&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Đáp án&lt;/summary&gt;

  &lt;ol&gt;
    &lt;li&gt;$F_x=2x+y=4$, $F_y=x+2y=5$, $y&apos;=-4/5$.&lt;/li&gt;
    &lt;li&gt;$F_x=y=1$, $F_y=e^y+x=e$, $y&apos;=-1/e$.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;p&gt;&lt;strong&gt;Trung bình.&lt;/strong&gt;&lt;/p&gt;

&lt;ol start=&quot;3&quot;&gt;
  &lt;li&gt;$z$ xác định bởi $xyz+z^3=2$ gần $(1,1,1)$. Tính $z_x$, $z_y$ tại đó.&lt;/li&gt;
  &lt;li&gt;Với $x^2+y^2=25$, chứng minh $y&apos;&apos;=-25/y^3$.&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Đáp án&lt;/summary&gt;

  &lt;ol start=&quot;3&quot;&gt;
    &lt;li&gt;$F_x=yz=1$, $F_y=xz=1$, $F_z=xy+3z^2=4$, nên $z_x=z_y=-1/4$.&lt;/li&gt;
    &lt;li&gt;$y&apos;=-x/y$; $y&apos;&apos;=-\dfrac{y-xy&apos;}{y^2}=-\dfrac{y^2+x^2}{y^3}=-\dfrac{25}{y^3}$.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;p&gt;&lt;strong&gt;Nâng cao.&lt;/strong&gt;&lt;/p&gt;

&lt;ol start=&quot;5&quot;&gt;
  &lt;li&gt;Xét $x^2-y^2=0$ gần $(0,0)$. Vì sao định lý hàm ẩn không áp dụng, và tập nghiệm trông như thế nào?&lt;/li&gt;
  &lt;li&gt;Chứng minh hệ thức vòng $\dfrac{\partial x}{\partial y}\dfrac{\partial y}{\partial z}\dfrac{\partial z}{\partial x}=-1$ cho mọi $F(x,y,z)=0$ có các đạo hàm riêng khác 0.&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Gợi ý&lt;/summary&gt;

  &lt;ol start=&quot;5&quot;&gt;
    &lt;li&gt;$F_y(0,0)=0$. Tập nghiệm là hai đường $y=x$ và $y=-x$ cắt nhau; gần gốc không có hàm duy nhất $y(x)$.&lt;/li&gt;
    &lt;li&gt;Mỗi thừa số là $-F_\bullet/F_\bullet$: $\big(-\tfrac{F_y}{F_x}\big)\big(-\tfrac{F_z}{F_y}\big)\big(-\tfrac{F_x}{F_z}\big)=-1$.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;h2 id=&quot;tóm-tắt&quot;&gt;Tóm tắt&lt;/h2&gt;

&lt;div class=&quot;content-box summary-box textbook-block&quot;&gt;
  &lt;ul&gt;
    &lt;li&gt;Nếu $F(a,b)=0$ và $F_y(a,b)\ne0$ thì gần đó $y=g(x)$ duy nhất và $g&apos;=-F_x/F_y$.&lt;/li&gt;
    &lt;li&gt;Ba biến: $z_x=-F_x/F_z$, $z_y=-F_y/F_z$.&lt;/li&gt;
    &lt;li&gt;Hệ phương trình: cần Jacobian theo các ẩn khác 0.&lt;/li&gt;
    &lt;li&gt;Ứng dụng: tỉ lệ thay thế biên, hệ thức vòng $-1$ của nhiệt động lực học.&lt;/li&gt;
  &lt;/ul&gt;
&lt;/div&gt;
</content>
 </entry>
 
 <entry>
   <title>Đạo hàm theo hướng và gradient</title>
   <link href="https://calculus-self-learning.pages.dev/contents/vi/chapter11/11_02_Dao_ham_theo_huong_va_gradient/"/>
   <updated>2026-12-01T00:00:00+00:00</updated>
   <id>https://calculus-self-learning.pages.dev/contents/vi/chapter11/11_02_Dao_ham_theo_huong_va_gradient</id>
   <content type="html">&lt;div class=&quot;textbook-objectives&quot;&gt;

  &lt;p&gt;&lt;strong&gt;Mục tiêu bài học.&lt;/strong&gt; Sau bài này bạn có thể:&lt;/p&gt;

  &lt;ul&gt;
    &lt;li&gt;tính đạo hàm theo hướng bằng công thức $D_uf=\nabla f\cdot u$;&lt;/li&gt;
    &lt;li&gt;chứng minh gradient là hướng tăng nhanh nhất và vuông góc với đường mức;&lt;/li&gt;
    &lt;li&gt;viết mặt phẳng tiếp xúc của mặt mức $F(x,y,z)=c$;&lt;/li&gt;
    &lt;li&gt;hiểu bước cập nhật của gradient descent.&lt;/li&gt;
  &lt;/ul&gt;

&lt;/div&gt;

&lt;h2 id=&quot;vì-sao-cần-bài-này&quot;&gt;Vì sao cần bài này&lt;/h2&gt;

&lt;p&gt;Đạo hàm riêng chỉ cho tốc độ thay đổi theo hai hướng trục. Người leo núi muốn biết: đi theo hướng bất kỳ thì dốc bao nhiêu, và hướng nào dốc nhất? Câu trả lời là vectơ gradient. Trong học máy, huấn luyện mô hình là đi ngược gradient của hàm mất mát.&lt;/p&gt;

&lt;h2 id=&quot;đạo-hàm-theo-hướng-và-gradient&quot;&gt;Đạo hàm theo hướng và gradient&lt;/h2&gt;

&lt;div class=&quot;textbook-definition&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Định nghĩa.&lt;/strong&gt; Với vectơ đơn vị $u$, &lt;strong&gt;đạo hàm theo hướng&lt;/strong&gt; $u$ của $f$ tại $a$ là&lt;/p&gt;

\[D_uf(a)=\lim_{h\to0}\frac{f(a+hu)-f(a)}{h}.\]

  &lt;p&gt;&lt;strong&gt;Gradient&lt;/strong&gt; của $f$ là vectơ các đạo hàm riêng: $\nabla f=(f_x,f_y)$ (hay $(f_x,f_y,f_z)$ trong không gian).&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-theorem&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Định lý 1.&lt;/strong&gt; Nếu $f$ khả vi tại $a$ thì $D_uf(a)=\nabla f(a)\cdot u$.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-proof&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Chứng minh.&lt;/strong&gt; Đặt $g(h)=f(a+hu)=f(a_1+hu_1,a_2+hu_2)$. Theo định nghĩa, $D_uf(a)=g&apos;(0)$. Theo quy tắc chuỗi (bài 11_01), $g&apos;(0)=f_x(a)u_1+f_y(a)u_2=\nabla f(a)\cdot u$.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Ví dụ 1.&lt;/strong&gt; $f=x^2+3xy$ tại $(1,2)$ theo hướng $(3,4)$. Vectơ đơn vị $u=(3,4)/5$; $\nabla f=(2x+3y,3x)=(8,3)$. Vậy $D_uf=(8\cdot3+3\cdot4)/5=36/5=7.2$.&lt;/p&gt;
&lt;/div&gt;

&lt;h2 id=&quot;hướng-tăng-nhanh-nhất&quot;&gt;Hướng tăng nhanh nhất&lt;/h2&gt;

&lt;div class=&quot;textbook-theorem&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Định lý 2.&lt;/strong&gt; Giả sử $f$ khả vi tại $a$ và $\nabla f(a)\ne0$.&lt;/p&gt;

  &lt;ol&gt;
    &lt;li&gt;Giá trị lớn nhất của $D_uf(a)$ là $\lVert\nabla f(a)\rVert$, đạt khi $u=\nabla f(a)/\lVert\nabla f(a)\rVert$; giá trị nhỏ nhất là $-\lVert\nabla f(a)\rVert$, theo hướng ngược lại.&lt;/li&gt;
    &lt;li&gt;$\nabla f(a)$ vuông góc với đường mức (mặt mức) của $f$ đi qua $a$.&lt;/li&gt;
  &lt;/ol&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-proof&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Chứng minh.&lt;/strong&gt; (1) Gọi $\theta$ là góc giữa $\nabla f$ và $u$. Vì $\lVert u\rVert=1$, $D_uf=\nabla f\cdot u=\lVert\nabla f\rVert\cos\theta$, lớn nhất khi $\theta=0$, nhỏ nhất khi $\theta=\pi$.&lt;/p&gt;

  &lt;p&gt;(2) Lấy đường cong khả vi $r(t)$ nằm trên mức $f=c$ với $r(0)=a$. Khi đó $f(r(t))=c$ với mọi $t$; lấy đạo hàm bằng quy tắc chuỗi: $\nabla f(r(t))\cdot r&apos;(t)=0$. Tại $t=0$, $\nabla f(a)$ vuông góc với vectơ tiếp tuyến $r&apos;(0)$. Điều này đúng với mọi đường cong như vậy, nên $\nabla f(a)$ vuông góc với mức.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;interactive-frame&quot;&gt;
  &lt;div class=&quot;interactive-frame-head&quot;&gt;
    &lt;div class=&quot;interactive-frame-title&quot;&gt;Đạo hàm theo hướng và gradient&lt;/div&gt;
    &lt;div class=&quot;interactive-frame-desc&quot;&gt;Kéo điểm và xoay hướng u; D_u f lớn nhất theo hướng gradient.&lt;/div&gt;
  &lt;/div&gt;
  &lt;iframe src=&quot;/interactives/chapter11/gradient-directional.html&quot; title=&quot;Đạo hàm theo hướng và gradient&quot; loading=&quot;lazy&quot; style=&quot;height: 700px;&quot;&gt;&lt;/iframe&gt;
  &lt;div class=&quot;interactive-frame-foot&quot;&gt;
    &lt;a href=&quot;/interactives/chapter11/gradient-directional.html&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;Mở minh hoạ ở cửa sổ riêng&lt;/a&gt;
  &lt;/div&gt;
&lt;/div&gt;

&lt;div class=&quot;reel-video&quot;&gt;
  &lt;video controls=&quot;&quot; playsinline=&quot;&quot; preload=&quot;metadata&quot; src=&quot;/public/videos/reels/gradient-steepest-ascent.mp4&quot;&gt;&lt;/video&gt;
  &lt;p class=&quot;reel-caption&quot;&gt;Quả bóng trên đồi: xoay hướng u để thấy D_u f = ∇f · u, gradient vuông góc đường mức và chỉ hướng dốc nhất (video không lời, khoảng 2 phút).&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Ví dụ 2 (Nhiệt độ).&lt;/strong&gt; Nhiệt độ trên tấm kim loại là $T=100e^{-(x^2+2y^2)}$. Tại $(1,1)$: $\nabla T=100e^{-3}(-2x,-4y)=100e^{-3}(-2,-4)$. Con kiến muốn ấm lên nhanh nhất phải đi theo hướng $(-1,-2)/\sqrt5$, với tốc độ tăng $100e^{-3}\sqrt{20}\approx22.3$ độ trên một đơn vị dài.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Ví dụ 3 (Mặt phẳng tiếp xúc của mặt mức).&lt;/strong&gt; Mặt cầu $x^2+y^2+z^2=14$ đi qua $(1,2,3)$. Pháp tuyến là $\nabla F=(2x,2y,2z)=(2,4,6)$, nên mặt phẳng tiếp xúc là $2(x-1)+4(y-2)+6(z-3)=0$, tức $x+2y+3z=14$.&lt;/p&gt;
&lt;/div&gt;

&lt;h2 id=&quot;ứng-dụng-gradient-descent-học-máy&quot;&gt;Ứng dụng: gradient descent (học máy)&lt;/h2&gt;

&lt;p&gt;Muốn giảm hàm mất mát $L(w)$, ta đi theo hướng giảm nhanh nhất $-\nabla L$:&lt;/p&gt;

\[w\leftarrow w-\eta\,\nabla L(w),\]

&lt;p&gt;với $\eta&amp;gt;0$ là tốc độ học. Xét $L=(w_1-1)^2+10w_2^2$, $\nabla L=(2(w_1-1),20w_2)$. Mỗi bước nhân $w_2$ với $1-20\eta$ và $w_1-1$ với $1-2\eta$.&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;$\eta=0.05$ từ $(0,1)$: một bước đến $(0.1,0)$. Thành phần $w_2$ hội tụ ngay, $w_1$ còn chậm.&lt;/li&gt;
  &lt;li&gt;$\eta=0.1$: $w_2$ bị nhân với $-1$, dao động $1,-1,1,\dots$ mãi mãi.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Đường mức dẹt (hệ số 1 và 10 chênh nhau) làm gradient descent khó chọn $\eta$; đây là lý do có các phương pháp như momentum, Adam, hay Newton (bài 11_04).&lt;/p&gt;

&lt;div class=&quot;interactive-frame&quot;&gt;
  &lt;div class=&quot;interactive-frame-head&quot;&gt;
    &lt;div class=&quot;interactive-frame-title&quot;&gt;Đi xuống theo gradient&lt;/div&gt;
    &lt;div class=&quot;interactive-frame-desc&quot;&gt;Đổi tốc độ học và điểm xuất phát, xem đường đi và giá trị f.&lt;/div&gt;
  &lt;/div&gt;
  &lt;iframe src=&quot;/interactives/chapter11/gradient-descent.html&quot; title=&quot;Đi xuống theo gradient&quot; loading=&quot;lazy&quot; style=&quot;height: 700px;&quot;&gt;&lt;/iframe&gt;
  &lt;div class=&quot;interactive-frame-foot&quot;&gt;
    &lt;a href=&quot;/interactives/chapter11/gradient-descent.html&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;Mở minh hoạ ở cửa sổ riêng&lt;/a&gt;
  &lt;/div&gt;
&lt;/div&gt;

&lt;h2 id=&quot;bài-tập&quot;&gt;Bài tập&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Cơ bản.&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;$f=xe^y$. Tính $\nabla f(2,0)$ và $D_uf(2,0)$ với $u=(1,1)/\sqrt2$.&lt;/li&gt;
  &lt;li&gt;$f=\ln(x^2+y^2)$. Tìm hướng và tốc độ tăng nhanh nhất tại $(1,1)$.&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Đáp án&lt;/summary&gt;

  &lt;ol&gt;
    &lt;li&gt;$\nabla f=(e^y,xe^y)=(1,2)$; $D_uf=3/\sqrt2$.&lt;/li&gt;
    &lt;li&gt;$\nabla f=\big(\tfrac{2x}{x^2+y^2},\tfrac{2y}{x^2+y^2}\big)=(1,1)$; hướng $(1,1)/\sqrt2$, tốc độ $\sqrt2$.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;p&gt;&lt;strong&gt;Trung bình.&lt;/strong&gt;&lt;/p&gt;

&lt;ol start=&quot;3&quot;&gt;
  &lt;li&gt;Dùng gradient của $F=x^2+y^2-z$, viết mặt phẳng tiếp xúc của $z=x^2+y^2$ tại $(1,1,2)$.&lt;/li&gt;
  &lt;li&gt;Tại $(2,1)$, theo hướng nào thì $f=x^2-y^2$ không đổi (tức thời)?&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Đáp án&lt;/summary&gt;

  &lt;ol start=&quot;3&quot;&gt;
    &lt;li&gt;$\nabla F=(2,2,-1)$: $2(x-1)+2(y-1)-(z-2)=0$, tức $z=2x+2y-2$.&lt;/li&gt;
    &lt;li&gt;$\nabla f=(4,-2)$; hướng vuông góc: $\pm(1,2)/\sqrt5$.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;p&gt;&lt;strong&gt;Nâng cao.&lt;/strong&gt;&lt;/p&gt;

&lt;ol start=&quot;5&quot;&gt;
  &lt;li&gt;Chứng minh $\nabla(fg)=f\nabla g+g\nabla f$.&lt;/li&gt;
  &lt;li&gt;Với $L(w)=\lambda w^2$, $\lambda&amp;gt;0$, chứng minh gradient descent hội tụ về 0 với mọi điểm đầu khi và chỉ khi $0&amp;lt;\eta&amp;lt;1/\lambda$.&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Gợi ý&lt;/summary&gt;

  &lt;ol start=&quot;5&quot;&gt;
    &lt;li&gt;Áp dụng quy tắc tích cho từng đạo hàm riêng.&lt;/li&gt;
    &lt;li&gt;$w_{k+1}=(1-2\eta\lambda)w_k$, nên $w_k=(1-2\eta\lambda)^kw_0\to0$ khi và chỉ khi $\lvert1-2\eta\lambda\rvert&amp;lt;1$, tức $0&amp;lt;\eta&amp;lt;1/\lambda$.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;h2 id=&quot;tóm-tắt&quot;&gt;Tóm tắt&lt;/h2&gt;

&lt;div class=&quot;content-box summary-box textbook-block&quot;&gt;
  &lt;ul&gt;
    &lt;li&gt;$D_uf=\nabla f\cdot u=\lVert\nabla f\rVert\cos\theta$.&lt;/li&gt;
    &lt;li&gt;Gradient chỉ hướng tăng nhanh nhất, độ lớn là tốc độ tăng đó; nó vuông góc với đường mức.&lt;/li&gt;
    &lt;li&gt;Mặt mức $F=c$ có pháp tuyến $\nabla F$.&lt;/li&gt;
    &lt;li&gt;Gradient descent: $w\leftarrow w-\eta\nabla L$; $\eta$ quá lớn gây dao động hoặc phân kỳ.&lt;/li&gt;
  &lt;/ul&gt;
&lt;/div&gt;
</content>
 </entry>
 
 <entry>
   <title>Quy tắc chuỗi và ma trận Jacobi</title>
   <link href="https://calculus-self-learning.pages.dev/contents/vi/chapter11/11_01_Quy_tac_chuoi_va_ma_tran_Jacobi/"/>
   <updated>2026-12-01T00:00:00+00:00</updated>
   <id>https://calculus-self-learning.pages.dev/contents/vi/chapter11/11_01_Quy_tac_chuoi_va_ma_tran_Jacobi</id>
   <content type="html">&lt;div class=&quot;textbook-objectives&quot;&gt;

  &lt;p&gt;&lt;strong&gt;Mục tiêu bài học.&lt;/strong&gt; Sau bài này bạn có thể:&lt;/p&gt;

  &lt;ul&gt;
    &lt;li&gt;tính đạo hàm của hàm hợp $z=f(x(t),y(t))$ và $z=f(x(s,t),y(s,t))$;&lt;/li&gt;
    &lt;li&gt;chứng minh quy tắc chuỗi từ định nghĩa khả vi;&lt;/li&gt;
    &lt;li&gt;lập ma trận Jacobi và viết quy tắc chuỗi bằng phép nhân ma trận.&lt;/li&gt;
  &lt;/ul&gt;

&lt;/div&gt;

&lt;h2 id=&quot;vì-sao-cần-bài-này&quot;&gt;Vì sao cần bài này&lt;/h2&gt;

&lt;p&gt;Trong thực tế các biến hiếm khi độc lập: nhiệt độ phụ thuộc vị trí, vị trí phụ thuộc thời gian; sản lượng phụ thuộc vốn và lao động, hai đại lượng này lại thay đổi theo năm. Quy tắc chuỗi cho biết đại lượng cuối thay đổi thế nào khi biến gốc thay đổi. Đây cũng là công cụ duy nhất đứng sau thuật toán lan truyền ngược (bài 11_05).&lt;/p&gt;

&lt;h2 id=&quot;quy-tắc-chuỗi-một-tham-số&quot;&gt;Quy tắc chuỗi một tham số&lt;/h2&gt;

&lt;div class=&quot;textbook-theorem&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Định lý 1.&lt;/strong&gt; Nếu $x(t)$, $y(t)$ khả vi tại $t$ và $f$ khả vi tại $(x(t),y(t))$ thì $z(t)=f(x(t),y(t))$ khả vi tại $t$ và&lt;/p&gt;

\[\frac{dz}{dt}=f_x\,\frac{dx}{dt}+f_y\,\frac{dy}{dt}.\]

&lt;/div&gt;

&lt;div class=&quot;textbook-proof&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Chứng minh.&lt;/strong&gt; Đặt $\Delta x=x(t+\Delta t)-x(t)$, $\Delta y=y(t+\Delta t)-y(t)$. Vì $f$ khả vi (bài 10_04),&lt;/p&gt;

\[\Delta z=f_x\Delta x+f_y\Delta y+\varepsilon(\Delta x,\Delta y)\sqrt{\Delta x^2+\Delta y^2},\]

  &lt;p&gt;với $\varepsilon\to0$ khi $(\Delta x,\Delta y)\to(0,0)$ (đặt $\varepsilon(0,0)=0$). Chia cho $\Delta t\ne0$:&lt;/p&gt;

\[\frac{\Delta z}{\Delta t}=f_x\frac{\Delta x}{\Delta t}+f_y\frac{\Delta y}{\Delta t}\pm\varepsilon\sqrt{\Big(\frac{\Delta x}{\Delta t}\Big)^2+\Big(\frac{\Delta y}{\Delta t}\Big)^2}.\]

  &lt;p&gt;Khi $\Delta t\to0$: $x$, $y$ liên tục nên $(\Delta x,\Delta y)\to0$ và $\varepsilon\to0$, còn căn thức tiến tới $\sqrt{x&apos;^2+y&apos;^2}$ hữu hạn. Vậy số hạng cuối tiến tới 0, ta được công thức.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Ví dụ 1.&lt;/strong&gt; $z=x^2y$, $x=\cos t$, $y=\sin t$. Theo quy tắc chuỗi:&lt;/p&gt;

\[\frac{dz}{dt}=2xy\cdot(-\sin t)+x^2\cos t=-2\cos t\sin^2t+\cos^3t.\]

  &lt;p&gt;Kiểm tra trực tiếp: $z=\cos^2t\sin t$, $z&apos;=-2\cos t\sin^2t+\cos^3t$. Khớp.&lt;/p&gt;
&lt;/div&gt;

&lt;h2 id=&quot;nhiều-tham-số&quot;&gt;Nhiều tham số&lt;/h2&gt;

&lt;p&gt;Nếu $x=x(s,t)$, $y=y(s,t)$ thì, giữ một tham số cố định và áp dụng định lý 1:&lt;/p&gt;

\[z_s=f_x\,x_s+f_y\,y_s,\qquad z_t=f_x\,x_t+f_y\,y_t.\]

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Ví dụ 2 (Toạ độ cực).&lt;/strong&gt; Với $x=r\cos\theta$, $y=r\sin\theta$:&lt;/p&gt;

\[z_r=f_x\cos\theta+f_y\sin\theta,\qquad z_\theta=-f_x\,r\sin\theta+f_y\,r\cos\theta.\]

  &lt;p&gt;Với $f=x^2+y^2$: $z_r=2x\cos\theta+2y\sin\theta=2r$, đúng với $z=r^2$.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;reel-video&quot;&gt;
  &lt;video controls=&quot;&quot; playsinline=&quot;&quot; preload=&quot;metadata&quot; src=&quot;/public/videos/reels/chain-rule-jacobian.mp4&quot;&gt;&lt;/video&gt;
  &lt;p class=&quot;reel-caption&quot;&gt;Quy tắc chuỗi và ma trận Jacobi: điểm chạy trên đường tròn, ô lưới nhỏ qua hai phép biến đổi G rồi F, hệ số phóng diện tích nhân với nhau, kiểm tra bằng số, sơ đồ đường đi, nhân ma trận, toạ độ cực và tốc độ tăng trưởng (video không lời, khoảng 3 phút 12 giây).&lt;/p&gt;
&lt;/div&gt;

&lt;h2 id=&quot;ma-trận-jacobi&quot;&gt;Ma trận Jacobi&lt;/h2&gt;

&lt;div class=&quot;textbook-definition&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Định nghĩa.&lt;/strong&gt; Với $F=(F_1,\dots,F_m):\mathbb R^n\to\mathbb R^m$ khả vi, &lt;strong&gt;ma trận Jacobi&lt;/strong&gt; là ma trận $m\times n$&lt;/p&gt;

\[J_F=\begin{pmatrix}\dfrac{\partial F_1}{\partial x_1}&amp;amp;\cdots&amp;amp;\dfrac{\partial F_1}{\partial x_n}\\\vdots&amp;amp;&amp;amp;\vdots\\\dfrac{\partial F_m}{\partial x_1}&amp;amp;\cdots&amp;amp;\dfrac{\partial F_m}{\partial x_n}\end{pmatrix}.\]

  &lt;p&gt;Khi $m=n$, định thức của nó gọi là &lt;strong&gt;Jacobian&lt;/strong&gt;.&lt;/p&gt;
&lt;/div&gt;

&lt;p&gt;Ma trận Jacobi là ánh xạ tuyến tính xấp xỉ tốt nhất $F$ gần một điểm: $F(a+h)\approx F(a)+J_F(a)h$.&lt;/p&gt;

&lt;div class=&quot;textbook-theorem&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Định lý 2 (Quy tắc chuỗi dạng ma trận).&lt;/strong&gt; Nếu $G$ khả vi tại $a$ và $F$ khả vi tại $G(a)$ thì&lt;/p&gt;

\[J_{F\circ G}(a)=J_F(G(a))\,J_G(a).\]

&lt;/div&gt;

&lt;div class=&quot;textbook-proof&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Chứng minh.&lt;/strong&gt; Phần tử hàng $i$, cột $j$ của vế trái là $\partial(F_i\circ G)/\partial x_j$. Áp dụng quy tắc chuỗi (dạng nhiều biến trung gian $u_k=G_k$, chứng minh y hệt định lý 1) cho hàm số $F_i(u_1,\dots,u_p)$:&lt;/p&gt;

\[\frac{\partial(F_i\circ G)}{\partial x_j}=\sum_{k=1}^p\frac{\partial F_i}{\partial u_k}\frac{\partial G_k}{\partial x_j},\]

  &lt;p&gt;đúng là phần tử $(i,j)$ của tích $J_F J_G$.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Ví dụ 3.&lt;/strong&gt; $G(r,\theta)=(r\cos\theta,r\sin\theta)$ có&lt;/p&gt;

\[J_G=\begin{pmatrix}\cos\theta&amp;amp;-r\sin\theta\\\sin\theta&amp;amp;r\cos\theta\end{pmatrix},\qquad\det J_G=r.\]

  &lt;p&gt;Một ô nhỏ $dr\,d\theta$ bị biến thành ô có diện tích xấp xỉ $r\,dr\,d\theta$; ta sẽ dùng điều này ở chương 13. Ví dụ 2 chính là $(z_r\ z_\theta)=(f_x\ f_y)\,J_G$.&lt;/p&gt;
&lt;/div&gt;

&lt;h2 id=&quot;ứng-dụng-hạch-toán-tăng-trưởng-kinh-tế&quot;&gt;Ứng dụng: hạch toán tăng trưởng (kinh tế)&lt;/h2&gt;

&lt;p&gt;Với hàm sản xuất Cobb–Douglas $Q=AK^{0.3}L^{0.7}$, vốn $K(t)$ và lao động $L(t)$ thay đổi theo thời gian. Quy tắc chuỗi cho&lt;/p&gt;

\[\frac{Q&apos;}{Q}=\frac{A&apos;}{A}+0.3\,\frac{K&apos;}{K}+0.7\,\frac{L&apos;}{L}.\]

&lt;p&gt;Nếu vốn tăng 5%/năm, lao động tăng 1%/năm và $A$ không đổi thì sản lượng tăng khoảng $0.3\cdot5+0.7\cdot1=2.2$%/năm. Phần tăng trưởng thực tế vượt con số này được gán cho $A$, gọi là năng suất nhân tố tổng hợp.&lt;/p&gt;

&lt;h2 id=&quot;bài-tập&quot;&gt;Bài tập&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Cơ bản.&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;$z=e^{xy}$, $x=t^2$, $y=t^3$. Tính $dz/dt$ bằng quy tắc chuỗi và kiểm tra trực tiếp.&lt;/li&gt;
  &lt;li&gt;$w=xyz$, $x=t$, $y=t^2$, $z=t^3$. Tính $dw/dt$.&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Đáp án&lt;/summary&gt;

  &lt;ol&gt;
    &lt;li&gt;$dz/dt=ye^{xy}\cdot2t+xe^{xy}\cdot3t^2=5t^4e^{t^5}$, khớp với $z=e^{t^5}$.&lt;/li&gt;
    &lt;li&gt;$yz\cdot1+xz\cdot2t+xy\cdot3t^2=t^5+2t^5+3t^5=6t^5$.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;p&gt;&lt;strong&gt;Trung bình.&lt;/strong&gt;&lt;/p&gt;

&lt;ol start=&quot;3&quot;&gt;
  &lt;li&gt;Tìm ma trận Jacobi và Jacobian của $(u,v)=(x+y,\,xy)$.&lt;/li&gt;
  &lt;li&gt;Chứng minh $u(x,t)=f(x-ct)$ thoả $u_t+c\,u_x=0$ với mọi $f$ khả vi (phương trình vận chuyển).&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Đáp án&lt;/summary&gt;

  &lt;ol start=&quot;3&quot;&gt;
    &lt;li&gt;$\begin{pmatrix}1&amp;amp;1\\y&amp;amp;x\end{pmatrix}$, Jacobian $x-y$.&lt;/li&gt;
    &lt;li&gt;Đặt $s=x-ct$: $u_t=f&apos;(s)\cdot(-c)$, $u_x=f&apos;(s)$, nên $u_t+cu_x=0$.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;p&gt;&lt;strong&gt;Nâng cao.&lt;/strong&gt;&lt;/p&gt;

&lt;ol start=&quot;5&quot;&gt;
  &lt;li&gt;(Định lý Euler về hàm thuần nhất.) Nếu $f(tx,ty)=t^nf(x,y)$ với mọi $t&amp;gt;0$ thì $xf_x+yf_y=nf$. Kiểm tra với Cobb–Douglas $K^{0.3}L^{0.7}$.&lt;/li&gt;
  &lt;li&gt;Với $x=r\cos\theta$, $y=r\sin\theta$, chứng minh $f_x^2+f_y^2=z_r^2+\dfrac{1}{r^2}z_\theta^2$.&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Gợi ý&lt;/summary&gt;

  &lt;ol start=&quot;5&quot;&gt;
    &lt;li&gt;Lấy đạo hàm hai vế theo $t$ rồi cho $t=1$: $xf_x+yf_y=nf$. Cobb–Douglas có $n=1$: $KQ_K+LQ_L=Q$, tức trả công theo năng suất biên vừa hết sản lượng.&lt;/li&gt;
    &lt;li&gt;Từ ví dụ 2, $z_r^2+z_\theta^2/r^2=(f_x\cos\theta+f_y\sin\theta)^2+(-f_x\sin\theta+f_y\cos\theta)^2=f_x^2+f_y^2$.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;h2 id=&quot;tóm-tắt&quot;&gt;Tóm tắt&lt;/h2&gt;

&lt;div class=&quot;content-box summary-box textbook-block&quot;&gt;
  &lt;ul&gt;
    &lt;li&gt;$\dfrac{dz}{dt}=f_xx&apos;+f_yy&apos;$; chứng minh dựa trên tính khả vi của $f$.&lt;/li&gt;
    &lt;li&gt;Nhiều tham số: giữ cố định các tham số khác rồi áp dụng cùng công thức.&lt;/li&gt;
    &lt;li&gt;Ma trận Jacobi gom mọi đạo hàm riêng; quy tắc chuỗi là $J_{F\circ G}=J_F\,J_G$.&lt;/li&gt;
    &lt;li&gt;Toạ độ cực có Jacobian $r$; Cobb–Douglas cho công thức hạch toán tăng trưởng.&lt;/li&gt;
  &lt;/ul&gt;
&lt;/div&gt;
</content>
 </entry>
 
 <entry>
   <title>Đạo hàm riêng cấp cao và định lý Schwarz</title>
   <link href="https://calculus-self-learning.pages.dev/contents/vi/chapter10/10_05_Dao_ham_rieng_cap_cao_va_dinh_ly_Schwarz/"/>
   <updated>2026-12-01T00:00:00+00:00</updated>
   <id>https://calculus-self-learning.pages.dev/contents/vi/chapter10/10_05_Dao_ham_rieng_cap_cao_va_dinh_ly_Schwarz</id>
   <content type="html">&lt;div class=&quot;textbook-objectives&quot;&gt;

  &lt;p&gt;&lt;strong&gt;Mục tiêu.&lt;/strong&gt; Sau bài này bạn có thể:&lt;/p&gt;

  &lt;ul&gt;
    &lt;li&gt;tính các đạo hàm riêng cấp hai $f_{xx}$, $f_{xy}$, $f_{yx}$, $f_{yy}$ và cấp cao hơn;&lt;/li&gt;
    &lt;li&gt;phát biểu, chứng minh định lý Schwarz và biết khi nào nó không áp dụng được;&lt;/li&gt;
    &lt;li&gt;kiểm tra một hàm có thoả phương trình Laplace, phương trình nhiệt, phương trình sóng không;&lt;/li&gt;
    &lt;li&gt;hiểu vai trò của ma trận Hessian.&lt;/li&gt;
  &lt;/ul&gt;

&lt;/div&gt;

&lt;h2 id=&quot;vì-sao-cần-bài-này&quot;&gt;Vì sao cần bài này&lt;/h2&gt;

&lt;p&gt;Đạo hàm cấp hai của hàm một biến cho biết độ cong, và dùng để phân loại cực trị. Với hàm nhiều biến, các đạo hàm cấp hai tạo thành &lt;strong&gt;ma trận Hessian&lt;/strong&gt;, nền tảng của phân loại cực trị (chương 12) và các phương pháp tối ưu bậc hai. Các định luật vật lý cơ bản (nhiệt, sóng, điện thế) đều là phương trình với đạo hàm riêng cấp hai.&lt;/p&gt;

&lt;h2 id=&quot;đạo-hàm-riêng-cấp-hai&quot;&gt;Đạo hàm riêng cấp hai&lt;/h2&gt;

&lt;div class=&quot;textbook-definition&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Định nghĩa.&lt;/strong&gt; Lấy đạo hàm riêng của các đạo hàm riêng:&lt;/p&gt;

\[f_{xx}=\frac{\partial^2f}{\partial x^2},\quad f_{yy}=\frac{\partial^2f}{\partial y^2},\quad f_{xy}=(f_x)_y=\frac{\partial^2f}{\partial y\,\partial x},\quad f_{yx}=(f_y)_x=\frac{\partial^2f}{\partial x\,\partial y}.\]

  &lt;p&gt;$f_{xy}$ và $f_{yx}$ gọi là &lt;strong&gt;đạo hàm hỗn hợp&lt;/strong&gt;.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Ví dụ 1.&lt;/strong&gt; $f=x^3y^2+e^{xy}$. Ta có $f_x=3x^2y^2+ye^{xy}$, $f_y=2x^3y+xe^{xy}$, và&lt;/p&gt;

\[f_{xx}=6xy^2+y^2e^{xy},\quad f_{yy}=2x^3+x^2e^{xy},\quad f_{xy}=6x^2y+e^{xy}+xye^{xy}=f_{yx}.\]

&lt;/div&gt;

&lt;p&gt;Hai đạo hàm hỗn hợp bằng nhau không phải ngẫu nhiên.&lt;/p&gt;

&lt;h2 id=&quot;định-lý-schwarz&quot;&gt;Định lý Schwarz&lt;/h2&gt;

&lt;div class=&quot;textbook-theorem&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Định lý 1 (Schwarz, còn gọi là Clairaut).&lt;/strong&gt; Nếu $f_{xy}$ và $f_{yx}$ tồn tại gần $(a,b)$ và liên tục tại $(a,b)$ thì $f_{xy}(a,b)=f_{yx}(a,b)$.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-proof&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Chứng minh.&lt;/strong&gt; Xét “sai phân kép” với $h\ne0$ nhỏ:&lt;/p&gt;

\[\Delta(h)=f(a+h,b+h)-f(a+h,b)-f(a,b+h)+f(a,b).\]

  &lt;p&gt;&lt;em&gt;Cách 1.&lt;/em&gt; Đặt $\varphi(x)=f(x,b+h)-f(x,b)$, thì $\Delta=\varphi(a+h)-\varphi(a)$. Theo định lý Lagrange, $\Delta=h\varphi&apos;(a+\theta_1h)=h\big[f_x(a+\theta_1h,b+h)-f_x(a+\theta_1h,b)\big]$. Áp dụng định lý Lagrange lần nữa cho $y\mapsto f_x(a+\theta_1h,y)$: $\Delta=h^2f_{xy}(a+\theta_1h,b+\theta_2h)$.&lt;/p&gt;

  &lt;p&gt;&lt;em&gt;Cách 2.&lt;/em&gt; Đặt $\psi(y)=f(a+h,y)-f(a,y)$, thì $\Delta=\psi(b+h)-\psi(b)$, và lập luận tương tự cho $\Delta=h^2f_{yx}(a+\theta_3h,b+\theta_4h)$.&lt;/p&gt;

  &lt;p&gt;Vậy $f_{xy}(a+\theta_1h,b+\theta_2h)=f_{yx}(a+\theta_3h,b+\theta_4h)$. Cho $h\to0$, cả hai điểm dần về $(a,b)$, và tính liên tục cho $f_{xy}(a,b)=f_{yx}(a,b)$.&lt;/p&gt;
&lt;/div&gt;

&lt;p&gt;Hệ quả: với hàm có các đạo hàm riêng cấp $n$ liên tục, thứ tự lấy đạo hàm không quan trọng. Hàm hai biến chỉ có $3$ đạo hàm cấp hai khác nhau và $4$ đạo hàm cấp ba khác nhau ($f_{xxx}$, $f_{xxy}$, $f_{xyy}$, $f_{yyy}$).&lt;/p&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Ví dụ 2 (Phản ví dụ).&lt;/strong&gt; $f(x,y)=\dfrac{xy(x^2-y^2)}{x^2+y^2}$, $f(0,0)=0$. Với $y$ cố định, $f_x(0,y)=\lim_{h\to0}\tfrac{f(h,y)}h=\lim_{h\to0}\tfrac{y(h^2-y^2)}{h^2+y^2}=-y$, nên $f_{xy}(0,0)=-1$. Tương tự $f_y(x,0)=x$, nên $f_{yx}(0,0)=1$. Hai đạo hàm hỗn hợp khác nhau; định lý Schwarz không áp dụng vì $f_{xy}$ không liên tục tại gốc.&lt;/p&gt;
&lt;/div&gt;

&lt;h2 id=&quot;các-phương-trình-đạo-hàm-riêng-cổ-điển&quot;&gt;Các phương trình đạo hàm riêng cổ điển&lt;/h2&gt;

&lt;div class=&quot;content-box insight-box textbook-block&quot;&gt;
  &lt;ul&gt;
    &lt;li&gt;&lt;strong&gt;Laplace&lt;/strong&gt; $u_{xx}+u_{yy}=0$ (điện thế, nhiệt độ cân bằng). Nghiệm gọi là hàm &lt;strong&gt;điều hoà&lt;/strong&gt;: $x^2-y^2$, $e^x\sin y$, $\ln(x^2+y^2)$ (ngoài gốc).&lt;/li&gt;
    &lt;li&gt;&lt;strong&gt;Nhiệt&lt;/strong&gt; $u_t=k\,u_{xx}$: $u=e^{-kt}\sin x$ (bài 10_03).&lt;/li&gt;
    &lt;li&gt;&lt;strong&gt;Sóng&lt;/strong&gt; $u_{tt}=c^2u_{xx}$: $u=F(x-ct)+G(x+ct)$ với $F$, $G$ bất kỳ khả vi hai lần (nghiệm d’Alembert): hai sóng chạy ngược chiều với tốc độ $c$.&lt;/li&gt;
  &lt;/ul&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Ví dụ 3.&lt;/strong&gt; $u=\ln(x^2+y^2)$: $u_x=\tfrac{2x}{x^2+y^2}$, $u_{xx}=\tfrac{2(y^2-x^2)}{(x^2+y^2)^2}$; do đối xứng $u_{yy}=\tfrac{2(x^2-y^2)}{(x^2+y^2)^2}$. Tổng bằng 0: $u$ điều hoà ngoài gốc. Đây (nhân hằng số) là điện thế của một dây dẫn thẳng dài tích điện.&lt;/p&gt;
&lt;/div&gt;

&lt;h2 id=&quot;ứng-dụng&quot;&gt;Ứng dụng&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Học máy: ma trận Hessian.&lt;/strong&gt; Ma trận $H=\begin{pmatrix}f_{xx}&amp;amp;f_{xy}\\f_{yx}&amp;amp;f_{yy}\end{pmatrix}$ mô tả độ cong của hàm mất mát. Theo định lý Schwarz, $H$ đối xứng, nên có các trị riêng thực và các hướng cong chính vuông góc nhau. Phương pháp Newton nhiều biến dùng bước $-H^{-1}\nabla f$; trong học sâu, người ta xấp xỉ $H$ (Adam, K-FAC) vì $H$ quá lớn để tính đầy đủ.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Xử lý ảnh: toán tử Laplace.&lt;/strong&gt; Với ảnh $u(i,j)$, sai phân $u_{xx}\approx u(i+1,j)-2u(i,j)+u(i-1,j)$ (cộng hai khai triển Taylor, bài 08_01) cho Laplace rời rạc với nhân $\begin{pmatrix}0&amp;amp;1&amp;amp;0\\1&amp;amp;-4&amp;amp;1\\0&amp;amp;1&amp;amp;0\end{pmatrix}$. Giá trị lớn tại những nơi cường độ đổi đột ngột, nên toán tử này dùng để phát hiện cạnh và làm nét ảnh.&lt;/p&gt;

&lt;h2 id=&quot;bài-tập&quot;&gt;Bài tập&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Cơ bản.&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;Tính mọi đạo hàm cấp hai của $f=x^4-3x^2y^3$.&lt;/li&gt;
  &lt;li&gt;Tính mọi đạo hàm cấp hai của $f=\sin(x+2y)$.&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Đáp án&lt;/summary&gt;

  &lt;ol&gt;
    &lt;li&gt;$f_{xx}=12x^2-6y^3$, $f_{yy}=-18x^2y$, $f_{xy}=f_{yx}=-18xy^2$.&lt;/li&gt;
    &lt;li&gt;$f_{xx}=-\sin(x+2y)$, $f_{xy}=f_{yx}=-2\sin(x+2y)$, $f_{yy}=-4\sin(x+2y)$.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;p&gt;&lt;strong&gt;Trung bình.&lt;/strong&gt;&lt;/p&gt;

&lt;ol start=&quot;3&quot;&gt;
  &lt;li&gt;Hàm nào điều hoà: $x^3-3xy^2$, $x^2+y^2$, $e^{-y}\cos x$?&lt;/li&gt;
  &lt;li&gt;Với $k&amp;gt;0$, tìm $\lambda$ để $u=e^{\lambda t}\sin(3x)$ thoả $u_t=k\,u_{xx}$.&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Đáp án&lt;/summary&gt;

  &lt;ol start=&quot;3&quot;&gt;
    &lt;li&gt;$x^3-3xy^2$: $6x-6x=0$, điều hoà. $x^2+y^2$: $2+2\ne0$. $e^{-y}\cos x$: $-e^{-y}\cos x+e^{-y}\cos x=0$, điều hoà.&lt;/li&gt;
    &lt;li&gt;$\lambda=-9k$: tần số cao hơn tắt nhanh hơn.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;p&gt;&lt;strong&gt;Nâng cao.&lt;/strong&gt;&lt;/p&gt;

&lt;ol start=&quot;5&quot;&gt;
  &lt;li&gt;Kiểm tra chi tiết các giới hạn trong ví dụ 2, và chứng minh $f_{xy}$ không liên tục tại gốc.&lt;/li&gt;
  &lt;li&gt;Chứng minh nếu $u(x,y)$ điều hoà thì $u_x$ cũng điều hoà (giả sử $u$ có đạo hàm riêng cấp ba liên tục).&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Gợi ý&lt;/summary&gt;

  &lt;ol start=&quot;5&quot;&gt;
    &lt;li&gt;Với $(x,y)\ne(0,0)$, tính trực tiếp cho $f_{xy}=\tfrac{x^6+9x^4y^2-9x^2y^4-y^6}{(x^2+y^2)^3}$. Dọc trục $Ox$ giá trị là 1, dọc trục $Oy$ là $-1$: không có giới hạn tại gốc.&lt;/li&gt;
    &lt;li&gt;$(u_x)_{xx}+(u_x)_{yy}=(u_{xx}+u_{yy})_x=0$, đổi thứ tự lấy đạo hàm nhờ định lý Schwarz.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;h2 id=&quot;tóm-tắt&quot;&gt;Tóm tắt&lt;/h2&gt;

&lt;div class=&quot;content-box summary-box textbook-block&quot;&gt;
  &lt;ul&gt;
    &lt;li&gt;Đạo hàm cấp hai: $f_{xx}$, $f_{yy}$ và hai đạo hàm hỗn hợp $f_{xy}$, $f_{yx}$.&lt;/li&gt;
    &lt;li&gt;Schwarz: nếu đạo hàm hỗn hợp liên tục thì $f_{xy}=f_{yx}$; phản ví dụ $\tfrac{xy(x^2-y^2)}{x^2+y^2}$.&lt;/li&gt;
    &lt;li&gt;Phương trình Laplace, nhiệt, sóng dùng đạo hàm riêng cấp hai.&lt;/li&gt;
    &lt;li&gt;Hessian đối xứng mô tả độ cong; Laplace rời rạc phát hiện cạnh trong ảnh.&lt;/li&gt;
  &lt;/ul&gt;
&lt;/div&gt;
</content>
 </entry>
 
 <entry>
   <title>Khả vi và vi phân toàn phần</title>
   <link href="https://calculus-self-learning.pages.dev/contents/vi/chapter10/10_04_Kha_vi_va_vi_phan_toan_phan/"/>
   <updated>2026-12-01T00:00:00+00:00</updated>
   <id>https://calculus-self-learning.pages.dev/contents/vi/chapter10/10_04_Kha_vi_va_vi_phan_toan_phan</id>
   <content type="html">&lt;div class=&quot;textbook-objectives&quot;&gt;

  &lt;p&gt;&lt;strong&gt;Mục tiêu.&lt;/strong&gt; Sau bài này bạn có thể:&lt;/p&gt;

  &lt;ul&gt;
    &lt;li&gt;phát biểu định nghĩa khả vi của hàm hai biến;&lt;/li&gt;
    &lt;li&gt;giải thích vì sao có đạo hàm riêng chưa đủ để khả vi;&lt;/li&gt;
    &lt;li&gt;dùng điều kiện đủ: đạo hàm riêng liên tục thì khả vi;&lt;/li&gt;
    &lt;li&gt;dùng vi phân toàn phần $df=f_x\,dx+f_y\,dy$ để xấp xỉ và ước lượng sai số đo.&lt;/li&gt;
  &lt;/ul&gt;

&lt;/div&gt;

&lt;h2 id=&quot;vì-sao-cần-bài-này&quot;&gt;Vì sao cần bài này&lt;/h2&gt;

&lt;p&gt;Ở bài 10_03, hàm $\tfrac{xy}{x^2+y^2}$ có cả hai đạo hàm riêng tại gốc mà vẫn gián đoạn. Đạo hàm riêng chỉ nhìn theo hai hướng trục, nên không đủ để nói mặt “trơn” tại điểm đó. Khái niệm đúng là &lt;strong&gt;khả vi&lt;/strong&gt;: mặt được xấp xỉ tốt bởi mặt phẳng tiếp xúc theo &lt;strong&gt;mọi&lt;/strong&gt; hướng. Đây là điều kiện cần cho quy tắc dây chuyền và gradient ở chương 11.&lt;/p&gt;

&lt;h2 id=&quot;định-nghĩa&quot;&gt;Định nghĩa&lt;/h2&gt;

&lt;div class=&quot;textbook-definition&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Định nghĩa.&lt;/strong&gt; $f$ &lt;strong&gt;khả vi&lt;/strong&gt; tại $(a,b)$ nếu có các số $A$, $B$ sao cho&lt;/p&gt;

\[f(a+h,b+k)=f(a,b)+Ah+Bk+\varepsilon(h,k)\sqrt{h^2+k^2},\qquad\varepsilon(h,k)\to0\text{ khi }(h,k)\to(0,0).\]

  &lt;p&gt;Biểu thức tuyến tính $df=A\,dx+B\,dy$ (với $dx=h$, $dy=k$) gọi là &lt;strong&gt;vi phân toàn phần&lt;/strong&gt;.&lt;/p&gt;
&lt;/div&gt;

&lt;p&gt;Nói cách khác, sai số của xấp xỉ tuyến tính nhỏ hơn hẳn khoảng cách $\sqrt{h^2+k^2}$, giống $f(a+h)=f(a)+f&apos;(a)h+o(h)$ của hàm một biến (bài 02_04).&lt;/p&gt;

&lt;div class=&quot;textbook-theorem&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Định lý 1.&lt;/strong&gt; Nếu $f$ khả vi tại $(a,b)$ thì $f$ liên tục tại đó, các đạo hàm riêng tồn tại, và $A=f_x(a,b)$, $B=f_y(a,b)$.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-proof&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Chứng minh.&lt;/strong&gt; Cho $(h,k)\to(0,0)$ trong định nghĩa: vế phải dần về $f(a,b)$, nên $f$ liên tục. Lấy $k=0$: $\tfrac{f(a+h,b)-f(a,b)}h=A+\varepsilon(h,0)\tfrac{\vert h\vert }h\to A$, nên $f_x(a,b)=A$. Tương tự $f_y(a,b)=B$.&lt;/p&gt;
&lt;/div&gt;

&lt;p&gt;Hệ quả: hàm $\tfrac{xy}{x^2+y^2}$ ($f(0,0)=0$) không khả vi tại gốc vì nó không liên tục ở đó.&lt;/p&gt;

&lt;div class=&quot;textbook-theorem&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Định lý 2 (Điều kiện đủ).&lt;/strong&gt; Nếu $f_x$, $f_y$ tồn tại gần $(a,b)$ và liên tục tại $(a,b)$, thì $f$ khả vi tại $(a,b)$.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-proof&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Chứng minh.&lt;/strong&gt; Viết hiệu thành hai bước, mỗi bước chỉ đổi một biến:&lt;/p&gt;

\[f(a+h,b+k)-f(a,b)=\big[f(a+h,b+k)-f(a,b+k)\big]+\big[f(a,b+k)-f(a,b)\big].\]

  &lt;p&gt;Theo định lý Lagrange cho từng hàm một biến, có $\theta_1,\theta_2\in(0,1)$ với vế phải bằng $f_x(a+\theta_1h,b+k)\,h+f_y(a,b+\theta_2k)\,k$. Do đó sai số so với $f_xh+f_yk$ (tính tại $(a,b)$) là&lt;/p&gt;

\[\big[f_x(a+\theta_1h,b+k)-f_x(a,b)\big]h+\big[f_y(a,b+\theta_2k)-f_y(a,b)\big]k .\]

  &lt;p&gt;Chia cho $\sqrt{h^2+k^2}$, dùng $\vert h\vert ,\vert k\vert \le\sqrt{h^2+k^2}$, và tính liên tục của $f_x$, $f_y$ tại $(a,b)$: thương dần về 0.&lt;/p&gt;
&lt;/div&gt;

&lt;p&gt;Vì vậy mọi hàm sơ cấp (đa thức, $e^{xy}$, $\sin(x+y^2)$, …) khả vi tại mọi điểm trong miền mà các đạo hàm riêng của nó liên tục.&lt;/p&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Ví dụ 1 (Có đạo hàm riêng, liên tục, vẫn không khả vi).&lt;/strong&gt; $f(x,y)=\sqrt{\vert xy\vert }$. Trên hai trục $f=0$, nên $f_x(0,0)=f_y(0,0)=0$; $f$ liên tục. Nếu khả vi, xấp xỉ tuyến tính tại gốc phải là $0$. Nhưng dọc $y=x$: $f=\vert x\vert $, còn khoảng cách đến gốc là $\sqrt2\vert x\vert $, tỉ số $\tfrac1{\sqrt2}$ không dần về 0. Vậy $f$ không khả vi tại gốc: đồ thị có “nếp gấp” dọc các đường chéo.&lt;/p&gt;
&lt;/div&gt;

&lt;h2 id=&quot;xấp-xỉ-tuyến-tính&quot;&gt;Xấp xỉ tuyến tính&lt;/h2&gt;

\[f(a+\Delta x,b+\Delta y)\approx f(a,b)+f_x(a,b)\,\Delta x+f_y(a,b)\,\Delta y .\]

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Ví dụ 2.&lt;/strong&gt; $\sqrt{3.02^2+3.97^2}$. Với $f=\sqrt{x^2+y^2}$ tại $(3,4)$: $f=5$, $f_x=\tfrac35$, $f_y=\tfrac45$. Xấp xỉ $5+\tfrac35(0.02)+\tfrac45(-0.03)=4.988$; giá trị thật $4.98812$.&lt;/p&gt;
&lt;/div&gt;

&lt;h2 id=&quot;lan-truyền-sai-số&quot;&gt;Lan truyền sai số&lt;/h2&gt;

&lt;p&gt;Nếu $x$, $y$ đo với sai số $\vert \Delta x\vert $, $\vert \Delta y\vert $, sai số của $f$ khoảng $\vert f_x\vert \vert \Delta x\vert +\vert f_y\vert \vert \Delta y\vert $. Với dạng tích lũy thừa $f=Cx^my^n$, lấy logarit rồi vi phân: $\dfrac{df}f=m\dfrac{dx}x+n\dfrac{dy}y$, nên &lt;strong&gt;sai số tương đối cộng lại, nhân với số mũ&lt;/strong&gt;.&lt;/p&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Ví dụ 3.&lt;/strong&gt; Thể tích hình trụ $V=\pi r^2h$ với $r$ sai $1\%$, $h$ sai $1\%$: $\left\lvert\tfrac{dV}V\right\rvert\le2(1\%)+1\%=3\%$. Bán kính “đáng” đo kỹ gấp đôi chiều cao.&lt;/p&gt;
&lt;/div&gt;

&lt;h2 id=&quot;ứng-dụng&quot;&gt;Ứng dụng&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Vật lý: đo gia tốc trọng trường bằng con lắc.&lt;/strong&gt; $g=\dfrac{4\pi^2L}{T^2}$. Đo $L=1.000$ m (sai $0.5\%$) và $T=2.007$ s (sai $0.5\%$) cho $g\approx9.80$ m/s². Sai số tương đối $\tfrac{dL}L+2\tfrac{dT}T\le0.5\%+1\%=1.5\%$, tức khoảng $\pm0.15$ m/s². Muốn chính xác hơn, ưu tiên đo chu kỳ (ví dụ đo thời gian 20 dao động rồi chia).&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Học máy: vì sao gradient descent giảm mất mát.&lt;/strong&gt; Theo định nghĩa khả vi, với bước nhỏ $\Delta w$: $L(w+\Delta w)\approx L(w)+L_{w_1}\Delta w_1+L_{w_2}\Delta w_2$. Chọn $\Delta w_i=-\eta L_{w_i}$ được $\Delta L\approx-\eta\left(L_{w_1}^2+L_{w_2}^2\right)\le0$. Khả vi là điều cho phép lập luận này; với hàm có “nếp gấp” như ví dụ 1 (hay ReLU tại 0), các thư viện dùng đạo hàm một phía hoặc dưới vi phân.&lt;/p&gt;

&lt;h2 id=&quot;bài-tập&quot;&gt;Bài tập&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Cơ bản.&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;Tìm vi phân toàn phần của $f=x^2y^3$ và $f=e^x\cos y$.&lt;/li&gt;
  &lt;li&gt;Dùng xấp xỉ tuyến tính tính gần đúng $1.98^2\cdot1.01^3$.&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Đáp án&lt;/summary&gt;

  &lt;ol&gt;
    &lt;li&gt;$2xy^3dx+3x^2y^2dy$; $e^x\cos y\,dx-e^x\sin y\,dy$.&lt;/li&gt;
    &lt;li&gt;Tại $(2,1)$: $f=4$, $df=4(-0.02)+12(0.01)=0.04$, nên $\approx4.04$; giá trị thật $4.0392$.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;p&gt;&lt;strong&gt;Trung bình.&lt;/strong&gt;&lt;/p&gt;

&lt;ol start=&quot;3&quot;&gt;
  &lt;li&gt;Hình chữ nhật có các cạnh đo được $30$ cm và $40$ cm, mỗi cạnh sai tối đa $0.1$ cm. Ước lượng sai số của diện tích và của đường chéo.&lt;/li&gt;
  &lt;li&gt;Chứng minh trực tiếp từ định nghĩa rằng $f=x^2+y^2$ khả vi tại mọi điểm.&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Đáp án&lt;/summary&gt;

  &lt;ol start=&quot;3&quot;&gt;
    &lt;li&gt;$dA=40(0.1)+30(0.1)=7$ cm². Đường chéo $d=50$: $dd=\tfrac{30(0.1)+40(0.1)}{50}=0.14$ cm.&lt;/li&gt;
    &lt;li&gt;$f(a+h,b+k)-f(a,b)-2ah-2bk=h^2+k^2$, và $\tfrac{h^2+k^2}{\sqrt{h^2+k^2}}=\sqrt{h^2+k^2}\to0$.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;p&gt;&lt;strong&gt;Nâng cao.&lt;/strong&gt;&lt;/p&gt;

&lt;ol start=&quot;5&quot;&gt;
  &lt;li&gt;Cho $f(x,y)=\dfrac{x^2y}{x^2+y^2}$, $f(0,0)=0$. Chứng minh $f$ liên tục, có đạo hàm riêng tại gốc, nhưng không khả vi tại gốc.&lt;/li&gt;
  &lt;li&gt;Điện trở tương đương của hai điện trở song song là $R=\dfrac{R_1R_2}{R_1+R_2}$. Với $R_1=100\ \Omega$, $R_2=400\ \Omega$, mỗi cái sai $1\%$, ước lượng sai số của $R$.&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Gợi ý&lt;/summary&gt;

  &lt;ol start=&quot;5&quot;&gt;
    &lt;li&gt;Liên tục: $\vert f\vert \le\vert y\vert $. $f_x(0,0)=f_y(0,0)=0$ (trên hai trục $f=0$). Dọc $y=x$: $f=\tfrac x2$, nhưng xấp xỉ tuyến tính là 0, tỉ số với $\sqrt2\vert x\vert $ là $\tfrac1{2\sqrt2}\not\to0$.&lt;/li&gt;
    &lt;li&gt;$R=80$. $R_{R_1}=\tfrac{R_2^2}{(R_1+R_2)^2}=0.64$, $R_{R_2}=\tfrac{R_1^2}{(R_1+R_2)^2}=0.04$. $dR\le0.64(1)+0.04(4)=0.8\ \Omega$, tức $1\%$.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;h2 id=&quot;tóm-tắt&quot;&gt;Tóm tắt&lt;/h2&gt;

&lt;div class=&quot;content-box summary-box textbook-block&quot;&gt;
  &lt;ul&gt;
    &lt;li&gt;Khả vi: $f(a+h,b+k)=f(a,b)+f_xh+f_yk+o\left(\sqrt{h^2+k^2}\right)$.&lt;/li&gt;
    &lt;li&gt;Khả vi kéo theo liên tục và có đạo hàm riêng; điều ngược lại sai (ví dụ $\sqrt{\vert xy\vert }$).&lt;/li&gt;
    &lt;li&gt;Đạo hàm riêng liên tục thì khả vi; mọi hàm sơ cấp khả vi ở nơi đạo hàm riêng liên tục.&lt;/li&gt;
    &lt;li&gt;$df=f_xdx+f_ydy$; với $f=Cx^my^n$, sai số tương đối là $m\tfrac{dx}x+n\tfrac{dy}y$.&lt;/li&gt;
  &lt;/ul&gt;
&lt;/div&gt;
</content>
 </entry>
 
 <entry>
   <title>Đạo hàm riêng và mặt phẳng tiếp xúc</title>
   <link href="https://calculus-self-learning.pages.dev/contents/vi/chapter10/10_03_Dao_ham_rieng_va_mat_phang_tiep_xuc/"/>
   <updated>2026-12-01T00:00:00+00:00</updated>
   <id>https://calculus-self-learning.pages.dev/contents/vi/chapter10/10_03_Dao_ham_rieng_va_mat_phang_tiep_xuc</id>
   <content type="html">&lt;div class=&quot;textbook-objectives&quot;&gt;

  &lt;p&gt;&lt;strong&gt;Mục tiêu.&lt;/strong&gt; Sau bài này bạn có thể:&lt;/p&gt;

  &lt;ul&gt;
    &lt;li&gt;định nghĩa và tính đạo hàm riêng $f_x$, $f_y$;&lt;/li&gt;
    &lt;li&gt;giải thích đạo hàm riêng là độ dốc của lát cắt;&lt;/li&gt;
    &lt;li&gt;viết phương trình mặt phẳng tiếp xúc với đồ thị $z=f(x,y)$;&lt;/li&gt;
    &lt;li&gt;dùng đạo hàm riêng trong kinh tế, vật lý và học máy.&lt;/li&gt;
  &lt;/ul&gt;

&lt;/div&gt;

&lt;h2 id=&quot;vì-sao-cần-bài-này&quot;&gt;Vì sao cần bài này&lt;/h2&gt;

&lt;p&gt;Muốn biết nhiệt độ thay đổi thế nào khi đi về phía đông, ta giữ nguyên vĩ độ và chỉ thay đổi kinh độ. Đạo hàm riêng làm đúng điều đó: cố định mọi biến trừ một, rồi lấy đạo hàm như hàm một biến. Đây là công cụ cơ bản nhất của giải tích nhiều biến, và là nền của gradient descent.&lt;/p&gt;

&lt;h2 id=&quot;định-nghĩa&quot;&gt;Định nghĩa&lt;/h2&gt;

&lt;div class=&quot;textbook-definition&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Định nghĩa.&lt;/strong&gt; Đạo hàm riêng của $f$ theo $x$ và theo $y$ tại $(a,b)$ là&lt;/p&gt;

\[f_x(a,b)=\frac{\partial f}{\partial x}(a,b)=\lim_{h\to0}\frac{f(a+h,b)-f(a,b)}h,\qquad f_y(a,b)=\lim_{h\to0}\frac{f(a,b+h)-f(a,b)}h,\]

  &lt;p&gt;nếu các giới hạn tồn tại.&lt;/p&gt;
&lt;/div&gt;

&lt;p&gt;&lt;strong&gt;Cách tính:&lt;/strong&gt; coi các biến còn lại là hằng số và dùng mọi quy tắc đạo hàm một biến.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Ý nghĩa hình học:&lt;/strong&gt; cắt đồ thị bằng mặt phẳng $y=b$ được đường cong $z=f(x,b)$; $f_x(a,b)$ là độ dốc của đường cong này tại $x=a$. Tương tự $f_y$ là độ dốc của lát cắt $x=a$.&lt;/p&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Ví dụ 1.&lt;/strong&gt; $f(x,y)=x^2+3xy-y^2$: $f_x=2x+3y$, $f_y=3x-2y$. Tại $(1,2)$: $f=3$, $f_x=8$, $f_y=-1$. Đi về hướng $x$ hàm tăng nhanh (độ dốc 8), đi về hướng $y$ hàm giảm chậm.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Ví dụ 2.&lt;/strong&gt; $f(x,y)=e^x\sin y$: $f_x=e^x\sin y$, $f_y=e^x\cos y$. $g(x,y)=x^y$ ($x&amp;gt;0$): $g_x=yx^{y-1}$ (lũy thừa với số mũ cố định), $g_y=x^y\ln x$ (hàm mũ với cơ số cố định).&lt;/p&gt;
&lt;/div&gt;

&lt;h2 id=&quot;mặt-phẳng-tiếp-xúc&quot;&gt;Mặt phẳng tiếp xúc&lt;/h2&gt;

&lt;div class=&quot;textbook-theorem&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Định lý 1.&lt;/strong&gt; Nếu $f_x$, $f_y$ tồn tại tại $(a,b)$, mặt phẳng duy nhất chứa hai tiếp tuyến của hai lát cắt $y=b$ và $x=a$ tại điểm $(a,b,f(a,b))$ là&lt;/p&gt;

\[z=f(a,b)+f_x(a,b)(x-a)+f_y(a,b)(y-b),\]

  &lt;p&gt;có vectơ pháp tuyến $(f_x(a,b),f_y(a,b),-1)$.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-proof&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Chứng minh.&lt;/strong&gt; Lát cắt $y=b$ là đường cong $t\mapsto(t,b,f(t,b))$, có vectơ tiếp tuyến tại $t=a$ là $\mathbf u=(1,0,f_x)$. Tương tự lát cắt $x=a$ có tiếp tuyến $\mathbf v=(0,1,f_y)$. Hai vectơ không cùng phương, nên mặt phẳng chứa chúng có pháp tuyến $\mathbf u\times\mathbf v=(-f_x,-f_y,1)$ (bài 09_01), cùng phương với $(f_x,f_y,-1)$. Mặt phẳng qua $(a,b,f(a,b))$ với pháp tuyến này là $f_x(x-a)+f_y(y-b)-(z-f(a,b))=0$.&lt;/p&gt;
&lt;/div&gt;

&lt;p&gt;Khi $f$ khả vi (bài 10_04), mặt phẳng này thật sự là xấp xỉ tốt nhất của mặt gần điểm tiếp xúc.&lt;/p&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Ví dụ 3.&lt;/strong&gt; Với ví dụ 1 tại $(1,2)$: $z=3+8(x-1)-(y-2)$.&lt;/p&gt;

  &lt;p&gt;Với $f=e^x\sin y$ tại $\left(0,\tfrac\pi2\right)$: $f=1$, $f_x=1$, $f_y=0$, nên $z=1+x$. Xấp xỉ $f\left(0.1,\tfrac\pi2+0.1\right)\approx1.1$; giá trị thật $1.0996$.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;interactive-frame&quot;&gt;
  &lt;div class=&quot;interactive-frame-head&quot;&gt;
    &lt;div class=&quot;interactive-frame-title&quot;&gt;Mặt phẳng tiếp xúc&lt;/div&gt;
    &lt;div class=&quot;interactive-frame-desc&quot;&gt;Kéo (x₀, y₀); hai lát cắt cho f_x và f_y.&lt;/div&gt;
  &lt;/div&gt;
  &lt;iframe src=&quot;/interactives/chapter10/tangent-plane.html&quot; title=&quot;Mặt phẳng tiếp xúc&quot; loading=&quot;lazy&quot; style=&quot;height: 720px;&quot;&gt;&lt;/iframe&gt;
  &lt;div class=&quot;interactive-frame-foot&quot;&gt;
    &lt;a href=&quot;/interactives/chapter10/tangent-plane.html&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;Mở minh hoạ ở cửa sổ riêng&lt;/a&gt;
  &lt;/div&gt;
&lt;/div&gt;

&lt;h2 id=&quot;video-ngắn&quot;&gt;Video ngắn&lt;/h2&gt;

&lt;div class=&quot;reel-video&quot;&gt;
  &lt;video controls=&quot;&quot; playsinline=&quot;&quot; preload=&quot;metadata&quot; src=&quot;/public/videos/reels/partial-derivatives-slices.mp4&quot;&gt;&lt;/video&gt;
  &lt;p class=&quot;reel-caption&quot;&gt;Đạo hàm riêng là độ dốc của hai lát cắt: cố định y thì được fₓ, cố định x thì được fᵧ; hai tiếp tuyến dựng nên mặt phẳng tiếp xúc, cát tuyến quay về tiếp tuyến, xấp xỉ tuyến tính, ví dụ eˣ sin y và độ dốc theo mọi hướng (video không lời, khoảng 3 phút 12 giây).&lt;/p&gt;
&lt;/div&gt;

&lt;h2 id=&quot;ứng-dụng&quot;&gt;Ứng dụng&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Kinh tế: sản phẩm cận biên.&lt;/strong&gt; Với $Q=K^{0.3}L^{0.7}$: $Q_L=0.7\tfrac QL$ là sản phẩm cận biên của lao động, $Q_K=0.3\tfrac QK$ của vốn. Tại $K=8$, $L=27$ ($Q\approx18.74$): $Q_L\approx0.486$, $Q_K\approx0.703$. Thêm một đơn vị vốn làm tăng sản lượng nhiều hơn thêm một đơn vị lao động; doanh nghiệp so sánh các con số này với giá vốn và lương.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Vật lý: phương trình nhiệt.&lt;/strong&gt; Nhiệt độ $u(x,t)$ trên thanh kim loại thoả phương trình đạo hàm riêng $u_t=k\,u_{xx}$. Hàm $u=e^{-kt}\sin x$ là một nghiệm: $u_t=-ke^{-kt}\sin x$ và $u_{xx}=-e^{-kt}\sin x$. Biên độ giảm theo hàm mũ khi nhiệt lan ra.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Học máy: gradient của hàm mất mát.&lt;/strong&gt; Với một điểm dữ liệu $(x,y)$ và mô hình $\hat y=wx+b$, mất mát $L=(wx+b-y)^2$ có $L_w=2(wx+b-y)x$, $L_b=2(wx+b-y)$. Gradient descent cập nhật $w\leftarrow w-\eta L_w$, $b\leftarrow b-\eta L_b$: mỗi tham số đi ngược độ dốc của lát cắt theo chính nó.&lt;/p&gt;

&lt;h2 id=&quot;bài-tập&quot;&gt;Bài tập&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Cơ bản.&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;Tính $f_x$, $f_y$ của $f=x^3y^2-4xy$ và $f=\ln(x^2+y^2)$.&lt;/li&gt;
  &lt;li&gt;Tính $f_x$, $f_y$ của $f=\sin(xy)$ và $f=\dfrac x{x+y}$.&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Đáp án&lt;/summary&gt;

  &lt;ol&gt;
    &lt;li&gt;$3x^2y^2-4y$, $2x^3y-4x$; $\tfrac{2x}{x^2+y^2}$, $\tfrac{2y}{x^2+y^2}$.&lt;/li&gt;
    &lt;li&gt;$y\cos(xy)$, $x\cos(xy)$; $\tfrac{y}{(x+y)^2}$, $-\tfrac{x}{(x+y)^2}$.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;p&gt;&lt;strong&gt;Trung bình.&lt;/strong&gt;&lt;/p&gt;

&lt;ol start=&quot;3&quot;&gt;
  &lt;li&gt;Viết mặt phẳng tiếp xúc của $z=\sqrt{x^2+y^2}$ tại $(3,4)$.&lt;/li&gt;
  &lt;li&gt;Viết mặt phẳng tiếp xúc của $z=x^2+y^2$ tại $(1,1)$ và tìm giao điểm của nó với trục $Oz$.&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Đáp án&lt;/summary&gt;

  &lt;ol start=&quot;3&quot;&gt;
    &lt;li&gt;$f_x=\tfrac35$, $f_y=\tfrac45$: $z=5+\tfrac35(x-3)+\tfrac45(y-4)$.&lt;/li&gt;
    &lt;li&gt;$z=2+2(x-1)+2(y-1)=2x+2y-2$; cắt $Oz$ tại $(0,0,-2)$.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;p&gt;&lt;strong&gt;Nâng cao.&lt;/strong&gt;&lt;/p&gt;

&lt;ol start=&quot;5&quot;&gt;
  &lt;li&gt;Chứng minh $u=\sin(x-ct)$ thoả phương trình sóng $u_{tt}=c^2u_{xx}$. Tổng quát hơn, chứng minh $u=F(x-ct)$ là nghiệm với mọi $F$ khả vi hai lần.&lt;/li&gt;
  &lt;li&gt;Cho $f(x,y)=\dfrac{xy}{x^2+y^2}$, $f(0,0)=0$. Chứng minh $f_x(0,0)=f_y(0,0)=0$, dù $f$ không liên tục tại gốc (bài 10_02).&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Gợi ý&lt;/summary&gt;

  &lt;ol start=&quot;5&quot;&gt;
    &lt;li&gt;Quy tắc dây chuyền: $u_t=-cF&apos;(x-ct)$, $u_{tt}=c^2F&apos;&apos;$, $u_{xx}=F&apos;&apos;$.&lt;/li&gt;
    &lt;li&gt;$f(h,0)=0$ với mọi $h$, nên $\tfrac{f(h,0)-f(0,0)}h=0$. Đạo hàm riêng chỉ nhìn dọc hai trục, không thấy hành vi theo các hướng khác.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;h2 id=&quot;tóm-tắt&quot;&gt;Tóm tắt&lt;/h2&gt;

&lt;div class=&quot;content-box summary-box textbook-block&quot;&gt;
  &lt;ul&gt;
    &lt;li&gt;$f_x$: đạo hàm theo $x$ khi coi $y$ là hằng số; là độ dốc của lát cắt $y=b$.&lt;/li&gt;
    &lt;li&gt;Mặt phẳng tiếp xúc: $z=f(a,b)+f_x(a,b)(x-a)+f_y(a,b)(y-b)$, pháp tuyến $(f_x,f_y,-1)$.&lt;/li&gt;
    &lt;li&gt;Có đạo hàm riêng chưa kéo theo liên tục.&lt;/li&gt;
    &lt;li&gt;Ứng dụng: sản phẩm cận biên, phương trình nhiệt và sóng, gradient của hàm mất mát.&lt;/li&gt;
  &lt;/ul&gt;
&lt;/div&gt;
</content>
 </entry>
 
 <entry>
   <title>Giới hạn và liên tục của hàm nhiều biến</title>
   <link href="https://calculus-self-learning.pages.dev/contents/vi/chapter10/10_02_Gioi_han_va_lien_tuc_cua_ham_nhieu_bien/"/>
   <updated>2026-12-01T00:00:00+00:00</updated>
   <id>https://calculus-self-learning.pages.dev/contents/vi/chapter10/10_02_Gioi_han_va_lien_tuc_cua_ham_nhieu_bien</id>
   <content type="html">&lt;div class=&quot;textbook-objectives&quot;&gt;

  &lt;p&gt;&lt;strong&gt;Mục tiêu.&lt;/strong&gt; Sau bài này bạn có thể:&lt;/p&gt;

  &lt;ul&gt;
    &lt;li&gt;phát biểu định nghĩa giới hạn của hàm hai biến;&lt;/li&gt;
    &lt;li&gt;chứng minh một giới hạn không tồn tại bằng cách tiến theo hai đường khác nhau;&lt;/li&gt;
    &lt;li&gt;chứng minh một giới hạn tồn tại bằng toạ độ cực và nguyên lý kẹp;&lt;/li&gt;
    &lt;li&gt;nhận ra các hàm liên tục và tính giới hạn bằng cách thay giá trị.&lt;/li&gt;
  &lt;/ul&gt;

&lt;/div&gt;

&lt;h2 id=&quot;vì-sao-cần-bài-này&quot;&gt;Vì sao cần bài này&lt;/h2&gt;

&lt;p&gt;Với hàm một biến, $x$ chỉ tiến đến $a$ từ hai phía. Trong mặt phẳng, $(x,y)$ có thể tiến đến $(a,b)$ theo vô số đường: thẳng, cong, xoắn ốc. Giới hạn chỉ tồn tại khi &lt;strong&gt;mọi&lt;/strong&gt; đường cho cùng kết quả. Hiểu điều này là bước chuẩn bị cho khái niệm khả vi ở bài 10_04, nơi có những hàm có đạo hàm riêng nhưng thậm chí không liên tục.&lt;/p&gt;

&lt;h2 id=&quot;định-nghĩa&quot;&gt;Định nghĩa&lt;/h2&gt;

&lt;div class=&quot;textbook-definition&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Định nghĩa.&lt;/strong&gt; Ta nói $\displaystyle\lim_{(x,y)\to(a,b)}f(x,y)=L$ nếu với mọi $\varepsilon&amp;gt;0$ có $\delta&amp;gt;0$ sao cho&lt;/p&gt;

\[0&amp;lt;\sqrt{(x-a)^2+(y-b)^2}&amp;lt;\delta\ \Rightarrow\ |f(x,y)-L|&amp;lt;\varepsilon\]

  &lt;p&gt;(với $(x,y)$ thuộc miền xác định). $f$ &lt;strong&gt;liên tục&lt;/strong&gt; tại $(a,b)$ nếu $\lim_{(x,y)\to(a,b)}f(x,y)=f(a,b)$.&lt;/p&gt;
&lt;/div&gt;

&lt;p&gt;Định nghĩa giống hệt một biến, chỉ thay $\vert x-a\vert $ bằng khoảng cách trong mặt phẳng. Các quy tắc tổng, tích, thương (mẫu khác 0) và hợp vẫn đúng với cùng chứng minh. Do đó &lt;strong&gt;đa thức liên tục khắp nơi, phân thức liên tục ở nơi mẫu khác 0&lt;/strong&gt;, và hợp của hàm liên tục là liên tục: $e^{xy}$, $\sin(x^2+y)$, $\ln(1+x^2+y^2)$ liên tục trên $\mathbb R^2$.&lt;/p&gt;

&lt;h2 id=&quot;hai-đường-cho-hai-giới-hạn-khác-nhau&quot;&gt;Hai đường cho hai giới hạn khác nhau&lt;/h2&gt;

&lt;div class=&quot;textbook-theorem&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Định lý 1.&lt;/strong&gt; Nếu $f(x,y)\to L_1$ khi $(x,y)\to(a,b)$ dọc theo một đường cong $C_1$ và $f(x,y)\to L_2$ dọc theo $C_2$ với $L_1\ne L_2$, thì $\lim_{(x,y)\to(a,b)}f(x,y)$ không tồn tại.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-proof&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Chứng minh.&lt;/strong&gt; Giả sử giới hạn bằng $L$. Lấy $\varepsilon=\tfrac{\vert L_1-L_2\vert }3&amp;gt;0$ và $\delta$ tương ứng. Các điểm của $C_1$ và $C_2$ đủ gần $(a,b)$ nằm trong hình tròn bán kính $\delta$, nên giá trị của $f$ tại đó cách $L$ ít hơn $\varepsilon$. Cho tiến đến $(a,b)$ dọc mỗi đường: $\vert L_1-L\vert \le\varepsilon$ và $\vert L_2-L\vert \le\varepsilon$. Do đó $\vert L_1-L_2\vert \le2\varepsilon=\tfrac23\vert L_1-L_2\vert $, mâu thuẫn.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Ví dụ 1.&lt;/strong&gt; $f(x,y)=\dfrac{xy}{x^2+y^2}$ tại gốc. Dọc đường $y=mx$: $f=\dfrac{mx^2}{(1+m^2)x^2}=\dfrac m{1+m^2}$. Với $m=0$ giới hạn là 0, với $m=1$ là $\tfrac12$. Vậy giới hạn không tồn tại.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Ví dụ 2 (Mọi đường thẳng chưa đủ).&lt;/strong&gt; $f(x,y)=\dfrac{x^2y}{x^4+y^2}$. Dọc $y=mx$: $f=\dfrac{mx^3}{x^4+m^2x^2}=\dfrac{mx}{x^2+m^2}\to0$; dọc trục $x=0$ cũng bằng 0. Nhưng dọc parabol $y=x^2$: $f=\dfrac{x^4}{2x^4}=\tfrac12$. Giới hạn không tồn tại, dù mọi đường thẳng cho 0.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;interactive-frame&quot;&gt;
  &lt;div class=&quot;interactive-frame-head&quot;&gt;
    &lt;div class=&quot;interactive-frame-title&quot;&gt;Tiến về gốc theo nhiều đường&lt;/div&gt;
    &lt;div class=&quot;interactive-frame-desc&quot;&gt;So sánh giới hạn dọc đường thẳng, parabol và xoắn ốc.&lt;/div&gt;
  &lt;/div&gt;
  &lt;iframe src=&quot;/interactives/chapter10/limit-two-paths.html&quot; title=&quot;Tiến về gốc theo nhiều đường&quot; loading=&quot;lazy&quot; style=&quot;height: 720px;&quot;&gt;&lt;/iframe&gt;
  &lt;div class=&quot;interactive-frame-foot&quot;&gt;
    &lt;a href=&quot;/interactives/chapter10/limit-two-paths.html&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;Mở minh hoạ ở cửa sổ riêng&lt;/a&gt;
  &lt;/div&gt;
&lt;/div&gt;

&lt;h2 id=&quot;chứng-minh-giới-hạn-tồn-tại-toạ-độ-cực&quot;&gt;Chứng minh giới hạn tồn tại: toạ độ cực&lt;/h2&gt;

&lt;p&gt;Đặt $x=a+r\cos\theta$, $y=b+r\sin\theta$. Nếu $\vert f(x,y)-L\vert \le g(r)$ với $g(r)\to0$ &lt;strong&gt;không phụ thuộc $\theta$&lt;/strong&gt;, thì $f\to L$ (nguyên lý kẹp).&lt;/p&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Ví dụ 3.&lt;/strong&gt; $\displaystyle\lim_{(x,y)\to(0,0)}\frac{x^2y}{x^2+y^2}$. Trong toạ độ cực: $\dfrac{r^3\cos^2\theta\sin\theta}{r^2}=r\cos^2\theta\sin\theta$, có trị tuyệt đối $\le r\to0$. Giới hạn bằng 0.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Ví dụ 4.&lt;/strong&gt; $\displaystyle\lim_{(x,y)\to(0,0)}\frac{\sin(x^2+y^2)}{x^2+y^2}=\lim_{t\to0^+}\frac{\sin t}t=1$ với $t=x^2+y^2$: hàm chỉ phụ thuộc $r$, nên quy về giới hạn một biến.&lt;/p&gt;
&lt;/div&gt;

&lt;p&gt;Cảnh báo: với ví dụ 2, toạ độ cực cho $\dfrac{r\cos^2\theta\sin\theta}{r^2\cos^4\theta+\sin^2\theta}$; khi $\theta$ thay đổi theo $r$ (dọc parabol), biểu thức không dần về 0. Ước lượng phải đều theo $\theta$.&lt;/p&gt;

&lt;h2 id=&quot;ứng-dụng&quot;&gt;Ứng dụng&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Vật lý: thế năng của điện tích điểm.&lt;/strong&gt; Thế $V=\dfrac{kq}{\sqrt{x^2+y^2+z^2}}$ liên tục ở mọi nơi trừ gốc, nơi nó tiến ra vô cùng theo mọi hướng. Ngược lại, hàm $\tfrac{xy}{x^2+y^2}$ ở ví dụ 1 bị chặn nhưng vẫn không có giới hạn: giá trị phụ thuộc hướng tiến đến. Đây là kiểu “gián đoạn theo hướng” thường gặp khi chia hai đại lượng cùng dần về 0.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Học máy: hàm mất mát liên tục.&lt;/strong&gt; Các thuật toán tối ưu giả thiết hàm mất mát liên tục theo tham số: thay đổi nhỏ tham số thì mất mát thay đổi nhỏ. Độ chính xác (tỉ lệ đoán đúng) là hàm bậc thang, không liên tục, nên người ta tối ưu cross-entropy, một hàm liên tục (và khả vi) thay thế.&lt;/p&gt;

&lt;h2 id=&quot;bài-tập&quot;&gt;Bài tập&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Cơ bản.&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;Tính $\displaystyle\lim_{(x,y)\to(1,2)}\frac{x^2+y}{x+y^2}$ và $\displaystyle\lim_{(x,y)\to(0,0)}e^{-x^2-y^2}\cos(xy)$.&lt;/li&gt;
  &lt;li&gt;Chứng minh $\displaystyle\lim_{(x,y)\to(0,0)}\frac{x^2-y^2}{x^2+y^2}$ không tồn tại.&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Đáp án&lt;/summary&gt;

  &lt;ol&gt;
    &lt;li&gt;$\tfrac35$; $1$ (các hàm liên tục, thay giá trị).&lt;/li&gt;
    &lt;li&gt;Dọc trục $Ox$: 1; dọc trục $Oy$: $-1$.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;p&gt;&lt;strong&gt;Trung bình.&lt;/strong&gt;&lt;/p&gt;

&lt;ol start=&quot;3&quot;&gt;
  &lt;li&gt;Tính $\displaystyle\lim_{(x,y)\to(0,0)}\frac{x^3+y^3}{x^2+y^2}$.&lt;/li&gt;
  &lt;li&gt;Xét $\displaystyle\lim_{(x,y)\to(0,0)}\frac{xy^2}{x^2+y^4}$.&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Đáp án&lt;/summary&gt;

  &lt;ol start=&quot;3&quot;&gt;
    &lt;li&gt;Toạ độ cực: $r(\cos^3\theta+\sin^3\theta)$, trị tuyệt đối $\le2r\to0$. Giới hạn 0.&lt;/li&gt;
    &lt;li&gt;Dọc đường thẳng: 0. Dọc $x=y^2$: $\tfrac{y^4}{2y^4}=\tfrac12$. Không tồn tại.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;p&gt;&lt;strong&gt;Nâng cao.&lt;/strong&gt;&lt;/p&gt;

&lt;ol start=&quot;5&quot;&gt;
  &lt;li&gt;Với giá trị nào của $p&amp;gt;0$ thì $\displaystyle\lim_{(x,y)\to(0,0)}\frac{\vert x\vert ^p\vert y\vert ^p}{x^2+y^2}$ tồn tại?&lt;/li&gt;
  &lt;li&gt;Cho $f(x,y)=\dfrac{xy}{x^2+y^2}$, $f(0,0)=0$. Chứng minh $f(x,0)$ và $f(0,y)$ là các hàm một biến liên tục tại 0, nhưng $f$ không liên tục tại gốc.&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Gợi ý&lt;/summary&gt;

  &lt;ol start=&quot;5&quot;&gt;
    &lt;li&gt;Toạ độ cực: $r^{2p-2}\vert \cos\theta\sin\theta\vert ^p$. Khi $p&amp;gt;1$ giới hạn là 0. Khi $p\le1$, dọc $y=x$ giá trị là $\tfrac{\vert x\vert ^{2p}}{2x^2}$, bằng $\tfrac12$ khi $p=1$ và ra vô cùng khi $p&amp;lt;1$: không tồn tại.&lt;/li&gt;
    &lt;li&gt;$f(x,0)=0$ và $f(0,y)=0$ với mọi giá trị. Nhưng dọc $y=x$, $f=\tfrac12\ne f(0,0)$.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;h2 id=&quot;tóm-tắt&quot;&gt;Tóm tắt&lt;/h2&gt;

&lt;div class=&quot;content-box summary-box textbook-block&quot;&gt;
  &lt;ul&gt;
    &lt;li&gt;$\lim_{(x,y)\to(a,b)}f=L$: $f$ gần $L$ khi khoảng cách đến $(a,b)$ đủ nhỏ, theo mọi cách tiến đến.&lt;/li&gt;
    &lt;li&gt;Hai đường cho hai giá trị khác nhau thì giới hạn không tồn tại; mọi đường thẳng cho cùng giá trị vẫn chưa đủ.&lt;/li&gt;
    &lt;li&gt;Chứng minh tồn tại: toạ độ cực với ước lượng $\vert f-L\vert \le g(r)\to0$ không phụ thuộc $\theta$.&lt;/li&gt;
    &lt;li&gt;Đa thức, phân thức (mẫu khác 0) và hợp của chúng liên tục.&lt;/li&gt;
  &lt;/ul&gt;
&lt;/div&gt;
</content>
 </entry>
 
 <entry>
   <title>Hàm nhiều biến, đồ thị và đường mức</title>
   <link href="https://calculus-self-learning.pages.dev/contents/vi/chapter10/10_01_Ham_nhieu_bien_do_thi_va_duong_muc/"/>
   <updated>2026-12-01T00:00:00+00:00</updated>
   <id>https://calculus-self-learning.pages.dev/contents/vi/chapter10/10_01_Ham_nhieu_bien_do_thi_va_duong_muc</id>
   <content type="html">&lt;div class=&quot;textbook-objectives&quot;&gt;

  &lt;p&gt;&lt;strong&gt;Mục tiêu.&lt;/strong&gt; Sau bài này bạn có thể:&lt;/p&gt;

  &lt;ul&gt;
    &lt;li&gt;tìm miền xác định của hàm hai, ba biến;&lt;/li&gt;
    &lt;li&gt;liên hệ đồ thị $z=f(x,y)$ với bản đồ đường mức $f(x,y)=c$;&lt;/li&gt;
    &lt;li&gt;vẽ đường mức của các hàm đơn giản và đọc độ dốc từ khoảng cách giữa các đường;&lt;/li&gt;
    &lt;li&gt;nhận ra mặt mức của hàm ba biến.&lt;/li&gt;
  &lt;/ul&gt;

&lt;/div&gt;

&lt;h2 id=&quot;vì-sao-cần-bài-này&quot;&gt;Vì sao cần bài này&lt;/h2&gt;

&lt;p&gt;Hầu hết đại lượng thực tế phụ thuộc nhiều biến: nhiệt độ phụ thuộc vị trí và thời gian, sản lượng phụ thuộc vốn và lao động, hàm mất mát của mạng nơ-ron phụ thuộc hàng triệu tham số. Trước khi lấy đạo hàm, ta cần cách &lt;strong&gt;nhìn&lt;/strong&gt; các hàm này. Bản đồ địa hình với các đường đồng mức là công cụ trực quan tốt nhất.&lt;/p&gt;

&lt;h2 id=&quot;hàm-nhiều-biến&quot;&gt;Hàm nhiều biến&lt;/h2&gt;

&lt;div class=&quot;textbook-definition&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Định nghĩa.&lt;/strong&gt; Một &lt;strong&gt;hàm hai biến&lt;/strong&gt; $f:D\to\mathbb R$ với $D\subset\mathbb R^2$ gán cho mỗi điểm $(x,y)\in D$ một số $f(x,y)$. $D$ là &lt;strong&gt;miền xác định&lt;/strong&gt;. &lt;strong&gt;Đồ thị&lt;/strong&gt; của $f$ là mặt $\lbrace (x,y,z):z=f(x,y)\rbrace $ trong $\mathbb R^3$. &lt;strong&gt;Đường mức&lt;/strong&gt; ứng với giá trị $c$ là tập $\lbrace (x,y):f(x,y)=c\rbrace $ trong mặt phẳng.&lt;/p&gt;
&lt;/div&gt;

&lt;p&gt;Đường mức là hình chiếu xuống mặt phẳng $Oxy$ của giao giữa đồ thị và mặt phẳng ngang $z=c$, đúng phương pháp lát cắt của bài 09_05.&lt;/p&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Ví dụ 1.&lt;/strong&gt; $f(x,y)=\sqrt{9-x^2-y^2}$: miền xác định là hình tròn $x^2+y^2\le9$; đồ thị là nửa trên mặt cầu bán kính 3; đường mức $f=c$ ($0\le c\le3$) là đường tròn bán kính $\sqrt{9-c^2}$. Các đường tròn dày lên gần biên, nơi mặt cầu dốc đứng.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Ví dụ 2.&lt;/strong&gt; $f(x,y)=100-x^2-2y^2$ (một “quả đồi”): đường mức $f=c$ là elip $x^2+2y^2=100-c$, đỉnh ở gốc với độ cao 100. $g(x,y)=x^2-y^2$ (yên ngựa): đường mức là các hyperbol $x^2-y^2=c$, và với $c=0$ là cặp đường thẳng $y=\pm x$ cắt nhau tại điểm yên ngựa.&lt;/p&gt;
&lt;/div&gt;

&lt;h2 id=&quot;đọc-bản-đồ-đường-mức&quot;&gt;Đọc bản đồ đường mức&lt;/h2&gt;

&lt;p&gt;Trên bản đồ vẽ các đường mức cách đều về giá trị ($c,c+h,c+2h,\dots$), các đường càng &lt;strong&gt;dày&lt;/strong&gt; thì hàm càng &lt;strong&gt;dốc&lt;/strong&gt;. Hai đường mức với hai giá trị khác nhau không bao giờ cắt nhau (mỗi điểm chỉ có một giá trị của $f$).&lt;/p&gt;

&lt;div class=&quot;textbook-theorem&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Mệnh đề 1.&lt;/strong&gt; Với hàm tuyến tính $f(x,y)=ax+by$ ($a,b$ không đồng thời bằng 0), các đường mức là các đường thẳng song song, vuông góc với vectơ $(a,b)$, và hai đường mức $f=c$, $f=c+1$ cách nhau $\dfrac1{\sqrt{a^2+b^2}}$.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-proof&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Chứng minh.&lt;/strong&gt; Đường $ax+by=c$ là đường thẳng có pháp tuyến $(a,b)$. Lấy điểm $P$ trên đường $f=c$; theo công thức khoảng cách (bài 09_02, trong mặt phẳng), khoảng cách từ $P$ đến đường $ax+by=c+1$ là $\tfrac{\vert ax_P+by_P-(c+1)\vert }{\sqrt{a^2+b^2}}=\tfrac{1}{\sqrt{a^2+b^2}}$.&lt;/p&gt;
&lt;/div&gt;

&lt;p&gt;Như vậy hàm tăng nhanh nhất theo hướng $(a,b)$, với tốc độ $\sqrt{a^2+b^2}$ mỗi đơn vị độ dài. Chương 11 sẽ thấy với hàm bất kỳ, hướng này là &lt;strong&gt;gradient&lt;/strong&gt;, luôn vuông góc với đường mức.&lt;/p&gt;

&lt;div class=&quot;interactive-frame&quot;&gt;
  &lt;div class=&quot;interactive-frame-head&quot;&gt;
    &lt;div class=&quot;interactive-frame-title&quot;&gt;Đồ thị và đường mức&lt;/div&gt;
    &lt;div class=&quot;interactive-frame-desc&quot;&gt;Mặt z = f(x, y), mặt phẳng z = c và các đường mức tương ứng.&lt;/div&gt;
  &lt;/div&gt;
  &lt;iframe src=&quot;/interactives/chapter10/level-curves.html&quot; title=&quot;Đồ thị và đường mức&quot; loading=&quot;lazy&quot; style=&quot;height: 700px;&quot;&gt;&lt;/iframe&gt;
  &lt;div class=&quot;interactive-frame-foot&quot;&gt;
    &lt;a href=&quot;/interactives/chapter10/level-curves.html&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;Mở minh hoạ ở cửa sổ riêng&lt;/a&gt;
  &lt;/div&gt;
&lt;/div&gt;

&lt;h2 id=&quot;hàm-ba-biến-và-mặt-mức&quot;&gt;Hàm ba biến và mặt mức&lt;/h2&gt;

&lt;p&gt;Với $f(x,y,z)$, đồ thị nằm trong $\mathbb R^4$ nên không vẽ được, nhưng các &lt;strong&gt;mặt mức&lt;/strong&gt; $f(x,y,z)=c$ thì vẽ được. Ví dụ $f=x^2+y^2+z^2$ có mặt mức là các mặt cầu; $f=x^2+y^2-z^2$ có mặt mức là các hyperboloid một tầng ($c&amp;gt;0$), mặt nón ($c=0$), hyperboloid hai tầng ($c&amp;lt;0$).&lt;/p&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Ví dụ 3.&lt;/strong&gt; Nhiệt độ quanh một nguồn nhiệt điểm tại gốc: $T(x,y,z)=\dfrac{100}{1+x^2+y^2+z^2}$. Mặt đẳng nhiệt $T=20$ là mặt cầu $x^2+y^2+z^2=4$, bán kính 2.&lt;/p&gt;
&lt;/div&gt;

&lt;h2 id=&quot;video-ngắn&quot;&gt;Video ngắn&lt;/h2&gt;

&lt;div class=&quot;reel-video&quot;&gt;
  &lt;video controls=&quot;&quot; playsinline=&quot;&quot; preload=&quot;metadata&quot; src=&quot;/public/videos/reels/surface-and-level-curves.mp4&quot;&gt;&lt;/video&gt;
  &lt;p class=&quot;reel-caption&quot;&gt;Mặt z = f(x, y) bị mặt phẳng ngang cắt, đường mức in xuống bản đồ; camera nâng lên nhìn từ trên xuống, rồi yên ngựa (video không lời, khoảng 2 phút).&lt;/p&gt;
&lt;/div&gt;

&lt;h2 id=&quot;ứng-dụng&quot;&gt;Ứng dụng&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Kinh tế: hàm sản xuất Cobb–Douglas.&lt;/strong&gt; Sản lượng $Q(K,L)=AK^\alpha L^{1-\alpha}$ với vốn $K$, lao động $L$, $0&amp;lt;\alpha&amp;lt;1$. Các đường mức $Q=c$ gọi là &lt;strong&gt;đường đồng lượng&lt;/strong&gt;: mọi tổ hợp vốn và lao động cho cùng sản lượng. Với $A=1$, $\alpha=0.3$: $Q(8,27)\approx18.74$, và $Q(16,54)\approx37.49$, gấp đôi: nhân đôi cả hai đầu vào thì sản lượng gấp đôi (lợi suất không đổi theo quy mô), vì $Q(tK,tL)=t^\alpha t^{1-\alpha}Q=tQ$.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Học máy: bề mặt hàm mất mát.&lt;/strong&gt; Với hồi quy tuyến tính hai tham số, hàm mất mát bình phương $L(w,b)=\tfrac1n\sum(wx_i+b-y_i)^2$ là đa thức bậc hai theo $(w,b)$; đường mức là các elip đồng tâm quanh nghiệm tối ưu. Elip càng dẹt, gradient descent càng đi zíc zắc. Vẽ đường mức là cách nhanh nhất để hiểu vì sao cần chuẩn hoá dữ liệu.&lt;/p&gt;

&lt;h2 id=&quot;bài-tập&quot;&gt;Bài tập&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Cơ bản.&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;Tìm miền xác định của $f(x,y)=\ln(x-y)$ và $g(x,y)=\dfrac1{\sqrt{1-x^2-y^2}}$.&lt;/li&gt;
  &lt;li&gt;Mô tả đường mức của $f(x,y)=y-x^2$ và $f(x,y)=xy$.&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Đáp án&lt;/summary&gt;

  &lt;ol&gt;
    &lt;li&gt;Nửa mặt phẳng $y&amp;lt;x$; hình tròn mở $x^2+y^2&amp;lt;1$.&lt;/li&gt;
    &lt;li&gt;Các parabol $y=x^2+c$; các hyperbol $xy=c$ (với $c=0$ là hai trục toạ độ).&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;p&gt;&lt;strong&gt;Trung bình.&lt;/strong&gt;&lt;/p&gt;

&lt;ol start=&quot;3&quot;&gt;
  &lt;li&gt;Vẽ phác các đường mức $c=1,2,3$ của $f(x,y)=\vert x\vert +\vert y\vert $. Đồ thị có hình gì?&lt;/li&gt;
  &lt;li&gt;Với $Q=K^{0.3}L^{0.7}$, viết phương trình đường đồng lượng $Q=10$ dưới dạng $K$ theo $L$.&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Đáp án&lt;/summary&gt;

  &lt;ol start=&quot;3&quot;&gt;
    &lt;li&gt;Các hình vuông xoay $45^\circ$ với đỉnh $(\pm c,0)$, $(0,\pm c)$. Đồ thị là hình chóp vuông ngược (đỉnh ở gốc).&lt;/li&gt;
    &lt;li&gt;$K=10^{1/0.3}L^{-7/3}\approx2154\,L^{-7/3}$.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;p&gt;&lt;strong&gt;Nâng cao.&lt;/strong&gt;&lt;/p&gt;

&lt;ol start=&quot;5&quot;&gt;
  &lt;li&gt;Chứng minh rằng nếu $f(tx,ty)=f(x,y)$ với mọi $t&amp;gt;0$ (hàm thuần nhất bậc 0) thì mọi đường mức là hợp của các tia từ gốc.&lt;/li&gt;
  &lt;li&gt;Mô tả các mặt mức của $f(x,y,z)=z-x^2-y^2$ và của $f(x,y,z)=\dfrac{x^2+y^2}{z^2}$.&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Gợi ý&lt;/summary&gt;

  &lt;ol start=&quot;5&quot;&gt;
    &lt;li&gt;Nếu $f(x_0,y_0)=c$ thì $f(tx_0,ty_0)=c$ với mọi $t&amp;gt;0$: cả tia qua $(x_0,y_0)$ nằm trên đường mức.&lt;/li&gt;
    &lt;li&gt;Các paraboloid $z=x^2+y^2+c$ (tịnh tiến theo $Oz$). Các mặt nón $x^2+y^2=cz^2$ (bỏ đỉnh), $c&amp;gt;0$; với $c=0$ là trục $Oz$ bỏ gốc.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;h2 id=&quot;tóm-tắt&quot;&gt;Tóm tắt&lt;/h2&gt;

&lt;div class=&quot;content-box summary-box textbook-block&quot;&gt;
  &lt;ul&gt;
    &lt;li&gt;Hàm hai biến có đồ thị là mặt $z=f(x,y)$; đường mức $f=c$ là lát cắt ngang chiếu xuống.&lt;/li&gt;
    &lt;li&gt;Đường mức cách đều về giá trị: càng dày thì càng dốc; chúng không cắt nhau.&lt;/li&gt;
    &lt;li&gt;Hàm tuyến tính $ax+by$: đường mức song song, vuông góc với $(a,b)$, cách nhau $\tfrac1{\sqrt{a^2+b^2}}$.&lt;/li&gt;
    &lt;li&gt;Hàm ba biến được hình dung bằng mặt mức; ví dụ đường đồng lượng, mặt đẳng nhiệt, bề mặt hàm mất mát.&lt;/li&gt;
  &lt;/ul&gt;
&lt;/div&gt;
</content>
 </entry>
 
 <entry>
   <title>Chuyển động trong không gian</title>
   <link href="https://calculus-self-learning.pages.dev/contents/vi/chapter09/09_06_Chuyen_dong_trong_khong_gian/"/>
   <updated>2026-12-01T00:00:00+00:00</updated>
   <id>https://calculus-self-learning.pages.dev/contents/vi/chapter09/09_06_Chuyen_dong_trong_khong_gian</id>
   <content type="html">&lt;div class=&quot;textbook-objectives&quot;&gt;

  &lt;p&gt;&lt;strong&gt;Mục tiêu.&lt;/strong&gt; Sau bài này bạn có thể:&lt;/p&gt;

  &lt;ul&gt;
    &lt;li&gt;tính vận tốc, tốc độ và gia tốc của chuyển động $\mathbf r(t)$;&lt;/li&gt;
    &lt;li&gt;định nghĩa và tính độ cong $\kappa$ của một đường cong;&lt;/li&gt;
    &lt;li&gt;tách gia tốc thành thành phần tiếp tuyến $a_T$ và pháp tuyến $a_N$;&lt;/li&gt;
    &lt;li&gt;giải bài toán ném xiên và chuyển động tròn đều.&lt;/li&gt;
  &lt;/ul&gt;

&lt;/div&gt;

&lt;h2 id=&quot;vì-sao-cần-bài-này&quot;&gt;Vì sao cần bài này&lt;/h2&gt;

&lt;p&gt;Định luật Newton $\mathbf F=m\mathbf a$ là một phương trình vectơ. Muốn hiểu vì sao xe bị văng ở khúc cua, vì sao vệ tinh không rơi, hay robot phải giảm tốc trước khi rẽ, ta cần tách gia tốc thành phần làm thay đổi &lt;strong&gt;tốc độ&lt;/strong&gt; và phần làm thay đổi &lt;strong&gt;hướng&lt;/strong&gt;. Phần thứ hai phụ thuộc vào độ cong của đường đi.&lt;/p&gt;

&lt;h2 id=&quot;vận-tốc-và-gia-tốc&quot;&gt;Vận tốc và gia tốc&lt;/h2&gt;

&lt;div class=&quot;textbook-definition&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Định nghĩa.&lt;/strong&gt; Với vị trí $\mathbf r(t)$: &lt;strong&gt;vận tốc&lt;/strong&gt; $\mathbf v=\mathbf r&apos;(t)$, &lt;strong&gt;tốc độ&lt;/strong&gt; $\lVert\mathbf v\rVert=\tfrac{ds}{dt}$, &lt;strong&gt;gia tốc&lt;/strong&gt; $\mathbf a=\mathbf r&apos;&apos;(t)$. Khi $\mathbf v\ne\mathbf 0$: &lt;strong&gt;vectơ tiếp tuyến đơn vị&lt;/strong&gt; $\mathbf T=\tfrac{\mathbf v}{\lVert\mathbf v\rVert}$; &lt;strong&gt;vectơ pháp tuyến đơn vị&lt;/strong&gt; $\mathbf N=\tfrac{\mathbf T&apos;}{\lVert\mathbf T&apos;\rVert}$ (khi $\mathbf T&apos;\ne\mathbf 0$).&lt;/p&gt;
&lt;/div&gt;

&lt;p&gt;Vì $\lVert\mathbf T\rVert=1$ nên $\mathbf T&apos;\perp\mathbf T$ (bài tập 6 bài 09_03): $\mathbf N$ chỉ về phía đường cong đang uốn vào.&lt;/p&gt;

&lt;h2 id=&quot;độ-cong&quot;&gt;Độ cong&lt;/h2&gt;

&lt;div class=&quot;textbook-definition&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Định nghĩa.&lt;/strong&gt; &lt;strong&gt;Độ cong&lt;/strong&gt; là tốc độ quay của vectơ tiếp tuyến theo độ dài cung: $\kappa=\left\lVert\dfrac{d\mathbf T}{ds}\right\rVert$. Bán kính cong là $\tfrac1\kappa$.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-theorem&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Định lý 1.&lt;/strong&gt; Với chuyển động trơn $\mathbf r(t)$:&lt;/p&gt;

\[\mathbf a=\frac{d\lVert\mathbf v\rVert}{dt}\,\mathbf T+\kappa\lVert\mathbf v\rVert^2\,\mathbf N,\qquad\kappa=\frac{\lVert\mathbf r&apos;\times\mathbf r&apos;&apos;\rVert}{\lVert\mathbf r&apos;\rVert^3}.\]

  &lt;p&gt;Do đó $a_T=\dfrac{d\lVert\mathbf v\rVert}{dt}=\dfrac{\mathbf v\cdot\mathbf a}{\lVert\mathbf v\rVert}$ và $a_N=\kappa\lVert\mathbf v\rVert^2=\dfrac{\lVert\mathbf v\times\mathbf a\rVert}{\lVert\mathbf v\rVert}$.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-proof&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Chứng minh.&lt;/strong&gt; Viết $\mathbf v=\lVert\mathbf v\rVert\mathbf T$ và đạo hàm: $\mathbf a=\tfrac{d\lVert\mathbf v\rVert}{dt}\mathbf T+\lVert\mathbf v\rVert\mathbf T&apos;$. Theo quy tắc dây chuyền $\mathbf T&apos;=\tfrac{d\mathbf T}{ds}\tfrac{ds}{dt}$, và $\tfrac{d\mathbf T}{ds}=\kappa\mathbf N$ (cùng hướng với $\mathbf T&apos;$, độ dài $\kappa$). Vậy $\mathbf T&apos;=\kappa\lVert\mathbf v\rVert\mathbf N$, cho công thức đầu.&lt;/p&gt;

  &lt;p&gt;Nhân có hướng với $\mathbf v=\lVert\mathbf v\rVert\mathbf T$: $\mathbf v\times\mathbf a=\kappa\lVert\mathbf v\rVert^3\,\mathbf T\times\mathbf N$ (vì $\mathbf T\times\mathbf T=\mathbf 0$). Mà $\mathbf T\perp\mathbf N$ đều là vectơ đơn vị nên $\lVert\mathbf T\times\mathbf N\rVert=1$. Suy ra $\kappa=\tfrac{\lVert\mathbf v\times\mathbf a\rVert}{\lVert\mathbf v\rVert^3}$. Công thức $a_T$ có từ $\mathbf v\cdot\mathbf a=\lVert\mathbf v\rVert a_T$.&lt;/p&gt;
&lt;/div&gt;

&lt;p&gt;Với đồ thị phẳng $y=f(x)$ (tham số $(t,f(t),0)$), công thức cho $\kappa=\dfrac{\vert f&apos;&apos;(x)\vert }{\left(1+f&apos;(x)^2\right)^{3/2}}$.&lt;/p&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Ví dụ 1.&lt;/strong&gt; Đường tròn bán kính $R$, $\mathbf r=(R\cos t,R\sin t,0)$: $\lVert\mathbf r&apos;\rVert=R$, $\lVert\mathbf r&apos;\times\mathbf r&apos;&apos;\rVert=R^2$, nên $\kappa=\tfrac1R$: đường tròn nhỏ cong nhiều. Đường xoắn $(\cos t,\sin t,t)$: $\mathbf r&apos;\times\mathbf r&apos;&apos;=(\sin t,-\cos t,1)$, độ dài $\sqrt2$, nên $\kappa=\tfrac{\sqrt2}{2\sqrt2}=\tfrac12$.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Ví dụ 2.&lt;/strong&gt; Chuyển động $\mathbf r=(t,t^2,0)$ tại $t=1$: $\mathbf v=(1,2,0)$, $\mathbf a=(0,2,0)$, $\mathbf v\times\mathbf a=(0,0,2)$. Vậy $\kappa=\tfrac2{5^{3/2}}\approx0.179$, $a_T=\tfrac4{\sqrt5}\approx1.789$, $a_N=\tfrac2{\sqrt5}\approx0.894$. Kiểm tra: $a_T^2+a_N^2=\tfrac{16}5+\tfrac45=4=\lVert\mathbf a\rVert^2$.&lt;/p&gt;
&lt;/div&gt;

&lt;h2 id=&quot;ném-xiên&quot;&gt;Ném xiên&lt;/h2&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Ví dụ 3.&lt;/strong&gt; Bỏ qua sức cản, vật ném từ gốc với tốc độ $v_0$, góc $\alpha$: $\mathbf a=(0,-g)$, tích phân hai lần:&lt;/p&gt;

\[\mathbf r(t)=\left(v_0\cos\alpha\,t,\ v_0\sin\alpha\,t-\tfrac12gt^2\right).\]

  &lt;p&gt;Vật chạm đất khi $t=\tfrac{2v_0\sin\alpha}g$, tầm xa $\tfrac{v_0^2\sin2\alpha}g$, lớn nhất khi $\alpha=45^\circ$. Với $v_0=20$ m/s, $g=9.8$ m/s²: tầm xa tối đa $40.8$ m.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;interactive-frame&quot;&gt;
  &lt;div class=&quot;interactive-frame-head&quot;&gt;
    &lt;div class=&quot;interactive-frame-title&quot;&gt;Vận tốc và gia tốc&lt;/div&gt;
    &lt;div class=&quot;interactive-frame-desc&quot;&gt;Gia tốc tách thành phần tiếp tuyến và pháp tuyến.&lt;/div&gt;
  &lt;/div&gt;
  &lt;iframe src=&quot;/interactives/chapter09/motion-in-space.html&quot; title=&quot;Vận tốc và gia tốc&quot; loading=&quot;lazy&quot; style=&quot;height: 700px;&quot;&gt;&lt;/iframe&gt;
  &lt;div class=&quot;interactive-frame-foot&quot;&gt;
    &lt;a href=&quot;/interactives/chapter09/motion-in-space.html&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;Mở minh hoạ ở cửa sổ riêng&lt;/a&gt;
  &lt;/div&gt;
&lt;/div&gt;

&lt;h2 id=&quot;ứng-dụng&quot;&gt;Ứng dụng&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Vật lý: quỹ đạo vệ tinh.&lt;/strong&gt; Chuyển động tròn đều bán kính $r$, tốc độ $v$ có $a_T=0$ và $a_N=\tfrac{v^2}r$. Lực hấp dẫn cung cấp gia tốc này: $\tfrac{v^2}r=\tfrac{GM}{r^2}$, nên $v=\sqrt{GM/r}$. Với $GM=3.986\times10^{14}$ m³/s² và độ cao 400 km ($r=6771$ km): $v\approx7.67$ km/s, chu kỳ khoảng 92 phút, đúng với Trạm Vũ trụ Quốc tế.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Giao thông: khúc cua và đường cong chuyển tiếp.&lt;/strong&gt; Xe chạy 72 km/h (20 m/s) qua khúc cua bán kính 100 m chịu gia tốc pháp tuyến $\tfrac{20^2}{100}=4$ m/s², khoảng $0.41g$. Nếu đường thẳng nối thẳng vào cung tròn, độ cong nhảy từ 0 lên $\tfrac1{100}$ và hành khách bị giật. Kỹ sư cầu đường chèn đường cong clothoid, có độ cong tăng tuyến tính theo độ dài cung, để $a_N$ tăng dần.&lt;/p&gt;

&lt;h2 id=&quot;bài-tập&quot;&gt;Bài tập&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Cơ bản.&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;Cho $\mathbf r=(t,t^2,t^3)$. Tính vận tốc, tốc độ, gia tốc tại $t=1$.&lt;/li&gt;
  &lt;li&gt;Tính độ cong của $y=\sin x$ tại $x=\tfrac\pi2$ và tại $x=0$.&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Đáp án&lt;/summary&gt;

  &lt;ol&gt;
    &lt;li&gt;$\mathbf v=(1,2,3)$, tốc độ $\sqrt{14}$, $\mathbf a=(0,2,6)$.&lt;/li&gt;
    &lt;li&gt;Tại $\tfrac\pi2$: $f&apos;=0$, $\vert f&apos;&apos;\vert =1$, $\kappa=1$. Tại 0: $f&apos;&apos;=0$, $\kappa=0$ (điểm uốn).&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;p&gt;&lt;strong&gt;Trung bình.&lt;/strong&gt;&lt;/p&gt;

&lt;ol start=&quot;3&quot;&gt;
  &lt;li&gt;Với chuyển động ở câu 1 tại $t=1$, tính $\kappa$, $a_T$, $a_N$.&lt;/li&gt;
  &lt;li&gt;Ném vật với $v_0=20$ m/s. Góc ném nào cho tầm xa 30 m?&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Đáp án&lt;/summary&gt;

  &lt;ol start=&quot;3&quot;&gt;
    &lt;li&gt;$\mathbf v\times\mathbf a=(6,-6,2)$, độ dài $\sqrt{76}$. $\kappa=\tfrac{\sqrt{76}}{14^{3/2}}\approx0.166$, $a_T=\tfrac{22}{\sqrt{14}}\approx5.88$, $a_N=\tfrac{\sqrt{76}}{\sqrt{14}}\approx2.33$.&lt;/li&gt;
    &lt;li&gt;$\sin2\alpha=\tfrac{30\cdot9.8}{400}=0.735$: $\alpha\approx23.7^\circ$ hoặc $66.3^\circ$.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;p&gt;&lt;strong&gt;Nâng cao.&lt;/strong&gt;&lt;/p&gt;

&lt;ol start=&quot;5&quot;&gt;
  &lt;li&gt;Chứng minh chuyển động có tốc độ không đổi thì gia tốc vuông góc với vận tốc.&lt;/li&gt;
  &lt;li&gt;Tính độ cong của đường xoắn $(a\cos t,a\sin t,bt)$ và giải thích hai trường hợp giới hạn $b=0$ và $a\to0$.&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Gợi ý&lt;/summary&gt;

  &lt;ol start=&quot;5&quot;&gt;
    &lt;li&gt;Đạo hàm $\mathbf v\cdot\mathbf v=c$: $2\,\mathbf v\cdot\mathbf a=0$. Đây cũng là $a_T=0$ trong định lý 1.&lt;/li&gt;
    &lt;li&gt;$\kappa=\tfrac a{a^2+b^2}$. Khi $b=0$: đường tròn, $\kappa=\tfrac1a$. Khi $a\to0$: đường xoắn duỗi thành đường thẳng, $\kappa\to0$.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;h2 id=&quot;tóm-tắt&quot;&gt;Tóm tắt&lt;/h2&gt;

&lt;div class=&quot;content-box summary-box textbook-block&quot;&gt;
  &lt;ul&gt;
    &lt;li&gt;$\mathbf v=\mathbf r&apos;$, $\mathbf a=\mathbf r&apos;&apos;$, $\mathbf T=\tfrac{\mathbf v}{\lVert\mathbf v\rVert}$, $\mathbf N=\tfrac{\mathbf T&apos;}{\lVert\mathbf T&apos;\rVert}$.&lt;/li&gt;
    &lt;li&gt;Độ cong $\kappa=\tfrac{\lVert\mathbf r&apos;\times\mathbf r&apos;&apos;\rVert}{\lVert\mathbf r&apos;\rVert^3}$; đường tròn bán kính $R$ có $\kappa=\tfrac1R$.&lt;/li&gt;
    &lt;li&gt;$\mathbf a=a_T\mathbf T+a_N\mathbf N$ với $a_T=\tfrac{\mathbf v\cdot\mathbf a}{\lVert\mathbf v\rVert}$, $a_N=\kappa\lVert\mathbf v\rVert^2$.&lt;/li&gt;
    &lt;li&gt;Ứng dụng: ném xiên, vệ tinh $v=\sqrt{GM/r}$, thiết kế khúc cua.&lt;/li&gt;
  &lt;/ul&gt;
&lt;/div&gt;
</content>
 </entry>
 
 <entry>
   <title>Mặt bậc hai</title>
   <link href="https://calculus-self-learning.pages.dev/contents/vi/chapter09/09_05_Mat_bac_hai/"/>
   <updated>2026-12-01T00:00:00+00:00</updated>
   <id>https://calculus-self-learning.pages.dev/contents/vi/chapter09/09_05_Mat_bac_hai</id>
   <content type="html">&lt;div class=&quot;textbook-objectives&quot;&gt;

  &lt;p&gt;&lt;strong&gt;Mục tiêu.&lt;/strong&gt; Sau bài này bạn có thể:&lt;/p&gt;

  &lt;ul&gt;
    &lt;li&gt;nhận dạng sáu loại mặt bậc hai từ phương trình chính tắc;&lt;/li&gt;
    &lt;li&gt;vẽ phác một mặt bằng cách xét các lát cắt song song với các mặt toạ độ;&lt;/li&gt;
    &lt;li&gt;đưa phương trình về dạng chính tắc bằng phép bù bình phương;&lt;/li&gt;
    &lt;li&gt;giải thích hình dạng yên ngựa và tính chất hội tụ của chảo parabol.&lt;/li&gt;
  &lt;/ul&gt;

&lt;/div&gt;

&lt;h2 id=&quot;vì-sao-cần-bài-này&quot;&gt;Vì sao cần bài này&lt;/h2&gt;

&lt;p&gt;Mặt bậc hai là “đồ thị bậc hai” của không gian, như parabol, elip, hyperbol trong mặt phẳng. Chúng xuất hiện khắp nơi: chảo vệ tinh, tháp làm mát, mặt kính thiên văn. Quan trọng hơn cho giải tích: gần một điểm tới hạn, mọi hàm trơn hai biến trông giống một paraboloid (cực trị) hoặc một mặt yên ngựa, và chương 12 sẽ dựa vào điều này để phân loại cực trị.&lt;/p&gt;

&lt;h2 id=&quot;phương-pháp-lát-cắt&quot;&gt;Phương pháp lát cắt&lt;/h2&gt;

&lt;p&gt;Để hình dung mặt $F(x,y,z)=0$, cắt nó bằng các mặt phẳng $z=k$ (rồi $x=k$, $y=k$) và nhận dạng các đường cong phẳng thu được. Ghép các lát cắt lại cho hình dạng của mặt, giống như máy chụp cắt lớp.&lt;/p&gt;

&lt;h2 id=&quot;sáu-mặt-bậc-hai-chính-tắc&quot;&gt;Sáu mặt bậc hai chính tắc&lt;/h2&gt;

&lt;div class=&quot;content-box insight-box textbook-block&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Bảng nhận dạng&lt;/strong&gt; (với $a,b,c&amp;gt;0$).&lt;/p&gt;

  &lt;table&gt;
    &lt;thead&gt;
      &lt;tr&gt;
        &lt;th&gt;Mặt&lt;/th&gt;
        &lt;th&gt;Phương trình&lt;/th&gt;
        &lt;th&gt;Lát cắt $z=k$&lt;/th&gt;
        &lt;th&gt;Lát cắt $x=k$ hoặc $y=k$&lt;/th&gt;
      &lt;/tr&gt;
    &lt;/thead&gt;
    &lt;tbody&gt;
      &lt;tr&gt;
        &lt;td&gt;Ellipsoid&lt;/td&gt;
        &lt;td&gt;$\tfrac{x^2}{a^2}+\tfrac{y^2}{b^2}+\tfrac{z^2}{c^2}=1$&lt;/td&gt;
        &lt;td&gt;elip (khi $\vert k\vert&amp;lt;c$)&lt;/td&gt;
        &lt;td&gt;elip&lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr&gt;
        &lt;td&gt;Paraboloid elliptic&lt;/td&gt;
        &lt;td&gt;$z=\tfrac{x^2}{a^2}+\tfrac{y^2}{b^2}$&lt;/td&gt;
        &lt;td&gt;elip ($k&amp;gt;0$)&lt;/td&gt;
        &lt;td&gt;parabol quay lên&lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr&gt;
        &lt;td&gt;Paraboloid hyperbolic (yên ngựa)&lt;/td&gt;
        &lt;td&gt;$z=\tfrac{x^2}{a^2}-\tfrac{y^2}{b^2}$&lt;/td&gt;
        &lt;td&gt;hyperbol&lt;/td&gt;
        &lt;td&gt;parabol, một quay lên, một quay xuống&lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr&gt;
        &lt;td&gt;Hyperboloid một tầng&lt;/td&gt;
        &lt;td&gt;$\tfrac{x^2}{a^2}+\tfrac{y^2}{b^2}-\tfrac{z^2}{c^2}=1$&lt;/td&gt;
        &lt;td&gt;elip với mọi $k$&lt;/td&gt;
        &lt;td&gt;hyperbol&lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr&gt;
        &lt;td&gt;Hyperboloid hai tầng&lt;/td&gt;
        &lt;td&gt;$\tfrac{z^2}{c^2}-\tfrac{x^2}{a^2}-\tfrac{y^2}{b^2}=1$&lt;/td&gt;
        &lt;td&gt;elip khi $\vert k\vert&amp;gt;c$, rỗng khi $\vert k\vert&amp;lt;c$&lt;/td&gt;
        &lt;td&gt;hyperbol&lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr&gt;
        &lt;td&gt;Mặt nón&lt;/td&gt;
        &lt;td&gt;$\tfrac{z^2}{c^2}=\tfrac{x^2}{a^2}+\tfrac{y^2}{b^2}$&lt;/td&gt;
        &lt;td&gt;elip ($k\ne0$), một điểm ($k=0$)&lt;/td&gt;
        &lt;td&gt;cặp đường thẳng hoặc hyperbol&lt;/td&gt;
      &lt;/tr&gt;
    &lt;/tbody&gt;
  &lt;/table&gt;

  &lt;p&gt;Biến xuất hiện với bậc một (paraboloid) hoặc mang dấu khác (hyperboloid, nón) cho biết trục của mặt.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Ví dụ 1 (Hyperboloid một tầng).&lt;/strong&gt; $x^2+y^2-z^2=1$. Lát cắt $z=k$: đường tròn bán kính $\sqrt{1+k^2}$, nhỏ nhất ($=1$) ở “eo” $z=0$ và nở ra khi $\vert k\vert $ tăng. Lát cắt $x=0$: hyperbol $y^2-z^2=1$. Mặt có dạng một ống loe hai đầu, như tháp làm mát.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Ví dụ 2 (Bù bình phương).&lt;/strong&gt; $x^2+2y^2+z^2-4x+4y=0$. Viết $x^2-4x=(x-2)^2-4$, $2y^2+4y=2(y+1)^2-2$:&lt;/p&gt;

\[(x-2)^2+2(y+1)^2+z^2=6\iff\frac{(x-2)^2}6+\frac{(y+1)^2}3+\frac{z^2}6=1 .\]

  &lt;p&gt;Ellipsoid tâm $(2,-1,0)$, bán trục $\sqrt6,\sqrt3,\sqrt6$.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Ví dụ 3.&lt;/strong&gt; $4x^2-y^2+2z^2+4=0$, tức $\tfrac{y^2}4-x^2-\tfrac{z^2}2=1$: hyperboloid hai tầng có trục là $Oy$; mặt không cắt các mặt phẳng $y=k$ với $\vert k\vert &amp;lt;2$.&lt;/p&gt;
&lt;/div&gt;

&lt;h2 id=&quot;hai-tính-chất-đáng-nhớ&quot;&gt;Hai tính chất đáng nhớ&lt;/h2&gt;

&lt;div class=&quot;textbook-theorem&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Định lý 1.&lt;/strong&gt; (a) Mặt $z=xy$ là paraboloid hyperbolic $z=\tfrac{u^2-v^2}2$ trong hệ trục $u=\tfrac{x+y}{\sqrt2}$, $v=\tfrac{x-y}{\sqrt2}$ (xoay $45^\circ$). (b) Hyperboloid một tầng $x^2+y^2-z^2=1$ chứa hai họ đường thẳng: qua mỗi điểm của nó có hai đường thẳng nằm hoàn toàn trên mặt.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-proof&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Chứng minh.&lt;/strong&gt; (a) $u^2-v^2=\tfrac{(x+y)^2-(x-y)^2}2=2xy$, nên $\tfrac{u^2-v^2}2=xy$. Phép đổi $(x,y)\mapsto(u,v)$ là phép quay nên không đổi hình dạng.&lt;/p&gt;

  &lt;p&gt;(b) Với mỗi góc $\alpha$, xét đường thẳng $\big(\cos\alpha-t\sin\alpha,\ \sin\alpha+t\cos\alpha,\ \pm t\big)$. Ta có $x^2+y^2=1+t^2$ (các số hạng chéo triệt tiêu) và $z^2=t^2$, nên $x^2+y^2-z^2=1$ với mọi $t$. Khi $\alpha$ chạy, các đường thẳng này (với dấu $+$ và dấu $-$) phủ kín mặt.&lt;/p&gt;
&lt;/div&gt;

&lt;p&gt;Tính chất (b) giải thích vì sao tháp làm mát và một số tháp truyền hình (như tháp Shukhov) xây được bằng các thanh thép thẳng.&lt;/p&gt;

&lt;div class=&quot;interactive-frame&quot;&gt;
  &lt;div class=&quot;interactive-frame-head&quot;&gt;
    &lt;div class=&quot;interactive-frame-title&quot;&gt;Mặt bậc hai và lát cắt&lt;/div&gt;
    &lt;div class=&quot;interactive-frame-desc&quot;&gt;Chọn loại mặt, kéo a, b, c và mặt phẳng z = k.&lt;/div&gt;
  &lt;/div&gt;
  &lt;iframe src=&quot;/interactives/chapter09/quadric-surfaces.html&quot; title=&quot;Mặt bậc hai và lát cắt&quot; loading=&quot;lazy&quot; style=&quot;height: 700px;&quot;&gt;&lt;/iframe&gt;
  &lt;div class=&quot;interactive-frame-foot&quot;&gt;
    &lt;a href=&quot;/interactives/chapter09/quadric-surfaces.html&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;Mở minh hoạ ở cửa sổ riêng&lt;/a&gt;
  &lt;/div&gt;
&lt;/div&gt;

&lt;h2 id=&quot;ứng-dụng&quot;&gt;Ứng dụng&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Học máy: điểm yên ngựa.&lt;/strong&gt; Hàm $f(x,y)=x^2-y^2$ có đồ thị là yên ngựa: tại gốc đạo hàm theo mọi hướng bằng 0, nhưng gốc không phải cực tiểu (theo hướng $y$ hàm giảm). Trong mạng nơ-ron nhiều tham số, phần lớn điểm có gradient bằng 0 là điểm yên ngựa chứ không phải cực tiểu địa phương. Gradient descent có nhiễu (SGD) giúp thoát khỏi chúng.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Kỹ thuật: chảo parabol.&lt;/strong&gt; Paraboloid $z=\tfrac{x^2+y^2}{4f}$ phản xạ mọi tia song song với trục vào tiêu điểm $(0,0,f)$. Một chảo thu sóng đường kính 60 cm, sâu 6 cm: $6=\tfrac{30^2}{4f}$, nên $f=37.5$ cm; đầu thu đặt cách đáy chảo 37.5 cm. Đèn pha ô tô dùng chiều ngược lại: nguồn sáng ở tiêu điểm cho chùm tia song song.&lt;/p&gt;

&lt;h2 id=&quot;bài-tập&quot;&gt;Bài tập&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Cơ bản.&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;Nhận dạng: $x^2+y^2=z$, $x^2+4y^2+9z^2=36$, $x^2-y^2-z^2=1$.&lt;/li&gt;
  &lt;li&gt;Nhận dạng $y^2+z^2=x^2$ và mô tả các lát cắt $x=k$.&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Đáp án&lt;/summary&gt;

  &lt;ol&gt;
    &lt;li&gt;Paraboloid tròn xoay; ellipsoid bán trục $6,3,2$; hyperboloid hai tầng trục $Ox$.&lt;/li&gt;
    &lt;li&gt;Mặt nón trục $Ox$; lát cắt $x=k$ là đường tròn bán kính $\vert k\vert $.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;p&gt;&lt;strong&gt;Trung bình.&lt;/strong&gt;&lt;/p&gt;

&lt;ol start=&quot;3&quot;&gt;
  &lt;li&gt;Đưa $x^2+y^2-z^2-2x+4y+5=0$ về dạng chính tắc và nhận dạng.&lt;/li&gt;
  &lt;li&gt;Tìm giao tuyến của paraboloid $z=x^2+y^2$ với mặt phẳng $z=2x$.&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Đáp án&lt;/summary&gt;

  &lt;ol start=&quot;3&quot;&gt;
    &lt;li&gt;$(x-1)^2+(y+2)^2-z^2=0$: mặt nón đỉnh $(1,-2,0)$, trục song song $Oz$.&lt;/li&gt;
    &lt;li&gt;$x^2-2x+y^2=0$, tức $(x-1)^2+y^2=1$, trên mặt phẳng $z=2x$: một elip (chiếu xuống mặt $Oxy$ là đường tròn).&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;p&gt;&lt;strong&gt;Nâng cao.&lt;/strong&gt;&lt;/p&gt;

&lt;ol start=&quot;5&quot;&gt;
  &lt;li&gt;Chứng minh paraboloid hyperbolic $z=xy$ cũng chứa hai họ đường thẳng.&lt;/li&gt;
  &lt;li&gt;Chứng minh tia song song trục $Oz$ chiếu vào parabol $z=\tfrac{x^2}{4f}$ phản xạ qua tiêu điểm $(0,f)$. Gợi ý: tại điểm $(x_0,z_0)$, so sánh góc của tia tới và đường nối đến tiêu điểm với pháp tuyến.&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Gợi ý&lt;/summary&gt;

  &lt;ol start=&quot;5&quot;&gt;
    &lt;li&gt;Với $x=a$ cố định, $z=ay$ là đường thẳng $(a,t,at)$; tương tự $y=b$ cho $(t,b,bt)$.&lt;/li&gt;
    &lt;li&gt;Pháp tuyến tỉ lệ với $\left(-\tfrac{x_0}{2f},1\right)$. Khoảng cách từ $(x_0,z_0)$ đến tiêu điểm bằng $z_0+f$ (khoảng cách đến đường chuẩn $z=-f$). Từ đó tam giác tạo bởi điểm, tiêu điểm và chân đường chuẩn cân, và pháp tuyến là phân giác: góc tới bằng góc phản xạ.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;h2 id=&quot;tóm-tắt&quot;&gt;Tóm tắt&lt;/h2&gt;

&lt;div class=&quot;content-box summary-box textbook-block&quot;&gt;
  &lt;ul&gt;
    &lt;li&gt;Sáu mặt bậc hai: ellipsoid, paraboloid elliptic, paraboloid hyperbolic, hyperboloid một tầng, hai tầng, mặt nón.&lt;/li&gt;
    &lt;li&gt;Nhận dạng bằng lát cắt $z=k$, $x=k$, $y=k$ và bù bình phương để tìm tâm.&lt;/li&gt;
    &lt;li&gt;$z=xy$ là yên ngựa xoay $45^\circ$; hyperboloid một tầng chứa hai họ đường thẳng.&lt;/li&gt;
    &lt;li&gt;Ứng dụng: điểm yên ngựa trong học máy, tiêu điểm của chảo parabol.&lt;/li&gt;
  &lt;/ul&gt;
&lt;/div&gt;
</content>
 </entry>
 
 <entry>
   <title>Toạ độ cực, trụ, cầu</title>
   <link href="https://calculus-self-learning.pages.dev/contents/vi/chapter09/09_04_Toa_do_cuc_tru_cau/"/>
   <updated>2026-12-01T00:00:00+00:00</updated>
   <id>https://calculus-self-learning.pages.dev/contents/vi/chapter09/09_04_Toa_do_cuc_tru_cau</id>
   <content type="html">&lt;div class=&quot;textbook-objectives&quot;&gt;

  &lt;p&gt;&lt;strong&gt;Mục tiêu.&lt;/strong&gt; Sau bài này bạn có thể:&lt;/p&gt;

  &lt;ul&gt;
    &lt;li&gt;chuyển đổi giữa toạ độ Descartes và toạ độ cực;&lt;/li&gt;
    &lt;li&gt;vẽ phác các đường cong cực quen thuộc;&lt;/li&gt;
    &lt;li&gt;tính diện tích miền giới hạn bởi đường cong cực bằng $\tfrac12\int r^2\,d\theta$;&lt;/li&gt;
    &lt;li&gt;chuyển đổi giữa toạ độ Descartes, trụ và cầu, và nhận ra các mặt đơn giản trong mỗi hệ.&lt;/li&gt;
  &lt;/ul&gt;

&lt;/div&gt;

&lt;h2 id=&quot;vì-sao-cần-bài-này&quot;&gt;Vì sao cần bài này&lt;/h2&gt;

&lt;p&gt;Một hệ toạ độ tốt làm bài toán dễ đi nhiều. Đường tròn $x^2+y^2=4$ trong toạ độ cực chỉ là $r=2$. Radar, vị trí trên mặt đất (vĩ độ, kinh độ), trường hấp dẫn quanh một hành tinh đều “tròn” tự nhiên. Chương 13 sẽ dùng các hệ này để tính tích phân bội.&lt;/p&gt;

&lt;h2 id=&quot;toạ-độ-cực&quot;&gt;Toạ độ cực&lt;/h2&gt;

&lt;p&gt;Điểm $P$ trong mặt phẳng được xác định bởi khoảng cách $r$ đến gốc và góc $\theta$ từ trục $Ox$ dương:&lt;/p&gt;

\[x=r\cos\theta,\quad y=r\sin\theta;\qquad r=\sqrt{x^2+y^2},\quad\tan\theta=\frac yx .\]

&lt;p&gt;Góc $\theta$ phải chọn đúng góc phần tư (hàm &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;atan2(y, x)&lt;/code&gt; trong lập trình làm việc này). Một điểm có nhiều toạ độ cực: $(r,\theta)$, $(r,\theta+2\pi)$, và $(-r,\theta+\pi)$ nếu cho phép $r&amp;lt;0$.&lt;/p&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Ví dụ 1.&lt;/strong&gt; $(-1,\sqrt3)$: $r=2$, điểm nằm ở góc phần tư thứ II nên $\theta=\tfrac{2\pi}3$ (không phải $-\tfrac\pi3$).&lt;/p&gt;

  &lt;p&gt;Đường $r=2\cos\theta$: nhân với $r$ được $x^2+y^2=2x$, tức $(x-1)^2+y^2=1$, đường tròn tâm $(1,0)$ bán kính 1.&lt;/p&gt;
&lt;/div&gt;

&lt;p&gt;&lt;strong&gt;Một số đường cong cực.&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;$r=a$: đường tròn; $\theta=\alpha$: đường thẳng qua gốc.&lt;/li&gt;
  &lt;li&gt;$r=1+\cos\theta$: &lt;strong&gt;cardioid&lt;/strong&gt; (hình trái tim), đi qua gốc khi $\theta=\pi$.&lt;/li&gt;
  &lt;li&gt;$r=\cos k\theta$: &lt;strong&gt;hoa hồng&lt;/strong&gt;, có $k$ cánh nếu $k$ lẻ và $2k$ cánh nếu $k$ chẵn.&lt;/li&gt;
  &lt;li&gt;$r=e^{a\theta}$: xoắn ốc logarit (vỏ ốc, thiên hà xoắn).&lt;/li&gt;
&lt;/ul&gt;

&lt;h2 id=&quot;diện-tích-trong-toạ-độ-cực&quot;&gt;Diện tích trong toạ độ cực&lt;/h2&gt;

&lt;div class=&quot;textbook-theorem&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Định lý 1.&lt;/strong&gt; Nếu $f\ge0$ liên tục trên $[\alpha,\beta]$ với $\beta-\alpha\le2\pi$, diện tích miền giới hạn bởi $r=f(\theta)$ và hai tia $\theta=\alpha$, $\theta=\beta$ là&lt;/p&gt;

\[A=\frac12\int_\alpha^\beta f(\theta)^2\,d\theta .\]

&lt;/div&gt;

&lt;div class=&quot;textbook-proof&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Chứng minh.&lt;/strong&gt; Chia $[\alpha,\beta]$ thành các góc nhỏ $\Delta\theta_i$. Miền ứng với mỗi góc gần như một hình quạt tròn bán kính $f(\theta_i^*)$, diện tích $\tfrac12f(\theta_i^*)^2\Delta\theta_i$ (hình quạt góc $\Delta\theta$ chiếm $\tfrac{\Delta\theta}{2\pi}$ diện tích $\pi r^2$). Cộng lại được tổng Riemann của $\tfrac12f^2$. Kẹp mỗi miền con giữa hai hình quạt với bán kính nhỏ nhất và lớn nhất cho thấy giới hạn chính là diện tích.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Ví dụ 2 (Cardioid).&lt;/strong&gt; $A=\tfrac12\int_0^{2\pi}(1+\cos\theta)^2d\theta=\tfrac12\int_0^{2\pi}\left(1+2\cos\theta+\cos^2\theta\right)d\theta=\tfrac12(2\pi+0+\pi)=\tfrac{3\pi}2$.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Ví dụ 3 (Một cánh hoa hồng).&lt;/strong&gt; $r=\cos2\theta$ có một cánh trên $-\tfrac\pi4\le\theta\le\tfrac\pi4$: $A=\tfrac12\int_{-\pi/4}^{\pi/4}\cos^22\theta\,d\theta=\tfrac12\cdot\tfrac\pi4=\tfrac\pi8$. Bốn cánh: $\tfrac\pi2$.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Ví dụ 4 (Miền giữa hai đường).&lt;/strong&gt; Phần bên trong $r=2\cos\theta$ và bên ngoài $r=1$: hai đường cắt nhau khi $\cos\theta=\tfrac12$, $\theta=\pm\tfrac\pi3$. Diện tích $\tfrac12\int_{-\pi/3}^{\pi/3}\left(4\cos^2\theta-1\right)d\theta=\tfrac\pi3+\tfrac{\sqrt3}2\approx1.913$.&lt;/p&gt;
&lt;/div&gt;

&lt;p&gt;Độ dài cung của đường cực $r=f(\theta)$ là $\int\sqrt{r^2+(dr/d\theta)^2}\,d\theta$ (áp dụng bài 09_03 cho $(f\cos\theta,f\sin\theta)$); cardioid dài 8.&lt;/p&gt;

&lt;div class=&quot;interactive-frame&quot;&gt;
  &lt;div class=&quot;interactive-frame-head&quot;&gt;
    &lt;div class=&quot;interactive-frame-title&quot;&gt;Đường cong cực và diện tích&lt;/div&gt;
    &lt;div class=&quot;interactive-frame-desc&quot;&gt;Vẽ dần r = f(θ) và cộng diện tích các hình quạt.&lt;/div&gt;
  &lt;/div&gt;
  &lt;iframe src=&quot;/interactives/chapter09/polar-curves.html&quot; title=&quot;Đường cong cực và diện tích&quot; loading=&quot;lazy&quot; style=&quot;height: 720px;&quot;&gt;&lt;/iframe&gt;
  &lt;div class=&quot;interactive-frame-foot&quot;&gt;
    &lt;a href=&quot;/interactives/chapter09/polar-curves.html&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;Mở minh hoạ ở cửa sổ riêng&lt;/a&gt;
  &lt;/div&gt;
&lt;/div&gt;

&lt;h2 id=&quot;toạ-độ-trụ-và-toạ-độ-cầu&quot;&gt;Toạ độ trụ và toạ độ cầu&lt;/h2&gt;

&lt;div class=&quot;textbook-definition&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Toạ độ trụ&lt;/strong&gt; $(r,\theta,z)$: toạ độ cực cho $(x,y)$, giữ nguyên $z$. Mặt $r=a$ là mặt trụ.&lt;/p&gt;

  &lt;p&gt;&lt;strong&gt;Toạ độ cầu&lt;/strong&gt; $(\rho,\varphi,\theta)$ với $\rho\ge0$ là khoảng cách đến gốc, $\varphi\in[0,\pi]$ là góc từ trục $Oz$ dương, $\theta$ như toạ độ cực:&lt;/p&gt;

\[x=\rho\sin\varphi\cos\theta,\quad y=\rho\sin\varphi\sin\theta,\quad z=\rho\cos\varphi .\]

  &lt;p&gt;Mặt $\rho=a$ là mặt cầu; $\varphi=\alpha$ là mặt nón; $\theta=\alpha$ là nửa mặt phẳng.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Ví dụ 5.&lt;/strong&gt; Điểm $(1,1,\sqrt2)$: $\rho=\sqrt{1+1+2}=2$, $\cos\varphi=\tfrac{\sqrt2}2$ nên $\varphi=\tfrac\pi4$, $\theta=\tfrac\pi4$. Toạ độ trụ: $(\sqrt2,\tfrac\pi4,\sqrt2)$. Mặt nón $z=\sqrt{x^2+y^2}$ trong toạ độ cầu là $\varphi=\tfrac\pi4$, trong toạ độ trụ là $z=r$.&lt;/p&gt;
&lt;/div&gt;

&lt;h2 id=&quot;video-ngắn&quot;&gt;Video ngắn&lt;/h2&gt;

&lt;div class=&quot;reel-video&quot;&gt;
  &lt;video controls=&quot;&quot; playsinline=&quot;&quot; preload=&quot;metadata&quot; src=&quot;/public/videos/reels/polar-grid-warp.mp4&quot;&gt;&lt;/video&gt;
  &lt;p class=&quot;reel-caption&quot;&gt;Tờ giấy kẻ ô (θ, r) cuộn thành lưới cực, ô diện tích r dr dθ, hoa hồng r = cos kθ và lưới cầu (video không lời, khoảng 2 phút).&lt;/p&gt;
&lt;/div&gt;

&lt;h2 id=&quot;ứng-dụng&quot;&gt;Ứng dụng&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Địa lý: khoảng cách trên mặt Trái Đất.&lt;/strong&gt; Vĩ độ là $90^\circ-\varphi$, kinh độ là $\theta$. Với bán kính $R=6371$ km, đổi vị trí ra toạ độ Descartes rồi dùng tích vô hướng, góc giữa hai vectơ vị trí cho khoảng cách theo đường tròn lớn $R\cdot\theta$. Hà Nội ($21.03^\circ$B, $105.85^\circ$Đ) và TP. Hồ Chí Minh ($10.78^\circ$B, $106.70^\circ$Đ): góc $0.1795$ rad, khoảng cách khoảng $1143$ km.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Radar và robot.&lt;/strong&gt; Radar đo trực tiếp khoảng cách $r$ và góc $\theta$ của mục tiêu; robot hai khớp (bài 09_03) có vùng với tới là hình vành khăn, mô tả gọn nhất trong toạ độ cực: $\vert L_1-L_2\vert \le r\le L_1+L_2$.&lt;/p&gt;

&lt;h2 id=&quot;bài-tập&quot;&gt;Bài tập&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Cơ bản.&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;Đổi sang toạ độ cực: $(0,-3)$, $(-2,-2)$.&lt;/li&gt;
  &lt;li&gt;Đổi phương trình $r=4\sin\theta$ sang toạ độ Descartes và nhận dạng đường cong.&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Đáp án&lt;/summary&gt;

  &lt;ol&gt;
    &lt;li&gt;$(3,\tfrac{3\pi}2)$; $(2\sqrt2,\tfrac{5\pi}4)$.&lt;/li&gt;
    &lt;li&gt;$x^2+y^2=4y$, tức $x^2+(y-2)^2=4$: đường tròn tâm $(0,2)$ bán kính 2.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;p&gt;&lt;strong&gt;Trung bình.&lt;/strong&gt;&lt;/p&gt;

&lt;ol start=&quot;3&quot;&gt;
  &lt;li&gt;Tính diện tích miền bên trong $r=2\sin\theta$.&lt;/li&gt;
  &lt;li&gt;Viết phương trình mặt cầu $x^2+y^2+z^2=2z$ trong toạ độ cầu.&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Đáp án&lt;/summary&gt;

  &lt;ol start=&quot;3&quot;&gt;
    &lt;li&gt;$\tfrac12\int_0^\pi4\sin^2\theta\,d\theta=\pi$ (đường tròn bán kính 1).&lt;/li&gt;
    &lt;li&gt;$\rho^2=2\rho\cos\varphi$, tức $\rho=2\cos\varphi$.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;p&gt;&lt;strong&gt;Nâng cao.&lt;/strong&gt;&lt;/p&gt;

&lt;ol start=&quot;5&quot;&gt;
  &lt;li&gt;Tính diện tích một cánh của $r=\sin3\theta$ và tổng diện tích hoa hồng.&lt;/li&gt;
  &lt;li&gt;Chứng minh độ dài cardioid $r=1+\cos\theta$ bằng 8.&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Gợi ý&lt;/summary&gt;

  &lt;ol start=&quot;5&quot;&gt;
    &lt;li&gt;Một cánh trên $[0,\tfrac\pi3]$: $\tfrac12\int_0^{\pi/3}\sin^23\theta\,d\theta=\tfrac\pi{12}$; ba cánh: $\tfrac\pi4$.&lt;/li&gt;
    &lt;li&gt;$r^2+r&apos;^2=(1+\cos\theta)^2+\sin^2\theta=2+2\cos\theta=4\cos^2\tfrac\theta2$; $\int_0^{2\pi}2\left\lvert\cos\tfrac\theta2\right\rvert d\theta=8$.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;h2 id=&quot;tóm-tắt&quot;&gt;Tóm tắt&lt;/h2&gt;

&lt;div class=&quot;content-box summary-box textbook-block&quot;&gt;
  &lt;ul&gt;
    &lt;li&gt;Cực: $x=r\cos\theta$, $y=r\sin\theta$; chọn $\theta$ đúng góc phần tư.&lt;/li&gt;
    &lt;li&gt;Diện tích cực: $\tfrac12\int_\alpha^\beta r^2\,d\theta$; cardioid $\tfrac{3\pi}2$, một cánh $\cos2\theta$ là $\tfrac\pi8$.&lt;/li&gt;
    &lt;li&gt;Trụ $(r,\theta,z)$; cầu $x=\rho\sin\varphi\cos\theta$, $y=\rho\sin\varphi\sin\theta$, $z=\rho\cos\varphi$.&lt;/li&gt;
    &lt;li&gt;Ứng dụng: khoảng cách địa lý, radar, vùng với tới của robot.&lt;/li&gt;
  &lt;/ul&gt;
&lt;/div&gt;
</content>
 </entry>
 
 <entry>
   <title>Đường cong tham số</title>
   <link href="https://calculus-self-learning.pages.dev/contents/vi/chapter09/09_03_Duong_cong_tham_so/"/>
   <updated>2026-12-01T00:00:00+00:00</updated>
   <id>https://calculus-self-learning.pages.dev/contents/vi/chapter09/09_03_Duong_cong_tham_so</id>
   <content type="html">&lt;div class=&quot;textbook-objectives&quot;&gt;

  &lt;p&gt;&lt;strong&gt;Mục tiêu.&lt;/strong&gt; Sau bài này bạn có thể:&lt;/p&gt;

  &lt;ul&gt;
    &lt;li&gt;mô tả đường cong bằng hàm vectơ $\mathbf r(t)$ và vẽ phác các đường quen thuộc;&lt;/li&gt;
    &lt;li&gt;tính vectơ tiếp tuyến $\mathbf r&apos;(t)$, viết phương trình tiếp tuyến và độ dốc $\tfrac{dy}{dx}$;&lt;/li&gt;
    &lt;li&gt;tính độ dài cung $\int_a^b\lVert\mathbf r&apos;(t)\rVert\,dt$;&lt;/li&gt;
    &lt;li&gt;tham số hoá lại một đường cong theo độ dài cung.&lt;/li&gt;
  &lt;/ul&gt;

&lt;/div&gt;

&lt;h2 id=&quot;vì-sao-cần-bài-này&quot;&gt;Vì sao cần bài này&lt;/h2&gt;

&lt;p&gt;Nhiều đường cong không phải đồ thị của một hàm $y=f(x)$: đường tròn, quỹ đạo của một điểm trên bánh xe, đường xoắn của lò xo, đường đi của cánh tay robot. Mô tả chúng bằng tham số $t$ (thường là thời gian) vừa tự nhiên vừa dễ tính toán: mỗi toạ độ là một hàm một biến, và mọi công cụ của chương 2–6 dùng được ngay.&lt;/p&gt;

&lt;h2 id=&quot;hàm-vectơ-và-đường-cong&quot;&gt;Hàm vectơ và đường cong&lt;/h2&gt;

&lt;div class=&quot;textbook-definition&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Định nghĩa.&lt;/strong&gt; Một &lt;strong&gt;hàm vectơ&lt;/strong&gt; là $\mathbf r(t)=(x(t),y(t),z(t))$ với $t\in I$. Tập các điểm $\mathbf r(t)$ là một &lt;strong&gt;đường cong tham số&lt;/strong&gt;. Giới hạn, liên tục và đạo hàm lấy theo từng toạ độ:&lt;/p&gt;

\[\mathbf r&apos;(t)=\lim_{h\to0}\frac{\mathbf r(t+h)-\mathbf r(t)}h=(x&apos;(t),y&apos;(t),z&apos;(t)).\]

  &lt;p&gt;Đường cong &lt;strong&gt;trơn&lt;/strong&gt; nếu $\mathbf r&apos;$ liên tục và $\mathbf r&apos;(t)\ne\mathbf 0$.&lt;/p&gt;
&lt;/div&gt;

&lt;p&gt;Ví dụ: đường tròn $(\cos t,\sin t)$; elip $(a\cos t,b\sin t)$; đường xoắn $(\cos t,\sin t,t)$; cycloid $(t-\sin t,\,1-\cos t)$, quỹ đạo của một điểm trên vành bánh xe bán kính 1 lăn trên đường thẳng.&lt;/p&gt;

&lt;h2 id=&quot;tiếp-tuyến&quot;&gt;Tiếp tuyến&lt;/h2&gt;

&lt;p&gt;Vectơ $\mathbf r(t+h)-\mathbf r(t)$ là dây cung; chia cho $h$ và cho $h\to0$ được $\mathbf r&apos;(t)$, tiếp xúc với đường cong. Nếu $t$ là thời gian, $\mathbf r&apos;(t)$ là &lt;strong&gt;vận tốc&lt;/strong&gt; (bài 09_06). Tiếp tuyến tại $t_0$ là đường thẳng $\mathbf r(t_0)+s\,\mathbf r&apos;(t_0)$.&lt;/p&gt;

&lt;p&gt;Với đường cong phẳng, nếu $x&apos;(t)\ne0$ thì theo quy tắc dây chuyền&lt;/p&gt;

\[\frac{dy}{dx}=\frac{y&apos;(t)}{x&apos;(t)} .\]

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Ví dụ 1.&lt;/strong&gt; Elip $(2\cos t,\sin t)$ tại $t=\tfrac\pi4$: điểm $\left(\sqrt2,\tfrac{\sqrt2}2\right)$, $\tfrac{dy}{dx}=\tfrac{\cos t}{-2\sin t}=-\tfrac12$.&lt;/p&gt;

  &lt;p&gt;Đường xoắn $(\cos t,\sin t,t)$ tại $t=\tfrac\pi2$: điểm $\left(0,1,\tfrac\pi2\right)$, $\mathbf r&apos;=(-\sin t,\cos t,1)=(-1,0,1)$. Tiếp tuyến $\left(0,1,\tfrac\pi2\right)+s(-1,0,1)$.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Ví dụ 2 (Điểm không trơn).&lt;/strong&gt; $\mathbf r(t)=(t^2,t^3)$ có $\mathbf r&apos;(0)=\mathbf 0$. Đường cong ($y^2=x^3$) có một điểm lùi (mũi nhọn) tại gốc: tham số hoá khả vi vẫn có thể cho một đường có góc nhọn khi vận tốc bằng 0.&lt;/p&gt;
&lt;/div&gt;

&lt;h2 id=&quot;độ-dài-cung&quot;&gt;Độ dài cung&lt;/h2&gt;

&lt;div class=&quot;textbook-theorem&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Định lý 1.&lt;/strong&gt; Nếu $\mathbf r$ trơn trên $[a,b]$ và đi qua đường cong đúng một lần, độ dài của nó là&lt;/p&gt;

\[L=\int_a^b\lVert\mathbf r&apos;(t)\rVert\,dt=\int_a^b\sqrt{x&apos;(t)^2+y&apos;(t)^2+z&apos;(t)^2}\,dt .\]

&lt;/div&gt;

&lt;div class=&quot;textbook-proof&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Ý chứng minh.&lt;/strong&gt; Chia $[a,b]$ bằng các điểm $t_0&amp;lt;t_1&amp;lt;\cdots&amp;lt;t_n$ và xấp xỉ đường cong bằng đường gấp khúc. Theo định lý giá trị trung bình cho từng toạ độ, mỗi đoạn có độ dài xấp xỉ $\lVert\mathbf r&apos;(t_i^*)\rVert\Delta t_i$. Tổng là tổng Riemann của $\lVert\mathbf r&apos;\rVert$ (như bài 06_02, nơi đây là trường hợp $\mathbf r(t)=(t,f(t))$).&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Ví dụ 3.&lt;/strong&gt; Đường xoắn $(\cos t,\sin t,t)$: $\lVert\mathbf r&apos;\rVert=\sqrt{\sin^2t+\cos^2t+1}=\sqrt2$. Một vòng ($0\le t\le2\pi$) dài $2\pi\sqrt2\approx8.886$, đúng bằng đường chéo của hình chữ nhật $2\pi\times2\pi$ khi “trải phẳng” mặt trụ.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Ví dụ 4 (Cycloid).&lt;/strong&gt; $\mathbf r&apos;=(1-\cos t,\sin t)$, $\lVert\mathbf r&apos;\rVert=\sqrt{2-2\cos t}=2\left\lvert\sin\tfrac t2\right\rvert$. Một vòm ($0\le t\le2\pi$) dài $\int_0^{2\pi}2\sin\tfrac t2\,dt=8$: gấp 4 lần đường kính bánh xe.&lt;/p&gt;
&lt;/div&gt;

&lt;p&gt;&lt;strong&gt;Tham số hoá theo độ dài cung.&lt;/strong&gt; Đặt $s(t)=\int_a^t\lVert\mathbf r&apos;(u)\rVert\,du$. Vì $s&apos;(t)=\lVert\mathbf r&apos;(t)\rVert&amp;gt;0$, có thể đổi biến sang $s$; khi đó $\left\lVert\tfrac{d\mathbf r}{ds}\right\rVert=1$: đi với tốc độ đơn vị. Với đường xoắn: $s=\sqrt2\,t$, nên $\mathbf r(s)=\left(\cos\tfrac s{\sqrt2},\sin\tfrac s{\sqrt2},\tfrac s{\sqrt2}\right)$. Tham số này dùng để định nghĩa độ cong ở bài 09_06.&lt;/p&gt;

&lt;div class=&quot;interactive-frame&quot;&gt;
  &lt;div class=&quot;interactive-frame-head&quot;&gt;
    &lt;div class=&quot;interactive-frame-title&quot;&gt;Đường cong tham số&lt;/div&gt;
    &lt;div class=&quot;interactive-frame-desc&quot;&gt;Cho t chạy: vectơ tiếp tuyến, độ dài cung và đường tròn mật tiếp.&lt;/div&gt;
  &lt;/div&gt;
  &lt;iframe src=&quot;/interactives/chapter09/parametric-curve.html&quot; title=&quot;Đường cong tham số&quot; loading=&quot;lazy&quot; style=&quot;height: 720px;&quot;&gt;&lt;/iframe&gt;
  &lt;div class=&quot;interactive-frame-foot&quot;&gt;
    &lt;a href=&quot;/interactives/chapter09/parametric-curve.html&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;Mở minh hoạ ở cửa sổ riêng&lt;/a&gt;
  &lt;/div&gt;
&lt;/div&gt;

&lt;h2 id=&quot;ứng-dụng&quot;&gt;Ứng dụng&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Robot: cánh tay hai khớp.&lt;/strong&gt; Cánh tay có hai đoạn dài $L_1,L_2$ và hai góc khớp $\theta_1,\theta_2$. Đầu tay ở&lt;/p&gt;

\[\mathbf p=\big(L_1\cos\theta_1+L_2\cos(\theta_1+\theta_2),\ L_1\sin\theta_1+L_2\sin(\theta_1+\theta_2)\big).\]

&lt;p&gt;Cho các góc thay đổi theo thời gian, đầu tay vẽ một đường cong tham số; vận tốc $\mathbf p&apos;(t)$ cho biết robot cần quay khớp nhanh thế nào. Theo định lý cosin, $\lVert\mathbf p\rVert^2=L_1^2+L_2^2+2L_1L_2\cos\theta_2$, nên vùng với tới là hình vành khăn $\vert L_1-L_2\vert \le\lVert\mathbf p\rVert\le L_1+L_2$.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Đồ hoạ: đường cong Bézier.&lt;/strong&gt; Phông chữ và công cụ vẽ vectơ dùng đường Bézier bậc ba $\mathbf B(t)=(1-t)^3\mathbf P_0+3(1-t)^2t\,\mathbf P_1+3(1-t)t^2\mathbf P_2+t^3\mathbf P_3$, $t\in[0,1]$. Ta có $\mathbf B&apos;(0)=3(\mathbf P_1-\mathbf P_0)$: điểm điều khiển $\mathbf P_1$ quyết định hướng tiếp tuyến tại đầu, đó là “tay nắm” bạn kéo trong phần mềm thiết kế.&lt;/p&gt;

&lt;h2 id=&quot;bài-tập&quot;&gt;Bài tập&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Cơ bản.&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;Tìm tiếp tuyến của $(t^2,t^3)$ tại $t=1$.&lt;/li&gt;
  &lt;li&gt;Tìm vectơ tiếp tuyến đơn vị của $(e^t\cos t,e^t\sin t)$ tại $t=0$.&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Đáp án&lt;/summary&gt;

  &lt;ol&gt;
    &lt;li&gt;Điểm $(1,1)$, $\mathbf r&apos;=(2,3)$: $(1,1)+s(2,3)$, độ dốc $\tfrac32$.&lt;/li&gt;
    &lt;li&gt;$\mathbf r&apos;=e^t(\cos t-\sin t,\sin t+\cos t)=(1,1)$ tại 0; vectơ đơn vị $\tfrac1{\sqrt2}(1,1)$.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;p&gt;&lt;strong&gt;Trung bình.&lt;/strong&gt;&lt;/p&gt;

&lt;ol start=&quot;3&quot;&gt;
  &lt;li&gt;Tính độ dài của $(t,t^{3/2})$, $0\le t\le4$.&lt;/li&gt;
  &lt;li&gt;Tính độ dài của $(e^t\cos t,e^t\sin t)$, $0\le t\le1$ (đường xoắn ốc logarit).&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Đáp án&lt;/summary&gt;

  &lt;ol start=&quot;3&quot;&gt;
    &lt;li&gt;$\int_0^4\sqrt{1+\tfrac94t}\,dt=\tfrac8{27}\left(10^{3/2}-1\right)\approx9.073$.&lt;/li&gt;
    &lt;li&gt;$\lVert\mathbf r&apos;\rVert=\sqrt2\,e^t$, độ dài $\sqrt2(e-1)\approx2.430$.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;p&gt;&lt;strong&gt;Nâng cao.&lt;/strong&gt;&lt;/p&gt;

&lt;ol start=&quot;5&quot;&gt;
  &lt;li&gt;Tính độ dài của đường astroid $(\cos^3t,\sin^3t)$, $0\le t\le2\pi$.&lt;/li&gt;
  &lt;li&gt;Chứng minh rằng nếu $\lVert\mathbf r(t)\rVert$ không đổi thì $\mathbf r&apos;(t)\perp\mathbf r(t)$. Giải thích bằng hình học.&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Gợi ý&lt;/summary&gt;

  &lt;ol start=&quot;5&quot;&gt;
    &lt;li&gt;$\lVert\mathbf r&apos;\rVert=3\vert \cos t\sin t\vert $; trên $[0,\tfrac\pi2]$ tích phân bằng $\tfrac32$, nhân 4: độ dài 6.&lt;/li&gt;
    &lt;li&gt;Đạo hàm $\mathbf r\cdot\mathbf r=c$: $2\,\mathbf r\cdot\mathbf r&apos;=0$. Đường cong nằm trên mặt cầu, nên tiếp tuyến vuông góc với bán kính.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;h2 id=&quot;tóm-tắt&quot;&gt;Tóm tắt&lt;/h2&gt;

&lt;div class=&quot;content-box summary-box textbook-block&quot;&gt;
  &lt;ul&gt;
    &lt;li&gt;Đường cong tham số $\mathbf r(t)=(x(t),y(t),z(t))$; đạo hàm theo từng toạ độ.&lt;/li&gt;
    &lt;li&gt;$\mathbf r&apos;(t)$ là vectơ tiếp tuyến (vận tốc); tiếp tuyến $\mathbf r(t_0)+s\mathbf r&apos;(t_0)$; độ dốc phẳng $\tfrac{y&apos;}{x&apos;}$.&lt;/li&gt;
    &lt;li&gt;Độ dài cung $\int_a^b\lVert\mathbf r&apos;(t)\rVert\,dt$; đường xoắn $2\pi\sqrt2$ mỗi vòng, vòm cycloid dài 8.&lt;/li&gt;
    &lt;li&gt;Theo độ dài cung, $\lVert d\mathbf r/ds\rVert=1$.&lt;/li&gt;
  &lt;/ul&gt;
&lt;/div&gt;
</content>
 </entry>
 
 <entry>
   <title>Đường thẳng và mặt phẳng</title>
   <link href="https://calculus-self-learning.pages.dev/contents/vi/chapter09/09_02_Duong_thang_va_mat_phang/"/>
   <updated>2026-12-01T00:00:00+00:00</updated>
   <id>https://calculus-self-learning.pages.dev/contents/vi/chapter09/09_02_Duong_thang_va_mat_phang</id>
   <content type="html">&lt;div class=&quot;textbook-objectives&quot;&gt;

  &lt;p&gt;&lt;strong&gt;Mục tiêu.&lt;/strong&gt; Sau bài này bạn có thể:&lt;/p&gt;

  &lt;ul&gt;
    &lt;li&gt;viết phương trình tham số của đường thẳng qua một điểm theo một hướng;&lt;/li&gt;
    &lt;li&gt;viết phương trình mặt phẳng qua một điểm với vectơ pháp tuyến, hoặc qua ba điểm;&lt;/li&gt;
    &lt;li&gt;tìm giao điểm đường thẳng với mặt phẳng và góc giữa hai mặt phẳng;&lt;/li&gt;
    &lt;li&gt;tính khoảng cách từ điểm đến mặt phẳng và giữa hai đường thẳng chéo nhau.&lt;/li&gt;
  &lt;/ul&gt;

&lt;/div&gt;

&lt;h2 id=&quot;vì-sao-cần-bài-này&quot;&gt;Vì sao cần bài này&lt;/h2&gt;

&lt;p&gt;Đường thẳng và mặt phẳng là các vật “tuyến tính” của không gian. Chúng là xấp xỉ bậc một của đường cong và mặt cong: tiếp tuyến (bài 09_03) và mặt phẳng tiếp xúc (chương 10). Trong học máy, một bộ phân loại tuyến tính chính là một mặt phẳng (siêu phẳng) chia đôi không gian dữ liệu.&lt;/p&gt;

&lt;h2 id=&quot;đường-thẳng&quot;&gt;Đường thẳng&lt;/h2&gt;

&lt;div class=&quot;textbook-definition&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Định nghĩa.&lt;/strong&gt; Đường thẳng qua điểm $P_0$ (vectơ vị trí $\mathbf r_0$) với vectơ chỉ phương $\mathbf d\ne\mathbf 0$ là tập các điểm&lt;/p&gt;

\[\mathbf r(t)=\mathbf r_0+t\,\mathbf d,\qquad t\in\mathbb R,\]

  &lt;p&gt;tức $x=x_0+td_1$, $y=y_0+td_2$, $z=z_0+td_3$.&lt;/p&gt;
&lt;/div&gt;

&lt;p&gt;Có thể hiểu $t$ là thời gian: một hạt xuất phát tại $P_0$ và chuyển động thẳng đều với vận tốc $\mathbf d$.&lt;/p&gt;

&lt;h2 id=&quot;mặt-phẳng&quot;&gt;Mặt phẳng&lt;/h2&gt;

&lt;div class=&quot;textbook-definition&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Định nghĩa.&lt;/strong&gt; Mặt phẳng qua $P_0$ với vectơ pháp tuyến $\mathbf n=(a,b,c)\ne\mathbf 0$ là tập các điểm $P$ sao cho $\overrightarrow{P_0P}\perp\mathbf n$:&lt;/p&gt;

\[\mathbf n\cdot(\mathbf r-\mathbf r_0)=0\iff ax+by+cz=d,\qquad d=\mathbf n\cdot\mathbf r_0 .\]

&lt;/div&gt;

&lt;p&gt;Qua ba điểm không thẳng hàng $A,B,C$: lấy $\mathbf n=\overrightarrow{AB}\times\overrightarrow{AC}$ (bài 09_01).&lt;/p&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Ví dụ 1.&lt;/strong&gt; Mặt phẳng qua $A(1,0,0)$, $B(0,2,0)$, $C(0,0,3)$: $\mathbf n=(-1,2,0)\times(-1,0,3)=(6,3,2)$, nên $6x+3y+2z=6$ (thay $A$ để tìm $d$). Chia cho 6: $\tfrac x1+\tfrac y2+\tfrac z3=1$, dạng “đoạn chắn” đọc ngay ba giao điểm với các trục.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Ví dụ 2 (Giao điểm).&lt;/strong&gt; Đường thẳng qua gốc với hướng $(1,2,3)$: $\mathbf r(t)=(t,2t,3t)$. Thay vào $6x+3y+2z=6$: $6t+6t+6t=6$, $t=\tfrac13$. Giao điểm $\left(\tfrac13,\tfrac23,1\right)$.&lt;/p&gt;
&lt;/div&gt;

&lt;p&gt;&lt;strong&gt;Góc giữa hai mặt phẳng&lt;/strong&gt; là góc giữa hai pháp tuyến (lấy góc nhọn): $\cos\varphi=\tfrac{\vert \mathbf n_1\cdot\mathbf n_2\vert }{\lVert\mathbf n_1\rVert\lVert\mathbf n_2\rVert}$. Mặt phẳng ở ví dụ 1 và mặt $z=0$ (pháp tuyến $\mathbf k$): $\cos\varphi=\tfrac27$, $\varphi\approx73.4^\circ$.&lt;/p&gt;

&lt;h2 id=&quot;khoảng-cách&quot;&gt;Khoảng cách&lt;/h2&gt;

&lt;div class=&quot;textbook-theorem&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Định lý 1.&lt;/strong&gt; Khoảng cách từ điểm $Q(x_1,y_1,z_1)$ đến mặt phẳng $ax+by+cz=d$ là&lt;/p&gt;

\[\operatorname{dist}=\frac{|ax_1+by_1+cz_1-d|}{\sqrt{a^2+b^2+c^2}}.\]

&lt;/div&gt;

&lt;div class=&quot;textbook-proof&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Chứng minh.&lt;/strong&gt; Lấy $P_0$ bất kỳ trên mặt phẳng. Khoảng cách là độ dài hình chiếu của $\overrightarrow{P_0Q}$ lên pháp tuyến: $\dfrac{\vert \mathbf n\cdot(\mathbf q-\mathbf r_0)\vert }{\lVert\mathbf n\rVert}$. Mà $\mathbf n\cdot\mathbf q-\mathbf n\cdot\mathbf r_0=ax_1+by_1+cz_1-d$.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Ví dụ 3.&lt;/strong&gt; Từ gốc đến $6x+3y+2z=6$: $\tfrac6{\sqrt{49}}=\tfrac67$. Từ $(1,1,1)$: $\tfrac{\vert 6+3+2-6\vert }7=\tfrac57$.&lt;/p&gt;
&lt;/div&gt;

&lt;p&gt;&lt;strong&gt;Hai đường thẳng chéo nhau&lt;/strong&gt; $\mathbf r=\mathbf a+t\mathbf u$ và $\mathbf r=\mathbf b+s\mathbf v$ (không song song): vectơ $\mathbf n=\mathbf u\times\mathbf v$ vuông góc với cả hai, nên khoảng cách là $\dfrac{\vert (\mathbf b-\mathbf a)\cdot(\mathbf u\times\mathbf v)\vert }{\lVert\mathbf u\times\mathbf v\rVert}$; bằng 0 khi hai đường cắt nhau.&lt;/p&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Ví dụ 4.&lt;/strong&gt; $L_1:(1,0,0)+t(1,1,0)$, $L_2:(0,0,2)+s(0,1,1)$. $\mathbf u\times\mathbf v=(1,-1,1)$, $\mathbf b-\mathbf a=(-1,0,2)$, tích vô hướng $1$. Khoảng cách $\tfrac1{\sqrt3}\approx0.577$.&lt;/p&gt;
&lt;/div&gt;

&lt;h2 id=&quot;ứng-dụng&quot;&gt;Ứng dụng&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Đồ hoạ 3D: chiếu sáng.&lt;/strong&gt; Mỗi mặt tam giác của mô hình 3D có pháp tuyến $\mathbf n=\overrightarrow{AB}\times\overrightarrow{AC}$ (thứ tự đỉnh quyết định mặt nào là “mặt ngoài”). Theo mô hình Lambert, độ sáng tỉ lệ với $\max(0,\hat{\mathbf n}\cdot\hat{\mathbf l})$, với $\hat{\mathbf l}$ là hướng tới nguồn sáng.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Học máy: máy vectơ hỗ trợ (SVM).&lt;/strong&gt; Bộ phân loại tuyến tính dùng siêu phẳng $\mathbf w\cdot\mathbf x+b=0$. Theo định lý 1 (trong $\mathbb R^n$), khoảng cách từ điểm dữ liệu $\mathbf x$ đến siêu phẳng là $\tfrac{\vert \mathbf w\cdot\mathbf x+b\vert }{\lVert\mathbf w\rVert}$. Với chuẩn hoá $\vert \mathbf w\cdot\mathbf x+b\vert =1$ tại các điểm gần nhất, lề bằng $\tfrac2{\lVert\mathbf w\rVert}$; SVM cực đại hoá lề bằng cách cực tiểu hoá $\lVert\mathbf w\rVert$.&lt;/p&gt;

&lt;h2 id=&quot;bài-tập&quot;&gt;Bài tập&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Cơ bản.&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;Viết phương trình tham số của đường thẳng qua $A(1,2,3)$ và $B(3,1,0)$.&lt;/li&gt;
  &lt;li&gt;Viết phương trình mặt phẳng qua $(1,-1,2)$ vuông góc với $(2,1,-1)$.&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Đáp án&lt;/summary&gt;

  &lt;ol&gt;
    &lt;li&gt;$(1,2,3)+t(2,-1,-3)$.&lt;/li&gt;
    &lt;li&gt;$2x+y-z=-1$.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;p&gt;&lt;strong&gt;Trung bình.&lt;/strong&gt;&lt;/p&gt;

&lt;ol start=&quot;3&quot;&gt;
  &lt;li&gt;Tìm giao tuyến của hai mặt phẳng $x+y+z=1$ và $x-y=0$.&lt;/li&gt;
  &lt;li&gt;Tìm khoảng cách giữa hai mặt phẳng song song $x+2y+2z=3$ và $x+2y+2z=12$.&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Đáp án&lt;/summary&gt;

  &lt;ol start=&quot;3&quot;&gt;
    &lt;li&gt;Hướng $(1,1,1)\times(1,-1,0)=(1,1,-2)$; một điểm chung $(0,0,1)$. Giao tuyến $(0,0,1)+t(1,1,-2)$.&lt;/li&gt;
    &lt;li&gt;Lấy $(3,0,0)$ trên mặt thứ nhất: $\tfrac{\vert 3-12\vert }3=3$.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;p&gt;&lt;strong&gt;Nâng cao.&lt;/strong&gt;&lt;/p&gt;

&lt;ol start=&quot;5&quot;&gt;
  &lt;li&gt;Tìm điểm trên mặt phẳng $6x+3y+2z=6$ gần gốc toạ độ nhất.&lt;/li&gt;
  &lt;li&gt;Chứng minh rằng bốn điểm $A,B,C,D$ đồng phẳng khi và chỉ khi $\overrightarrow{AD}\cdot(\overrightarrow{AB}\times\overrightarrow{AC})=0$, và kiểm tra cho $(1,0,0)$, $(0,2,0)$, $(0,0,3)$, $\left(\tfrac13,\tfrac23,1\right)$.&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Gợi ý&lt;/summary&gt;

  &lt;ol start=&quot;5&quot;&gt;
    &lt;li&gt;Đi từ gốc theo pháp tuyến: $t(6,3,2)$ với $49t=6$. Điểm $\tfrac6{49}(6,3,2)$, cách gốc $\tfrac67$.&lt;/li&gt;
    &lt;li&gt;Thể tích hình hộp bằng 0. Với các điểm đã cho: $\overrightarrow{AD}=\left(-\tfrac23,\tfrac23,1\right)$, nhân vô hướng với $(6,3,2)$: $-4+2+2=0$.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;h2 id=&quot;tóm-tắt&quot;&gt;Tóm tắt&lt;/h2&gt;

&lt;div class=&quot;content-box summary-box textbook-block&quot;&gt;
  &lt;ul&gt;
    &lt;li&gt;Đường thẳng: $\mathbf r=\mathbf r_0+t\mathbf d$. Mặt phẳng: $\mathbf n\cdot(\mathbf r-\mathbf r_0)=0$, tức $ax+by+cz=d$.&lt;/li&gt;
    &lt;li&gt;Pháp tuyến qua ba điểm: $\overrightarrow{AB}\times\overrightarrow{AC}$.&lt;/li&gt;
    &lt;li&gt;Khoảng cách điểm đến mặt phẳng: $\tfrac{\vert ax_1+by_1+cz_1-d\vert }{\sqrt{a^2+b^2+c^2}}$; giữa hai đường chéo nhau: $\tfrac{\vert (\mathbf b-\mathbf a)\cdot(\mathbf u\times\mathbf v)\vert }{\lVert\mathbf u\times\mathbf v\rVert}$.&lt;/li&gt;
    &lt;li&gt;Ứng dụng: chiếu sáng trong đồ hoạ, lề của SVM.&lt;/li&gt;
  &lt;/ul&gt;
&lt;/div&gt;
</content>
 </entry>
 
 <entry>
   <title>Vectơ trong R² và R³</title>
   <link href="https://calculus-self-learning.pages.dev/contents/vi/chapter09/09_01_Vecto_trong_R2_va_R3/"/>
   <updated>2026-12-01T00:00:00+00:00</updated>
   <id>https://calculus-self-learning.pages.dev/contents/vi/chapter09/09_01_Vecto_trong_R2_va_R3</id>
   <content type="html">&lt;div class=&quot;textbook-objectives&quot;&gt;

  &lt;p&gt;&lt;strong&gt;Mục tiêu.&lt;/strong&gt; Sau bài này bạn có thể:&lt;/p&gt;

  &lt;ul&gt;
    &lt;li&gt;cộng vectơ, nhân với số, tính độ dài;&lt;/li&gt;
    &lt;li&gt;tính tích vô hướng, góc giữa hai vectơ và hình chiếu;&lt;/li&gt;
    &lt;li&gt;tính tích có hướng và dùng nó để tìm diện tích và vectơ pháp tuyến;&lt;/li&gt;
    &lt;li&gt;tính thể tích hình hộp bằng tích hỗn tạp.&lt;/li&gt;
  &lt;/ul&gt;

&lt;/div&gt;

&lt;h2 id=&quot;vì-sao-cần-bài-này&quot;&gt;Vì sao cần bài này&lt;/h2&gt;

&lt;p&gt;Từ chương này, giải tích bước sang nhiều chiều. Vị trí, vận tốc, lực, gradient đều là vectơ. Hai phép nhân của bài này trả lời hai câu hỏi hình học cơ bản: hai hướng “giống nhau” đến mức nào (tích vô hướng), và chúng “quét” ra diện tích bao nhiêu (tích có hướng).&lt;/p&gt;

&lt;h2 id=&quot;vectơ-và-độ-dài&quot;&gt;Vectơ và độ dài&lt;/h2&gt;

&lt;p&gt;Vectơ trong $\mathbb R^3$ là bộ ba $\mathbf u=(u_1,u_2,u_3)$, hình dung như mũi tên từ gốc đến điểm $(u_1,u_2,u_3)$. Cộng và nhân với số làm theo từng toạ độ. &lt;strong&gt;Độ dài&lt;/strong&gt; $\lVert\mathbf u\rVert=\sqrt{u_1^2+u_2^2+u_3^2}$ (định lý Pythagore hai lần). Vectơ đơn vị theo hướng $\mathbf u$ là $\tfrac{\mathbf u}{\lVert\mathbf u\rVert}$. Các vectơ cơ sở $\mathbf i=(1,0,0)$, $\mathbf j=(0,1,0)$, $\mathbf k=(0,0,1)$.&lt;/p&gt;

&lt;h2 id=&quot;tích-vô-hướng&quot;&gt;Tích vô hướng&lt;/h2&gt;

&lt;div class=&quot;textbook-definition&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Định nghĩa.&lt;/strong&gt; $\mathbf u\cdot\mathbf v=u_1v_1+u_2v_2+u_3v_3$.&lt;/p&gt;
&lt;/div&gt;

&lt;p&gt;Tính chất: đối xứng, tuyến tính theo từng biến, $\mathbf u\cdot\mathbf u=\lVert\mathbf u\rVert^2$.&lt;/p&gt;

&lt;div class=&quot;textbook-theorem&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Định lý 1.&lt;/strong&gt; Nếu $\theta\in[0,\pi]$ là góc giữa hai vectơ khác $\mathbf 0$ thì $\mathbf u\cdot\mathbf v=\lVert\mathbf u\rVert\,\lVert\mathbf v\rVert\cos\theta$. Đặc biệt $\mathbf u\perp\mathbf v$ khi và chỉ khi $\mathbf u\cdot\mathbf v=0$.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-proof&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Chứng minh.&lt;/strong&gt; Tam giác có hai cạnh $\mathbf u$, $\mathbf v$ và cạnh thứ ba $\mathbf u-\mathbf v$. Định lý cosin: $\lVert\mathbf u-\mathbf v\rVert^2=\lVert\mathbf u\rVert^2+\lVert\mathbf v\rVert^2-2\lVert\mathbf u\rVert\lVert\mathbf v\rVert\cos\theta$. Khai triển vế trái bằng tích vô hướng: $\lVert\mathbf u\rVert^2-2\,\mathbf u\cdot\mathbf v+\lVert\mathbf v\rVert^2$. So sánh hai vế.&lt;/p&gt;
&lt;/div&gt;

&lt;p&gt;Hệ quả: bất đẳng thức Cauchy–Schwarz $\vert \mathbf u\cdot\mathbf v\vert \le\lVert\mathbf u\rVert\lVert\mathbf v\rVert$.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Hình chiếu.&lt;/strong&gt; Hình chiếu của $\mathbf v$ lên hướng $\mathbf u$ là&lt;/p&gt;

\[\operatorname{proj}_{\mathbf u}\mathbf v=\frac{\mathbf u\cdot\mathbf v}{\lVert\mathbf u\rVert^2}\,\mathbf u,\]

&lt;p&gt;và $\mathbf v-\operatorname{proj}_{\mathbf u}\mathbf v$ vuông góc với $\mathbf u$.&lt;/p&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Ví dụ 1.&lt;/strong&gt; $\mathbf u=(1,2,2)$, $\mathbf v=(2,-1,2)$. Ta có $\mathbf u\cdot\mathbf v=2-2+4=4$, $\lVert\mathbf u\rVert=\lVert\mathbf v\rVert=3$, nên $\cos\theta=\tfrac49$, $\theta\approx63.6^\circ$. Hình chiếu $\operatorname{proj}_{\mathbf u}\mathbf v=\tfrac49(1,2,2)$.&lt;/p&gt;
&lt;/div&gt;

&lt;h2 id=&quot;tích-có-hướng&quot;&gt;Tích có hướng&lt;/h2&gt;

&lt;div class=&quot;textbook-definition&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Định nghĩa.&lt;/strong&gt; Với $\mathbf u,\mathbf v\in\mathbb R^3$,&lt;/p&gt;

\[\mathbf u\times\mathbf v=\begin{vmatrix}\mathbf i&amp;amp;\mathbf j&amp;amp;\mathbf k\\u_1&amp;amp;u_2&amp;amp;u_3\\v_1&amp;amp;v_2&amp;amp;v_3\end{vmatrix}=(u_2v_3-u_3v_2,\ u_3v_1-u_1v_3,\ u_1v_2-u_2v_1).\]

&lt;/div&gt;

&lt;div class=&quot;textbook-theorem&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Định lý 2.&lt;/strong&gt; (a) $\mathbf u\times\mathbf v$ vuông góc với cả $\mathbf u$ và $\mathbf v$, theo quy tắc bàn tay phải. (b) $\lVert\mathbf u\times\mathbf v\rVert=\lVert\mathbf u\rVert\lVert\mathbf v\rVert\sin\theta$, bằng diện tích hình bình hành dựng trên $\mathbf u$, $\mathbf v$. (c) $\mathbf v\times\mathbf u=-\mathbf u\times\mathbf v$; $\mathbf u\times\mathbf v=\mathbf 0$ khi và chỉ khi hai vectơ cùng phương.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-proof&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Chứng minh.&lt;/strong&gt; (a) Tính trực tiếp: $\mathbf u\cdot(\mathbf u\times\mathbf v)=u_1(u_2v_3-u_3v_2)+u_2(u_3v_1-u_1v_3)+u_3(u_1v_2-u_2v_1)=0$. (b) Khai triển cho đẳng thức Lagrange $\lVert\mathbf u\times\mathbf v\rVert^2=\lVert\mathbf u\rVert^2\lVert\mathbf v\rVert^2-(\mathbf u\cdot\mathbf v)^2=\lVert\mathbf u\rVert^2\lVert\mathbf v\rVert^2(1-\cos^2\theta)$. Diện tích hình bình hành là đáy $\lVert\mathbf u\rVert$ nhân chiều cao $\lVert\mathbf v\rVert\sin\theta$. (c) Đổi chỗ hai hàng của định thức đổi dấu.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Ví dụ 2.&lt;/strong&gt; Với $\mathbf u,\mathbf v$ ở ví dụ 1: $\mathbf u\times\mathbf v=(2\cdot2-2\cdot(-1),\ 2\cdot2-1\cdot2,\ 1\cdot(-1)-2\cdot2)=(6,2,-5)$. Kiểm tra: $(6,2,-5)\cdot(1,2,2)=0$. Diện tích hình bình hành $\sqrt{65}\approx8.06$; tam giác dựng trên hai vectơ có diện tích một nửa.&lt;/p&gt;
&lt;/div&gt;

&lt;p&gt;&lt;strong&gt;Tích hỗn tạp.&lt;/strong&gt; $\mathbf w\cdot(\mathbf u\times\mathbf v)=\det[\mathbf u;\mathbf v;\mathbf w]$, trị tuyệt đối bằng thể tích hình hộp dựng trên ba vectơ (đáy $\lVert\mathbf u\times\mathbf v\rVert$ nhân chiều cao là hình chiếu của $\mathbf w$ lên pháp tuyến). Bằng 0 khi ba vectơ đồng phẳng.&lt;/p&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Ví dụ 3.&lt;/strong&gt; Với $\mathbf w=(1,0,1)$: $\mathbf w\cdot(6,2,-5)=1$. Hình hộp dựng trên $\mathbf u,\mathbf v,\mathbf w$ có thể tích 1.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;interactive-frame&quot;&gt;
  &lt;div class=&quot;interactive-frame-head&quot;&gt;
    &lt;div class=&quot;interactive-frame-title&quot;&gt;Tích vô hướng và tích có hướng&lt;/div&gt;
    &lt;div class=&quot;interactive-frame-desc&quot;&gt;Kéo hai vectơ; xem góc, hình chiếu và diện tích hình bình hành.&lt;/div&gt;
  &lt;/div&gt;
  &lt;iframe src=&quot;/interactives/chapter09/dot-cross.html&quot; title=&quot;Tích vô hướng và tích có hướng&quot; loading=&quot;lazy&quot; style=&quot;height: 720px;&quot;&gt;&lt;/iframe&gt;
  &lt;div class=&quot;interactive-frame-foot&quot;&gt;
    &lt;a href=&quot;/interactives/chapter09/dot-cross.html&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;Mở minh hoạ ở cửa sổ riêng&lt;/a&gt;
  &lt;/div&gt;
&lt;/div&gt;

&lt;h2 id=&quot;video-ngắn&quot;&gt;Video ngắn&lt;/h2&gt;

&lt;div class=&quot;reel-video&quot;&gt;
  &lt;video controls=&quot;&quot; playsinline=&quot;&quot; preload=&quot;metadata&quot; src=&quot;/public/videos/reels/cross-product-right-hand.mp4&quot;&gt;&lt;/video&gt;
  &lt;p class=&quot;reel-caption&quot;&gt;Tích có hướng và bàn tay phải: hình bình hành dựng bởi u và v, vectơ u × v vuông góc với cả hai, độ dài bằng diện tích; đổi thứ tự thì đổi chiều, góc thay đổi thì diện tích thay đổi theo |u||v| sin θ; nghiêng v khỏi mặt phẳng, thể tích hộp |(u × v) · w|, công thức theo thành phần kèm ví dụ, mômen lực trên cờ lê và diện tích tam giác trong không gian (video không lời, khoảng 3 phút 2 giây).&lt;/p&gt;
&lt;/div&gt;

&lt;h2 id=&quot;ứng-dụng&quot;&gt;Ứng dụng&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Vật lý: công và mômen lực.&lt;/strong&gt; Lực không đổi $\mathbf F$ dời vật theo $\mathbf d$ sinh công $W=\mathbf F\cdot\mathbf d$: chỉ thành phần lực theo hướng chuyển động có tác dụng. Mômen của lực $\mathbf F$ đặt tại điểm có vectơ vị trí $\mathbf r$ là $\boldsymbol\tau=\mathbf r\times\mathbf F$; vì thế cờ lê dài giúp vặn dễ hơn.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Học máy: độ tương tự cosin.&lt;/strong&gt; Văn bản hoặc câu được biểu diễn bằng vectơ nhúng (embedding). Độ tương tự $\cos\theta=\tfrac{\mathbf u\cdot\mathbf v}{\lVert\mathbf u\rVert\lVert\mathbf v\rVert}$ đo hai vectơ cùng hướng đến đâu, không phụ thuộc độ dài; đây là phép đo chuẩn trong tìm kiếm ngữ nghĩa.&lt;/p&gt;

&lt;h2 id=&quot;bài-tập&quot;&gt;Bài tập&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Cơ bản.&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;Cho $\mathbf u=(3,0,4)$, $\mathbf v=(1,1,1)$. Tính $\lVert\mathbf u\rVert$, $\mathbf u\cdot\mathbf v$ và góc giữa hai vectơ.&lt;/li&gt;
  &lt;li&gt;Tính $\mathbf i\times\mathbf j$, $\mathbf j\times\mathbf k$, $\mathbf k\times\mathbf i$.&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Đáp án&lt;/summary&gt;

  &lt;ol&gt;
    &lt;li&gt;$5$; $7$; $\cos\theta=\tfrac7{5\sqrt3}\approx0.808$, $\theta\approx36.1^\circ$.&lt;/li&gt;
    &lt;li&gt;$\mathbf k$, $\mathbf i$, $\mathbf j$.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;p&gt;&lt;strong&gt;Trung bình.&lt;/strong&gt;&lt;/p&gt;

&lt;ol start=&quot;3&quot;&gt;
  &lt;li&gt;Tính diện tích tam giác có đỉnh $A(1,0,0)$, $B(0,2,0)$, $C(0,0,3)$.&lt;/li&gt;
  &lt;li&gt;Tìm $t$ để $(1,t,2)$ vuông góc với $(3,-1,t)$.&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Đáp án&lt;/summary&gt;

  &lt;ol start=&quot;3&quot;&gt;
    &lt;li&gt;$\overrightarrow{AB}\times\overrightarrow{AC}=(-1,2,0)\times(-1,0,3)=(6,3,2)$, độ dài 7, diện tích $\tfrac72$.&lt;/li&gt;
    &lt;li&gt;$3-t+2t=0$, $t=-3$.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;p&gt;&lt;strong&gt;Nâng cao.&lt;/strong&gt;&lt;/p&gt;

&lt;ol start=&quot;5&quot;&gt;
  &lt;li&gt;Chứng minh $\lVert\mathbf u+\mathbf v\rVert\le\lVert\mathbf u\rVert+\lVert\mathbf v\rVert$ từ bất đẳng thức Cauchy–Schwarz.&lt;/li&gt;
  &lt;li&gt;Chứng minh $\mathbf u\times(\mathbf v\times\mathbf w)=(\mathbf u\cdot\mathbf w)\mathbf v-(\mathbf u\cdot\mathbf v)\mathbf w$ khi $\mathbf v=\mathbf i$, $\mathbf w=\mathbf j$, rồi giải thích vì sao trường hợp tổng quát suy ra bằng tuyến tính.&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Gợi ý&lt;/summary&gt;

  &lt;ol start=&quot;5&quot;&gt;
    &lt;li&gt;$\lVert\mathbf u+\mathbf v\rVert^2=\lVert\mathbf u\rVert^2+2\,\mathbf u\cdot\mathbf v+\lVert\mathbf v\rVert^2\le(\lVert\mathbf u\rVert+\lVert\mathbf v\rVert)^2$.&lt;/li&gt;
    &lt;li&gt;$\mathbf i\times\mathbf j=\mathbf k$, $\mathbf u\times\mathbf k=(u_2,-u_1,0)=u_2\mathbf i-u_1\mathbf j$, khớp vế phải. Hai vế tuyến tính theo $\mathbf v$ và theo $\mathbf w$, nên chỉ cần kiểm tra trên các cặp vectơ cơ sở.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;h2 id=&quot;tóm-tắt&quot;&gt;Tóm tắt&lt;/h2&gt;

&lt;div class=&quot;content-box summary-box textbook-block&quot;&gt;
  &lt;ul&gt;
    &lt;li&gt;$\mathbf u\cdot\mathbf v=\sum u_iv_i=\lVert\mathbf u\rVert\lVert\mathbf v\rVert\cos\theta$; bằng 0 khi vuông góc; $\operatorname{proj}_{\mathbf u}\mathbf v=\tfrac{\mathbf u\cdot\mathbf v}{\lVert\mathbf u\rVert^2}\mathbf u$.&lt;/li&gt;
    &lt;li&gt;$\mathbf u\times\mathbf v$ vuông góc với cả hai, độ dài là diện tích hình bình hành, đổi dấu khi đổi chỗ.&lt;/li&gt;
    &lt;li&gt;$\vert \mathbf w\cdot(\mathbf u\times\mathbf v)\vert $ là thể tích hình hộp.&lt;/li&gt;
    &lt;li&gt;Ứng dụng: công, mômen lực, độ tương tự cosin.&lt;/li&gt;
  &lt;/ul&gt;
&lt;/div&gt;
</content>
 </entry>
 
 <entry>
   <title>Xấp xỉ trong tính toán</title>
   <link href="https://calculus-self-learning.pages.dev/contents/vi/chapter08/08_06_Xap_xi_trong_tinh_toan/"/>
   <updated>2026-12-01T00:00:00+00:00</updated>
   <id>https://calculus-self-learning.pages.dev/contents/vi/chapter08/08_06_Xap_xi_trong_tinh_toan</id>
   <content type="html">&lt;div class=&quot;textbook-objectives&quot;&gt;

  &lt;p&gt;&lt;strong&gt;Mục tiêu.&lt;/strong&gt; Sau bài này bạn có thể:&lt;/p&gt;

  &lt;ul&gt;
    &lt;li&gt;giải thích các bước một thư viện số dùng để tính $e^x$, $\sin x$;&lt;/li&gt;
    &lt;li&gt;tính đa thức bằng sơ đồ Horner;&lt;/li&gt;
    &lt;li&gt;phân biệt sai số chặt cụt (do cắt chuỗi) và sai số làm tròn (do số dấu phẩy động);&lt;/li&gt;
    &lt;li&gt;chọn bước $h$ hợp lý cho đạo hàm số, và nhận ra, tránh hiện tượng triệt tiêu thảm hoạ.&lt;/li&gt;
  &lt;/ul&gt;

&lt;/div&gt;

&lt;h2 id=&quot;vì-sao-cần-bài-này&quot;&gt;Vì sao cần bài này&lt;/h2&gt;

&lt;p&gt;Các bài trước cho ta chuỗi hội tụ đến đúng giá trị. Nhưng máy tính chỉ cộng được hữu hạn số hạng, và mỗi phép tính lại làm tròn đến khoảng 16 chữ số. Hiểu hai nguồn sai số này giúp tránh những lỗi rất thật: một mô hình học máy ra &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;NaN&lt;/code&gt;, một đạo hàm số sai hoàn toàn, một nghiệm phương trình bậc hai sai 25%.&lt;/p&gt;

&lt;h2 id=&quot;máy-tính-tính-ex-như-thế-nào&quot;&gt;Máy tính tính $e^x$ như thế nào&lt;/h2&gt;

&lt;p&gt;Cắt chuỗi $\sum\tfrac{x^n}{n!}$ trực tiếp là không tốt khi $\vert x\vert $ lớn: cần nhiều số hạng, và các số hạng lớn gây sai số. Các thư viện làm ba bước.&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;&lt;strong&gt;Thu gọn khoảng.&lt;/strong&gt; Viết $x=k\ln2+r$ với $k$ nguyên và $\vert r\vert \le\tfrac{\ln2}2\approx0.347$. Khi đó $e^x=2^k e^r$, và nhân với $2^k$ trong hệ nhị phân chỉ là cộng vào số mũ.&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Đa thức trên khoảng nhỏ.&lt;/strong&gt; Trên $\vert r\vert \le0.347$, đa thức Taylor bậc 11 có sai số không quá $\tfrac{e^{0.347}\,0.347^{12}}{12!}\approx9\times10^{-15}$, gần độ chính xác của máy. (Thư viện thực tế dùng đa thức “minimax” bậc thấp hơn một chút, sai số đều trên cả khoảng.)&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Sơ đồ Horner.&lt;/strong&gt; Tính $p(r)=c_0+c_1r+\cdots+c_nr^n$ dưới dạng $c_0+r(c_1+r(c_2+\cdots+r\,c_n))$: chỉ $n$ phép nhân và $n$ phép cộng.&lt;/li&gt;
&lt;/ol&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Ví dụ 1.&lt;/strong&gt; $x=10$: $k=\operatorname{round}(10/\ln2)=14$, $r=10-14\ln2=0.29594$. Đa thức Taylor bậc 11 của $e^r$ nhân với $2^{14}=16384$ cho $22026.4657948067$, khớp $e^{10}$ đến 15 chữ số.&lt;/p&gt;
&lt;/div&gt;

&lt;p&gt;Với $\sin x$, thu gọn theo $\tfrac\pi2$: $x=k\tfrac\pi2+r$ với $\vert r\vert \le\tfrac\pi4$, rồi dùng $\pm\sin r$ hoặc $\pm\cos r$ tuỳ $k$ chia 4 dư mấy.&lt;/p&gt;

&lt;h2 id=&quot;số-dấu-phẩy-động-và-sai-số-làm-tròn&quot;&gt;Số dấu phẩy động và sai số làm tròn&lt;/h2&gt;

&lt;p&gt;Số &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;double&lt;/code&gt; (IEEE 754) có dạng $\pm1.b_1b_2\dots b_{52}\times2^e$. Khoảng cách từ 1 đến số &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;double&lt;/code&gt; kế tiếp là &lt;strong&gt;epsilon máy&lt;/strong&gt; $\varepsilon=2^{-52}\approx2.2\times10^{-16}$. Mỗi phép tính cho kết quả đúng sau khi làm tròn, với sai số tương đối không quá $\tfrac\varepsilon2$.&lt;/p&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Ví dụ 2.&lt;/strong&gt; Trong Python, &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;0.1 + 0.2&lt;/code&gt; cho &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;0.30000000000000004&lt;/code&gt;, vì $0.1$ không biểu diễn chính xác được trong hệ nhị phân. Còn &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;1e16 + 1 - 1e16&lt;/code&gt; cho &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;0.0&lt;/code&gt;: ở độ lớn $10^{16}$ các số &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;double&lt;/code&gt; cách nhau 2, nên số 1 bị “nuốt mất”. Với &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;float16&lt;/code&gt; (dùng khi huấn luyện mạng nơ-ron), $\varepsilon\approx9.8\times10^{-4}$, nên $1+0.0004$ làm tròn thành 1.&lt;/p&gt;
&lt;/div&gt;

&lt;h2 id=&quot;sai-số-chặt-cụt-và-sai-số-làm-tròn-cùng-lúc&quot;&gt;Sai số chặt cụt và sai số làm tròn cùng lúc&lt;/h2&gt;

&lt;p&gt;Đạo hàm số $D(h)=\tfrac{f(x+h)-f(x)}h$ có hai sai số.&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;strong&gt;Chặt cụt:&lt;/strong&gt; theo Taylor, $D(h)-f&apos;(x)=\tfrac h2f&apos;&apos;(c)$, giảm khi $h$ nhỏ.&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Làm tròn:&lt;/strong&gt; $f(x+h)$ và $f(x)$ mỗi số sai khoảng $\varepsilon\vert f(x)\vert $, chia cho $h$ nên sai cỡ $\tfrac{2\varepsilon\vert f(x)\vert }h$, tăng khi $h$ nhỏ.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Tổng $E(h)\approx\tfrac h2\vert f&apos;&apos;\vert +\tfrac{2\varepsilon\vert f\vert }h$ nhỏ nhất khi $h=2\sqrt{\varepsilon\vert f\vert /\vert f&apos;&apos;\vert }$, cỡ $\sqrt\varepsilon\approx10^{-8}$.&lt;/p&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Ví dụ 3.&lt;/strong&gt; Với $f=e^x$ tại $x=1$, sai số của $D(h)$ so với $e$:&lt;/p&gt;

  &lt;table&gt;
    &lt;thead&gt;
      &lt;tr&gt;
        &lt;th&gt;$h$&lt;/th&gt;
        &lt;th&gt;$10^{-4}$&lt;/th&gt;
        &lt;th&gt;$10^{-6}$&lt;/th&gt;
        &lt;th&gt;$10^{-8}$&lt;/th&gt;
        &lt;th&gt;$10^{-10}$&lt;/th&gt;
        &lt;th&gt;$10^{-12}$&lt;/th&gt;
      &lt;/tr&gt;
    &lt;/thead&gt;
    &lt;tbody&gt;
      &lt;tr&gt;
        &lt;td&gt;sai số&lt;/td&gt;
        &lt;td&gt;$1.4\times10^{-4}$&lt;/td&gt;
        &lt;td&gt;$1.4\times10^{-6}$&lt;/td&gt;
        &lt;td&gt;$6.6\times10^{-9}$&lt;/td&gt;
        &lt;td&gt;$1.5\times10^{-6}$&lt;/td&gt;
        &lt;td&gt;$4.3\times10^{-4}$&lt;/td&gt;
      &lt;/tr&gt;
    &lt;/tbody&gt;
  &lt;/table&gt;

  &lt;p&gt;Giảm $h$ dưới $10^{-8}$ làm kết quả &lt;strong&gt;tệ hơn&lt;/strong&gt;.&lt;/p&gt;
&lt;/div&gt;

&lt;h2 id=&quot;triệt-tiêu-thảm-hoạ&quot;&gt;Triệt tiêu thảm hoạ&lt;/h2&gt;

&lt;p&gt;Trừ hai số gần bằng nhau làm mất các chữ số đúng ở đầu, chỉ còn lại phần “nhiễu” làm tròn. Khắc phục: biến đổi công thức trước khi tính, thường nhờ khai triển Taylor hoặc đẳng thức đại số.&lt;/p&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Ví dụ 4.&lt;/strong&gt;&lt;/p&gt;

  &lt;ul&gt;
    &lt;li&gt;$1-\cos x$ với $x=10^{-8}$: máy cho $0$, vì $\cos x$ làm tròn thành 1. Dùng $2\sin^2\tfrac x2$ (hoặc $\tfrac{x^2}2$ theo Taylor) cho đúng $5\times10^{-17}$.&lt;/li&gt;
    &lt;li&gt;$\ln(1+x)$ và $e^x-1$ với $x=10^{-10}$: công thức trực tiếp sai ở chữ số thứ 8. Các hàm &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;log1p&lt;/code&gt; và &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;expm1&lt;/code&gt; dùng khai triển Taylor cho $x$ nhỏ và cho kết quả đúng.&lt;/li&gt;
    &lt;li&gt;Nghiệm nhỏ của $x^2-10^8x+1=0$: công thức $\tfrac{b-\sqrt{b^2-4}}2$ cho $7.45\times10^{-9}$, sai 25%. Viết lại $\tfrac{2}{b+\sqrt{b^2-4}}$ cho đúng $10^{-8}$.&lt;/li&gt;
    &lt;li&gt;$e^{-20}$ bằng chuỗi $\sum\tfrac{(-20)^n}{n!}$: các số hạng lên đến khoảng $4\times10^7$ rồi triệt tiêu nhau, kết quả $7.2\times10^{-10}$, sai gấp 3 lần. Tính $\tfrac1{e^{20}}$ (chuỗi toàn số dương) cho đúng $2.061\times10^{-9}$.&lt;/li&gt;
  &lt;/ul&gt;
&lt;/div&gt;

&lt;h2 id=&quot;ứng-dụng&quot;&gt;Ứng dụng&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Học máy: thủ thuật log-sum-exp.&lt;/strong&gt; Hàm softmax cần $\log\sum_ie^{x_i}$. Với $x_i=1000$, $e^{1000}$ tràn số thành vô cùng. Đặt $m=\max x_i$ và dùng $\log\sum e^{x_i}=m+\log\sum e^{x_i-m}$: mọi số mũ $\le0$, không tràn. Tương tự, hàm mất mát cross-entropy trong các thư viện được tính bằng &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;log1p&lt;/code&gt;, &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;logsumexp&lt;/code&gt; thay vì công thức thẳng.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Kỹ thuật: huấn luyện với độ chính xác thấp.&lt;/strong&gt; Huấn luyện bằng &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;float16&lt;/code&gt;/&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;bfloat16&lt;/code&gt; nhanh hơn và tốn ít bộ nhớ, nhưng $\varepsilon$ lớn làm các cập nhật nhỏ bị nuốt mất (ví dụ 2). Vì thế người ta giữ bản sao trọng số ở &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;float32&lt;/code&gt; và nhân hệ số cho hàm mất mát (loss scaling).&lt;/p&gt;

&lt;h2 id=&quot;bài-tập&quot;&gt;Bài tập&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Cơ bản.&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;Viết $p(x)=2x^3-3x^2+4x-5$ theo sơ đồ Horner và tính $p(2)$.&lt;/li&gt;
  &lt;li&gt;Với $x=10^{-5}$, vì sao $\sqrt{1+x}-1$ kém chính xác? Viết lại công thức.&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Đáp án&lt;/summary&gt;

  &lt;ol&gt;
    &lt;li&gt;$-5+x(4+x(-3+2x))$; $p(2)=-5+2(4+2\cdot1)=7$.&lt;/li&gt;
    &lt;li&gt;Trừ hai số gần bằng 1. Viết $\tfrac{x}{\sqrt{1+x}+1}\approx\tfrac x2$.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;p&gt;&lt;strong&gt;Trung bình.&lt;/strong&gt;&lt;/p&gt;

&lt;ol start=&quot;3&quot;&gt;
  &lt;li&gt;Với đạo hàm trung tâm $\tfrac{f(x+h)-f(x-h)}{2h}$, sai số chặt cụt là $\tfrac{h^2}6f&apos;&apos;&apos;(c)$. Tìm $h$ tối ưu cỡ bao nhiêu.&lt;/li&gt;
  &lt;li&gt;Để tính $\sin x$ với $\vert x\vert \le\tfrac\pi4$ chính xác đến $10^{-16}$ bằng đa thức Taylor, cần bậc bao nhiêu?&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Đáp án&lt;/summary&gt;

  &lt;ol start=&quot;3&quot;&gt;
    &lt;li&gt;Cân bằng $h^2$ với $\tfrac\varepsilon h$: $h\sim\varepsilon^{1/3}\approx6\times10^{-6}$, sai số cỡ $\varepsilon^{2/3}\approx4\times10^{-11}$.&lt;/li&gt;
    &lt;li&gt;Cần $\tfrac{(\pi/4)^{n+1}}{(n+1)!}&amp;lt;10^{-16}$. Vì $T_{15}=T_{16}$ (chỉ có lũy thừa lẻ), sai số của $T_{15}$ không quá $\tfrac{(\pi/4)^{17}}{17!}\approx4.6\times10^{-17}$. Đa thức bậc 15 là đủ.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;p&gt;&lt;strong&gt;Nâng cao.&lt;/strong&gt;&lt;/p&gt;

&lt;ol start=&quot;5&quot;&gt;
  &lt;li&gt;Vì sao &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;math.exp(-20)&lt;/code&gt; của Python cho kết quả đúng trong khi chuỗi trực tiếp thì sai? Giải thích bằng các bước của mục “Máy tính tính $e^x$”.&lt;/li&gt;
  &lt;li&gt;Phương sai mẫu tính theo $\tfrac1n\sum x_i^2-\bar x^2$ cho $0$ thay vì $\tfrac23$ khi dữ liệu là $10^9+1,\ 10^9+2,\ 10^9+3$ (với dữ liệu khác có thể ra số âm). Giải thích, và đề xuất cách tính ổn định.&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Gợi ý&lt;/summary&gt;

  &lt;ol start=&quot;5&quot;&gt;
    &lt;li&gt;Thu gọn khoảng: $-20=-29\ln2+r$ với $\vert r\vert $ nhỏ, chuỗi của $e^r$ không có triệt tiêu, rồi nhân $2^{-29}$ chính xác.&lt;/li&gt;
    &lt;li&gt;Hai số cỡ $10^{18}$ gần bằng nhau bị trừ, mất hết chữ số đúng. Trừ trung bình trước: $\tfrac1n\sum(x_i-\bar x)^2$, hoặc dùng thuật toán Welford.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;h2 id=&quot;tóm-tắt&quot;&gt;Tóm tắt&lt;/h2&gt;

&lt;div class=&quot;content-box summary-box textbook-block&quot;&gt;
  &lt;ul&gt;
    &lt;li&gt;Thư viện tính $e^x$, $\sin x$ bằng thu gọn khoảng, đa thức trên khoảng nhỏ và sơ đồ Horner.&lt;/li&gt;
    &lt;li&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;double&lt;/code&gt; có $\varepsilon=2^{-52}\approx2.2\times10^{-16}$; mỗi phép tính sai tương đối tối đa $\tfrac\varepsilon2$.&lt;/li&gt;
    &lt;li&gt;Sai số chặt cụt giảm khi $h$ nhỏ, sai số làm tròn tăng; đạo hàm số tốt nhất khi $h\sim\sqrt\varepsilon$.&lt;/li&gt;
    &lt;li&gt;Tránh trừ hai số gần bằng nhau: biến đổi công thức, dùng &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;log1p&lt;/code&gt;, &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;expm1&lt;/code&gt;, log-sum-exp.&lt;/li&gt;
  &lt;/ul&gt;
&lt;/div&gt;
</content>
 </entry>
 
 <entry>
   <title>Hội tụ đều và chuỗi Fourier (giới thiệu)</title>
   <link href="https://calculus-self-learning.pages.dev/contents/vi/chapter08/08_05_Hoi_tu_deu_va_chuoi_Fourier/"/>
   <updated>2026-12-01T00:00:00+00:00</updated>
   <id>https://calculus-self-learning.pages.dev/contents/vi/chapter08/08_05_Hoi_tu_deu_va_chuoi_Fourier</id>
   <content type="html">&lt;div class=&quot;textbook-objectives&quot;&gt;

  &lt;p&gt;&lt;strong&gt;Mục tiêu.&lt;/strong&gt; Sau bài này bạn có thể:&lt;/p&gt;

  &lt;ul&gt;
    &lt;li&gt;phân biệt hội tụ từng điểm và hội tụ đều của dãy hàm;&lt;/li&gt;
    &lt;li&gt;dùng tiêu chuẩn Weierstrass (tiêu chuẩn M) để chứng minh chuỗi hàm hội tụ đều;&lt;/li&gt;
    &lt;li&gt;biết hội tụ đều cho phép đổi chỗ giới hạn với liên tục và tích phân;&lt;/li&gt;
    &lt;li&gt;tính hệ số Fourier của sóng vuông và giải thích hiện tượng Gibbs.&lt;/li&gt;
  &lt;/ul&gt;

&lt;/div&gt;

&lt;h2 id=&quot;vì-sao-cần-bài-này&quot;&gt;Vì sao cần bài này&lt;/h2&gt;

&lt;p&gt;Ở bài 08_04 ta đã đổi chỗ “tích phân” và “tổng vô hạn”. Phép đổi chỗ này không phải lúc nào cũng đúng. Bài này cho điều kiện an toàn, hội tụ đều, rồi giới thiệu một loại chuỗi hàm thứ hai rất quan trọng: chuỗi Fourier, biểu diễn một hàm tuần hoàn bằng tổng các sóng $\sin$, $\cos$.&lt;/p&gt;

&lt;h2 id=&quot;hội-tụ-từng-điểm-và-hội-tụ-đều&quot;&gt;Hội tụ từng điểm và hội tụ đều&lt;/h2&gt;

&lt;div class=&quot;textbook-definition&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Định nghĩa.&lt;/strong&gt; Dãy hàm $f_n$ trên tập $I$:&lt;/p&gt;

  &lt;p&gt;&lt;strong&gt;Hội tụ từng điểm&lt;/strong&gt; về $f$ nếu với mỗi $x\in I$, $f_n(x)\to f(x)$.&lt;/p&gt;

  &lt;p&gt;&lt;strong&gt;Hội tụ đều&lt;/strong&gt; về $f$ nếu $\displaystyle\sup_{x\in I}\vert f_n(x)-f(x)\vert \to0$, tức là với mọi $\varepsilon&amp;gt;0$ có $N$ (không phụ thuộc $x$) sao cho $\vert f_n(x)-f(x)\vert &amp;lt;\varepsilon$ với mọi $n\ge N$ và mọi $x\in I$.&lt;/p&gt;
&lt;/div&gt;

&lt;p&gt;Hình ảnh: hội tụ đều nghĩa là khi $n$ lớn, cả đồ thị $f_n$ nằm trong một “ống” bề rộng $2\varepsilon$ quanh đồ thị $f$.&lt;/p&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Ví dụ 1.&lt;/strong&gt; $f_n(x)=x^n$ trên $[0,1]$ hội tụ từng điểm về $f(x)=0$ khi $x&amp;lt;1$ và $f(1)=1$. Hàm giới hạn &lt;strong&gt;không liên tục&lt;/strong&gt;, dù mọi $f_n$ liên tục. Sự hội tụ không đều: $\sup_{[0,1)}x^n=1$ với mọi $n$. Trên $[0,0.9]$ thì hội tụ đều về 0, vì $\sup=0.9^n\to0$.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Ví dụ 2 (Tích phân không đổi chỗ được).&lt;/strong&gt; $f_n(x)=nxe^{-nx^2}$ trên $[0,1]$ hội tụ từng điểm về 0, nhưng $\int_0^1f_n\,dx=\tfrac{1-e^{-n}}2\to\tfrac12\ne0$. Đỉnh của $f_n$ cao $\sqrt{n/2}\,e^{-1/2}$, ngày càng nhọn và cao.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-theorem&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Định lý 1.&lt;/strong&gt; Nếu $f_n\to f$ đều trên $[a,b]$ và mọi $f_n$ liên tục thì $f$ liên tục và $\displaystyle\int_a^bf_n\,dx\to\int_a^bf\,dx$.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-proof&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Chứng minh.&lt;/strong&gt; &lt;em&gt;Liên tục.&lt;/em&gt; Cho $\varepsilon&amp;gt;0$, chọn $n$ với $\sup\vert f_n-f\vert &amp;lt;\tfrac\varepsilon3$. Vì $f_n$ liên tục tại $x_0$, có $\delta$ để $\vert f_n(x)-f_n(x_0)\vert &amp;lt;\tfrac\varepsilon3$ khi $\vert x-x_0\vert &amp;lt;\delta$. Khi đó&lt;/p&gt;

\[|f(x)-f(x_0)|\le|f(x)-f_n(x)|+|f_n(x)-f_n(x_0)|+|f_n(x_0)-f(x_0)|&amp;lt;\varepsilon .\]

  &lt;p&gt;&lt;em&gt;Tích phân.&lt;/em&gt; $\left\lvert\int_a^b(f_n-f)\right\rvert\le(b-a)\sup\vert f_n-f\vert \to0$.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-theorem&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Định lý 2 (Tiêu chuẩn Weierstrass).&lt;/strong&gt; Nếu $\vert u_n(x)\vert \le M_n$ với mọi $x\in I$ và $\sum M_n$ hội tụ thì $\sum u_n(x)$ hội tụ đều (và tuyệt đối) trên $I$.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-proof&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Chứng minh.&lt;/strong&gt; Chuỗi hội tụ tuyệt đối tại mỗi $x$ theo tiêu chuẩn so sánh. Phần dư thoả $\left\lvert\sum_{n&amp;gt;N}u_n(x)\right\rvert\le\sum_{n&amp;gt;N}M_n$, một số không phụ thuộc $x$ và dần về 0.&lt;/p&gt;
&lt;/div&gt;

&lt;p&gt;&lt;strong&gt;Hệ quả cho chuỗi lũy thừa.&lt;/strong&gt; Nếu $\sum c_nx^n$ có bán kính $R$ và $0&amp;lt;r&amp;lt;R$, thì trên $[-r,r]$ ta có $\vert c_nx^n\vert \le\vert c_n\vert r^n=M_n$ và $\sum M_n$ hội tụ. Vậy chuỗi lũy thừa hội tụ đều trên mọi đoạn con nằm trong khoảng hội tụ: đây là lý do các phép tính của bài 08_04 hợp lệ.&lt;/p&gt;

&lt;h2 id=&quot;chuỗi-fourier-của-sóng-vuông&quot;&gt;Chuỗi Fourier của sóng vuông&lt;/h2&gt;

&lt;p&gt;Một hàm tuần hoàn chu kỳ $2\pi$ có thể viết (với điều kiện thích hợp) thành&lt;/p&gt;

\[f(x)=\frac{a_0}2+\sum_{n=1}^\infty\big(a_n\cos nx+b_n\sin nx\big),\qquad a_n=\frac1\pi\int_{-\pi}^{\pi}f(x)\cos nx\,dx,\quad b_n=\frac1\pi\int_{-\pi}^{\pi}f(x)\sin nx\,dx .\]

&lt;p&gt;Các công thức hệ số đến từ tính trực giao: $\int_{-\pi}^{\pi}\sin mx\sin nx\,dx=0$ khi $m\ne n$ và bằng $\pi$ khi $m=n$ (tương tự cho $\cos$, và $\int\sin mx\cos nx=0$). Nhân hai vế với $\sin nx$ rồi tích phân, chỉ số hạng thứ $n$ còn lại.&lt;/p&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Ví dụ 3 (Sóng vuông).&lt;/strong&gt; Cho $f(x)=-1$ trên $(-\pi,0)$, $f(x)=1$ trên $(0,\pi)$, lặp lại tuần hoàn. Hàm lẻ nên $a_n=0$, và&lt;/p&gt;

\[b_n=\frac2\pi\int_0^\pi\sin nx\,dx=\frac{2}{n\pi}(1-\cos n\pi)=\begin{cases}\dfrac4{n\pi}&amp;amp;n\text{ lẻ}\\0&amp;amp;n\text{ chẵn.}\end{cases}\]

  &lt;p&gt;Vậy&lt;/p&gt;

\[f(x)=\frac4\pi\left(\sin x+\frac{\sin3x}3+\frac{\sin5x}5+\cdots\right).\]

  &lt;p&gt;Tại $x=\tfrac\pi2$: $1=\tfrac4\pi\left(1-\tfrac13+\tfrac15-\cdots\right)$, lại thu được chuỗi Leibniz $\tfrac\pi4$ của bài 08_04.&lt;/p&gt;
&lt;/div&gt;

&lt;p&gt;&lt;strong&gt;Hiện tượng Gibbs.&lt;/strong&gt; Mỗi tổng riêng là hàm liên tục, còn sóng vuông nhảy tại $x=0$. Theo định lý 1, chuỗi không thể hội tụ đều trên một khoảng chứa điểm nhảy. Điều thấy được trên đồ thị: gần điểm nhảy, tổng riêng luôn vọt lên khoảng $1.179$ (vượt khoảng $9\%$ của bước nhảy 2), dù lấy bao nhiêu số hạng. Chỗ vọt chỉ hẹp lại, không thấp đi. (Tính số với 50 số hạng lẻ cho giá trị cực đại $1.1790$.)&lt;/p&gt;

&lt;div class=&quot;interactive-frame&quot;&gt;
  &lt;div class=&quot;interactive-frame-head&quot;&gt;
    &lt;div class=&quot;interactive-frame-title&quot;&gt;Tổng riêng Fourier và hiện tượng Gibbs&lt;/div&gt;
    &lt;div class=&quot;interactive-frame-desc&quot;&gt;Tăng số hài; so sóng vuông (hội tụ không đều) với sóng tam giác (hội tụ đều).&lt;/div&gt;
  &lt;/div&gt;
  &lt;iframe src=&quot;/interactives/chapter08/fourier-partial-sums.html&quot; title=&quot;Tổng riêng Fourier và hiện tượng Gibbs&quot; loading=&quot;lazy&quot; style=&quot;height: 720px;&quot;&gt;&lt;/iframe&gt;
  &lt;div class=&quot;interactive-frame-foot&quot;&gt;
    &lt;a href=&quot;/interactives/chapter08/fourier-partial-sums.html&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;Mở minh hoạ ở cửa sổ riêng&lt;/a&gt;
  &lt;/div&gt;
&lt;/div&gt;

&lt;h2 id=&quot;ứng-dụng&quot;&gt;Ứng dụng&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Âm thanh và tín hiệu.&lt;/strong&gt; Một nốt nhạc là tổng của tần số cơ bản và các hoạ âm $2f,3f,\dots$; hệ số Fourier quyết định âm sắc. Sóng vuông chỉ có hoạ âm lẻ với biên độ $\tfrac1n$, nghe “rè” như tiếng clarinet. Bộ lọc thông thấp bỏ các hoạ âm cao, tức cắt chuỗi Fourier.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Học máy: mã hoá vị trí.&lt;/strong&gt; Transformer mã hoá vị trí $p$ của một từ bằng vectơ $\big(\sin(\omega_kp),\cos(\omega_kp)\big)_k$ với nhiều tần số $\omega_k$, cùng ý tưởng như chuỗi Fourier: các tần số khác nhau mô tả vị trí ở các thang độ khác nhau.&lt;/p&gt;

&lt;h2 id=&quot;bài-tập&quot;&gt;Bài tập&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Cơ bản.&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;Dãy $f_n(x)=\tfrac{x}{n}$ có hội tụ đều trên $[0,1]$ không? Trên $\mathbb R$?&lt;/li&gt;
  &lt;li&gt;Chứng minh $\sum\dfrac{\sin nx}{n^2}$ hội tụ đều trên $\mathbb R$ và tổng là hàm liên tục.&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Đáp án&lt;/summary&gt;

  &lt;ol&gt;
    &lt;li&gt;Trên $[0,1]$: $\sup=\tfrac1n\to0$, đều. Trên $\mathbb R$: $\sup=\infty$, không đều (dù hội tụ từng điểm về 0).&lt;/li&gt;
    &lt;li&gt;Tiêu chuẩn Weierstrass với $M_n=\tfrac1{n^2}$; định lý 1.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;p&gt;&lt;strong&gt;Trung bình.&lt;/strong&gt;&lt;/p&gt;

&lt;ol start=&quot;3&quot;&gt;
  &lt;li&gt;Tìm chuỗi Fourier của $f(x)=x$ trên $(-\pi,\pi)$.&lt;/li&gt;
  &lt;li&gt;Dùng kết quả câu 3 tại $x=\tfrac\pi2$ để kiểm tra lại chuỗi Leibniz.&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Đáp án&lt;/summary&gt;

  &lt;ol start=&quot;3&quot;&gt;
    &lt;li&gt;$f$ lẻ, $b_n=\tfrac2\pi\int_0^\pi x\sin nx\,dx=\tfrac{2(-1)^{n+1}}n$. Vậy $x=2\left(\sin x-\tfrac{\sin2x}2+\tfrac{\sin3x}3-\cdots\right)$.&lt;/li&gt;
    &lt;li&gt;$\sin\tfrac{n\pi}2$ bằng $1,0,-1,0,\dots$: $\tfrac\pi2=2\left(1-\tfrac13+\tfrac15-\cdots\right)$.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;p&gt;&lt;strong&gt;Nâng cao.&lt;/strong&gt;&lt;/p&gt;

&lt;ol start=&quot;5&quot;&gt;
  &lt;li&gt;Đẳng thức Parseval cho $\tfrac1\pi\int_{-\pi}^{\pi}f^2=\tfrac{a_0^2}2+\sum(a_n^2+b_n^2)$. Áp dụng cho sóng vuông để tính $\sum\tfrac1{(2k+1)^2}$, rồi suy ra $\sum\tfrac1{n^2}=\tfrac{\pi^2}6$.&lt;/li&gt;
  &lt;li&gt;Chứng minh $\int_{-\pi}^{\pi}\sin mx\sin nx\,dx=0$ khi $m\ne n$ là số nguyên dương.&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Gợi ý&lt;/summary&gt;

  &lt;ol start=&quot;5&quot;&gt;
    &lt;li&gt;Vế trái bằng 2. Vế phải $\tfrac{16}{\pi^2}\sum\tfrac1{(2k+1)^2}$, nên $\sum\tfrac1{(2k+1)^2}=\tfrac{\pi^2}8$. Với $S=\sum\tfrac1{n^2}$: $S=\tfrac{\pi^2}8+\tfrac S4$, nên $S=\tfrac{\pi^2}6$.&lt;/li&gt;
    &lt;li&gt;$\sin mx\sin nx=\tfrac12\big(\cos(m-n)x-\cos(m+n)x\big)$, và $\int_{-\pi}^{\pi}\cos kx\,dx=0$ khi $k\ne0$.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;h2 id=&quot;tóm-tắt&quot;&gt;Tóm tắt&lt;/h2&gt;

&lt;div class=&quot;content-box summary-box textbook-block&quot;&gt;
  &lt;ul&gt;
    &lt;li&gt;Hội tụ đều: $\sup\vert f_n-f\vert \to0$; mạnh hơn hội tụ từng điểm.&lt;/li&gt;
    &lt;li&gt;Giới hạn đều của hàm liên tục là liên tục, và được đổi chỗ với tích phân.&lt;/li&gt;
    &lt;li&gt;Tiêu chuẩn Weierstrass: $\vert u_n\vert \le M_n$, $\sum M_n&amp;lt;\infty$ cho hội tụ đều; chuỗi lũy thừa hội tụ đều trên đoạn $[-r,r]$, $r&amp;lt;R$.&lt;/li&gt;
    &lt;li&gt;Sóng vuông $=\tfrac4\pi\sum_{n\text{ lẻ}}\tfrac{\sin nx}n$; gần điểm nhảy có hiện tượng Gibbs (vọt khoảng $9\%$).&lt;/li&gt;
  &lt;/ul&gt;
&lt;/div&gt;
</content>
 </entry>
 
 <entry>
   <title>Đạo hàm và tích phân từng số hạng</title>
   <link href="https://calculus-self-learning.pages.dev/contents/vi/chapter08/08_04_Dao_ham_va_tich_phan_tung_so_hang/"/>
   <updated>2026-12-01T00:00:00+00:00</updated>
   <id>https://calculus-self-learning.pages.dev/contents/vi/chapter08/08_04_Dao_ham_va_tich_phan_tung_so_hang</id>
   <content type="html">&lt;div class=&quot;textbook-objectives&quot;&gt;

  &lt;p&gt;&lt;strong&gt;Mục tiêu.&lt;/strong&gt; Sau bài này bạn có thể:&lt;/p&gt;

  &lt;ul&gt;
    &lt;li&gt;đạo hàm và tích phân chuỗi lũy thừa từng số hạng, biết bán kính hội tụ không đổi;&lt;/li&gt;
    &lt;li&gt;suy ra khai triển của $\ln(1+x)$ và $\arctan x$ từ chuỗi hình học;&lt;/li&gt;
    &lt;li&gt;tính gần đúng các tích phân không có nguyên hàm sơ cấp như $\int_0^1e^{-x^2}dx$;&lt;/li&gt;
    &lt;li&gt;tính tổng các chuỗi số như $\sum\tfrac n{2^n}$, $\sum\tfrac1{n2^n}$.&lt;/li&gt;
  &lt;/ul&gt;

&lt;/div&gt;

&lt;h2 id=&quot;vì-sao-cần-bài-này&quot;&gt;Vì sao cần bài này&lt;/h2&gt;

&lt;p&gt;Nguyên hàm của $e^{-x^2}$ (đường cong chuẩn trong thống kê) hay của $\tfrac{\sin x}x$ không viết được bằng hàm sơ cấp (bài 04_04). Nhưng khai triển của chúng thì có, và tích phân một chuỗi lũy thừa dễ như tích phân đa thức. Bài này cho phép làm điều đó một cách chặt chẽ.&lt;/p&gt;

&lt;h2 id=&quot;định-lý-chính&quot;&gt;Định lý chính&lt;/h2&gt;

&lt;div class=&quot;textbook-theorem&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Định lý 1.&lt;/strong&gt; Giả sử $f(x)=\sum_{n=0}^\infty c_n(x-a)^n$ có bán kính hội tụ $R&amp;gt;0$. Khi đó trên $(a-R,a+R)$:&lt;/p&gt;

  &lt;ol&gt;
    &lt;li&gt;$f$ khả vi và $f&apos;(x)=\sum_{n=1}^\infty nc_n(x-a)^{n-1}$;&lt;/li&gt;
    &lt;li&gt;$\displaystyle\int_a^xf(t)\,dt=\sum_{n=0}^\infty\frac{c_n}{n+1}(x-a)^{n+1}$;&lt;/li&gt;
  &lt;/ol&gt;

  &lt;p&gt;và cả hai chuỗi mới đều có bán kính hội tụ $R$.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-proof&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Ý chứng minh.&lt;/strong&gt; &lt;em&gt;Bán kính.&lt;/em&gt; Lấy $0&amp;lt;\vert x-a\vert &amp;lt;r&amp;lt;R$. Vì $\sum\vert c_n\vert r^n$ hội tụ nên $\vert c_n\vert r^n\le M$. Khi đó $\vert nc_n(x-a)^{n-1}\vert \le\tfrac Mr\,n\,q^{n-1}$ với $q=\tfrac{\vert x-a\vert }r&amp;lt;1$, và $\sum nq^{n-1}$ hội tụ (tiêu chuẩn tỉ số). Ngược lại, $\vert c_n(x-a)^n\vert \le\vert x-a\vert \cdot\vert nc_n(x-a)^{n-1}\vert $ khi $n\ge1$, nên chuỗi đạo hàm không thể hội tụ ở nơi chuỗi gốc phân kỳ. Lập luận tương tự cho chuỗi tích phân.&lt;/p&gt;

  &lt;p&gt;&lt;em&gt;Đạo hàm đúng bằng chuỗi đạo hàm.&lt;/em&gt; Cần đổi chỗ giới hạn và tổng vô hạn; điều này hợp lệ vì chuỗi lũy thừa hội tụ đều trên mọi đoạn $[a-r,a+r]$ với $r&amp;lt;R$ (bài 08_05). Từ đó tích phân từng số hạng là hợp lệ, và phần đạo hàm suy ra từ định lý cơ bản của giải tích áp dụng cho chuỗi đạo hàm.&lt;/p&gt;
&lt;/div&gt;

&lt;p&gt;Hệ quả: $f$ có đạo hàm mọi cấp và $c_n=\tfrac{f^{(n)}(a)}{n!}$. Vậy &lt;strong&gt;mọi chuỗi lũy thừa là chuỗi Taylor của tổng của nó&lt;/strong&gt;, và khai triển là duy nhất: dù tìm bằng cách nào, hệ số cũng như nhau.&lt;/p&gt;

&lt;h2 id=&quot;khai-triển-mới-từ-chuỗi-hình-học&quot;&gt;Khai triển mới từ chuỗi hình học&lt;/h2&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Ví dụ 1 ($\ln(1+x)$).&lt;/strong&gt; Với $\vert t\vert &amp;lt;1$, $\tfrac1{1+t}=\sum(-1)^nt^n$. Tích phân từ 0 đến $x$:&lt;/p&gt;

\[\ln(1+x)=\sum_{n=0}^\infty\frac{(-1)^nx^{n+1}}{n+1}=x-\frac{x^2}2+\frac{x^3}3-\cdots,\qquad|x|&amp;lt;1 .\]

  &lt;p&gt;Tại $x=1$ chuỗi hội tụ theo Leibniz, và định lý Abel (ta công nhận) cho biết tổng bằng giới hạn của hàm: $\ln2=1-\tfrac12+\tfrac13-\cdots$, đúng như bài 07_04.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Ví dụ 2 ($\arctan x$ và số $\pi$).&lt;/strong&gt; Tích phân $\tfrac1{1+t^2}=\sum(-1)^nt^{2n}$:&lt;/p&gt;

\[\arctan x=\sum_{n=0}^\infty\frac{(-1)^nx^{2n+1}}{2n+1}=x-\frac{x^3}3+\frac{x^5}5-\cdots,\qquad|x|\le1 .\]

  &lt;p&gt;Tại $x=1$: $\tfrac\pi4=1-\tfrac13+\tfrac15-\cdots$ (chuỗi Leibniz), nhưng 1000 số hạng chỉ cho $\pi\approx3.1406$. Công thức Machin $\tfrac\pi4=4\arctan\tfrac15-\arctan\tfrac1{239}$ hội tụ nhanh hơn nhiều: 5 số hạng cho $\arctan\tfrac15$ và 2 số hạng cho $\arctan\tfrac1{239}$ đã cho $\pi$ với sai số $3\times10^{-8}$. Các chương trình tính hàng nghìn tỉ chữ số của $\pi$ dùng ý tưởng cùng loại.&lt;/p&gt;
&lt;/div&gt;

&lt;h2 id=&quot;tích-phân-không-có-nguyên-hàm-sơ-cấp&quot;&gt;Tích phân không có nguyên hàm sơ cấp&lt;/h2&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Ví dụ 3.&lt;/strong&gt; Từ $e^{-x^2}=\sum\tfrac{(-1)^nx^{2n}}{n!}$:&lt;/p&gt;

\[\int_0^1e^{-x^2}dx=\sum_{n=0}^\infty\frac{(-1)^n}{n!\,(2n+1)}=1-\frac13+\frac1{10}-\frac1{42}+\frac1{216}-\frac1{1320}+\cdots\]

  &lt;p&gt;Sáu số hạng cho $0.746729$; chuỗi đan dấu nên sai số không quá $\tfrac1{6!\cdot13}=1.1\times10^{-4}$. Giá trị thật $0.746824$.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Ví dụ 4 (Tích phân sin).&lt;/strong&gt; $\displaystyle\int_0^1\frac{\sin x}x\,dx=\sum_{n=0}^\infty\frac{(-1)^n}{(2n+1)!\,(2n+1)}=1-\frac1{18}+\frac1{600}-\frac1{35280}+\cdots\approx0.946083 .$&lt;/p&gt;
&lt;/div&gt;

&lt;h2 id=&quot;tính-tổng-chuỗi-số&quot;&gt;Tính tổng chuỗi số&lt;/h2&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Ví dụ 5.&lt;/strong&gt; Đạo hàm $\sum_{n\ge0}x^n=\tfrac1{1-x}$ rồi nhân với $x$: $\sum_{n\ge1}nx^n=\dfrac x{(1-x)^2}$. Với $x=\tfrac12$: $\sum\tfrac n{2^n}=2$.&lt;/p&gt;

  &lt;p&gt;Thay $x=-\tfrac12$ vào $\ln(1+x)$ rồi đổi dấu: $\sum_{n\ge1}\dfrac1{n2^n}=-\ln\left(1-\tfrac12\right)=\ln2$.&lt;/p&gt;
&lt;/div&gt;

&lt;h2 id=&quot;ứng-dụng&quot;&gt;Ứng dụng&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Thống kê: hàm lỗi.&lt;/strong&gt; Xác suất để biến chuẩn tắc nằm trong $[-z,z]$ là $\operatorname{erf}(z/\sqrt2)$ với $\operatorname{erf}(x)=\tfrac2{\sqrt\pi}\int_0^xe^{-t^2}dt=\tfrac2{\sqrt\pi}\sum\tfrac{(-1)^nx^{2n+1}}{n!(2n+1)}$. Các thư viện số dùng chuỗi này khi $x$ nhỏ và khai triển tiệm cận khi $x$ lớn.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Xác suất: kỳ vọng của phân phối hình học.&lt;/strong&gt; Nếu mỗi lần thử thành công với xác suất $p$, số lần thử đến khi thành công $N$ có $P(N=n)=(1-p)^{n-1}p$. Kỳ vọng $\sum n(1-p)^{n-1}p=p\cdot\tfrac1{(1-(1-p))^2}=\tfrac1p$, nhờ đạo hàm chuỗi hình học. Ví dụ tung xúc xắc đến khi ra mặt 6: trung bình 6 lần.&lt;/p&gt;

&lt;h2 id=&quot;bài-tập&quot;&gt;Bài tập&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Cơ bản.&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;Từ $\tfrac1{1-x}=\sum x^n$, khai triển $\tfrac1{(1-x)^2}$ và $\tfrac1{(1-x)^3}$.&lt;/li&gt;
  &lt;li&gt;Khai triển $\int_0^x\cos(t^2)\,dt$ (tích phân Fresnel) đến bậc 9.&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Đáp án&lt;/summary&gt;

  &lt;ol&gt;
    &lt;li&gt;$\sum(n+1)x^n$; $\sum\tfrac{(n+1)(n+2)}2x^n$.&lt;/li&gt;
    &lt;li&gt;$x-\tfrac{x^5}{10}+\tfrac{x^9}{216}-\cdots$.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;p&gt;&lt;strong&gt;Trung bình.&lt;/strong&gt;&lt;/p&gt;

&lt;ol start=&quot;3&quot;&gt;
  &lt;li&gt;Tính $\sum_{n\ge1}\dfrac{n^2}{2^n}$.&lt;/li&gt;
  &lt;li&gt;Tính $\displaystyle\int_0^{0.5}\frac{dx}{1+x^4}$ với sai số dưới $10^{-4}$.&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Đáp án&lt;/summary&gt;

  &lt;ol start=&quot;3&quot;&gt;
    &lt;li&gt;Đạo hàm $\sum nx^n=\tfrac x{(1-x)^2}$ rồi nhân $x$: $\sum n^2x^n=\tfrac{x(1+x)}{(1-x)^3}$. Với $x=\tfrac12$: $6$.&lt;/li&gt;
    &lt;li&gt;$\sum(-1)^n\tfrac{0.5^{4n+1}}{4n+1}=0.5-0.00625+0.000217-\cdots\approx0.49397$; số hạng kế tiếp $\approx9.4\times10^{-6}$.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;p&gt;&lt;strong&gt;Nâng cao.&lt;/strong&gt;&lt;/p&gt;

&lt;ol start=&quot;5&quot;&gt;
  &lt;li&gt;Tìm hàm $f$ có khai triển $\sum_{n\ge0}\dfrac{x^{2n+1}}{2n+1}$ trên $(-1,1)$.&lt;/li&gt;
  &lt;li&gt;Chứng minh $y=\sum\tfrac{x^n}{n!}$ thoả $y&apos;=y$, $y(0)=1$, và suy ra $y=e^x$.&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Gợi ý&lt;/summary&gt;

  &lt;ol start=&quot;5&quot;&gt;
    &lt;li&gt;Đạo hàm cho $\sum x^{2n}=\tfrac1{1-x^2}$, nên $f(x)=\tfrac12\ln\tfrac{1+x}{1-x}=\operatorname{artanh}x$.&lt;/li&gt;
    &lt;li&gt;Đạo hàm từng số hạng cho lại chính chuỗi. Đặt $g=ye^{-x}$: $g&apos;=0$, $g(0)=1$.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;h2 id=&quot;tóm-tắt&quot;&gt;Tóm tắt&lt;/h2&gt;

&lt;div class=&quot;content-box summary-box textbook-block&quot;&gt;
  &lt;ul&gt;
    &lt;li&gt;Bên trong khoảng hội tụ, chuỗi lũy thừa được đạo hàm và tích phân từng số hạng; bán kính không đổi.&lt;/li&gt;
    &lt;li&gt;Mọi chuỗi lũy thừa là chuỗi Taylor của tổng của nó; khai triển là duy nhất.&lt;/li&gt;
    &lt;li&gt;Từ chuỗi hình học: $\ln(1+x)$, $\arctan x$, $\sum nx^n=\tfrac x{(1-x)^2}$.&lt;/li&gt;
    &lt;li&gt;Tích phân chuỗi cho giá trị của $\int e^{-x^2}$, $\int\tfrac{\sin x}x$ và hàm lỗi.&lt;/li&gt;
  &lt;/ul&gt;
&lt;/div&gt;
</content>
 </entry>
 
 <entry>
   <title>Khai triển Maclaurin của các hàm sơ cấp</title>
   <link href="https://calculus-self-learning.pages.dev/contents/vi/chapter08/08_03_Khai_trien_Maclaurin_cua_cac_ham_so_cap/"/>
   <updated>2026-12-01T00:00:00+00:00</updated>
   <id>https://calculus-self-learning.pages.dev/contents/vi/chapter08/08_03_Khai_trien_Maclaurin_cua_cac_ham_so_cap</id>
   <content type="html">&lt;div class=&quot;textbook-objectives&quot;&gt;

  &lt;p&gt;&lt;strong&gt;Mục tiêu.&lt;/strong&gt; Sau bài này bạn có thể:&lt;/p&gt;

  &lt;ul&gt;
    &lt;li&gt;viết chuỗi Taylor của một hàm và biết khi nào chuỗi hội tụ về đúng hàm đó;&lt;/li&gt;
    &lt;li&gt;nhớ và chứng minh khai triển của $e^x$, $\sin x$, $\cos x$, $\ln(1+x)$, $(1+x)^\alpha$;&lt;/li&gt;
    &lt;li&gt;kết hợp các khai triển có sẵn bằng thay biến, nhân và cộng;&lt;/li&gt;
    &lt;li&gt;dùng khai triển để tính giá trị gần đúng.&lt;/li&gt;
  &lt;/ul&gt;

&lt;/div&gt;

&lt;h2 id=&quot;vì-sao-cần-bài-này&quot;&gt;Vì sao cần bài này&lt;/h2&gt;

&lt;p&gt;Máy tính bỏ túi không “biết” $\sin$ hay $\ln$; nó chỉ cộng và nhân. Khai triển Maclaurin biến các hàm sơ cấp thành chuỗi lũy thừa, và năm khai triển trong bài này là bảng tra mà mọi kỹ sư dùng thường xuyên.&lt;/p&gt;

&lt;h2 id=&quot;chuỗi-taylor&quot;&gt;Chuỗi Taylor&lt;/h2&gt;

&lt;div class=&quot;textbook-definition&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Định nghĩa.&lt;/strong&gt; Nếu $f$ có đạo hàm mọi cấp tại $a$, &lt;strong&gt;chuỗi Taylor&lt;/strong&gt; của $f$ tại $a$ là $\displaystyle\sum_{n=0}^\infty\frac{f^{(n)}(a)}{n!}(x-a)^n$. Khi $a=0$ gọi là &lt;strong&gt;chuỗi Maclaurin&lt;/strong&gt;.&lt;/p&gt;
&lt;/div&gt;

&lt;p&gt;Chuỗi Taylor bằng $f(x)$ đúng khi phần dư $R_n(x)\to0$ (bài 08_01). Điều này không tự động đúng: hàm $f(x)=e^{-1/x^2}$ (với $f(0)=0$) có mọi đạo hàm tại 0 bằng 0, nên chuỗi Maclaurin của nó là chuỗi 0, khác $f$ tại mọi $x\ne0$.&lt;/p&gt;

&lt;div class=&quot;textbook-theorem&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Định lý 1.&lt;/strong&gt; Nếu có $M$ sao cho $\vert f^{(n)}(t)\vert \le M$ với mọi $n$ và mọi $t$ trong khoảng $I$ chứa $a$, thì chuỗi Taylor của $f$ hội tụ về $f(x)$ với mọi $x\in I$.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-proof&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Chứng minh.&lt;/strong&gt; Theo định lý 1 bài 08_01, $\vert R_n(x)\vert \le\dfrac{M\vert x-a\vert ^{n+1}}{(n+1)!}$. Với mọi số $r$, $\tfrac{r^{n}}{n!}\to0$ (đây là số hạng của chuỗi hội tụ $\sum\tfrac{r^n}{n!}$, bài 07_03). Vậy $R_n(x)\to0$.&lt;/p&gt;
&lt;/div&gt;

&lt;h2 id=&quot;năm-khai-triển-cơ-bản&quot;&gt;Năm khai triển cơ bản&lt;/h2&gt;

&lt;div class=&quot;content-box insight-box textbook-block&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Bảng khai triển Maclaurin.&lt;/strong&gt;&lt;/p&gt;

\[e^x=\sum_{n=0}^\infty\frac{x^n}{n!}=1+x+\frac{x^2}{2!}+\frac{x^3}{3!}+\cdots\qquad(x\in\mathbb R)\]

\[\sin x=\sum_{n=0}^\infty\frac{(-1)^nx^{2n+1}}{(2n+1)!}=x-\frac{x^3}{3!}+\frac{x^5}{5!}-\cdots\qquad(x\in\mathbb R)\]

\[\cos x=\sum_{n=0}^\infty\frac{(-1)^nx^{2n}}{(2n)!}=1-\frac{x^2}{2!}+\frac{x^4}{4!}-\cdots\qquad(x\in\mathbb R)\]

\[\ln(1+x)=\sum_{n=1}^\infty\frac{(-1)^{n+1}x^n}{n}=x-\frac{x^2}2+\frac{x^3}3-\cdots\qquad(-1&amp;lt;x\le1)\]

\[(1+x)^\alpha=\sum_{n=0}^\infty\binom\alpha nx^n=1+\alpha x+\frac{\alpha(\alpha-1)}{2!}x^2+\cdots\qquad(|x|&amp;lt;1)\]

  &lt;p&gt;với $\binom\alpha n=\dfrac{\alpha(\alpha-1)\cdots(\alpha-n+1)}{n!}$.&lt;/p&gt;
&lt;/div&gt;

&lt;p&gt;&lt;strong&gt;Lý do.&lt;/strong&gt; Với $e^x$: trên $[-r,r]$ mọi đạo hàm bị chặn bởi $e^r$, dùng định lý 1. Với $\sin$, $\cos$: mọi đạo hàm bị chặn bởi 1. Với $\ln(1+x)$: các đạo hàm $f^{(n)}(0)=(-1)^{n+1}(n-1)!$ cho các hệ số; chứng minh hội tụ về đúng hàm dễ nhất là tích phân chuỗi hình học, ở bài 08_04. Với $(1+x)^\alpha$: hệ số suy từ $f^{(n)}(0)=\alpha(\alpha-1)\cdots(\alpha-n+1)$; tỉ số hệ số $\tfrac{\alpha-n}{n+1}\to-1$ nên $R=1$ (khi $\alpha$ không phải số tự nhiên). Khi $\alpha$ là số tự nhiên, chuỗi dừng lại và ta được công thức nhị thức Newton.&lt;/p&gt;

&lt;div class=&quot;interactive-frame&quot;&gt;
  &lt;div class=&quot;interactive-frame-head&quot;&gt;
    &lt;div class=&quot;interactive-frame-title&quot;&gt;Đa thức Maclaurin của các hàm sơ cấp&lt;/div&gt;
    &lt;div class=&quot;interactive-frame-desc&quot;&gt;Để a = 0, tăng bậc n và so sánh sin x, eˣ với ln(1 + x), arctan x.&lt;/div&gt;
  &lt;/div&gt;
  &lt;iframe src=&quot;/interactives/chapter08/taylor-polynomial.html&quot; title=&quot;Đa thức Maclaurin của các hàm sơ cấp&quot; loading=&quot;lazy&quot; style=&quot;height: 720px;&quot;&gt;&lt;/iframe&gt;
  &lt;div class=&quot;interactive-frame-foot&quot;&gt;
    &lt;a href=&quot;/interactives/chapter08/taylor-polynomial.html&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;Mở minh hoạ ở cửa sổ riêng&lt;/a&gt;
  &lt;/div&gt;
&lt;/div&gt;

&lt;h2 id=&quot;ví-dụ&quot;&gt;Ví dụ&lt;/h2&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Ví dụ 1 (Tính $\cos0.2$).&lt;/strong&gt; $\cos0.2\approx1-\tfrac{0.04}2+\tfrac{0.0016}{24}=0.9800667$. Chuỗi đan dấu với số hạng giảm, nên sai số không quá số hạng kế tiếp $\tfrac{0.2^6}{720}=8.9\times10^{-8}$ (bài 07_04). Giá trị thật $0.98006658$.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Ví dụ 2 (Tính $\ln2$ nhanh).&lt;/strong&gt; Chuỗi $1-\tfrac12+\tfrac13-\cdots$ hội tụ rất chậm: 10 số hạng chỉ cho $0.6456$. Trừ hai khai triển:&lt;/p&gt;

\[\ln\frac{1+x}{1-x}=\ln(1+x)-\ln(1-x)=2\left(x+\frac{x^3}3+\frac{x^5}5+\cdots\right).\]

  &lt;p&gt;Chọn $x=\tfrac13$ để $\tfrac{1+x}{1-x}=2$: bốn số hạng $2\left(\tfrac13+\tfrac1{81}+\tfrac1{1215}+\tfrac1{15309}\right)=0.693135$, sai số $1.2\times10^{-5}$ so với $\ln2=0.693147$.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Ví dụ 3 (Kết hợp khai triển).&lt;/strong&gt; Thay biến: $e^{-x^2}=1-x^2+\tfrac{x^4}{2}-\tfrac{x^6}6+\cdots$. Nhân: đến bậc 3,&lt;/p&gt;

\[e^x\sin x=\left(1+x+\tfrac{x^2}2+\tfrac{x^3}6\right)\left(x-\tfrac{x^3}6\right)+o(x^3)=x+x^2+\tfrac{x^3}3+o(x^3).\]

&lt;/div&gt;

&lt;h2 id=&quot;công-thức-euler&quot;&gt;Công thức Euler&lt;/h2&gt;

&lt;p&gt;Thay $x$ bằng $ix$ (với $i^2=-1$) trong chuỗi $e^x$ và tách phần chẵn, phần lẻ:&lt;/p&gt;

\[e^{ix}=\left(1-\frac{x^2}{2!}+\frac{x^4}{4!}-\cdots\right)+i\left(x-\frac{x^3}{3!}+\frac{x^5}{5!}-\cdots\right)=\cos x+i\sin x .\]

&lt;p&gt;Với $x=\pi$: $e^{i\pi}+1=0$. Công thức này là nền tảng của dòng điện xoay chiều, xử lý tín hiệu và chuỗi Fourier (bài 08_05).&lt;/p&gt;

&lt;h2 id=&quot;video-ngắn&quot;&gt;Video ngắn&lt;/h2&gt;

&lt;div class=&quot;reel-video&quot;&gt;
  &lt;video controls=&quot;&quot; playsinline=&quot;&quot; preload=&quot;metadata&quot; src=&quot;/public/videos/reels/taylor-hugs-sine.mp4&quot;&gt;&lt;/video&gt;
  &lt;p class=&quot;reel-caption&quot;&gt;Các đa thức Maclaurin bậc 1, 3, 5, …, 17 lần lượt ôm lấy đồ thị sin, vùng khớp rộng dần (video không lời, khoảng 2 phút).&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;reel-video&quot;&gt;
  &lt;video controls=&quot;&quot; playsinline=&quot;&quot; preload=&quot;metadata&quot; src=&quot;/public/videos/reels/euler-formula-series.mp4&quot;&gt;&lt;/video&gt;
  &lt;p class=&quot;reel-caption&quot;&gt;Công thức Euler bằng chuỗi: các số hạng của e^(ix) xếp thành đường gấp khúc trong mặt phẳng phức, phần thực cho cos, phần ảo cho sin, điểm cuối quay trên đường tròn đơn vị (video không lời, khoảng 1 phút 57 giây).&lt;/p&gt;
&lt;/div&gt;

&lt;h2 id=&quot;ứng-dụng&quot;&gt;Ứng dụng&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Vật lý: động năng tương đối tính.&lt;/strong&gt; Động năng của vật khối lượng $m$ vận tốc $v$ là $mc^2(\gamma-1)$ với $\gamma=(1-v^2/c^2)^{-1/2}$. Khai triển nhị thức với $\alpha=-\tfrac12$:&lt;/p&gt;

\[\gamma=1+\frac12\frac{v^2}{c^2}+\frac38\frac{v^4}{c^4}+\cdots\quad\Rightarrow\quad mc^2(\gamma-1)=\frac12mv^2+\frac38m\frac{v^4}{c^2}+\cdots\]

&lt;p&gt;Số hạng đầu là động năng Newton. Với $v=0.1c$: $\gamma-1=0.0050378$, hai số hạng cho $0.0050375$.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Học máy: hàm kích hoạt gần 0.&lt;/strong&gt; Gần 0, $\tanh x=x-\tfrac{x^3}3+\cdots$ và hàm sigmoid $\sigma(x)=\tfrac12+\tfrac x4-\tfrac{x^3}{48}+\cdots$ gần như tuyến tính. Vì vậy khi khởi tạo trọng số quá nhỏ, mạng nhiều lớp với các hàm này hoạt động gần như một ánh xạ tuyến tính.&lt;/p&gt;

&lt;h2 id=&quot;bài-tập&quot;&gt;Bài tập&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Cơ bản.&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;Viết khai triển Maclaurin của $x\cos x$ và $\dfrac1{1+x}$.&lt;/li&gt;
  &lt;li&gt;Viết 4 số hạng đầu của $\sqrt{1+x}$.&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Đáp án&lt;/summary&gt;

  &lt;ol&gt;
    &lt;li&gt;$x-\tfrac{x^3}2+\tfrac{x^5}{24}-\cdots$; $1-x+x^2-x^3+\cdots$ ($\vert x\vert &amp;lt;1$).&lt;/li&gt;
    &lt;li&gt;$1+\tfrac x2-\tfrac{x^2}8+\tfrac{x^3}{16}$.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;p&gt;&lt;strong&gt;Trung bình.&lt;/strong&gt;&lt;/p&gt;

&lt;ol start=&quot;3&quot;&gt;
  &lt;li&gt;Tính $\displaystyle\lim_{x\to0}\frac{x-\ln(1+x)}{x^2}$ và $\displaystyle\lim_{x\to0}\frac{\sin x-x\cos x}{x^3}$.&lt;/li&gt;
  &lt;li&gt;Tính $e^{-0.5}$ với sai số dưới $10^{-3}$.&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Đáp án&lt;/summary&gt;

  &lt;ol start=&quot;3&quot;&gt;
    &lt;li&gt;$\tfrac12$; $-\tfrac16+\tfrac12=\tfrac13$.&lt;/li&gt;
    &lt;li&gt;Chuỗi đan dấu: $1-0.5+0.125-0.020833+0.002604=0.60677$, số hạng kế tiếp $0.00026$. Giá trị thật $0.60653$.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;p&gt;&lt;strong&gt;Nâng cao.&lt;/strong&gt;&lt;/p&gt;

&lt;ol start=&quot;5&quot;&gt;
  &lt;li&gt;Chứng minh mọi đạo hàm của $f(x)=e^{-1/x^2}$ ($f(0)=0$) tại 0 bằng 0.&lt;/li&gt;
  &lt;li&gt;Dùng công thức Euler để suy ra $\cos(a+b)$ và $\sin(a+b)$ từ $e^{i(a+b)}=e^{ia}e^{ib}$.&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Gợi ý&lt;/summary&gt;

  &lt;ol start=&quot;5&quot;&gt;
    &lt;li&gt;Với $x\ne0$, quy nạp: $f^{(n)}(x)=P_n(1/x)e^{-1/x^2}$ với $P_n$ là đa thức. Với $t=1/x$, $t^ke^{-t^2}\to0$. Tại 0 dùng định nghĩa đạo hàm và cùng giới hạn.&lt;/li&gt;
    &lt;li&gt;Nhân $(\cos a+i\sin a)(\cos b+i\sin b)$ và so sánh phần thực, phần ảo.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;h2 id=&quot;tóm-tắt&quot;&gt;Tóm tắt&lt;/h2&gt;

&lt;div class=&quot;content-box summary-box textbook-block&quot;&gt;
  &lt;ul&gt;
    &lt;li&gt;Chuỗi Taylor bằng hàm khi $R_n\to0$; đủ khi mọi đạo hàm bị chặn đều.&lt;/li&gt;
    &lt;li&gt;$e^x$, $\sin x$, $\cos x$ hội tụ trên $\mathbb R$; $\ln(1+x)$ trên $(-1,1]$; $(1+x)^\alpha$ khi $\vert x\vert &amp;lt;1$.&lt;/li&gt;
    &lt;li&gt;Thay biến, nhân, trừ các khai triển có sẵn thay vì tính đạo hàm.&lt;/li&gt;
    &lt;li&gt;$e^{ix}=\cos x+i\sin x$.&lt;/li&gt;
  &lt;/ul&gt;
&lt;/div&gt;
</content>
 </entry>
 
 <entry>
   <title>Chuỗi lũy thừa và bán kính hội tụ</title>
   <link href="https://calculus-self-learning.pages.dev/contents/vi/chapter08/08_02_Chuoi_luy_thua_va_ban_kinh_hoi_tu/"/>
   <updated>2026-12-01T00:00:00+00:00</updated>
   <id>https://calculus-self-learning.pages.dev/contents/vi/chapter08/08_02_Chuoi_luy_thua_va_ban_kinh_hoi_tu</id>
   <content type="html">&lt;div class=&quot;textbook-objectives&quot;&gt;

  &lt;p&gt;&lt;strong&gt;Mục tiêu.&lt;/strong&gt; Sau bài này bạn có thể:&lt;/p&gt;

  &lt;ul&gt;
    &lt;li&gt;nhận dạng chuỗi lũy thừa tâm $a$;&lt;/li&gt;
    &lt;li&gt;chứng minh tập hội tụ của chuỗi lũy thừa là một khoảng (bổ đề Abel);&lt;/li&gt;
    &lt;li&gt;tìm bán kính hội tụ bằng tiêu chuẩn tỉ số hoặc căn;&lt;/li&gt;
    &lt;li&gt;xét riêng hai đầu mút để có khoảng hội tụ.&lt;/li&gt;
  &lt;/ul&gt;

&lt;/div&gt;

&lt;h2 id=&quot;vì-sao-cần-bài-này&quot;&gt;Vì sao cần bài này&lt;/h2&gt;

&lt;p&gt;Bài 08_01 dùng đa thức Taylor bậc hữu hạn. Cho bậc tiến ra vô cùng, ta được một &lt;strong&gt;chuỗi lũy thừa&lt;/strong&gt;, một “đa thức bậc vô hạn”. Khác với đa thức, chuỗi lũy thừa có thể chỉ hội tụ với một số giá trị của $x$. Trước khi dùng một khai triển, ta phải biết nó đúng ở đâu.&lt;/p&gt;

&lt;h2 id=&quot;chuỗi-lũy-thừa&quot;&gt;Chuỗi lũy thừa&lt;/h2&gt;

&lt;div class=&quot;textbook-definition&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Định nghĩa.&lt;/strong&gt; &lt;strong&gt;Chuỗi lũy thừa tâm $a$&lt;/strong&gt; là chuỗi dạng&lt;/p&gt;

\[\sum_{n=0}^\infty c_n(x-a)^n=c_0+c_1(x-a)+c_2(x-a)^2+\cdots\]

  &lt;p&gt;với các hệ số $c_n$ là hằng số. Với mỗi $x$ ta được một chuỗi số; tập các $x$ làm chuỗi hội tụ là &lt;strong&gt;miền hội tụ&lt;/strong&gt;.&lt;/p&gt;
&lt;/div&gt;

&lt;p&gt;Ví dụ quen thuộc: chuỗi hình học $\sum x^n=\tfrac1{1-x}$ hội tụ đúng khi $\vert x\vert &amp;lt;1$ (bài 07_02).&lt;/p&gt;

&lt;div class=&quot;textbook-theorem&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Định lý 1 (Bổ đề Abel).&lt;/strong&gt; Nếu $\sum c_nx_0^n$ hội tụ với một $x_0\ne0$ thì $\sum c_nx^n$ hội tụ tuyệt đối với mọi $\vert x\vert &amp;lt;\vert x_0\vert $.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-proof&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Chứng minh.&lt;/strong&gt; Chuỗi $\sum c_nx_0^n$ hội tụ nên $c_nx_0^n\to0$, do đó bị chặn: $\vert c_nx_0^n\vert \le M$. Với $\vert x\vert &amp;lt;\vert x_0\vert $, đặt $q=\tfrac{\vert x\vert }{\vert x_0\vert }&amp;lt;1$. Khi đó $\vert c_nx^n\vert =\vert c_nx_0^n\vert \,q^n\le Mq^n$. Chuỗi hình học $\sum Mq^n$ hội tụ; dùng tiêu chuẩn so sánh.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-theorem&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Hệ quả (Bán kính hội tụ).&lt;/strong&gt; Với mỗi chuỗi lũy thừa $\sum c_n(x-a)^n$ có một số $R\in[0,\infty]$, gọi là &lt;strong&gt;bán kính hội tụ&lt;/strong&gt;, sao cho chuỗi hội tụ tuyệt đối khi $\vert x-a\vert &amp;lt;R$ và phân kỳ khi $\vert x-a\vert &amp;gt;R$. Tại hai đầu mút $x=a\pm R$, chuỗi có thể hội tụ hoặc phân kỳ.&lt;/p&gt;
&lt;/div&gt;

&lt;p&gt;Thật vậy, đặt $R$ là cận trên đúng của các $\vert x-a\vert $ mà chuỗi hội tụ; bổ đề Abel cho hội tụ bên trong, còn bên ngoài thì phân kỳ theo định nghĩa của $R$.&lt;/p&gt;

&lt;h2 id=&quot;tìm-bán-kính-hội-tụ&quot;&gt;Tìm bán kính hội tụ&lt;/h2&gt;

&lt;p&gt;Áp dụng tiêu chuẩn tỉ số cho $\vert c_n(x-a)^n\vert $: tỉ số là $\left\lvert\tfrac{c_{n+1}}{c_n}\right\rvert\vert x-a\vert $. Vậy&lt;/p&gt;

\[\text{nếu }\left\lvert\frac{c_{n+1}}{c_n}\right\rvert\to L\text{ thì }R=\frac1L\qquad(R=\infty\text{ khi }L=0,\ R=0\text{ khi }L=\infty).\]

&lt;p&gt;Tương tự, nếu $\sqrt[n]{\vert c_n\vert }\to L$ thì $R=\tfrac1L$ (công thức Cauchy–Hadamard dùng $\limsup$ và luôn đúng).&lt;/p&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Ví dụ 1.&lt;/strong&gt;&lt;/p&gt;

  &lt;ul&gt;
    &lt;li&gt;$\sum\dfrac{x^n}{n!}$: $\tfrac{c_{n+1}}{c_n}=\tfrac1{n+1}\to0$, $R=\infty$: hội tụ với mọi $x$.&lt;/li&gt;
    &lt;li&gt;$\sum n!\,x^n$: tỉ số $n+1\to\infty$, $R=0$: chỉ hội tụ tại $x=0$.&lt;/li&gt;
    &lt;li&gt;$\sum\dfrac{x^n}{n}$: $R=1$. Tại $x=1$: chuỗi điều hoà, phân kỳ. Tại $x=-1$: đan dấu, hội tụ. Miền hội tụ $[-1,1)$.&lt;/li&gt;
    &lt;li&gt;$\sum\dfrac{x^n}{n^2}$: $R=1$, hội tụ tuyệt đối tại cả hai đầu mút. Miền hội tụ $[-1,1]$.&lt;/li&gt;
  &lt;/ul&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Ví dụ 2 (Tâm khác 0).&lt;/strong&gt; $\displaystyle\sum_{n\ge1}\frac{(x-2)^n}{n\,3^n}$. Tỉ số $\tfrac{n}{3(n+1)}\to\tfrac13$, nên $R=3$: hội tụ khi $-1&amp;lt;x&amp;lt;5$. Tại $x=5$: $\sum\tfrac1n$ phân kỳ. Tại $x=-1$: $\sum\tfrac{(-1)^n}n$ hội tụ. Miền hội tụ $[-1,5)$.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Ví dụ 3 (Chỉ có lũy thừa chẵn).&lt;/strong&gt; $\sum\dfrac{x^{2n}}{4^n}$. Hệ số lẻ bằng 0 nên không dùng tỉ số $\tfrac{c_{n+1}}{c_n}$ được; ta áp dụng tiêu chuẩn tỉ số cho chính các số hạng: $\tfrac{x^2}4&amp;lt;1$ khi $\vert x\vert &amp;lt;2$. Đây là chuỗi hình học công bội $\tfrac{x^2}4$, tổng $\tfrac4{4-x^2}$; tại $x=\pm2$ số hạng bằng 1, phân kỳ. Miền hội tụ $(-2,2)$.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;interactive-frame&quot;&gt;
  &lt;div class=&quot;interactive-frame-head&quot;&gt;
    &lt;div class=&quot;interactive-frame-title&quot;&gt;Bán kính và khoảng hội tụ&lt;/div&gt;
    &lt;div class=&quot;interactive-frame-desc&quot;&gt;Tăng N: trong khoảng hội tụ các tổng riêng dồn lại, ngoài khoảng thì bùng nổ.&lt;/div&gt;
  &lt;/div&gt;
  &lt;iframe src=&quot;/interactives/chapter08/radius-of-convergence.html&quot; title=&quot;Bán kính và khoảng hội tụ&quot; loading=&quot;lazy&quot; style=&quot;height: 720px;&quot;&gt;&lt;/iframe&gt;
  &lt;div class=&quot;interactive-frame-foot&quot;&gt;
    &lt;a href=&quot;/interactives/chapter08/radius-of-convergence.html&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;Mở minh hoạ ở cửa sổ riêng&lt;/a&gt;
  &lt;/div&gt;
&lt;/div&gt;

&lt;h2 id=&quot;ứng-dụng&quot;&gt;Ứng dụng&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Vì sao $\tfrac1{1+x^2}$ chỉ khai triển được khi $\vert x\vert &amp;lt;1$.&lt;/strong&gt; Hàm $\tfrac1{1+x^2}=\sum(-1)^nx^{2n}$ trơn trên cả $\mathbb R$, vậy mà chuỗi chỉ hội tụ khi $\vert x\vert &amp;lt;1$. Lý do nằm trong số phức: $1+x^2=0$ tại $x=\pm i$, cách tâm 0 đúng 1 đơn vị. Bán kính hội tụ bằng khoảng cách từ tâm đến “điểm xấu” gần nhất trong mặt phẳng phức. Trong tính toán số, điều này giải thích vì sao đa thức Taylor của $\tfrac1{1+x^2}$ bậc càng cao lại càng sai khi $\vert x\vert &amp;gt;1$.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Xác suất: hàm sinh.&lt;/strong&gt; Với biến ngẫu nhiên nhận giá trị $0,1,2,\dots$ với xác suất $p_n$, hàm sinh xác suất $G(s)=\sum p_ns^n$ có bán kính hội tụ ít nhất 1 vì $\sum p_n=1$. Ví dụ phân phối hình học $p_n=(1-p)p^n$ cho $G(s)=\tfrac{1-p}{1-ps}$, với $R=\tfrac1p&amp;gt;1$.&lt;/p&gt;

&lt;h2 id=&quot;bài-tập&quot;&gt;Bài tập&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Cơ bản.&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;Tìm miền hội tụ: $\sum\dfrac{x^n}{2^n}$, $\sum n x^n$.&lt;/li&gt;
  &lt;li&gt;Tìm miền hội tụ: $\sum\dfrac{(x+1)^n}{\sqrt n}$.&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Đáp án&lt;/summary&gt;

  &lt;ol&gt;
    &lt;li&gt;$(-2,2)$; $(-1,1)$ (tại $\pm1$ số hạng không dần về 0).&lt;/li&gt;
    &lt;li&gt;$R=1$, tâm $-1$. Tại $x=0$: $\sum\tfrac1{\sqrt n}$ phân kỳ; tại $x=-2$: đan dấu, hội tụ. Miền $[-2,0)$.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;p&gt;&lt;strong&gt;Trung bình.&lt;/strong&gt;&lt;/p&gt;

&lt;ol start=&quot;3&quot;&gt;
  &lt;li&gt;Tìm bán kính hội tụ của $\sum\dfrac{(2n)!}{(n!)^2}x^n$ và $\sum\dfrac{n^n}{n!}x^n$.&lt;/li&gt;
  &lt;li&gt;Chứng minh rằng nếu $\sum c_nx^n$ có bán kính $R$ thì $\sum c_nx^{2n}$ có bán kính $\sqrt R$.&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Đáp án&lt;/summary&gt;

  &lt;ol start=&quot;3&quot;&gt;
    &lt;li&gt;Tỉ số $\tfrac{(2n+2)(2n+1)}{(n+1)^2}\to4$, $R=\tfrac14$. Tỉ số $\left(1+\tfrac1n\right)^n\to e$, $R=\tfrac1e$.&lt;/li&gt;
    &lt;li&gt;$\sum c_n(x^2)^n$ hội tụ khi $x^2&amp;lt;R$ và phân kỳ khi $x^2&amp;gt;R$.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;p&gt;&lt;strong&gt;Nâng cao.&lt;/strong&gt;&lt;/p&gt;

&lt;ol start=&quot;5&quot;&gt;
  &lt;li&gt;Cho ví dụ chuỗi lũy thừa có miền hội tụ lần lượt là $(-1,1)$, $(-1,1]$, $[-1,1]$.&lt;/li&gt;
  &lt;li&gt;Tìm bán kính hội tụ của khai triển $\tfrac1{x^2-4x+5}$ tại tâm $a=0$ mà không cần tính hệ số.&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Gợi ý&lt;/summary&gt;

  &lt;ol start=&quot;5&quot;&gt;
    &lt;li&gt;$\sum x^n$; $\sum\tfrac{(-1)^nx^n}{n}$; $\sum\tfrac{x^n}{n^2}$.&lt;/li&gt;
    &lt;li&gt;Mẫu bằng 0 tại $x=2\pm i$, cách 0 một khoảng $\sqrt5$. Vậy $R=\sqrt5$.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;h2 id=&quot;tóm-tắt&quot;&gt;Tóm tắt&lt;/h2&gt;

&lt;div class=&quot;content-box summary-box textbook-block&quot;&gt;
  &lt;ul&gt;
    &lt;li&gt;Chuỗi lũy thừa $\sum c_n(x-a)^n$ hội tụ tuyệt đối khi $\vert x-a\vert &amp;lt;R$, phân kỳ khi $\vert x-a\vert &amp;gt;R$ (bổ đề Abel).&lt;/li&gt;
    &lt;li&gt;$R=\tfrac1L$ với $L=\lim\left\lvert\tfrac{c_{n+1}}{c_n}\right\rvert$ hoặc $L=\lim\sqrt[n]{\vert c_n\vert }$.&lt;/li&gt;
    &lt;li&gt;Hai đầu mút phải xét riêng bằng các tiêu chuẩn của chương 7.&lt;/li&gt;
    &lt;li&gt;$R$ bằng khoảng cách từ tâm đến điểm kỳ dị gần nhất trong mặt phẳng phức.&lt;/li&gt;
  &lt;/ul&gt;
&lt;/div&gt;
</content>
 </entry>
 
 <entry>
   <title>Công thức Taylor và phần dư</title>
   <link href="https://calculus-self-learning.pages.dev/contents/vi/chapter08/08_01_Cong_thuc_Taylor_va_phan_du/"/>
   <updated>2026-12-01T00:00:00+00:00</updated>
   <id>https://calculus-self-learning.pages.dev/contents/vi/chapter08/08_01_Cong_thuc_Taylor_va_phan_du</id>
   <content type="html">&lt;div class=&quot;textbook-objectives&quot;&gt;

  &lt;p&gt;&lt;strong&gt;Mục tiêu.&lt;/strong&gt; Sau bài này bạn có thể:&lt;/p&gt;

  &lt;ul&gt;
    &lt;li&gt;viết đa thức Taylor bậc $n$ của một hàm tại một điểm;&lt;/li&gt;
    &lt;li&gt;phát biểu và chứng minh công thức Taylor với phần dư dạng Lagrange;&lt;/li&gt;
    &lt;li&gt;ước lượng sai số khi xấp xỉ, và chọn bậc đủ để đạt độ chính xác cho trước;&lt;/li&gt;
    &lt;li&gt;dùng phần dư dạng Peano để tính giới hạn.&lt;/li&gt;
  &lt;/ul&gt;

&lt;/div&gt;

&lt;h2 id=&quot;vì-sao-cần-bài-này&quot;&gt;Vì sao cần bài này&lt;/h2&gt;

&lt;p&gt;Xấp xỉ tuyến tính $f(x)\approx f(a)+f&apos;(a)(x-a)$ (bài 02_04) khớp giá trị và độ dốc tại $a$. Muốn chính xác hơn, ta khớp thêm độ cong, rồi các đạo hàm bậc cao hơn. Kết quả là một đa thức, thứ máy tính tính được bằng cộng và nhân. Câu hỏi quan trọng là: &lt;strong&gt;sai bao nhiêu?&lt;/strong&gt; Công thức Taylor trả lời câu hỏi đó.&lt;/p&gt;

&lt;h2 id=&quot;đa-thức-taylor&quot;&gt;Đa thức Taylor&lt;/h2&gt;

&lt;div class=&quot;textbook-definition&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Định nghĩa.&lt;/strong&gt; Cho $f$ có đạo hàm đến cấp $n$ tại $a$. &lt;strong&gt;Đa thức Taylor bậc $n$&lt;/strong&gt; của $f$ tại $a$ là&lt;/p&gt;

\[T_n(x)=\sum_{k=0}^n\frac{f^{(k)}(a)}{k!}(x-a)^k=f(a)+f&apos;(a)(x-a)+\frac{f&apos;&apos;(a)}{2!}(x-a)^2+\cdots+\frac{f^{(n)}(a)}{n!}(x-a)^n .\]

  &lt;p&gt;Khi $a=0$ ta gọi là đa thức &lt;strong&gt;Maclaurin&lt;/strong&gt;. Hiệu $R_n(x)=f(x)-T_n(x)$ là &lt;strong&gt;phần dư&lt;/strong&gt;.&lt;/p&gt;
&lt;/div&gt;

&lt;p&gt;Hệ số $\tfrac{f^{(k)}(a)}{k!}$ được chọn để $T_n^{(k)}(a)=f^{(k)}(a)$ với $k=0,\dots,n$: đạo hàm cấp $k$ của $(x-a)^k$ là $k!$, còn các số hạng khác triệt tiêu tại $a$.&lt;/p&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Ví dụ 1.&lt;/strong&gt; Với $f(x)=e^x$, mọi đạo hàm bằng $e^x$, bằng 1 tại 0, nên $T_n(x)=1+x+\tfrac{x^2}{2!}+\cdots+\tfrac{x^n}{n!}$. Với $f(x)=\sin x$, các đạo hàm tại 0 lặp lại $0,1,0,-1$, nên $T_5(x)=x-\tfrac{x^3}{6}+\tfrac{x^5}{120}$ (và $T_6=T_5$).&lt;/p&gt;
&lt;/div&gt;

&lt;h2 id=&quot;phần-dư-dạng-lagrange&quot;&gt;Phần dư dạng Lagrange&lt;/h2&gt;

&lt;div class=&quot;textbook-theorem&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Định lý 1 (Taylor).&lt;/strong&gt; Nếu $f$ có đạo hàm đến cấp $n+1$ trên một khoảng chứa $a$ và $x$, thì có $c$ nằm giữa $a$ và $x$ sao cho&lt;/p&gt;

\[f(x)=T_n(x)+\frac{f^{(n+1)}(c)}{(n+1)!}(x-a)^{n+1}.\]

&lt;/div&gt;

&lt;div class=&quot;textbook-proof&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Chứng minh.&lt;/strong&gt; Cố định $x$ và đặt, với $t$ giữa $a$ và $x$,&lt;/p&gt;

\[\varphi(t)=f(x)-\sum_{k=0}^n\frac{f^{(k)}(t)}{k!}(x-t)^k,\qquad \psi(t)=(x-t)^{n+1}.\]

  &lt;p&gt;Ta có $\varphi(x)=0$, $\varphi(a)=R_n(x)$, $\psi(x)=0$, $\psi(a)=(x-a)^{n+1}$. Khi lấy đạo hàm $\varphi$, các số hạng triệt tiêu từng cặp (tổng lồng), chỉ còn $\varphi&apos;(t)=-\dfrac{f^{(n+1)}(t)}{n!}(x-t)^n$. Còn $\psi&apos;(t)=-(n+1)(x-t)^n$. Theo định lý giá trị trung bình Cauchy (bài 02_05), có $c$ giữa $a$ và $x$ với&lt;/p&gt;

\[\frac{\varphi(a)-\varphi(x)}{\psi(a)-\psi(x)}=\frac{\varphi&apos;(c)}{\psi&apos;(c)}=\frac{f^{(n+1)}(c)}{(n+1)!},\]

  &lt;p&gt;tức $R_n(x)=\dfrac{f^{(n+1)}(c)}{(n+1)!}(x-a)^{n+1}$.&lt;/p&gt;
&lt;/div&gt;

&lt;p&gt;Với $n=0$ đây chính là định lý Lagrange $f(x)-f(a)=f&apos;(c)(x-a)$. Hệ quả thực hành: nếu $\vert f^{(n+1)}\vert \le M$ giữa $a$ và $x$ thì&lt;/p&gt;

\[|R_n(x)|\le\frac{M}{(n+1)!}|x-a|^{n+1}.\]

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Ví dụ 2 (Tính $e$).&lt;/strong&gt; Với $x=1$, $n=7$: $T_7(1)=1+1+\tfrac12+\cdots+\tfrac1{5040}=2.718254$. Vì $e^c\le e&amp;lt;3$ với $c\in(0,1)$, sai số không quá $\tfrac{3}{8!}=7.4\times10^{-5}$. Thực tế $e-T_7(1)=2.8\times10^{-5}$.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Ví dụ 3 (Tính $\sin0.5$).&lt;/strong&gt; Dùng $T_5=T_6$ và $\vert \sin^{(7)}\vert \le1$: $\sin0.5\approx0.5-\tfrac{0.125}6+\tfrac{0.03125}{120}=0.4794271$, với sai số không quá $\tfrac{0.5^7}{7!}=1.55\times10^{-6}$. Giá trị thật $0.4794255$.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Ví dụ 4 (Tính $\sqrt{1.1}$).&lt;/strong&gt; Với $f(x)=\sqrt{1+x}$: $f&apos;(0)=\tfrac12$, $f&apos;&apos;(0)=-\tfrac14$, nên $T_2(x)=1+\tfrac x2-\tfrac{x^2}8$ và $\sqrt{1.1}\approx1.04875$. Ta có $f&apos;&apos;&apos;(c)=\tfrac38(1+c)^{-5/2}\le\tfrac38$ với $c&amp;gt;0$, nên $\vert R_2(0.1)\vert \le\tfrac{3/8}{6}(0.1)^3=6.25\times10^{-5}$. Giá trị thật $1.0488088$, sai số $5.9\times10^{-5}$.&lt;/p&gt;
&lt;/div&gt;

&lt;h2 id=&quot;phần-dư-dạng-peano-và-giới-hạn&quot;&gt;Phần dư dạng Peano và giới hạn&lt;/h2&gt;

&lt;div class=&quot;textbook-theorem&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Định lý 2 (Peano).&lt;/strong&gt; Nếu $f$ có đạo hàm đến cấp $n$ liên tục gần $a$ thì $f(x)=T_n(x)+o\big((x-a)^n\big)$ khi $x\to a$, nghĩa là $\dfrac{R_n(x)}{(x-a)^n}\to0$.&lt;/p&gt;
&lt;/div&gt;

&lt;p&gt;Với $f$ có đạo hàm cấp $n+1$ bị chặn, điều này suy ngay từ định lý 1. Dạng Peano thay thế nhiều lần dùng quy tắc L’Hôpital:&lt;/p&gt;

\[\lim_{x\to0}\frac{\sin x-x}{x^3}=\lim_{x\to0}\frac{-\tfrac{x^3}6+o(x^3)}{x^3}=-\frac16 .\]

&lt;div class=&quot;interactive-frame&quot;&gt;
  &lt;div class=&quot;interactive-frame-head&quot;&gt;
    &lt;div class=&quot;interactive-frame-title&quot;&gt;Đa thức Taylor và phần dư&lt;/div&gt;
    &lt;div class=&quot;interactive-frame-desc&quot;&gt;Chọn hàm, tâm a và bậc n; đoạn đỏ là phần dư tại x.&lt;/div&gt;
  &lt;/div&gt;
  &lt;iframe src=&quot;/interactives/chapter08/taylor-polynomial.html&quot; title=&quot;Đa thức Taylor và phần dư&quot; loading=&quot;lazy&quot; style=&quot;height: 720px;&quot;&gt;&lt;/iframe&gt;
  &lt;div class=&quot;interactive-frame-foot&quot;&gt;
    &lt;a href=&quot;/interactives/chapter08/taylor-polynomial.html&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;Mở minh hoạ ở cửa sổ riêng&lt;/a&gt;
  &lt;/div&gt;
&lt;/div&gt;

&lt;h2 id=&quot;ứng-dụng&quot;&gt;Ứng dụng&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Vật lý: con lắc nhỏ.&lt;/strong&gt; Phương trình con lắc $\theta&apos;&apos;=-\tfrac gL\sin\theta$ không giải được bằng hàm sơ cấp. Với góc nhỏ, $\sin\theta\approx\theta$ cho dao động điều hoà chu kỳ $2\pi\sqrt{L/g}$. Sai số $\vert \sin\theta-\theta\vert \le\tfrac{\theta^3}6$: với $\theta=0.2$ rad (khoảng $11.5^\circ$) sai số tương đối dưới $0.7\%$.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Học máy: xấp xỉ bậc hai và phương pháp Newton.&lt;/strong&gt; Gần điểm $w$, hàm mất mát $L(w+h)\approx L(w)+L&apos;(w)h+\tfrac12L&apos;&apos;(w)h^2$. Cực tiểu hoá đa thức bậc hai này theo $h$ cho $h=-\tfrac{L&apos;(w)}{L&apos;&apos;(w)}$: đó là bước Newton (bài 03_05). Gradient descent dùng xấp xỉ bậc một, nên cần chọn tốc độ học; Newton dùng thêm độ cong.&lt;/p&gt;

&lt;h2 id=&quot;bài-tập&quot;&gt;Bài tập&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Cơ bản.&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;Viết $T_3$ của $\ln(1+x)$ tại 0.&lt;/li&gt;
  &lt;li&gt;Viết $T_4$ của $\cos x$ tại 0, và $T_2$ của $\tfrac1x$ tại $a=1$.&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Đáp án&lt;/summary&gt;

  &lt;ol&gt;
    &lt;li&gt;$x-\tfrac{x^2}2+\tfrac{x^3}3$.&lt;/li&gt;
    &lt;li&gt;$1-\tfrac{x^2}2+\tfrac{x^4}{24}$; $1-(x-1)+(x-1)^2$.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;p&gt;&lt;strong&gt;Trung bình.&lt;/strong&gt;&lt;/p&gt;

&lt;ol start=&quot;3&quot;&gt;
  &lt;li&gt;Cần bậc $n$ nhỏ nhất bằng bao nhiêu để $T_n(0.1)$ xấp xỉ $e^{0.1}$ với sai số dưới $10^{-6}$?&lt;/li&gt;
  &lt;li&gt;Tính $\displaystyle\lim_{x\to0}\frac{e^x-1-x}{x^2}$ và $\displaystyle\lim_{x\to0}\frac{1-\cos x}{x^2}$ bằng khai triển Taylor.&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Đáp án&lt;/summary&gt;

  &lt;ol start=&quot;3&quot;&gt;
    &lt;li&gt;Sai số $\le\tfrac{e^{0.1}(0.1)^{n+1}}{(n+1)!}$. Với $n=3$: $4.6\times10^{-6}$, chưa đủ; với $n=4$: $9.2\times10^{-8}$. Vậy $n=4$.&lt;/li&gt;
    &lt;li&gt;$\tfrac12$ và $\tfrac12$.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;p&gt;&lt;strong&gt;Nâng cao.&lt;/strong&gt;&lt;/p&gt;

&lt;ol start=&quot;5&quot;&gt;
  &lt;li&gt;Chứng minh $\cos x\ge1-\tfrac{x^2}2$ với mọi $x$.&lt;/li&gt;
  &lt;li&gt;Chứng minh $e$ là số vô tỉ. Gợi ý: giả sử $e=\tfrac pq$, nhân $e=T_q(1)+R_q(1)$ với $q!$.&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Gợi ý&lt;/summary&gt;

  &lt;ol start=&quot;5&quot;&gt;
    &lt;li&gt;Đặt $g(x)=\cos x-1+\tfrac{x^2}2$. Ta có $g(0)=0$, $g&apos;(x)=x-\sin x\ge0$ khi $x\ge0$; $g$ chẵn.&lt;/li&gt;
    &lt;li&gt;$q!\,e$ và $q!\,T_q(1)$ là số nguyên, nên $q!\,R_q(1)=q!\tfrac{e^c}{(q+1)!}=\tfrac{e^c}{q+1}$ là số nguyên. Nhưng $0&amp;lt;\tfrac{e^c}{q+1}&amp;lt;\tfrac3{q+1}&amp;lt;1$ khi $q\ge2$ (và $e$ không là số nguyên). Mâu thuẫn.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;h2 id=&quot;tóm-tắt&quot;&gt;Tóm tắt&lt;/h2&gt;

&lt;div class=&quot;content-box summary-box textbook-block&quot;&gt;
  &lt;ul&gt;
    &lt;li&gt;$T_n(x)=\sum_{k=0}^n\tfrac{f^{(k)}(a)}{k!}(x-a)^k$ khớp $f$ đến đạo hàm cấp $n$ tại $a$.&lt;/li&gt;
    &lt;li&gt;Lagrange: $R_n(x)=\tfrac{f^{(n+1)}(c)}{(n+1)!}(x-a)^{n+1}$, nên $\vert R_n\vert \le\tfrac{M\vert x-a\vert ^{n+1}}{(n+1)!}$.&lt;/li&gt;
    &lt;li&gt;Peano: $R_n=o\big((x-a)^n\big)$, dùng để tính giới hạn.&lt;/li&gt;
    &lt;li&gt;Ứng dụng: $\sin\theta\approx\theta$ cho con lắc, xấp xỉ bậc hai dẫn đến phương pháp Newton.&lt;/li&gt;
  &lt;/ul&gt;
&lt;/div&gt;
</content>
 </entry>
 
 <entry>
   <title>Sắp xếp lại chuỗi và tích Cauchy</title>
   <link href="https://calculus-self-learning.pages.dev/contents/vi/chapter07/07_05_Sap_xep_lai_chuoi_va_tich_Cauchy/"/>
   <updated>2026-12-01T00:00:00+00:00</updated>
   <id>https://calculus-self-learning.pages.dev/contents/vi/chapter07/07_05_Sap_xep_lai_chuoi_va_tich_Cauchy</id>
   <content type="html">&lt;div class=&quot;textbook-objectives&quot;&gt;

  &lt;p&gt;&lt;strong&gt;Mục tiêu.&lt;/strong&gt; Bài đọc thêm này giúp bạn:&lt;/p&gt;

  &lt;ul&gt;
    &lt;li&gt;thấy rằng sắp xếp lại số hạng có thể làm thay đổi tổng của chuỗi bán hội tụ;&lt;/li&gt;
    &lt;li&gt;hiểu thuật toán trong định lý sắp xếp lại của Riemann;&lt;/li&gt;
    &lt;li&gt;biết rằng chuỗi hội tụ tuyệt đối có tổng không phụ thuộc thứ tự;&lt;/li&gt;
    &lt;li&gt;nhân hai chuỗi bằng tích Cauchy và biết khi nào tích hội tụ đúng.&lt;/li&gt;
  &lt;/ul&gt;

&lt;/div&gt;

&lt;h2 id=&quot;vì-sao-cần-bài-này&quot;&gt;Vì sao cần bài này&lt;/h2&gt;

&lt;p&gt;Với tổng hữu hạn, phép cộng giao hoán: đổi thứ tự không đổi kết quả. Với chuỗi vô hạn điều này &lt;strong&gt;có thể sai&lt;/strong&gt;. Đây không chỉ là chuyện lý thuyết: khi một chương trình cộng song song các số hạng theo thứ tự khác nhau, hoặc khi nhân hai chuỗi lũy thừa (chương 8), ta cần biết khi nào được phép sắp xếp lại.&lt;/p&gt;

&lt;h2 id=&quot;một-ví-dụ-gây-ngạc-nhiên&quot;&gt;Một ví dụ gây ngạc nhiên&lt;/h2&gt;

&lt;p&gt;Ta biết $1-\tfrac12+\tfrac13-\tfrac14+\cdots=\ln2$. Sắp xếp lại: sau mỗi số hạng dương lấy hai số hạng âm.&lt;/p&gt;

\[\left(1-\tfrac12\right)-\tfrac14+\left(\tfrac13-\tfrac16\right)-\tfrac18+\left(\tfrac15-\tfrac1{10}\right)-\tfrac1{12}+\cdots\]

&lt;p&gt;Mỗi cặp trong ngoặc là $\tfrac1{2k-1}-\tfrac1{2(2k-1)}=\tfrac1{2(2k-1)}$, nên chuỗi mới bằng&lt;/p&gt;

\[\tfrac12-\tfrac14+\tfrac16-\tfrac18+\cdots=\tfrac12\left(1-\tfrac12+\tfrac13-\cdots\right)=\tfrac12\ln2\approx0.3466 .\]

&lt;p&gt;Cùng các số hạng, chỉ đổi thứ tự, tổng giảm một nửa. (Tính số với 200000 nhóm cho $0.346573$.)&lt;/p&gt;

&lt;h2 id=&quot;định-lý-sắp-xếp-lại-của-riemann&quot;&gt;Định lý sắp xếp lại của Riemann&lt;/h2&gt;

&lt;div class=&quot;textbook-theorem&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Định lý 1 (Riemann).&lt;/strong&gt; Nếu $\sum a_n$ bán hội tụ thì với mọi số thực $L$ (kể cả $\pm\infty$) có một cách sắp xếp lại các số hạng để chuỗi mới có tổng $L$.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-proof&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Ý chứng minh.&lt;/strong&gt; Tách thành các số hạng dương $p_1,p_2,\dots$ và các số hạng âm $-q_1,-q_2,\dots$. Vì $\sum a_n$ hội tụ nhưng $\sum\vert a_n\vert =\infty$, cả $\sum p_k$ và $\sum q_k$ đều phân kỳ (nếu một chuỗi hội tụ thì chuỗi kia cũng hội tụ, khi đó $\sum\vert a_n\vert $ hội tụ), và $p_k,q_k\to0$.&lt;/p&gt;

  &lt;p&gt;Thuật toán tham lam: lấy các số hạng dương cho đến khi tổng vượt $L$; rồi lấy các số hạng âm cho đến khi tổng xuống dưới $L$; lặp lại. Vì mỗi chuỗi con phân kỳ nên luôn vượt qua được $L$; mỗi lần đổi chiều, tổng cách $L$ không quá số hạng cuối vừa lấy, mà số hạng này dần về 0. Vậy tổng riêng dần về $L$.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Ví dụ 1 (Đạt tổng 1.5).&lt;/strong&gt; Với $1-\tfrac12+\tfrac13-\cdots$ và $L=1.5$:&lt;/p&gt;

  &lt;ul&gt;
    &lt;li&gt;$1+\tfrac13+\tfrac15=1.5333&amp;gt;1.5$; dừng.&lt;/li&gt;
    &lt;li&gt;$-\tfrac12$: $1.0333&amp;lt;1.5$; dừng.&lt;/li&gt;
    &lt;li&gt;$+\tfrac17+\tfrac19+\tfrac1{11}+\tfrac1{13}+\tfrac1{15}$: $1.5218&amp;gt;1.5$; dừng.&lt;/li&gt;
    &lt;li&gt;$-\tfrac14$: $1.2718$; và cứ thế.&lt;/li&gt;
  &lt;/ul&gt;

  &lt;p&gt;Các dao động quanh $1.5$ nhỏ dần vì các số hạng nhỏ dần.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;interactive-frame&quot;&gt;
  &lt;div class=&quot;interactive-frame-head&quot;&gt;
    &lt;div class=&quot;interactive-frame-title&quot;&gt;Sắp xếp lại để được tổng L&lt;/div&gt;
    &lt;div class=&quot;interactive-frame-desc&quot;&gt;Chọn L, thuật toán tham lam đưa tổng riêng về L.&lt;/div&gt;
  &lt;/div&gt;
  &lt;iframe src=&quot;/interactives/chapter07/rearrangement.html&quot; title=&quot;Sắp xếp lại để được tổng L&quot; loading=&quot;lazy&quot; style=&quot;height: 700px;&quot;&gt;&lt;/iframe&gt;
  &lt;div class=&quot;interactive-frame-foot&quot;&gt;
    &lt;a href=&quot;/interactives/chapter07/rearrangement.html&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;Mở minh hoạ ở cửa sổ riêng&lt;/a&gt;
  &lt;/div&gt;
&lt;/div&gt;

&lt;div class=&quot;reel-video&quot;&gt;
  &lt;video controls=&quot;&quot; playsinline=&quot;&quot; preload=&quot;metadata&quot; src=&quot;/public/videos/reels/riemann-rearrangement.mp4&quot;&gt;&lt;/video&gt;
  &lt;p class=&quot;reel-caption&quot;&gt;Sắp xếp lại chuỗi điều hoà đan dấu: tổng riêng nhảy qua lại quanh mục tiêu L; đổi L thì cùng các số hạng hội tụ đến số khác; mẫu p dương, q âm cho ln 2 + ½ ln(p/q), tổng riêng leo lên vô cùng, vì sao phần dương và phần âm đều phân kỳ, và chuỗi hội tụ tuyệt đối 1 − 1/4 + 1/9 − … không đổi tổng (video không lời, khoảng 3 phút 30 giây).&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-theorem&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Định lý 2 (Dirichlet).&lt;/strong&gt; Nếu $\sum a_n$ hội tụ tuyệt đối thì mọi cách sắp xếp lại đều hội tụ và có cùng tổng.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-proof&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Ý chứng minh.&lt;/strong&gt; Cho $\varepsilon&amp;gt;0$, chọn $N$ để $\sum_{n&amp;gt;N}\vert a_n\vert &amp;lt;\varepsilon$. Một cách sắp xếp lại, sau đủ nhiều số hạng, đã chứa hết $a_1,\dots,a_N$. Hiệu giữa tổng riêng của chuỗi mới và $S_N$ chỉ gồm các số hạng có chỉ số lớn hơn $N$, nên có trị tuyệt đối nhỏ hơn $\varepsilon$.&lt;/p&gt;
&lt;/div&gt;

&lt;h2 id=&quot;tích-cauchy&quot;&gt;Tích Cauchy&lt;/h2&gt;

&lt;p&gt;Để nhân hai chuỗi, ta gom các tích $a_kb_{n-k}$ có cùng tổng chỉ số, giống như nhân hai đa thức.&lt;/p&gt;

&lt;div class=&quot;textbook-definition&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Định nghĩa.&lt;/strong&gt; &lt;strong&gt;Tích Cauchy&lt;/strong&gt; của $\sum_{n\ge0}a_n$ và $\sum_{n\ge0}b_n$ là $\sum_{n\ge0}c_n$ với $c_n=\sum_{k=0}^na_kb_{n-k}$.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-theorem&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Định lý 3 (Mertens).&lt;/strong&gt; Nếu $\sum a_n=A$ hội tụ tuyệt đối và $\sum b_n=B$ hội tụ thì tích Cauchy hội tụ và có tổng $AB$. (Nếu cả hai hội tụ tuyệt đối thì tích Cauchy cũng hội tụ tuyệt đối.)&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Ví dụ 2.&lt;/strong&gt; Với $\vert x\vert &amp;lt;1$, bình phương $\sum x^n=\tfrac1{1-x}$: $c_n=\sum_{k=0}^nx^kx^{n-k}=(n+1)x^n$. Vậy&lt;/p&gt;

\[\sum_{n\ge0}(n+1)x^n=\frac1{(1-x)^2}.\]

  &lt;p&gt;Với $x=\tfrac12$: $\sum(n+1)2^{-n}=4$, phù hợp với $\sum k2^{-k}=2$ ở bài 07_03.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Ví dụ 3 (Lũy thừa của $e$).&lt;/strong&gt; Đặt $E(a)=\sum\tfrac{a^n}{n!}$ (chương 8 cho thấy $E(a)=e^a$). Chuỗi hội tụ tuyệt đối với mọi $a$, và theo công thức nhị thức&lt;/p&gt;

\[c_n=\sum_{k=0}^n\frac{a^k}{k!}\frac{b^{n-k}}{(n-k)!}=\frac{(a+b)^n}{n!},\]

  &lt;p&gt;nên $E(a)E(b)=E(a+b)$: quy tắc $e^ae^b=e^{a+b}$ suy ra từ tích Cauchy.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Ví dụ 4 (Phản ví dụ).&lt;/strong&gt; Lấy $a_n=b_n=\tfrac{(-1)^n}{\sqrt{n+1}}$, hội tụ theo Leibniz nhưng không tuyệt đối. Khi đó $c_n=(-1)^n\sum_{k=0}^n\tfrac1{\sqrt{(k+1)(n-k+1)}}$. Theo bất đẳng thức AM-GM, $\sqrt{(k+1)(n-k+1)}\le\tfrac{n+2}2$, nên $\vert c_n\vert \ge\tfrac{2(n+1)}{n+2}\to2$. Số hạng không dần về 0: tích Cauchy phân kỳ.&lt;/p&gt;
&lt;/div&gt;

&lt;h2 id=&quot;ứng-dụng&quot;&gt;Ứng dụng&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Xác suất: tổng hai biến độc lập.&lt;/strong&gt; Nếu $X,Y$ độc lập, nhận giá trị nguyên không âm, thì $P(X+Y=n)=\sum_kP(X=k)P(Y=n-k)$: đó chính là tích Cauchy (phép tích chập). Với $X\sim\text{Poisson}(\lambda)$, $Y\sim\text{Poisson}(\mu)$, ví dụ 3 cho $X+Y\sim\text{Poisson}(\lambda+\mu)$.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Tính toán: cộng song song.&lt;/strong&gt; Khi GPU cộng hàng triệu số theo thứ tự khác nhau, ngay cả với dữ liệu hữu hạn, kết quả dấu phẩy động có thể khác nhau chút ít. Với chuỗi bán hội tụ, hiện tượng này thành vấn đề thật sự; nên ưu tiên các biểu diễn hội tụ tuyệt đối.&lt;/p&gt;

&lt;h2 id=&quot;bài-tập&quot;&gt;Bài tập&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Cơ bản.&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;Tính tích Cauchy của $\sum x^n$ và $\sum(-1)^nx^n$ với $\vert x\vert &amp;lt;1$, và kiểm tra với $\tfrac1{1-x^2}$.&lt;/li&gt;
  &lt;li&gt;Theo thuật toán Riemann, viết 6 số hạng đầu của cách sắp xếp lại $1-\tfrac12+\tfrac13-\cdots$ có tổng $0$.&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Đáp án&lt;/summary&gt;

  &lt;ol&gt;
    &lt;li&gt;$c_n=x^n\sum_{k=0}^n(-1)^k$, bằng $x^n$ khi $n$ chẵn và 0 khi $n$ lẻ: $\sum x^{2m}=\tfrac1{1-x^2}$.&lt;/li&gt;
    &lt;li&gt;$1$ (vượt 0); $-\tfrac12,-\tfrac14,-\tfrac16,-\tfrac18$ (tổng lần lượt $0.5,\ 0.25,\ 0.0833,\ -0.0417$, dừng khi xuống dưới 0); $+\tfrac13$ ($0.2917$). Sáu số hạng đầu: $1,-\tfrac12,-\tfrac14,-\tfrac16,-\tfrac18,\tfrac13$.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;p&gt;&lt;strong&gt;Trung bình.&lt;/strong&gt;&lt;/p&gt;

&lt;ol start=&quot;3&quot;&gt;
  &lt;li&gt;Chứng minh rằng sắp xếp lại một chuỗi số dương hội tụ không đổi tổng.&lt;/li&gt;
  &lt;li&gt;Bình phương chuỗi $\sum\tfrac{x^n}{n!}$ và kiểm tra kết quả bằng $\sum\tfrac{(2x)^n}{n!}$.&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Đáp án&lt;/summary&gt;

  &lt;ol start=&quot;3&quot;&gt;
    &lt;li&gt;Chuỗi số dương hội tụ thì hội tụ tuyệt đối; áp dụng định lý 2.&lt;/li&gt;
    &lt;li&gt;$c_n=\tfrac{x^n}{n!}\sum_k\binom nk=\tfrac{(2x)^n}{n!}$.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;p&gt;&lt;strong&gt;Nâng cao.&lt;/strong&gt;&lt;/p&gt;

&lt;ol start=&quot;5&quot;&gt;
  &lt;li&gt;Sắp xếp lại $1-\tfrac12+\tfrac13-\cdots$ thành hai số hạng dương rồi một số hạng âm: $1+\tfrac13-\tfrac12+\tfrac15+\tfrac17-\tfrac14+\cdots$. Dùng $\sum_{k\le n}\tfrac1k=\ln n+\gamma+o(1)$ để chứng minh tổng bằng $\tfrac32\ln2$.&lt;/li&gt;
  &lt;li&gt;Trong chứng minh định lý 1, giải thích vì sao $\sum p_k$ và $\sum q_k$ đều phân kỳ.&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Gợi ý&lt;/summary&gt;

  &lt;ol start=&quot;5&quot;&gt;
    &lt;li&gt;Sau $n$ khối, tổng là $\sum_{k\le 2n}\tfrac1{2k-1}-\sum_{k\le n}\tfrac1{2k}=\left(H_{4n}-\tfrac12H_{2n}\right)-\tfrac12H_n\to\ln4-\tfrac12\ln2=\tfrac32\ln2$.&lt;/li&gt;
    &lt;li&gt;$\sum_{n\le N}a_n=P_N-Q_N$ và $\sum_{n\le N}\vert a_n\vert =P_N+Q_N$. Nếu một trong hai hội tụ thì từ hiệu hội tụ suy ra chuỗi kia hội tụ, mâu thuẫn với $\sum\vert a_n\vert =\infty$.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;h2 id=&quot;tóm-tắt&quot;&gt;Tóm tắt&lt;/h2&gt;

&lt;div class=&quot;content-box summary-box textbook-block&quot;&gt;
  &lt;ul&gt;
    &lt;li&gt;Chuỗi bán hội tụ có thể sắp xếp lại để có tổng bất kỳ (Riemann).&lt;/li&gt;
    &lt;li&gt;Chuỗi hội tụ tuyệt đối có tổng không phụ thuộc thứ tự (Dirichlet).&lt;/li&gt;
    &lt;li&gt;Tích Cauchy $c_n=\sum a_kb_{n-k}$ hội tụ đến $AB$ khi ít nhất một chuỗi hội tụ tuyệt đối (Mertens); ví dụ $e^ae^b=e^{a+b}$.&lt;/li&gt;
    &lt;li&gt;Không có hội tụ tuyệt đối, tích Cauchy có thể phân kỳ.&lt;/li&gt;
  &lt;/ul&gt;
&lt;/div&gt;
</content>
 </entry>
 
 <entry>
   <title>Chuỗi đan dấu, hội tụ tuyệt đối và bán hội tụ</title>
   <link href="https://calculus-self-learning.pages.dev/contents/vi/chapter07/07_04_Chuoi_dan_dau_va_hoi_tu_tuyet_doi/"/>
   <updated>2026-12-01T00:00:00+00:00</updated>
   <id>https://calculus-self-learning.pages.dev/contents/vi/chapter07/07_04_Chuoi_dan_dau_va_hoi_tu_tuyet_doi</id>
   <content type="html">&lt;div class=&quot;textbook-objectives&quot;&gt;

  &lt;p&gt;&lt;strong&gt;Mục tiêu.&lt;/strong&gt; Sau bài này bạn có thể:&lt;/p&gt;

  &lt;ul&gt;
    &lt;li&gt;phát biểu và chứng minh tiêu chuẩn Leibniz cho chuỗi đan dấu;&lt;/li&gt;
    &lt;li&gt;ước lượng sai số khi cắt chuỗi đan dấu;&lt;/li&gt;
    &lt;li&gt;phân biệt hội tụ tuyệt đối và bán hội tụ (hội tụ có điều kiện);&lt;/li&gt;
    &lt;li&gt;chứng minh hội tụ tuyệt đối kéo theo hội tụ.&lt;/li&gt;
  &lt;/ul&gt;

&lt;/div&gt;

&lt;h2 id=&quot;vì-sao-cần-bài-này&quot;&gt;Vì sao cần bài này&lt;/h2&gt;

&lt;p&gt;Chuỗi điều hoà $1+\tfrac12+\tfrac13+\cdots$ phân kỳ. Nhưng nếu đổi dấu xen kẽ, $1-\tfrac12+\tfrac13-\tfrac14+\cdots$, các số hạng bù trừ nhau và tổng riêng dao động quanh một giá trị cố định, $\ln2\approx0.6931$. Nhiều khai triển quan trọng (như $e^{-1}$, $\sin x$, $\arctan x$) là chuỗi đan dấu, và với chúng ta có một ước lượng sai số rất đơn giản.&lt;/p&gt;

&lt;h2 id=&quot;tiêu-chuẩn-leibniz&quot;&gt;Tiêu chuẩn Leibniz&lt;/h2&gt;

&lt;div class=&quot;textbook-definition&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Định nghĩa.&lt;/strong&gt; Chuỗi &lt;strong&gt;đan dấu&lt;/strong&gt; có dạng $\sum_{n\ge1}(-1)^{n+1}b_n=b_1-b_2+b_3-\cdots$ với $b_n&amp;gt;0$.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-theorem&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Định lý 1 (Leibniz).&lt;/strong&gt; Nếu $b_n$ giảm và $b_n\to0$ thì chuỗi $\sum(-1)^{n+1}b_n$ hội tụ đến một tổng $S$, và với mọi $N$:&lt;/p&gt;

\[|S-S_N|\le b_{N+1},\]

  &lt;p&gt;đồng thời $S-S_N$ cùng dấu với số hạng đầu tiên bị bỏ đi.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-proof&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Chứng minh.&lt;/strong&gt; Xét các tổng riêng chẵn: $S_{2m+2}=S_{2m}+(b_{2m+1}-b_{2m+2})\ge S_{2m}$, nên $(S_{2m})$ tăng. Mặt khác $S_{2m}=b_1-(b_2-b_3)-\cdots-(b_{2m-2}-b_{2m-1})-b_{2m}\le b_1$. Theo định lý dãy đơn điệu bị chặn, $S_{2m}\to S$. Vì $S_{2m+1}=S_{2m}+b_{2m+1}$ và $b_{2m+1}\to0$, cũng có $S_{2m+1}\to S$. Vậy $S_N\to S$.&lt;/p&gt;

  &lt;p&gt;Tương tự, các tổng riêng lẻ giảm, nên $S_{2m}\le S\le S_{2m+1}$ với mọi $m$: $S$ luôn nằm giữa hai tổng riêng liên tiếp. Do đó $\vert S-S_N\vert \le\vert S_{N+1}-S_N\vert =b_{N+1}$.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Ví dụ 1 ($1/e$).&lt;/strong&gt; Ở chương 8 ta sẽ thấy $\dfrac1e=\sum_{n\ge0}\dfrac{(-1)^n}{n!}=1-1+\tfrac12-\tfrac16+\tfrac1{24}-\tfrac1{120}+\cdots$. Tổng đến $n=5$:&lt;/p&gt;

\[S=1-1+0.5-0.16667+0.04167-0.00833=0.36667 .\]

  &lt;p&gt;Sai số không quá số hạng kế tiếp, $\tfrac1{720}\approx0.00139$. Thực tế $\tfrac1e=0.367879$, sai số $0.00121$.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Ví dụ 2 (Cần bao nhiêu số hạng).&lt;/strong&gt; Để tính $\sum_{n\ge1}\dfrac{(-1)^{n+1}}{n^4}$ với sai số dưới $10^{-4}$, cần $\tfrac1{(N+1)^4}&amp;lt;10^{-4}$, tức $N+1&amp;gt;10$, nghĩa là $N=10$ số hạng. Với chuỗi $1-\tfrac12+\tfrac13-\cdots$ thì cần $N\ge10^4$ số hạng cho cùng độ chính xác: chuỗi bán hội tụ thường hội tụ rất chậm.&lt;/p&gt;
&lt;/div&gt;

&lt;h2 id=&quot;hội-tụ-tuyệt-đối-và-bán-hội-tụ&quot;&gt;Hội tụ tuyệt đối và bán hội tụ&lt;/h2&gt;

&lt;div class=&quot;textbook-definition&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Định nghĩa.&lt;/strong&gt; Chuỗi $\sum a_n$ &lt;strong&gt;hội tụ tuyệt đối&lt;/strong&gt; nếu $\sum\vert a_n\vert $ hội tụ. Chuỗi hội tụ nhưng không hội tụ tuyệt đối gọi là &lt;strong&gt;bán hội tụ&lt;/strong&gt; (hội tụ có điều kiện).&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-theorem&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Định lý 2.&lt;/strong&gt; Hội tụ tuyệt đối kéo theo hội tụ.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-proof&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Chứng minh.&lt;/strong&gt; Ta có $0\le a_n+\vert a_n\vert \le2\vert a_n\vert $. Theo tiêu chuẩn so sánh, $\sum(a_n+\vert a_n\vert )$ hội tụ. Vậy $\sum a_n=\sum(a_n+\vert a_n\vert )-\sum\vert a_n\vert $ là hiệu của hai chuỗi hội tụ.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Ví dụ 3.&lt;/strong&gt;&lt;/p&gt;

  &lt;ul&gt;
    &lt;li&gt;$\sum\dfrac{(-1)^n}{n^2}$ hội tụ tuyệt đối.&lt;/li&gt;
    &lt;li&gt;$\sum\dfrac{(-1)^{n+1}}n$ bán hội tụ: hội tụ theo Leibniz (tổng $\ln2$), nhưng chuỗi trị tuyệt đối là chuỗi điều hoà.&lt;/li&gt;
    &lt;li&gt;$\sum\dfrac{\sin n}{n^2}$ (không đan dấu đều đặn): $\left\lvert\dfrac{\sin n}{n^2}\right\rvert\le\dfrac1{n^2}$, nên hội tụ tuyệt đối.&lt;/li&gt;
    &lt;li&gt;Tổng quát, $\sum\dfrac{(-1)^n}{n^p}$ hội tụ tuyệt đối khi $p&amp;gt;1$, bán hội tụ khi $0&amp;lt;p\le1$, phân kỳ khi $p\le0$.&lt;/li&gt;
  &lt;/ul&gt;
&lt;/div&gt;

&lt;p&gt;Tiêu chuẩn tỉ số và căn (bài 07_03) áp dụng cho $\vert a_n\vert $: nếu $\rho&amp;lt;1$ chuỗi hội tụ tuyệt đối, nếu $\rho&amp;gt;1$ số hạng không dần về 0 nên chuỗi phân kỳ.&lt;/p&gt;

&lt;p&gt;Sự khác biệt giữa hai loại hội tụ rất sâu sắc: bài 07_05 cho thấy chỉ chuỗi hội tụ tuyệt đối mới cho phép sắp xếp lại số hạng mà không đổi tổng.&lt;/p&gt;

&lt;h2 id=&quot;ứng-dụng&quot;&gt;Ứng dụng&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Vật lý: thế năng của tinh thể (hằng số Madelung).&lt;/strong&gt; Trong một chuỗi ion dương và âm xen kẽ cách nhau $d$, thế năng của một ion tỉ lệ với $2\left(1-\tfrac12+\tfrac13-\cdots\right)=2\ln2\approx1.386$. Đây là chuỗi bán hội tụ; trong tinh thể ba chiều (như NaCl), các tổng tương tự nhạy cảm với cách cộng, và các nhà vật lý phải dùng phương pháp cộng đặc biệt (Ewald).&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Tính toán số: ước lượng sai số miễn phí.&lt;/strong&gt; Khi một hàm có khai triển đan dấu với số hạng giảm, như $\sin x=x-\tfrac{x^3}6+\cdots$ với $\vert x\vert \le1$, định lý 1 cho ngay sai số: $\vert \sin x-x\vert \le\tfrac{\vert x\vert ^3}6$. Với $x=0.1$, sai số dưới $1.7\times10^{-4}$.&lt;/p&gt;

&lt;h2 id=&quot;bài-tập&quot;&gt;Bài tập&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Cơ bản.&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;Xét hội tụ tuyệt đối, bán hội tụ hay phân kỳ: $\sum\dfrac{(-1)^n}{\sqrt n}$, $\sum\dfrac{(-1)^n n}{n+1}$, $\sum\dfrac{(-1)^n}{2^n}$.&lt;/li&gt;
  &lt;li&gt;Tính $\sum_{n\ge1}\dfrac{(-1)^{n+1}}{n^3}$ với sai số dưới $0.01$.&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Đáp án&lt;/summary&gt;

  &lt;ol&gt;
    &lt;li&gt;Bán hội tụ; phân kỳ (số hạng không dần về 0); hội tụ tuyệt đối.&lt;/li&gt;
    &lt;li&gt;Cần $\tfrac1{(N+1)^3}&amp;lt;0.01$, tức $N=4$: $1-\tfrac18+\tfrac1{27}-\tfrac1{64}\approx0.896$ (giá trị thật $0.9015$).&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;p&gt;&lt;strong&gt;Trung bình.&lt;/strong&gt;&lt;/p&gt;

&lt;ol start=&quot;3&quot;&gt;
  &lt;li&gt;Chứng minh $\sum_{n\ge2}\dfrac{(-1)^n}{\ln n}$ bán hội tụ.&lt;/li&gt;
  &lt;li&gt;Với giá trị nào của $x$ thì $\sum\dfrac{x^n}n$ hội tụ tuyệt đối, bán hội tụ?&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Đáp án&lt;/summary&gt;

  &lt;ol start=&quot;3&quot;&gt;
    &lt;li&gt;$\tfrac1{\ln n}$ giảm về 0: hội tụ theo Leibniz. $\tfrac1{\ln n}&amp;gt;\tfrac1n$ nên chuỗi trị tuyệt đối phân kỳ.&lt;/li&gt;
    &lt;li&gt;Tỉ số $\to\vert x\vert $: hội tụ tuyệt đối khi $\vert x\vert &amp;lt;1$, phân kỳ khi $\vert x\vert &amp;gt;1$. Tại $x=1$ phân kỳ (điều hoà); tại $x=-1$ bán hội tụ.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;p&gt;&lt;strong&gt;Nâng cao.&lt;/strong&gt;&lt;/p&gt;

&lt;ol start=&quot;5&quot;&gt;
  &lt;li&gt;Giải thích vì sao điều kiện “$b_n$ giảm” là cần trong tiêu chuẩn Leibniz: xét chuỗi $\tfrac1{\sqrt2-1}-\tfrac1{\sqrt2+1}+\tfrac1{\sqrt3-1}-\tfrac1{\sqrt3+1}+\cdots$.&lt;/li&gt;
  &lt;li&gt;Chứng minh rằng nếu $\sum a_n$ hội tụ tuyệt đối thì $\sum a_n^2$ hội tụ. Điều ngược lại có đúng không?&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Gợi ý&lt;/summary&gt;

  &lt;ol start=&quot;5&quot;&gt;
    &lt;li&gt;Mỗi cặp bằng $\dfrac1{\sqrt n-1}-\dfrac1{\sqrt n+1}=\dfrac2{n-1}$, tổng các cặp phân kỳ như chuỗi điều hoà, dù $b_n\to0$.&lt;/li&gt;
    &lt;li&gt;$\vert a_n\vert \to0$ nên $\vert a_n\vert &amp;lt;1$ khi $n$ lớn, do đó $a_n^2\le\vert a_n\vert $. Ngược lại sai: $a_n=\tfrac1n$.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;h2 id=&quot;tóm-tắt&quot;&gt;Tóm tắt&lt;/h2&gt;

&lt;div class=&quot;content-box summary-box textbook-block&quot;&gt;
  &lt;ul&gt;
    &lt;li&gt;Leibniz: $b_n$ giảm về 0 thì $\sum(-1)^{n+1}b_n$ hội tụ, và $\vert S-S_N\vert \le b_{N+1}$.&lt;/li&gt;
    &lt;li&gt;Hội tụ tuyệt đối ($\sum\vert a_n\vert &amp;lt;\infty$) kéo theo hội tụ.&lt;/li&gt;
    &lt;li&gt;Bán hội tụ: hội tụ nhưng $\sum\vert a_n\vert =\infty$, ví dụ $\sum\tfrac{(-1)^{n+1}}n=\ln2$; thường hội tụ chậm.&lt;/li&gt;
    &lt;li&gt;Tỉ số và căn áp dụng cho $\vert a_n\vert $ cho kết luận hội tụ tuyệt đối.&lt;/li&gt;
  &lt;/ul&gt;
&lt;/div&gt;
</content>
 </entry>
 
 <entry>
   <title>Các tiêu chuẩn hội tụ chuỗi số dương</title>
   <link href="https://calculus-self-learning.pages.dev/contents/vi/chapter07/07_03_Cac_tieu_chuan_hoi_tu_chuoi_so_duong/"/>
   <updated>2026-12-01T00:00:00+00:00</updated>
   <id>https://calculus-self-learning.pages.dev/contents/vi/chapter07/07_03_Cac_tieu_chuan_hoi_tu_chuoi_so_duong</id>
   <content type="html">&lt;div class=&quot;textbook-objectives&quot;&gt;

  &lt;p&gt;&lt;strong&gt;Mục tiêu.&lt;/strong&gt; Sau bài này bạn có thể:&lt;/p&gt;

  &lt;ul&gt;
    &lt;li&gt;dùng tiêu chuẩn tích phân để chứng minh chuỗi $p$ hội tụ khi và chỉ khi $p&amp;gt;1$, và ước lượng phần dư;&lt;/li&gt;
    &lt;li&gt;dùng tiêu chuẩn so sánh và so sánh giới hạn với chuỗi $p$ hoặc chuỗi hình học;&lt;/li&gt;
    &lt;li&gt;dùng tiêu chuẩn d’Alembert (tỉ số) và Cauchy (căn) cho chuỗi có giai thừa hoặc lũy thừa bậc $n$;&lt;/li&gt;
    &lt;li&gt;chọn tiêu chuẩn phù hợp cho từng dạng số hạng.&lt;/li&gt;
  &lt;/ul&gt;

&lt;/div&gt;

&lt;h2 id=&quot;vì-sao-cần-bài-này&quot;&gt;Vì sao cần bài này&lt;/h2&gt;

&lt;p&gt;Rất ít chuỗi tính được tổng chính xác như chuỗi hình học. Thường ta chỉ cần biết chuỗi có hội tụ không, rồi tính gần đúng bằng máy. Với chuỗi số dương $a_n\ge0$, tổng riêng tăng, nên theo định lý dãy đơn điệu bị chặn (bài 07_01): &lt;strong&gt;chuỗi số dương hội tụ khi và chỉ khi dãy tổng riêng bị chặn trên&lt;/strong&gt;. Mọi tiêu chuẩn trong bài đều dựa trên nhận xét này.&lt;/p&gt;

&lt;h2 id=&quot;tiêu-chuẩn-tích-phân&quot;&gt;Tiêu chuẩn tích phân&lt;/h2&gt;

&lt;div class=&quot;textbook-theorem&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Định lý 1 (Tiêu chuẩn tích phân).&lt;/strong&gt; Cho $f$ liên tục, dương, giảm trên $[1,\infty)$ và $a_n=f(n)$. Khi đó $\sum a_n$ và $\int_1^\infty f(x)\,dx$ cùng hội tụ hoặc cùng phân kỳ. Khi hội tụ, phần dư $R_N=\sum_{n&amp;gt;N}a_n$ thoả&lt;/p&gt;

\[\int_{N+1}^\infty f(x)\,dx\le R_N\le\int_N^\infty f(x)\,dx .\]

&lt;/div&gt;

&lt;div class=&quot;textbook-proof&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Chứng minh.&lt;/strong&gt; Vì $f$ giảm, trên $[n,n+1]$ ta có $f(n+1)\le f(x)\le f(n)$. Tích phân: $a_{n+1}\le\int_n^{n+1}f\le a_n$. Cộng từ $n=1$ đến $N-1$: $S_N-a_1\le\int_1^Nf\le S_{N-1}$. Nếu tích phân hội tụ, $S_N\le a_1+\int_1^\infty f$ bị chặn; nếu tích phân phân kỳ, $S_{N-1}\ge\int_1^Nf\to\infty$. Ước lượng phần dư làm tương tự trên $[N,\infty)$.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-theorem&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Hệ quả (Chuỗi $p$).&lt;/strong&gt; $\displaystyle\sum_{n=1}^\infty\frac1{n^p}$ hội tụ khi và chỉ khi $p&amp;gt;1$ (so với $\int_1^\infty x^{-p}\,dx$, bài 05_05).&lt;/p&gt;
&lt;/div&gt;

&lt;p&gt;Tiêu chuẩn tích phân cũng giải thích vì sao $\sum_{n\le N}\tfrac1n\approx\ln N$. Một kết quả nổi tiếng (Euler): $\sum\tfrac1{n^2}=\tfrac{\pi^2}6\approx1.645$; ta sẽ thấy lý do ở chương 8.&lt;/p&gt;

&lt;h2 id=&quot;so-sánh&quot;&gt;So sánh&lt;/h2&gt;

&lt;div class=&quot;textbook-theorem&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Định lý 2 (So sánh).&lt;/strong&gt; Nếu $0\le a_n\le b_n$ với mọi $n$ đủ lớn: $\sum b_n$ hội tụ thì $\sum a_n$ hội tụ; $\sum a_n$ phân kỳ thì $\sum b_n$ phân kỳ.&lt;/p&gt;

  &lt;p&gt;&lt;strong&gt;Định lý 3 (So sánh giới hạn).&lt;/strong&gt; Nếu $a_n,b_n&amp;gt;0$ và $\dfrac{a_n}{b_n}\to L\in(0,\infty)$ thì hai chuỗi cùng hội tụ hoặc cùng phân kỳ.&lt;/p&gt;
&lt;/div&gt;

&lt;p&gt;Chứng minh như với tích phân suy rộng (bài 05_05): tổng riêng của $\sum a_n$ bị chặn bởi tổng của $\sum b_n$. Mẹo: giữ lại số hạng “trội” ở tử và mẫu để đoán chuỗi so sánh.&lt;/p&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Ví dụ 1.&lt;/strong&gt;&lt;/p&gt;

  &lt;ul&gt;
    &lt;li&gt;$\sum\dfrac1{n^2+1}$ hội tụ: $\dfrac1{n^2+1}&amp;lt;\dfrac1{n^2}$.&lt;/li&gt;
    &lt;li&gt;$\sum\dfrac1{\sqrt n}$ phân kỳ: chuỗi $p$ với $p=\tfrac12$.&lt;/li&gt;
    &lt;li&gt;$\sum\dfrac{2n+3}{n^3-n+5}$ hội tụ: so sánh giới hạn với $\dfrac{2n}{n^3}=\dfrac2{n^2}$, tỉ số dần về 1.&lt;/li&gt;
    &lt;li&gt;$\sum\dfrac{\ln n}{n^2}$ hội tụ: với $n$ lớn, $\ln n\le\sqrt n$, nên số hạng $\le\dfrac1{n^{3/2}}$.&lt;/li&gt;
  &lt;/ul&gt;
&lt;/div&gt;

&lt;h2 id=&quot;tiêu-chuẩn-dalembert-và-cauchy&quot;&gt;Tiêu chuẩn d’Alembert và Cauchy&lt;/h2&gt;

&lt;div class=&quot;textbook-theorem&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Định lý 4 (D’Alembert, tỉ số).&lt;/strong&gt; Cho $a_n&amp;gt;0$ và $\dfrac{a_{n+1}}{a_n}\to\rho$. Nếu $\rho&amp;lt;1$ chuỗi hội tụ; nếu $\rho&amp;gt;1$ chuỗi phân kỳ; nếu $\rho=1$ chưa kết luận được.&lt;/p&gt;

  &lt;p&gt;&lt;strong&gt;Định lý 5 (Cauchy, căn).&lt;/strong&gt; Cho $a_n\ge0$ và $\sqrt[n]{a_n}\to\rho$. Kết luận như trên.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-proof&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Chứng minh (định lý 4, trường hợp $\rho&amp;lt;1$).&lt;/strong&gt; Chọn $q$ với $\rho&amp;lt;q&amp;lt;1$. Có $N$ để $\dfrac{a_{n+1}}{a_n}&amp;lt;q$ với $n\ge N$, nên $a_{N+k}&amp;lt;a_Nq^k$. Chuỗi $\sum a_Nq^k$ là chuỗi hình học hội tụ; dùng so sánh. Nếu $\rho&amp;gt;1$ thì $a_n$ tăng từ một chỉ số nào đó, không dần về 0.&lt;/p&gt;
&lt;/div&gt;

&lt;p&gt;Với chuỗi $p$, $\tfrac{a_{n+1}}{a_n}=\left(\tfrac n{n+1}\right)^p\to1$ với mọi $p$: tiêu chuẩn tỉ số không phân biệt được $p&amp;gt;1$ và $p\le1$.&lt;/p&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Ví dụ 2.&lt;/strong&gt;&lt;/p&gt;

  &lt;ul&gt;
    &lt;li&gt;$\sum\dfrac{2^n}{n!}$: $\dfrac{a_{n+1}}{a_n}=\dfrac2{n+1}\to0$, hội tụ (tổng bằng $e^2-1$, chương 8).&lt;/li&gt;
    &lt;li&gt;$\sum\dfrac{n!}{n^n}$: $\dfrac{a_{n+1}}{a_n}=\left(\dfrac n{n+1}\right)^n\to\dfrac1e&amp;lt;1$, hội tụ.&lt;/li&gt;
    &lt;li&gt;$\sum\left(\dfrac n{2n+1}\right)^n$: $\sqrt[n]{a_n}=\dfrac n{2n+1}\to\dfrac12$, hội tụ.&lt;/li&gt;
  &lt;/ul&gt;
&lt;/div&gt;

&lt;div class=&quot;content-box insight-box textbook-block&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Chọn tiêu chuẩn.&lt;/strong&gt;&lt;/p&gt;

  &lt;ol&gt;
    &lt;li&gt;Số hạng không dần về 0? Phân kỳ ngay.&lt;/li&gt;
    &lt;li&gt;Phân thức của lũy thừa $n$ (có căn, có $\ln$)? So sánh hoặc so sánh giới hạn với chuỗi $p$.&lt;/li&gt;
    &lt;li&gt;Có $n!$, $a^n$, $n^n$? Tiêu chuẩn tỉ số.&lt;/li&gt;
    &lt;li&gt;Cả số hạng là lũy thừa bậc $n$? Tiêu chuẩn căn.&lt;/li&gt;
    &lt;li&gt;Số hạng là $f(n)$ với $f$ dễ lấy tích phân (như $\tfrac1{n\ln n}$)? Tiêu chuẩn tích phân.&lt;/li&gt;
  &lt;/ol&gt;
&lt;/div&gt;

&lt;div class=&quot;interactive-frame&quot;&gt;
  &lt;div class=&quot;interactive-frame-head&quot;&gt;
    &lt;div class=&quot;interactive-frame-title&quot;&gt;Các tiêu chuẩn hội tụ&lt;/div&gt;
    &lt;div class=&quot;interactive-frame-desc&quot;&gt;Tổng riêng, tỉ số, căn bậc n và so sánh với 1/nᵖ.&lt;/div&gt;
  &lt;/div&gt;
  &lt;iframe src=&quot;/interactives/chapter07/series-tests.html&quot; title=&quot;Các tiêu chuẩn hội tụ&quot; loading=&quot;lazy&quot; style=&quot;height: 700px;&quot;&gt;&lt;/iframe&gt;
  &lt;div class=&quot;interactive-frame-foot&quot;&gt;
    &lt;a href=&quot;/interactives/chapter07/series-tests.html&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;Mở minh hoạ ở cửa sổ riêng&lt;/a&gt;
  &lt;/div&gt;
&lt;/div&gt;

&lt;h2 id=&quot;ứng-dụng&quot;&gt;Ứng dụng&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Học máy: điều kiện Robbins–Monro.&lt;/strong&gt; Gradient descent ngẫu nhiên hội tụ (dưới các giả thiết thích hợp) khi tốc độ học thoả $\sum\eta_n=\infty$ và $\sum\eta_n^2&amp;lt;\infty$. Lịch $\eta_n=\tfrac1n$ thoả cả hai (chuỗi điều hoà phân kỳ, $\sum\tfrac1{n^2}$ hội tụ). Lịch $\eta_n=\tfrac1{\sqrt n}$ không thoả điều kiện thứ hai; tốc độ học hằng số không thoả điều kiện thứ hai.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Tính toán: ước lượng sai số.&lt;/strong&gt; Cần bao nhiêu số hạng để $\sum\tfrac1{n^3}$ có sai số dưới $10^{-3}$? Theo định lý 1, $R_N\le\int_N^\infty\tfrac{dx}{x^3}=\tfrac1{2N^2}&amp;lt;10^{-3}$ khi $N\ge23$.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Tin học: kỳ vọng số bước.&lt;/strong&gt; Một thuật toán ngẫu nhiên dừng ở bước $k$ với xác suất $2^{-k}$. Số bước trung bình $\sum\tfrac k{2^k}$ hội tụ theo tiêu chuẩn tỉ số ($\rho=\tfrac12$), và bằng 2 (bài tập 6 bài 07_02).&lt;/p&gt;

&lt;h2 id=&quot;bài-tập&quot;&gt;Bài tập&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Cơ bản.&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;Xét hội tụ: $\sum\dfrac1{n^3+n}$, $\sum\dfrac1{2n-1}$.&lt;/li&gt;
  &lt;li&gt;Xét hội tụ: $\sum\dfrac{n^2}{3^n}$, $\sum\dfrac{(2n)!}{(n!)^2}$.&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Đáp án&lt;/summary&gt;

  &lt;ol&gt;
    &lt;li&gt;Hội tụ (so với $\tfrac1{n^3}$); phân kỳ (so sánh giới hạn với $\tfrac1n$).&lt;/li&gt;
    &lt;li&gt;Tỉ số $\to\tfrac13$: hội tụ. Tỉ số $\dfrac{(2n+2)(2n+1)}{(n+1)^2}\to4$: phân kỳ.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;p&gt;&lt;strong&gt;Trung bình.&lt;/strong&gt;&lt;/p&gt;

&lt;ol start=&quot;3&quot;&gt;
  &lt;li&gt;Xét hội tụ: $\sum_{n\ge2}\dfrac1{n\ln n}$ và $\sum_{n\ge2}\dfrac1{n(\ln n)^2}$.&lt;/li&gt;
  &lt;li&gt;Với $k$ cố định, chứng minh $\sum\dfrac{n^k}{e^n}$ hội tụ.&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Đáp án&lt;/summary&gt;

  &lt;ol start=&quot;3&quot;&gt;
    &lt;li&gt;Tiêu chuẩn tích phân: $\int\tfrac{dx}{x\ln x}=\ln\ln x\to\infty$, phân kỳ; $\int\tfrac{dx}{x(\ln x)^2}=-\tfrac1{\ln x}$ hội tụ, nên chuỗi hội tụ.&lt;/li&gt;
    &lt;li&gt;Tỉ số $\left(\tfrac{n+1}n\right)^k\tfrac1e\to\tfrac1e&amp;lt;1$.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;p&gt;&lt;strong&gt;Nâng cao.&lt;/strong&gt;&lt;/p&gt;

&lt;ol start=&quot;5&quot;&gt;
  &lt;li&gt;Dùng tiêu chuẩn tích phân để chứng minh $1.6\le\sum_{n=1}^\infty\tfrac1{n^2}\le1.7$ chỉ từ 3 số hạng đầu.&lt;/li&gt;
  &lt;li&gt;Chứng minh $\ln(N+1)\le\sum_{n=1}^N\tfrac1n\le1+\ln N$.&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Gợi ý&lt;/summary&gt;

  &lt;ol start=&quot;5&quot;&gt;
    &lt;li&gt;$S_3=1+\tfrac14+\tfrac19\approx1.3611$. Phần dư $\int_4^\infty\tfrac{dx}{x^2}=\tfrac14\le R_3\le\int_3^\infty\tfrac{dx}{x^2}=\tfrac13$. Tổng nằm trong $[1.611,\ 1.695]$.&lt;/li&gt;
    &lt;li&gt;Từ chứng minh định lý 1 với $f=\tfrac1x$: $\int_1^{N+1}\tfrac{dx}x\le S_N\le1+\int_1^N\tfrac{dx}x$.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;h2 id=&quot;tóm-tắt&quot;&gt;Tóm tắt&lt;/h2&gt;

&lt;div class=&quot;content-box summary-box textbook-block&quot;&gt;
  &lt;ul&gt;
    &lt;li&gt;Chuỗi số dương hội tụ khi và chỉ khi tổng riêng bị chặn.&lt;/li&gt;
    &lt;li&gt;Tiêu chuẩn tích phân: $\sum f(n)$ và $\int_1^\infty f$ cùng tính chất; chuỗi $p$ hội tụ khi và chỉ khi $p&amp;gt;1$; phần dư nằm giữa hai tích phân.&lt;/li&gt;
    &lt;li&gt;So sánh, so sánh giới hạn: đối chiếu với chuỗi $p$ hoặc chuỗi hình học.&lt;/li&gt;
    &lt;li&gt;Tỉ số, căn: $\rho&amp;lt;1$ hội tụ, $\rho&amp;gt;1$ phân kỳ, $\rho=1$ chưa kết luận; hợp với giai thừa và lũy thừa bậc $n$.&lt;/li&gt;
  &lt;/ul&gt;
&lt;/div&gt;
</content>
 </entry>
 
 <entry>
   <title>Chuỗi số, chuỗi hình học và chuỗi điều hoà</title>
   <link href="https://calculus-self-learning.pages.dev/contents/vi/chapter07/07_02_Chuoi_so_chuoi_hinh_hoc_va_chuoi_dieu_hoa/"/>
   <updated>2026-12-01T00:00:00+00:00</updated>
   <id>https://calculus-self-learning.pages.dev/contents/vi/chapter07/07_02_Chuoi_so_chuoi_hinh_hoc_va_chuoi_dieu_hoa</id>
   <content type="html">&lt;div class=&quot;textbook-objectives&quot;&gt;

  &lt;p&gt;&lt;strong&gt;Mục tiêu.&lt;/strong&gt; Sau bài này bạn có thể:&lt;/p&gt;

  &lt;ul&gt;
    &lt;li&gt;định nghĩa tổng của chuỗi qua dãy tổng riêng;&lt;/li&gt;
    &lt;li&gt;tính tổng chuỗi hình học và chuỗi lồng nhau (telescoping);&lt;/li&gt;
    &lt;li&gt;dùng điều kiện cần $a_n\to0$ để chứng minh chuỗi phân kỳ;&lt;/li&gt;
    &lt;li&gt;chứng minh chuỗi điều hoà phân kỳ và ước lượng tổng riêng của nó;&lt;/li&gt;
    &lt;li&gt;tính giá trị hiện tại của niên kim và tổng phần thưởng chiết khấu trong học tăng cường.&lt;/li&gt;
  &lt;/ul&gt;

&lt;/div&gt;

&lt;h2 id=&quot;vì-sao-cần-bài-này&quot;&gt;Vì sao cần bài này&lt;/h2&gt;

&lt;p&gt;Một quả bóng nảy vô số lần; tổng quãng đường đi được có hữu hạn không? Một khoản trợ cấp trả mỗi năm mãi mãi đáng giá bao nhiêu hôm nay? Một tác tử học tăng cường nhận phần thưởng ở mỗi bước, mỗi bước sau được nhân với $\gamma&amp;lt;1$; tổng phần thưởng là bao nhiêu? Cả ba câu hỏi là tổng của &lt;strong&gt;vô hạn&lt;/strong&gt; số hạng.&lt;/p&gt;

&lt;h2 id=&quot;chuỗi-và-tổng-riêng&quot;&gt;Chuỗi và tổng riêng&lt;/h2&gt;

&lt;div class=&quot;textbook-definition&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Định nghĩa 1 (Chuỗi số).&lt;/strong&gt; Với dãy $(a_n)$, tổng riêng thứ $N$ là $S_N=a_1+a_2+\dots+a_N$. Chuỗi $\sum_{n=1}^\infty a_n$ &lt;strong&gt;hội tụ&lt;/strong&gt; và có tổng $S$ nếu $S_N\to S$; ngược lại chuỗi &lt;strong&gt;phân kỳ&lt;/strong&gt;.&lt;/p&gt;
&lt;/div&gt;

&lt;p&gt;Nếu $\sum a_n=A$ và $\sum b_n=B$ thì $\sum(\alpha a_n+\beta b_n)=\alpha A+\beta B$ (quy tắc giới hạn cho tổng riêng). Bỏ đi hoặc thêm vào hữu hạn số hạng không thay đổi tính hội tụ.&lt;/p&gt;

&lt;div class=&quot;textbook-theorem&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Định lý 1 (Chuỗi hình học).&lt;/strong&gt; Với $a\ne0$, chuỗi $\sum_{n=0}^\infty ar^n$ hội tụ khi và chỉ khi $\lvert r\rvert&amp;lt;1$, và khi đó&lt;/p&gt;

\[\sum_{n=0}^\infty ar^n=\frac a{1-r} .\]

&lt;/div&gt;

&lt;div class=&quot;textbook-proof&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Chứng minh.&lt;/strong&gt; Với $r\ne1$: $S_N=a+ar+\dots+ar^N$ và $rS_N=ar+\dots+ar^{N+1}$. Trừ hai đẳng thức: $(1-r)S_N=a(1-r^{N+1})$, nên $S_N=a\dfrac{1-r^{N+1}}{1-r}$. Khi $\lvert r\rvert&amp;lt;1$, $r^{N+1}\to0$ và $S_N\to\dfrac a{1-r}$. Khi $\lvert r\rvert\ge1$, $ar^N$ không dần về 0 nên chuỗi phân kỳ (định lý 2).&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Ví dụ 1.&lt;/strong&gt;&lt;/p&gt;

  &lt;ul&gt;
    &lt;li&gt;$0.999\ldots=\dfrac9{10}+\dfrac9{100}+\dots=\dfrac{9/10}{1-1/10}=1$.&lt;/li&gt;
    &lt;li&gt;$\sum_{n=1}^\infty\dfrac1{n(n+1)}$: vì $\dfrac1{n(n+1)}=\dfrac1n-\dfrac1{n+1}$, tổng riêng &lt;strong&gt;lồng nhau&lt;/strong&gt;: $S_N=1-\dfrac1{N+1}\to1$.&lt;/li&gt;
  &lt;/ul&gt;
&lt;/div&gt;

&lt;h2 id=&quot;điều-kiện-cần-và-chuỗi-điều-hoà&quot;&gt;Điều kiện cần và chuỗi điều hoà&lt;/h2&gt;

&lt;div class=&quot;textbook-theorem&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Định lý 2 (Điều kiện cần).&lt;/strong&gt; Nếu $\sum a_n$ hội tụ thì $a_n\to0$. Tương đương: nếu $a_n\not\to0$ thì chuỗi phân kỳ.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-proof&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Chứng minh.&lt;/strong&gt; $a_n=S_n-S_{n-1}\to S-S=0$.&lt;/p&gt;
&lt;/div&gt;

&lt;p&gt;Chiều ngược lại &lt;strong&gt;sai&lt;/strong&gt;: $a_n\to0$ chưa đủ để chuỗi hội tụ.&lt;/p&gt;

&lt;div class=&quot;textbook-theorem&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Định lý 3 (Chuỗi điều hoà phân kỳ).&lt;/strong&gt; $\displaystyle\sum_{n=1}^\infty\frac1n=\infty$, dù $\dfrac1n\to0$.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-proof&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Chứng minh (Oresme, thế kỷ 14).&lt;/strong&gt; Gom thành nhóm có $1,1,2,4,8,\dots$ số hạng:&lt;/p&gt;

\[1+\tfrac12+\left(\tfrac13+\tfrac14\right)+\left(\tfrac15+\dots+\tfrac18\right)+\dots\ge1+\tfrac12+\tfrac24+\tfrac48+\dots\]

  &lt;p&gt;Mỗi nhóm $\left(\tfrac1{2^{k-1}+1}+\dots+\tfrac1{2^k}\right)$ có $2^{k-1}$ số hạng, mỗi số hạng $\ge\tfrac1{2^k}$, nên nhóm $\ge\tfrac12$. Vậy $S_{2^k}\ge1+\tfrac k2\to\infty$. Tổng riêng tăng, nên $S_N\to\infty$.&lt;/p&gt;
&lt;/div&gt;

&lt;p&gt;Chuỗi điều hoà phân kỳ rất chậm: $S_N\approx\ln N+0.5772$ (hằng số Euler–Mascheroni; bài 07_03 giải thích $\ln N$). Một triệu số hạng chỉ cho $S_{10^6}\approx14.39$.&lt;/p&gt;

&lt;h2 id=&quot;video-ngắn&quot;&gt;Video ngắn&lt;/h2&gt;

&lt;div class=&quot;reel-video&quot;&gt;
  &lt;video controls=&quot;&quot; playsinline=&quot;&quot; preload=&quot;metadata&quot; src=&quot;/public/videos/reels/harmonic-stacking.mp4&quot;&gt;&lt;/video&gt;
  &lt;p class=&quot;reel-caption&quot;&gt;Chồng khối nhô khỏi mép bàn: độ nhô bằng nửa tổng điều hoà, lớn mãi không có trần (video không lời, khoảng 2 phút).&lt;/p&gt;
&lt;/div&gt;

&lt;h2 id=&quot;ứng-dụng&quot;&gt;Ứng dụng&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Kinh tế: niên kim.&lt;/strong&gt; Nhận $P$ đồng vào cuối mỗi năm trong $n$ năm, lãi suất $i$ mỗi năm. Giá trị hiện tại là tổng hữu hạn của chuỗi hình học công bội $\tfrac1{1+i}$:&lt;/p&gt;

\[PV=\sum_{k=1}^n\frac P{(1+i)^k}=P\,\frac{1-(1+i)^{-n}}i .\]

&lt;p&gt;Với $P=10$ triệu, $i=8\%$, $n=10$: $PV\approx67.10$ triệu. Khi $n\to\infty$ (trợ cấp vĩnh viễn): $PV=\tfrac Pi=125$ triệu.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Học máy: chiết khấu trong học tăng cường.&lt;/strong&gt; Tổng phần thưởng chiết khấu là $G=\sum_{k=0}^\infty\gamma^kr_k$. Nếu mọi $\lvert r_k\rvert\le R$ và $0\le\gamma&amp;lt;1$ thì $\lvert G\rvert\le\dfrac R{1-\gamma}$. Với $\gamma=0.9$ và phần thưởng 1 mỗi bước, $G=10$: $\tfrac1{1-\gamma}$ thường được gọi là “tầm nhìn hiệu dụng” của tác tử.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Tin học: thuật toán chia để trị.&lt;/strong&gt; Nếu mỗi tầng đệ quy chỉ làm việc trên một nửa dữ liệu của tầng trước (ví dụ tìm trung vị bằng quickselect trong trường hợp tốt), tổng công việc là $n+\tfrac n2+\tfrac n4+\dots\le2n$: tuyến tính.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Vật lý: quả bóng nảy.&lt;/strong&gt; Thả từ 2 m, mỗi lần nảy cao bằng 80% lần trước. Quãng đường $=2+2\sum_{k=1}^\infty2\cdot0.8^k=2+2\cdot\dfrac{1.6}{0.2}=18$ m: vô số lần nảy nhưng quãng đường hữu hạn.&lt;/p&gt;

&lt;h2 id=&quot;bài-tập&quot;&gt;Bài tập&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Cơ bản.&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;Tính $\sum_{n=0}^\infty\left(\tfrac23\right)^n$ và $\sum_{n=1}^\infty3\left(-\tfrac12\right)^n$.&lt;/li&gt;
  &lt;li&gt;Viết $0.272727\ldots$ dưới dạng phân số.&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Đáp án&lt;/summary&gt;

  &lt;ol&gt;
    &lt;li&gt;$3$; $3\cdot\dfrac{-1/2}{1+1/2}=-1$.&lt;/li&gt;
    &lt;li&gt;$\dfrac{27}{100}\cdot\dfrac1{1-1/100}=\dfrac{27}{99}=\dfrac3{11}$.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;p&gt;&lt;strong&gt;Trung bình.&lt;/strong&gt;&lt;/p&gt;

&lt;ol start=&quot;3&quot;&gt;
  &lt;li&gt;Tính $\sum_{n=1}^\infty\dfrac1{n^2+3n+2}$.&lt;/li&gt;
  &lt;li&gt;Chứng minh $\sum\dfrac n{n+1}$ và $\sum\ln\left(1+\dfrac1n\right)$ phân kỳ.&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Đáp án&lt;/summary&gt;

  &lt;ol start=&quot;3&quot;&gt;
    &lt;li&gt;$\dfrac1{(n+1)(n+2)}=\dfrac1{n+1}-\dfrac1{n+2}$, lồng nhau: tổng $\tfrac12$.&lt;/li&gt;
    &lt;li&gt;$\tfrac n{n+1}\to1\ne0$. Với chuỗi thứ hai $a_n\to0$ nhưng tổng riêng lồng nhau: $S_N=\ln(N+1)\to\infty$.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;p&gt;&lt;strong&gt;Nâng cao.&lt;/strong&gt;&lt;/p&gt;

&lt;ol start=&quot;5&quot;&gt;
  &lt;li&gt;Biến ngẫu nhiên hình học $X$ (số lần thử đến khi thành công lần đầu, xác suất thành công $p$) có $P(X=k)=p(1-p)^{k-1}$. Chứng minh tổng các xác suất bằng 1 và $E[X]=\sum_{k\ge1}kp(1-p)^{k-1}=\dfrac1p$.&lt;/li&gt;
  &lt;li&gt;Với $\lvert x\rvert&amp;lt;1$, tính $\sum_{k=1}^\infty kx^k$, rồi suy ra $\sum_{k\ge1}\dfrac k{2^k}$.&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Gợi ý&lt;/summary&gt;

  &lt;ol start=&quot;5&quot;&gt;
    &lt;li&gt;Chuỗi hình học công bội $q=1-p$. Với $T=\sum kq^{k-1}$: $T-qT=\sum_{k\ge0}q^k=\tfrac1{1-q}$, nên $T=\tfrac1{(1-q)^2}=\tfrac1{p^2}$ và $E[X]=pT=\tfrac1p$.&lt;/li&gt;
    &lt;li&gt;Cùng mẹo: $\sum kx^k=\dfrac x{(1-x)^2}$. Với $x=\tfrac12$: tổng bằng 2.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;h2 id=&quot;tóm-tắt&quot;&gt;Tóm tắt&lt;/h2&gt;

&lt;div class=&quot;content-box summary-box textbook-block&quot;&gt;
  &lt;ul&gt;
    &lt;li&gt;$\sum a_n=\lim S_N$; chuỗi hội tụ khi dãy tổng riêng hội tụ.&lt;/li&gt;
    &lt;li&gt;Chuỗi hình học $\sum_{n\ge0}ar^n=\tfrac a{1-r}$ khi $\lvert r\rvert&amp;lt;1$, phân kỳ khi $\lvert r\rvert\ge1$.&lt;/li&gt;
    &lt;li&gt;Chuỗi lồng nhau: viết $a_n=b_n-b_{n+1}$, khi đó $S_N=b_1-b_{N+1}$.&lt;/li&gt;
    &lt;li&gt;Nếu $a_n\not\to0$ thì chuỗi phân kỳ; nhưng $a_n\to0$ chưa đủ: chuỗi điều hoà phân kỳ, $S_N\approx\ln N$.&lt;/li&gt;
    &lt;li&gt;Niên kim, chiết khấu phần thưởng và quả bóng nảy đều là chuỗi hình học.&lt;/li&gt;
  &lt;/ul&gt;
&lt;/div&gt;
</content>
 </entry>
 
 <entry>
   <title>Dãy số và giới hạn của dãy</title>
   <link href="https://calculus-self-learning.pages.dev/contents/vi/chapter07/07_01_Day_so_va_gioi_han_cua_day/"/>
   <updated>2026-12-01T00:00:00+00:00</updated>
   <id>https://calculus-self-learning.pages.dev/contents/vi/chapter07/07_01_Day_so_va_gioi_han_cua_day</id>
   <content type="html">&lt;div class=&quot;textbook-objectives&quot;&gt;

  &lt;p&gt;&lt;strong&gt;Mục tiêu.&lt;/strong&gt; Sau bài này bạn có thể:&lt;/p&gt;

  &lt;ul&gt;
    &lt;li&gt;phát biểu định nghĩa $\varepsilon$–$N$ của giới hạn dãy và dùng nó cho ví dụ đơn giản;&lt;/li&gt;
    &lt;li&gt;tính giới hạn dãy bằng các quy tắc, nguyên lý kẹp và giới hạn của hàm tương ứng;&lt;/li&gt;
    &lt;li&gt;dùng định lý dãy đơn điệu bị chặn để chứng minh một dãy truy hồi hội tụ và tìm giới hạn;&lt;/li&gt;
    &lt;li&gt;phân tích sự hội tụ của gradient descent trên hàm bậc hai.&lt;/li&gt;
  &lt;/ul&gt;

&lt;/div&gt;

&lt;h2 id=&quot;vì-sao-cần-bài-này&quot;&gt;Vì sao cần bài này&lt;/h2&gt;

&lt;p&gt;Phương pháp Newton (bài 03_05), gradient descent, lãi kép theo kỳ đều sinh ra các &lt;strong&gt;dãy&lt;/strong&gt; số $a_1,a_2,a_3,\dots$ Câu hỏi luôn là: dãy có tiến tới một giá trị nào không, và nhanh đến đâu? Chuỗi số (các bài sau) cũng được định nghĩa qua dãy các tổng riêng.&lt;/p&gt;

&lt;h2 id=&quot;giới-hạn-của-dãy&quot;&gt;Giới hạn của dãy&lt;/h2&gt;

&lt;div class=&quot;textbook-definition&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Định nghĩa 1 (Giới hạn của dãy).&lt;/strong&gt; Dãy $(a_n)$ có giới hạn $L$, viết $\lim_{n\to\infty}a_n=L$ hay $a_n\to L$, nếu với mọi $\varepsilon&amp;gt;0$ có số $N$ sao cho $\lvert a_n-L\rvert&amp;lt;\varepsilon$ với mọi $n&amp;gt;N$. Dãy có giới hạn hữu hạn gọi là &lt;strong&gt;hội tụ&lt;/strong&gt;, ngược lại gọi là &lt;strong&gt;phân kỳ&lt;/strong&gt;.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Ví dụ 1.&lt;/strong&gt; $\dfrac{n+1}{2n-1}\to\dfrac12$. Ta có $\left\lvert\dfrac{n+1}{2n-1}-\dfrac12\right\rvert=\dfrac{3}{2(2n-1)}$. Muốn nhỏ hơn $\varepsilon$ chỉ cần $2n-1&amp;gt;\dfrac3{2\varepsilon}$, nên chọn $N=\dfrac3{4\varepsilon}+\dfrac12$.&lt;/p&gt;
&lt;/div&gt;

&lt;p&gt;Các quy tắc tính giới hạn tổng, hiệu, tích, thương và nguyên lý kẹp (bài 01_03, 01_04) đúng cho dãy với cùng chứng minh. Thêm một cầu nối hữu ích:&lt;/p&gt;

&lt;div class=&quot;textbook-theorem&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Định lý 1.&lt;/strong&gt; Nếu $\lim_{x\to\infty}f(x)=L$ và $a_n=f(n)$ thì $a_n\to L$. Nếu $a_n\to L$ và $g$ liên tục tại $L$ thì $g(a_n)\to g(L)$.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Ví dụ 2 (Các giới hạn chuẩn).&lt;/strong&gt;&lt;/p&gt;

  &lt;ul&gt;
    &lt;li&gt;$r^n\to0$ nếu $\lvert r\rvert&amp;lt;1$; $r^n\to\infty$ nếu $r&amp;gt;1$; $(-1)^n$ phân kỳ (dao động giữa $\pm1$).&lt;/li&gt;
    &lt;li&gt;$\dfrac{\ln n}n\to0$: L’Hôpital cho $\lim_{x\to\infty}\frac{\ln x}x=\lim\frac{1/x}1=0$.&lt;/li&gt;
    &lt;li&gt;$n^{1/n}=e^{\ln n/n}\to e^0=1$.&lt;/li&gt;
    &lt;li&gt;$\left(1+\dfrac rn\right)^n\to e^r$: vì $n\ln(1+\tfrac rn)\to r$ (bài 01_04).&lt;/li&gt;
  &lt;/ul&gt;
&lt;/div&gt;

&lt;h2 id=&quot;dãy-đơn-điệu-bị-chặn&quot;&gt;Dãy đơn điệu bị chặn&lt;/h2&gt;

&lt;div class=&quot;textbook-theorem&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Định lý 2 (Dãy đơn điệu bị chặn).&lt;/strong&gt; Dãy tăng và bị chặn trên thì hội tụ, và giới hạn bằng $\sup_na_n$. Tương tự, dãy giảm và bị chặn dưới thì hội tụ.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-proof&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Chứng minh.&lt;/strong&gt; Tập $\lbrace a_n\rbrace$ bị chặn trên nên có cận trên đúng $L=\sup a_n$ (tiên đề đầy đủ, bài 00_01). Cho $\varepsilon&amp;gt;0$. Vì $L-\varepsilon$ không là cận trên, có $N$ với $a_N&amp;gt;L-\varepsilon$. Dãy tăng nên với $n&amp;gt;N$: $L-\varepsilon&amp;lt;a_N\le a_n\le L$, tức $\lvert a_n-L\rvert&amp;lt;\varepsilon$.&lt;/p&gt;
&lt;/div&gt;

&lt;p&gt;Định lý cho biết dãy hội tụ mà không cần biết trước giới hạn. Với dãy truy hồi $a_{n+1}=g(a_n)$ và $g$ liên tục, nếu $a_n\to L$ thì $L=g(L)$: giới hạn là một điểm bất động.&lt;/p&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Ví dụ 3.&lt;/strong&gt; $a_1=\sqrt2$, $a_{n+1}=\sqrt{2+a_n}$, tức $\sqrt2,\ \sqrt{2+\sqrt2},\ \sqrt{2+\sqrt{2+\sqrt2}},\dots$&lt;/p&gt;

  &lt;ul&gt;
    &lt;li&gt;Bị chặn trên bởi 2: $a_1&amp;lt;2$, và nếu $a_n&amp;lt;2$ thì $a_{n+1}&amp;lt;\sqrt4=2$.&lt;/li&gt;
    &lt;li&gt;Tăng: $a_{n+1}^2-a_n^2=2+a_n-a_n^2=(2-a_n)(1+a_n)&amp;gt;0$.&lt;/li&gt;
  &lt;/ul&gt;

  &lt;p&gt;Theo định lý 2, $a_n\to L$ với $L=\sqrt{2+L}$, tức $L^2-L-2=0$, $L=2$ (loại $L=-1$). Bằng số: $a_7\approx1.99985$.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;content-box warning-box textbook-block&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Phải chứng minh hội tụ trước.&lt;/strong&gt; Với $a_{n+1}=2a_n$, $a_1=1$, phương trình $L=2L$ cho $L=0$, nhưng dãy $1,2,4,8,\dots$ tiến ra vô cùng. Phương trình điểm bất động chỉ cho giới hạn &lt;strong&gt;nếu&lt;/strong&gt; giới hạn tồn tại.&lt;/p&gt;
&lt;/div&gt;

&lt;h2 id=&quot;ứng-dụng&quot;&gt;Ứng dụng&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Kinh tế: lãi kép.&lt;/strong&gt; Gửi 100 triệu đồng, lãi suất 8%/năm, ghép lãi $n$ lần mỗi năm: sau một năm được $100\left(1+\tfrac{0.08}n\right)^n$ triệu. Ghép hằng tháng ($n=12$): $108.30$ triệu. Khi $n\to\infty$ (ghép liên tục): $100e^{0.08}\approx108.33$ triệu. Chênh lệch chỉ khoảng 29 nghìn đồng.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Học máy: khi nào gradient descent hội tụ.&lt;/strong&gt; Với $f(x)=\tfrac a2x^2$ ($a&amp;gt;0$), bước $x_{n+1}=x_n-\eta f&apos;(x_n)=(1-\eta a)x_n$, nên $x_n=(1-\eta a)^nx_0$. Dãy hội tụ về cực tiểu 0 khi và chỉ khi $\lvert1-\eta a\rvert&amp;lt;1$, tức $0&amp;lt;\eta&amp;lt;\tfrac2a$. Tốc độ học lớn hơn $\tfrac2a$ làm dãy dao động và phân kỳ. Đây là lý do “tốc độ học quá lớn” làm hàm mất mát tăng vọt.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Vật lý: quả bóng nảy.&lt;/strong&gt; Bóng thả từ 2 m, mỗi lần nảy lên bằng 80% độ cao trước: $h_n=2\cdot0.8^n\to0$. Tổng quãng đường là một chuỗi hình học (bài 07_02).&lt;/p&gt;

&lt;h2 id=&quot;bài-tập&quot;&gt;Bài tập&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Cơ bản.&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;Tính $\lim\dfrac{3n^2+1}{n^2-n}$ và $\lim\dfrac{(-1)^n}n$.&lt;/li&gt;
  &lt;li&gt;Tính $\lim\dfrac n{2^n}$ và $\lim\left(1+\dfrac2n\right)^n$.&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Đáp án&lt;/summary&gt;

  &lt;ol&gt;
    &lt;li&gt;$3$; $0$ (kẹp giữa $\pm\tfrac1n$).&lt;/li&gt;
    &lt;li&gt;$0$ (L’Hôpital cho $x/2^x$); $e^2$.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;p&gt;&lt;strong&gt;Trung bình.&lt;/strong&gt;&lt;/p&gt;

&lt;ol start=&quot;3&quot;&gt;
  &lt;li&gt;Cho $a_1=0$, $a_{n+1}=\sqrt{6+a_n}$. Chứng minh dãy hội tụ và tìm giới hạn.&lt;/li&gt;
  &lt;li&gt;Chứng minh bằng định nghĩa: $\dfrac1{n^2}\to0$.&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Đáp án&lt;/summary&gt;

  &lt;ol start=&quot;3&quot;&gt;
    &lt;li&gt;Quy nạp: $0\le a_n&amp;lt;3$ và dãy tăng vì $6+a_n-a_n^2=(3-a_n)(2+a_n)&amp;gt;0$. Giới hạn thoả $L^2=6+L$, $L=3$.&lt;/li&gt;
    &lt;li&gt;Với $\varepsilon&amp;gt;0$ chọn $N=1/\sqrt\varepsilon$; khi $n&amp;gt;N$ thì $\tfrac1{n^2}&amp;lt;\varepsilon$.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;p&gt;&lt;strong&gt;Nâng cao.&lt;/strong&gt;&lt;/p&gt;

&lt;ol start=&quot;5&quot;&gt;
  &lt;li&gt;Dãy Fibonacci $F_1=F_2=1$, $F_{n+2}=F_{n+1}+F_n$. Giả sử $r_n=F_{n+1}/F_n$ hội tụ, chứng minh giới hạn là $\varphi=\tfrac{1+\sqrt5}2$.&lt;/li&gt;
  &lt;li&gt;Cho $a_1=1$, $a_{n+1}=\dfrac{a_n}2+\dfrac1{a_n}$ (Newton cho $x^2=2$). Chứng minh $a_n\ge\sqrt2$ với $n\ge2$, dãy giảm từ $n=2$, và $a_n\to\sqrt2$.&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Gợi ý&lt;/summary&gt;

  &lt;ol start=&quot;5&quot;&gt;
    &lt;li&gt;$r_{n+1}=1+\tfrac1{r_n}$, nên $L=1+\tfrac1L$, $L^2-L-1=0$, $L&amp;gt;0$.&lt;/li&gt;
    &lt;li&gt;Bất đẳng thức AM–GM: $\tfrac{a}2+\tfrac1a\ge2\sqrt{\tfrac12}=\sqrt2$. Khi $a_n\ge\sqrt2$: $a_{n+1}-a_n=\tfrac{2-a_n^2}{2a_n}\le0$. Dãy giảm, bị chặn dưới, giới hạn thoả $L=\tfrac L2+\tfrac1L$.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;h2 id=&quot;tóm-tắt&quot;&gt;Tóm tắt&lt;/h2&gt;

&lt;div class=&quot;content-box summary-box textbook-block&quot;&gt;
  &lt;ul&gt;
    &lt;li&gt;$a_n\to L$: với mọi $\varepsilon&amp;gt;0$, từ một chỉ số nào đó trở đi $\lvert a_n-L\rvert&amp;lt;\varepsilon$.&lt;/li&gt;
    &lt;li&gt;Quy tắc tính và nguyên lý kẹp như với hàm; $f(x)\to L$ khi $x\to\infty$ kéo theo $f(n)\to L$.&lt;/li&gt;
    &lt;li&gt;Giới hạn chuẩn: $r^n\to0$ ($\lvert r\rvert&amp;lt;1$), $\ln n/n\to0$, $n^{1/n}\to1$, $(1+r/n)^n\to e^r$.&lt;/li&gt;
    &lt;li&gt;Dãy đơn điệu bị chặn thì hội tụ. Với dãy truy hồi: chứng minh hội tụ trước, rồi giải $L=g(L)$.&lt;/li&gt;
    &lt;li&gt;Gradient descent trên $\tfrac a2x^2$ hội tụ khi và chỉ khi $0&amp;lt;\eta&amp;lt;2/a$.&lt;/li&gt;
  &lt;/ul&gt;
&lt;/div&gt;
</content>
 </entry>
 
 <entry>
   <title>Ứng dụng trong kinh tế và khoa học</title>
   <link href="https://calculus-self-learning.pages.dev/contents/vi/chapter06/06_05_Ung_dung_trong_kinh_te_va_khoa_hoc/"/>
   <updated>2026-12-01T00:00:00+00:00</updated>
   <id>https://calculus-self-learning.pages.dev/contents/vi/chapter06/06_05_Ung_dung_trong_kinh_te_va_khoa_hoc</id>
   <content type="html">&lt;div class=&quot;textbook-objectives&quot;&gt;

  &lt;p&gt;&lt;strong&gt;Mục tiêu.&lt;/strong&gt; Sau bài này bạn có thể:&lt;/p&gt;

  &lt;ul&gt;
    &lt;li&gt;tính điểm cân bằng thị trường, thặng dư tiêu dùng và thặng dư sản xuất;&lt;/li&gt;
    &lt;li&gt;tính giá trị hiện tại và giá trị tương lai của một dòng thu nhập liên tục;&lt;/li&gt;
    &lt;li&gt;tính tổng lượng thay đổi từ tốc độ thay đổi (điện lượng, lượng nước, dân số);&lt;/li&gt;
    &lt;li&gt;lập tích phân cho lưu lượng chất lỏng trong ống và cho cung lượng tim.&lt;/li&gt;
  &lt;/ul&gt;

&lt;/div&gt;

&lt;h2 id=&quot;vì-sao-cần-bài-này&quot;&gt;Vì sao cần bài này&lt;/h2&gt;

&lt;p&gt;Định lý cơ bản (bài 04_03) có một cách đọc rất thực tế: &lt;strong&gt;tích phân của tốc độ thay đổi bằng tổng lượng thay đổi&lt;/strong&gt;,&lt;/p&gt;

\[\int_a^bF&apos;(t)\,dt=F(b)-F(a).\]

&lt;p&gt;Tốc độ có thể là chi phí biên, dòng tiền, cường độ dòng điện, lưu lượng nước, tốc độ sinh trưởng. Bài này tập hợp các ứng dụng hay gặp ngoài hình học và cơ học.&lt;/p&gt;

&lt;h2 id=&quot;thặng-dư-tiêu-dùng-và-thặng-dư-sản-xuất&quot;&gt;Thặng dư tiêu dùng và thặng dư sản xuất&lt;/h2&gt;

&lt;p&gt;Hàm cầu $p=D(q)$ cho biết người mua sẵn sàng trả giá $p$ cho đơn vị thứ $q$; hàm cung $p=S(q)$ cho biết người bán chấp nhận giá $p$ cho đơn vị thứ $q$. Tại điểm cân bằng $(q^*,p^*)$, $D(q^*)=S(q^*)=p^*$.&lt;/p&gt;

&lt;div class=&quot;textbook-definition&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Định nghĩa 1 (Thặng dư).&lt;/strong&gt;&lt;/p&gt;

\[CS=\int_0^{q^*}\bigl(D(q)-p^*\bigr)\,dq,\qquad PS=\int_0^{q^*}\bigl(p^*-S(q)\bigr)\,dq .\]

&lt;/div&gt;

&lt;p&gt;$CS$ là tổng khoản “tiết kiệm” của những người mua sẵn sàng trả nhiều hơn $p^*$; $PS$ là tổng khoản “lời thêm” của những người bán chấp nhận giá thấp hơn $p^*$. Trên đồ thị, đó là hai miền giữa đường cầu (cung) và đường ngang $p=p^*$.&lt;/p&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Ví dụ 1.&lt;/strong&gt; $D(q)=100-0.5q$, $S(q)=20+0.3q$ (nghìn đồng). Cân bằng: $100-0.5q=20+0.3q$, nên $q^*=100$, $p^*=50$.&lt;/p&gt;

\[CS=\int_0^{100}(50-0.5q)\,dq=5000-2500=2500,\qquad PS=\int_0^{100}(30-0.3q)\,dq=3000-1500=1500\]

  &lt;p&gt;(nghìn đồng). Tổng phúc lợi $4000$. Một mức thuế hay giá trần làm $q$ khác $q^*$ và làm giảm tổng này; phần giảm gọi là tổn thất vô ích.&lt;/p&gt;
&lt;/div&gt;

&lt;h2 id=&quot;dòng-thu-nhập-liên-tục&quot;&gt;Dòng thu nhập liên tục&lt;/h2&gt;

&lt;p&gt;Một dòng tiền với tốc độ $R(t)$ (đồng/năm), lãi suất liên tục $r$. Khoản nhỏ $R(t)\,dt$ nhận tại thời điểm $t$ có giá trị hiện tại $R(t)e^{-rt}\,dt$ và giá trị tại thời điểm $T$ là $R(t)e^{r(T-t)}\,dt$.&lt;/p&gt;

&lt;div class=&quot;textbook-definition&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Định nghĩa 2.&lt;/strong&gt;&lt;/p&gt;

\[PV=\int_0^TR(t)e^{-rt}\,dt,\qquad FV=\int_0^TR(t)e^{r(T-t)}\,dt=e^{rT}PV .\]

&lt;/div&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Ví dụ 2.&lt;/strong&gt; Gửi đều 10 triệu đồng/năm trong 5 năm, lãi suất liên tục 6%:&lt;/p&gt;

\[FV=\int_0^510e^{0.06(5-t)}\,dt=\frac{10}{0.06}\left(e^{0.3}-1\right)\approx58.31\ \text{triệu đồng},\]

  &lt;p&gt;so với 50 triệu tiền gốc.&lt;/p&gt;
&lt;/div&gt;

&lt;h2 id=&quot;tổng-lượng-từ-tốc-độ&quot;&gt;Tổng lượng từ tốc độ&lt;/h2&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Ví dụ 3.&lt;/strong&gt;&lt;/p&gt;

  &lt;ul&gt;
    &lt;li&gt;&lt;strong&gt;Lượng nước.&lt;/strong&gt; Nước chảy vào bồn với lưu lượng $2+\sin t$ (lít/phút). Trong $\pi$ phút đầu, lượng nước vào là $\int_0^\pi(2+\sin t)\,dt=2\pi+2\approx8.28$ lít.&lt;/li&gt;
    &lt;li&gt;&lt;strong&gt;Điện lượng.&lt;/strong&gt; $Q=\int_{t_1}^{t_2}i(t)\,dt$ (bài 05_02).&lt;/li&gt;
    &lt;li&gt;&lt;strong&gt;Dân số.&lt;/strong&gt; Nếu tốc độ sinh là $b(t)$ và tốc độ tử là $d(t)$ (người/năm), thay đổi dân số trên $[0,T]$ là $\int_0^T\bigl(b(t)-d(t)\bigr)\,dt$.&lt;/li&gt;
  &lt;/ul&gt;
&lt;/div&gt;

&lt;h2 id=&quot;ứng-dụng-trong-y-sinh-và-học-máy&quot;&gt;Ứng dụng trong y sinh và học máy&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Lưu lượng máu (định luật Poiseuille).&lt;/strong&gt; Trong mạch máu bán kính $R$, dài $\ell$, chênh áp $P$, độ nhớt $\eta$, vận tốc máu ở khoảng cách $r$ đến tâm là $v(r)=\dfrac{P}{4\eta\ell}(R^2-r^2)$. Vành khuyên bán kính $r$, dày $dr$ có diện tích $2\pi r\,dr$, nên lưu lượng&lt;/p&gt;

\[F=\int_0^Rv(r)\,2\pi r\,dr=\frac{\pi P}{2\eta\ell}\int_0^R(R^2r-r^3)\,dr=\frac{\pi PR^4}{8\eta\ell}.\]

&lt;p&gt;Lưu lượng tỉ lệ với $R^4$: mạch hẹp đi 10% thì lưu lượng giảm khoảng 34%.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Cung lượng tim (pha loãng chất chỉ thị).&lt;/strong&gt; Tiêm $A$ mg chất chỉ thị vào tĩnh mạch, đo nồng độ $c(t)$ ở động mạch. Lưu lượng tim $F$ (lít/giây) thoả $A=F\int_0^Tc(t)\,dt$. Với $A=3$ mg và $c(t)=\tfrac{t(10-t)}5$ mg/L trên $[0,10]$ giây: $\int_0^{10}c\,dt=\tfrac{100}3$, nên $F=\tfrac{3}{100/3}=0.09$ L/s, tức 5.4 L/phút, trong khoảng bình thường của người trưởng thành lúc nghỉ.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Học máy: integrated gradients.&lt;/strong&gt; Để giải thích dự đoán $F(x)$ của một mô hình, phương pháp integrated gradients so sánh với một điểm gốc $x&apos;$ và tích phân đạo hàm dọc đoạn thẳng nối chúng: với một biến, $\text{IG}=(x-x&apos;)\int_0^1F&apos;\bigl(x&apos;+\alpha(x-x&apos;)\bigr)\,d\alpha=F(x)-F(x&apos;)$ (đổi biến và định lý cơ bản). Tính chất “tổng các đóng góp bằng thay đổi của đầu ra” chính là định lý cơ bản.&lt;/p&gt;

&lt;h2 id=&quot;bài-tập&quot;&gt;Bài tập&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Cơ bản.&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;Cầu $D(q)=50-q^2$, giá thị trường $p^*=25$. Tính thặng dư tiêu dùng.&lt;/li&gt;
  &lt;li&gt;Cầu $D(q)=120-2q$, cung $S(q)=3q$. Tìm điểm cân bằng, $CS$ và $PS$.&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Đáp án&lt;/summary&gt;

  &lt;ol&gt;
    &lt;li&gt;$q^*=5$; $CS=\int_0^5(25-q^2)\,dq=125-\tfrac{125}3=\tfrac{250}3\approx83.3$.&lt;/li&gt;
    &lt;li&gt;$q^*=24$, $p^*=72$. $CS=\tfrac12\cdot24\cdot48=576$, $PS=\tfrac12\cdot24\cdot72=864$.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;p&gt;&lt;strong&gt;Trung bình.&lt;/strong&gt;&lt;/p&gt;

&lt;ol start=&quot;3&quot;&gt;
  &lt;li&gt;Một nhà máy thải chất ô nhiễm với tốc độ $r(t)=50e^{-0.1t}$ (tấn/năm). Tính tổng lượng thải trong 10 năm đầu, và tổng lượng nếu kéo dài mãi mãi.&lt;/li&gt;
  &lt;li&gt;Một dòng thu nhập $R(t)=20e^{0.03t}$ (triệu đồng/năm) trong 10 năm, lãi suất liên tục 8%. Tính giá trị hiện tại.&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Đáp án&lt;/summary&gt;

  &lt;ol start=&quot;3&quot;&gt;
    &lt;li&gt;$\int_0^{10}50e^{-0.1t}\,dt=500(1-e^{-1})\approx316$ tấn; mãi mãi: $500$ tấn.&lt;/li&gt;
    &lt;li&gt;$PV=\int_0^{10}20e^{-0.05t}\,dt=400(1-e^{-0.5})\approx157.4$ triệu đồng.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;p&gt;&lt;strong&gt;Nâng cao.&lt;/strong&gt;&lt;/p&gt;

&lt;ol start=&quot;5&quot;&gt;
  &lt;li&gt;Đường cong Lorenz $L(p)=p^2$. Tính hệ số Gini $G=1-2\int_0^1L$. Với $L(p)=p^k$, Gini bằng bao nhiêu và khi nào bằng 0?&lt;/li&gt;
  &lt;li&gt;Theo Poiseuille, cần tăng bán kính mạch bao nhiêu phần trăm để lưu lượng tăng gấp đôi (cùng chênh áp)?&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Gợi ý&lt;/summary&gt;

  &lt;ol start=&quot;5&quot;&gt;
    &lt;li&gt;$G=1-\tfrac23=\tfrac13$. Với $p^k$: $G=1-\tfrac2{k+1}=\tfrac{k-1}{k+1}$, bằng 0 khi $k=1$ (bình đẳng hoàn toàn).&lt;/li&gt;
    &lt;li&gt;$R^4$ gấp đôi nên $R$ tăng $2^{1/4}\approx1.189$ lần, tức khoảng 19%.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;h2 id=&quot;tóm-tắt&quot;&gt;Tóm tắt&lt;/h2&gt;

&lt;div class=&quot;content-box summary-box textbook-block&quot;&gt;
  &lt;ul&gt;
    &lt;li&gt;Tích phân của tốc độ thay đổi bằng tổng lượng thay đổi.&lt;/li&gt;
    &lt;li&gt;$CS=\int_0^{q^*}(D-p^*)$, $PS=\int_0^{q^*}(p^*-S)$.&lt;/li&gt;
    &lt;li&gt;Dòng tiền liên tục: $PV=\int Re^{-rt}\,dt$, $FV=e^{rT}PV$.&lt;/li&gt;
    &lt;li&gt;Lưu lượng trong ống: tích phân vận tốc trên các vành khuyên $2\pi r\,dr$; Poiseuille cho $F\propto R^4$.&lt;/li&gt;
    &lt;li&gt;Cung lượng tim: $F=A/\int c(t)\,dt$.&lt;/li&gt;
  &lt;/ul&gt;
&lt;/div&gt;
</content>
 </entry>
 
 <entry>
   <title>Giá trị trung bình và giá trị hiệu dụng</title>
   <link href="https://calculus-self-learning.pages.dev/contents/vi/chapter06/06_04_Gia_tri_trung_binh_va_gia_tri_hieu_dung/"/>
   <updated>2026-12-01T00:00:00+00:00</updated>
   <id>https://calculus-self-learning.pages.dev/contents/vi/chapter06/06_04_Gia_tri_trung_binh_va_gia_tri_hieu_dung</id>
   <content type="html">&lt;div class=&quot;textbook-objectives&quot;&gt;

  &lt;p&gt;&lt;strong&gt;Mục tiêu.&lt;/strong&gt; Sau bài này bạn có thể:&lt;/p&gt;

  &lt;ul&gt;
    &lt;li&gt;tính giá trị trung bình của một hàm trên đoạn $[a,b]$;&lt;/li&gt;
    &lt;li&gt;phát biểu và chứng minh định lý giá trị trung bình cho tích phân;&lt;/li&gt;
    &lt;li&gt;tính giá trị hiệu dụng (RMS) và giải thích vì sao điện áp lưới 220 V có biên độ khoảng 311 V;&lt;/li&gt;
    &lt;li&gt;nhận ra MSE, RMSE và kỳ vọng là các “giá trị trung bình” theo nghĩa của bài này.&lt;/li&gt;
  &lt;/ul&gt;

&lt;/div&gt;

&lt;h2 id=&quot;vì-sao-cần-bài-này&quot;&gt;Vì sao cần bài này&lt;/h2&gt;

&lt;p&gt;Nhiệt độ trung bình của một ngày là bao nhiêu khi nhiệt độ thay đổi liên tục? Với $n$ số đo, trung bình là $\tfrac1n\sum y_i$. Nếu đo cách đều nhau trên $[a,b]$ với bước $\Delta x=\tfrac{b-a}n$, thì $\tfrac1n\sum f(x_i)=\tfrac1{b-a}\sum f(x_i)\Delta x$, một tổng Riemann chia cho độ dài đoạn. Cho $n\to\infty$ được định nghĩa dưới đây.&lt;/p&gt;

&lt;h2 id=&quot;giá-trị-trung-bình&quot;&gt;Giá trị trung bình&lt;/h2&gt;

&lt;div class=&quot;textbook-definition&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Định nghĩa 1 (Giá trị trung bình).&lt;/strong&gt; Giá trị trung bình của hàm khả tích $f$ trên $[a,b]$ là&lt;/p&gt;

\[\bar f=\frac1{b-a}\int_a^bf(x)\,dx .\]

&lt;/div&gt;

&lt;p&gt;Về hình học: hình chữ nhật đáy $[a,b]$, cao $\bar f$ có cùng diện tích (có dấu) với miền dưới đồ thị.&lt;/p&gt;

&lt;div class=&quot;textbook-theorem&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Định lý 1 (Giá trị trung bình cho tích phân).&lt;/strong&gt; Nếu $f$ liên tục trên $[a,b]$ thì có $c\in[a,b]$ với&lt;/p&gt;

\[f(c)=\frac1{b-a}\int_a^bf(x)\,dx .\]

&lt;/div&gt;

&lt;div class=&quot;textbook-proof&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Chứng minh.&lt;/strong&gt; Theo định lý Weierstrass, $f$ đạt giá trị nhỏ nhất $m$ và lớn nhất $M$ trên $[a,b]$. Tính chất chặn (bài 04_02) cho $m\le\bar f\le M$. Theo định lý giá trị trung gian (bài 01_06), $f$ nhận mọi giá trị giữa $m$ và $M$, nên có $c$ với $f(c)=\bar f$.&lt;/p&gt;
&lt;/div&gt;

&lt;p&gt;Giả thiết liên tục là cần: hàm bằng 0 trên $[0,1)$ và bằng 1 trên $[1,2]$ có trung bình $\tfrac12$ nhưng không nhận giá trị $\tfrac12$.&lt;/p&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Ví dụ 1.&lt;/strong&gt; Trung bình của $x^2$ trên $[0,3]$: $\tfrac13\int_0^3x^2\,dx=3$. Điểm $c$ với $c^2=3$ là $c=\sqrt3\approx1.73$.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Ví dụ 2 (Nhiệt độ).&lt;/strong&gt; Nhiệt độ $T(t)=25+5\sin\dfrac{\pi t}{12}$ (°C), $t$ tính bằng giờ từ 6 giờ sáng. Trung bình cả ngày ($0\le t\le24$): phần sin có tích phân 0 trên một chu kỳ, nên $\bar T=25$ °C. Trung bình 12 giờ ban ngày:&lt;/p&gt;

\[\bar T=25+\frac1{12}\int_0^{12}5\sin\frac{\pi t}{12}\,dt=25+\frac1{12}\cdot\frac{120}\pi=25+\frac{10}\pi\approx28.2\ \text{°C}.\]

&lt;/div&gt;

&lt;h2 id=&quot;giá-trị-hiệu-dụng&quot;&gt;Giá trị hiệu dụng&lt;/h2&gt;

&lt;div class=&quot;textbook-definition&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Định nghĩa 2 (Giá trị hiệu dụng, RMS).&lt;/strong&gt; Giá trị hiệu dụng (root mean square) của $f$ trên $[a,b]$ là&lt;/p&gt;

\[f_{\text{rms}}=\sqrt{\frac1{b-a}\int_a^bf(x)^2\,dx} .\]

&lt;/div&gt;

&lt;p&gt;Lý do dùng bình phương: công suất toả nhiệt trên điện trở $R$ là $P=\tfrac{v^2}R$, tỉ lệ với bình phương điện áp. Điện áp xoay chiều có trung bình bằng 0 nhưng vẫn làm nóng bếp điện; giá trị hiệu dụng là điện áp một chiều cho cùng công suất trung bình.&lt;/p&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Ví dụ 3 (Điện xoay chiều).&lt;/strong&gt; $v(t)=V_0\sin(\omega t)$, chu kỳ $T=\tfrac{2\pi}\omega$. Vì $\sin^2$ có trung bình $\tfrac12$ trên một chu kỳ (bài 05_04),&lt;/p&gt;

\[v_{\text{rms}}=\sqrt{\frac1T\int_0^TV_0^2\sin^2(\omega t)\,dt}=\frac{V_0}{\sqrt2}.\]

  &lt;p&gt;Lưới điện Việt Nam ghi 220 V là giá trị hiệu dụng; biên độ là $220\sqrt2\approx311$ V. Một bóng đèn sợi đốt 100 W dùng điện áp hiệu dụng 220 V có điện trở $R=\tfrac{220^2}{100}=484\ \Omega$.&lt;/p&gt;
&lt;/div&gt;

&lt;h2 id=&quot;ứng-dụng&quot;&gt;Ứng dụng&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Học máy: MSE, RMSE và kỳ vọng.&lt;/strong&gt; Sai số bình phương trung bình $\text{MSE}=\tfrac1n\sum(y_i-\hat y_i)^2$ là bản rời rạc của $\tfrac1{b-a}\int(f-\hat f)^2$, và RMSE là giá trị hiệu dụng của phần dư. Với biến ngẫu nhiên có mật độ $p$, $E[g(X)]=\int g(x)p(x)\,dx$ là “trung bình có trọng số”; phân phối đều trên $[a,b]$ ($p=\tfrac1{b-a}$) cho đúng định nghĩa 1.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Kinh tế: tồn kho trung bình.&lt;/strong&gt; Kho nhận 600 sản phẩm đầu mỗi tháng (30 ngày), bán đều nên tồn kho $I(t)=600-20t$. Tồn kho trung bình là $\tfrac1{30}\int_0^{30}(600-20t)\,dt=300$ sản phẩm; chi phí lưu kho tính theo con số này.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Vật lý: vận tốc trung bình.&lt;/strong&gt; Trung bình của vận tốc trên $[t_1,t_2]$ là $\tfrac{s(t_2)-s(t_1)}{t_2-t_1}$, đúng với định nghĩa vận tốc trung bình. Định lý 1 nói có thời điểm vận tốc tức thời bằng vận tốc trung bình (cùng kết luận với định lý Lagrange ở bài 02_05).&lt;/p&gt;

&lt;h2 id=&quot;bài-tập&quot;&gt;Bài tập&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Cơ bản.&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;Tính trung bình của $\sin x$ trên $[0,\pi]$.&lt;/li&gt;
  &lt;li&gt;Tính trung bình của $\tfrac1x$ trên $[1,e]$.&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Đáp án&lt;/summary&gt;

  &lt;ol&gt;
    &lt;li&gt;$\tfrac1\pi\cdot2=\tfrac2\pi\approx0.637$.&lt;/li&gt;
    &lt;li&gt;$\tfrac1{e-1}\approx0.582$.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;p&gt;&lt;strong&gt;Trung bình.&lt;/strong&gt;&lt;/p&gt;

&lt;ol start=&quot;3&quot;&gt;
  &lt;li&gt;Tìm $c$ trong định lý 1 cho $f(x)=\sqrt x$ trên $[0,4]$.&lt;/li&gt;
  &lt;li&gt;Tính giá trị hiệu dụng của sóng răng cưa $f(t)=t$ trên $[0,1]$ và của sóng vuông nhận giá trị $\pm V$.&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Đáp án&lt;/summary&gt;

  &lt;ol start=&quot;3&quot;&gt;
    &lt;li&gt;$\bar f=\tfrac14\cdot\tfrac23\cdot8=\tfrac43$, nên $\sqrt c=\tfrac43$, $c=\tfrac{16}9$.&lt;/li&gt;
    &lt;li&gt;$\sqrt{\int_0^1t^2\,dt}=\tfrac1{\sqrt3}\approx0.577$; sóng vuông có $f^2=V^2$ nên RMS bằng $V$.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;p&gt;&lt;strong&gt;Nâng cao.&lt;/strong&gt;&lt;/p&gt;

&lt;ol start=&quot;5&quot;&gt;
  &lt;li&gt;Tính giá trị hiệu dụng của $f(t)=1+2\sin t$ trên $[0,2\pi]$. Vì sao không bằng $1+\tfrac2{\sqrt2}$?&lt;/li&gt;
  &lt;li&gt;Chứng minh $\lvert\bar f\rvert\le f_{\text{rms}}$ (gợi ý: $\int(f-\bar f)^2\ge0$). Khi nào dấu bằng xảy ra (với $f$ liên tục)?&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Gợi ý&lt;/summary&gt;

  &lt;ol start=&quot;5&quot;&gt;
    &lt;li&gt;$f^2=1+4\sin t+4\sin^2t$, trung bình $1+0+2=3$, RMS $\sqrt3\approx1.732$. Giá trị hiệu dụng không cộng tuyến tính: thành phần một chiều và xoay chiều cộng theo bình phương, $\sqrt{1^2+(\sqrt2)^2}$.&lt;/li&gt;
    &lt;li&gt;Khai triển $\tfrac1{b-a}\int(f-\bar f)^2=f_{\text{rms}}^2-\bar f^2\ge0$. Dấu bằng khi $f$ là hằng số (bài tập 6 bài 04_02). Đây là “phương sai = trung bình bình phương − bình phương trung bình”.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;h2 id=&quot;tóm-tắt&quot;&gt;Tóm tắt&lt;/h2&gt;

&lt;div class=&quot;content-box summary-box textbook-block&quot;&gt;
  &lt;ul&gt;
    &lt;li&gt;Giá trị trung bình: $\bar f=\tfrac1{b-a}\int_a^bf$.&lt;/li&gt;
    &lt;li&gt;Hàm liên tục đạt giá trị trung bình tại ít nhất một điểm $c$.&lt;/li&gt;
    &lt;li&gt;Giá trị hiệu dụng: $f_{\text{rms}}=\sqrt{\tfrac1{b-a}\int f^2}$; với sóng sin, $V_0/\sqrt2$. Lưới 220 V có biên độ khoảng 311 V.&lt;/li&gt;
    &lt;li&gt;$f_{\text{rms}}^2-\bar f^2\ge0$ là phương sai; MSE và RMSE là các trung bình loại này.&lt;/li&gt;
  &lt;/ul&gt;
&lt;/div&gt;
</content>
 </entry>
 
 <entry>
   <title>Công, khối lượng và trọng tâm</title>
   <link href="https://calculus-self-learning.pages.dev/contents/vi/chapter06/06_03_Cong_khoi_luong_trong_tam/"/>
   <updated>2026-12-01T00:00:00+00:00</updated>
   <id>https://calculus-self-learning.pages.dev/contents/vi/chapter06/06_03_Cong_khoi_luong_trong_tam</id>
   <content type="html">&lt;div class=&quot;textbook-objectives&quot;&gt;

  &lt;p&gt;&lt;strong&gt;Mục tiêu.&lt;/strong&gt; Sau bài này bạn có thể:&lt;/p&gt;

  &lt;ul&gt;
    &lt;li&gt;tính công của lực biến thiên, công kéo dây cáp và công bơm chất lỏng;&lt;/li&gt;
    &lt;li&gt;tính khối lượng và khối tâm của thanh có mật độ thay đổi;&lt;/li&gt;
    &lt;li&gt;tính trọng tâm của miền phẳng và dùng định lý Pappus để tính thể tích;&lt;/li&gt;
    &lt;li&gt;liên hệ khối tâm với kỳ vọng trong xác suất và tâm cụm trong học máy.&lt;/li&gt;
  &lt;/ul&gt;

&lt;/div&gt;

&lt;h2 id=&quot;vì-sao-cần-bài-này&quot;&gt;Vì sao cần bài này&lt;/h2&gt;

&lt;p&gt;Công bằng lực nhân quãng đường khi lực không đổi. Khi kéo lò xo, lực tăng dần; khi bơm nước ra khỏi bồn, mỗi lớp nước phải nâng một độ cao khác nhau. Cách làm vẫn như bài 06_01: chia thành phần nhỏ mà trên đó đại lượng gần như không đổi, rồi tích phân.&lt;/p&gt;

&lt;h2 id=&quot;công&quot;&gt;Công&lt;/h2&gt;

&lt;div class=&quot;textbook-definition&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Định nghĩa 1 (Công của lực biến thiên).&lt;/strong&gt; Lực $F(x)$ liên tục tác dụng dọc trục $x$ từ $a$ đến $b$ sinh công&lt;/p&gt;

\[W=\int_a^bF(x)\,dx .\]

&lt;/div&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Ví dụ 1 (Lò xo).&lt;/strong&gt; Lực 10 N kéo lò xo giãn 5 cm. Theo định luật Hooke $F=kx$, nên $k=\tfrac{10}{0.05}=200$ N/m. Công để kéo từ độ giãn 5 cm đến 15 cm:&lt;/p&gt;

\[W=\int_{0.05}^{0.15}200x\,dx=100\,(0.15^2-0.05^2)=2\ \text{J}.\]

&lt;/div&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Ví dụ 2 (Kéo dây cáp).&lt;/strong&gt; Dây cáp dài 20 m, nặng 2 kg/m, treo thẳng từ nóc nhà. Kéo toàn bộ dây lên nóc. Đoạn dây nhỏ dài $dy$ ở cách nóc $y$ mét có trọng lượng $2\cdot9.8\,dy$ và phải nâng $y$ mét:&lt;/p&gt;

\[W=\int_0^{20}19.6\,y\,dy=19.6\cdot200=3920\ \text{J}.\]

&lt;/div&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Ví dụ 3 (Bơm nước).&lt;/strong&gt; Bồn trụ bán kính 1 m, cao 3 m, đầy nước ($\rho=1000$ kg/m³). Bơm hết nước qua miệng bồn. Lớp nước dày $dy$ ở độ cao $y$ có khối lượng $\rho\pi\cdot1^2\,dy$ và phải nâng $3-y$ mét:&lt;/p&gt;

\[W=\int_0^3\rho g\pi(3-y)\,dy=1000\cdot9.8\cdot\pi\cdot4.5\approx1.39\cdot10^5\ \text{J}.\]

&lt;/div&gt;

&lt;h2 id=&quot;khối-lượng-và-khối-tâm&quot;&gt;Khối lượng và khối tâm&lt;/h2&gt;

&lt;p&gt;Thanh nằm trên $[a,b]$ với mật độ (kg/m) $\rho(x)$. Đoạn nhỏ $dx$ có khối lượng $\rho(x)\,dx$.&lt;/p&gt;

&lt;div class=&quot;textbook-definition&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Định nghĩa 2 (Khối lượng, khối tâm của thanh).&lt;/strong&gt;&lt;/p&gt;

\[m=\int_a^b\rho(x)\,dx,\qquad\bar x=\frac1m\int_a^bx\,\rho(x)\,dx .\]

&lt;/div&gt;

&lt;p&gt;$\bar x$ là điểm mà thanh cân bằng: tổng mômen $\int(x-\bar x)\rho(x)\,dx$ bằng 0.&lt;/p&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Ví dụ 4.&lt;/strong&gt; Thanh trên $[0,2]$ với $\rho=1+x^2$. $m=\int_0^2(1+x^2)\,dx=\tfrac{14}3$, $\int_0^2x(1+x^2)\,dx=2+4=6$, nên $\bar x=\tfrac{6}{14/3}=\tfrac97\approx1.29$, lệch về phía đầu nặng hơn.&lt;/p&gt;
&lt;/div&gt;

&lt;h2 id=&quot;trọng-tâm-miền-phẳng-và-định-lý-pappus&quot;&gt;Trọng tâm miền phẳng và định lý Pappus&lt;/h2&gt;

&lt;p&gt;Với tấm phẳng đồng chất chiếm miền dưới $y=f(x)\ge0$, $a\le x\le b$, diện tích $A$: dải hẹp tại $x$ có diện tích $f\,dx$ và trọng tâm ở độ cao $f/2$. Do đó&lt;/p&gt;

\[\bar x=\frac1A\int_a^bx\,f(x)\,dx,\qquad\bar y=\frac1A\int_a^b\frac{f(x)^2}2\,dx .\]

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Ví dụ 5.&lt;/strong&gt; Miền dưới $y=x^2$, $0\le x\le1$: $A=\tfrac13$, $\bar x=3\int_0^1x^3\,dx=\tfrac34$, $\bar y=3\int_0^1\tfrac{x^4}2\,dx=\tfrac3{10}$.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-theorem&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Định lý 1 (Pappus).&lt;/strong&gt; Quay một miền phẳng diện tích $A$ quanh một trục nằm trong mặt phẳng và không cắt miền, thể tích vật thể bằng $A$ nhân quãng đường trọng tâm đi được:&lt;/p&gt;

\[V=2\pi\bar r\,A,\]

  &lt;p&gt;với $\bar r$ là khoảng cách từ trọng tâm đến trục.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-proof&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Chứng minh (quay quanh trục $x$, miền dưới $y=f$).&lt;/strong&gt; Theo phương pháp đĩa, $V=\pi\int_a^bf^2\,dx=2\pi\int_a^b\tfrac{f^2}2\,dx=2\pi\bar yA$.&lt;/p&gt;
&lt;/div&gt;

&lt;p&gt;Kiểm tra với ví dụ 5: $2\pi\cdot\tfrac3{10}\cdot\tfrac13=\tfrac\pi5=\pi\int_0^1x^4\,dx$. Với hình xuyến (bài 06_01, bài tập 5): $V=2\pi R\cdot\pi r^2$, không cần tích phân.&lt;/p&gt;

&lt;div class=&quot;interactive-frame&quot;&gt;
  &lt;div class=&quot;interactive-frame-head&quot;&gt;
    &lt;div class=&quot;interactive-frame-title&quot;&gt;Trọng tâm và định lý Pappus&lt;/div&gt;
    &lt;div class=&quot;interactive-frame-desc&quot;&gt;Kéo điểm tựa tìm chỗ cân bằng; kéo trục quay để kiểm tra Pappus.&lt;/div&gt;
  &lt;/div&gt;
  &lt;iframe src=&quot;/interactives/chapter06/centroid.html&quot; title=&quot;Trọng tâm và định lý Pappus&quot; loading=&quot;lazy&quot; style=&quot;height: 760px;&quot;&gt;&lt;/iframe&gt;
  &lt;div class=&quot;interactive-frame-foot&quot;&gt;
    &lt;a href=&quot;/interactives/chapter06/centroid.html&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;Mở minh hoạ ở cửa sổ riêng&lt;/a&gt;
  &lt;/div&gt;
&lt;/div&gt;

&lt;h2 id=&quot;ứng-dụng&quot;&gt;Ứng dụng&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Xây dựng: áp lực lên đập.&lt;/strong&gt; Áp suất ở độ sâu $y$ là $\rho gy$. Tấm chắn hình chữ nhật rộng 10 m, ngập sâu 5 m chịu lực $F=\int_0^5\rho g\,y\cdot10\,dy=1000\cdot9.8\cdot10\cdot12.5\approx1.23\cdot10^6$ N. Lực tăng theo bình phương độ sâu, nên chân đập phải dày hơn đỉnh.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Xác suất: khối tâm là kỳ vọng.&lt;/strong&gt; Nếu $\rho$ là mật độ xác suất ($m=1$), khối tâm $\bar x=\int x\rho(x)\,dx$ chính là kỳ vọng $E[X]$. Mômen quán tính $\int(x-\bar x)^2\rho\,dx$ chính là phương sai.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Học máy: tâm cụm.&lt;/strong&gt; Trong thuật toán k-means, tâm của mỗi cụm là trung bình (khối tâm) của các điểm trong cụm, bản rời rạc của $\bar x=\tfrac1m\int x\rho$.&lt;/p&gt;

&lt;h2 id=&quot;bài-tập&quot;&gt;Bài tập&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Cơ bản.&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;Lực 6 N kéo lò xo giãn 3 cm. Tính công kéo lò xo từ trạng thái tự nhiên đến khi giãn 10 cm.&lt;/li&gt;
  &lt;li&gt;Thanh trên $[0,3]$ có mật độ $\rho=3-x$. Tính khối lượng và khối tâm.&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Đáp án&lt;/summary&gt;

  &lt;ol&gt;
    &lt;li&gt;$k=200$ N/m, $W=\int_0^{0.1}200x\,dx=1$ J.&lt;/li&gt;
    &lt;li&gt;$m=\tfrac92$, $\int_0^3x(3-x)\,dx=\tfrac92$, nên $\bar x=1$.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;p&gt;&lt;strong&gt;Trung bình.&lt;/strong&gt;&lt;/p&gt;

&lt;ol start=&quot;3&quot;&gt;
  &lt;li&gt;Tìm trọng tâm tam giác dưới $y=x$, $0\le x\le1$.&lt;/li&gt;
  &lt;li&gt;Bát hình bán cầu bán kính $R$ đầy nước. Tính công bơm hết nước qua miệng bát.&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Đáp án&lt;/summary&gt;

  &lt;ol start=&quot;3&quot;&gt;
    &lt;li&gt;$A=\tfrac12$, $\bar x=2\int_0^1x^2\,dx=\tfrac23$, $\bar y=2\int_0^1\tfrac{x^2}2\,dx=\tfrac13$.&lt;/li&gt;
    &lt;li&gt;Ở độ sâu $s$ dưới miệng, lớp nước có bán kính $\sqrt{R^2-s^2}$, nâng $s$ mét: $W=\rho g\pi\int_0^R(R^2-s^2)s\,ds=\dfrac{\rho g\pi R^4}4$.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;p&gt;&lt;strong&gt;Nâng cao.&lt;/strong&gt;&lt;/p&gt;

&lt;ol start=&quot;5&quot;&gt;
  &lt;li&gt;Chứng minh trọng tâm nửa hình tròn bán kính $R$ (phần $y\ge0$) có $\bar y=\dfrac{4R}{3\pi}$, rồi dùng Pappus để suy ra thể tích hình cầu.&lt;/li&gt;
  &lt;li&gt;Dùng Pappus tính thể tích vật thể tạo bởi quay hình vuông cạnh 2, tâm $(5,0)$, cạnh song song với các trục, quanh trục $y$.&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Gợi ý&lt;/summary&gt;

  &lt;ol start=&quot;5&quot;&gt;
    &lt;li&gt;$A=\tfrac{\pi R^2}2$, $\int_{-R}^R\tfrac{R^2-x^2}2\,dx=\tfrac{2R^3}3$, nên $\bar y=\tfrac{4R}{3\pi}$. Quay quanh trục $x$: $V=2\pi\cdot\tfrac{4R}{3\pi}\cdot\tfrac{\pi R^2}2=\tfrac43\pi R^3$.&lt;/li&gt;
    &lt;li&gt;$A=4$, $\bar r=5$: $V=2\pi\cdot5\cdot4=40\pi$.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;h2 id=&quot;tóm-tắt&quot;&gt;Tóm tắt&lt;/h2&gt;

&lt;div class=&quot;content-box summary-box textbook-block&quot;&gt;
  &lt;ul&gt;
    &lt;li&gt;Công: $W=\int F(x)\,dx$. Bơm chất lỏng: tích phân (trọng lượng lớp mỏng) × (độ cao phải nâng).&lt;/li&gt;
    &lt;li&gt;Thanh: $m=\int\rho$, $\bar x=\tfrac1m\int x\rho$.&lt;/li&gt;
    &lt;li&gt;Miền dưới $y=f$: $\bar x=\tfrac1A\int xf$, $\bar y=\tfrac1A\int\tfrac{f^2}2$.&lt;/li&gt;
    &lt;li&gt;Pappus: $V=2\pi\bar rA$.&lt;/li&gt;
    &lt;li&gt;Khối tâm của mật độ xác suất là kỳ vọng; mômen quán tính là phương sai.&lt;/li&gt;
  &lt;/ul&gt;
&lt;/div&gt;
</content>
 </entry>
 
 <entry>
   <title>Độ dài cung và diện tích mặt tròn xoay</title>
   <link href="https://calculus-self-learning.pages.dev/contents/vi/chapter06/06_02_Do_dai_cung_va_dien_tich_mat_tron_xoay/"/>
   <updated>2026-12-01T00:00:00+00:00</updated>
   <id>https://calculus-self-learning.pages.dev/contents/vi/chapter06/06_02_Do_dai_cung_va_dien_tich_mat_tron_xoay</id>
   <content type="html">&lt;div class=&quot;textbook-objectives&quot;&gt;

  &lt;p&gt;&lt;strong&gt;Mục tiêu.&lt;/strong&gt; Sau bài này bạn có thể:&lt;/p&gt;

  &lt;ul&gt;
    &lt;li&gt;suy ra công thức độ dài cung $\int_a^b\sqrt{1+f&apos;(x)^2}\,dx$ từ đường gấp khúc;&lt;/li&gt;
    &lt;li&gt;tính độ dài của đồ thị và của đường cong tham số;&lt;/li&gt;
    &lt;li&gt;tính diện tích mặt tròn xoay $2\pi\int f\sqrt{1+f&apos;^2}\,dx$;&lt;/li&gt;
    &lt;li&gt;biết rằng nhiều tích phân độ dài cung không có dạng sơ cấp và tính chúng bằng số.&lt;/li&gt;
  &lt;/ul&gt;

&lt;/div&gt;

&lt;h2 id=&quot;vì-sao-cần-bài-này&quot;&gt;Vì sao cần bài này&lt;/h2&gt;

&lt;p&gt;Một dây điện treo giữa hai cột dài bao nhiêu? Một quả bóng ném xiên bay qua quãng đường dài bao nhiêu trong không khí? Độ dài đoạn thẳng thì dễ; với đường cong, ta xấp xỉ bằng đường gấp khúc rồi cho số đoạn tăng lên.&lt;/p&gt;

&lt;h2 id=&quot;độ-dài-cung&quot;&gt;Độ dài cung&lt;/h2&gt;

&lt;p&gt;Chia $[a,b]$ bởi $x_0&amp;lt;\dots&amp;lt;x_n$. Đoạn thẳng nối $(x_{i-1},f(x_{i-1}))$ và $(x_i,f(x_i))$ dài&lt;/p&gt;

\[\sqrt{\Delta x_i^2+\Delta y_i^2}=\sqrt{1+\left(\frac{\Delta y_i}{\Delta x_i}\right)^2}\,\Delta x_i=\sqrt{1+f&apos;(\xi_i)^2}\,\Delta x_i,\]

&lt;p&gt;với $\xi_i\in(x_{i-1},x_i)$ theo định lý Lagrange. Tổng độ dài các đoạn là một tổng Riemann của $\sqrt{1+f&apos;^2}$.&lt;/p&gt;

&lt;div class=&quot;textbook-theorem&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Định lý 1 (Độ dài cung).&lt;/strong&gt; Nếu $f$ có đạo hàm liên tục trên $[a,b]$, độ dài đồ thị của $f$ là&lt;/p&gt;

\[L=\int_a^b\sqrt{1+f&apos;(x)^2}\,dx .\]

  &lt;p&gt;Với đường cong tham số $x=x(t)$, $y=y(t)$, $t\in[\alpha,\beta]$, có đạo hàm liên tục và không đi lại một đoạn nào hai lần:&lt;/p&gt;

\[L=\int_\alpha^\beta\sqrt{x&apos;(t)^2+y&apos;(t)^2}\,dt .\]

&lt;/div&gt;

&lt;p&gt;Công thức tham số có ý nghĩa vật lý: $\sqrt{x&apos;^2+y&apos;^2}$ là tốc độ, và quãng đường là tích phân của tốc độ.&lt;/p&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Ví dụ 1.&lt;/strong&gt; Độ dài của $y=x^{3/2}$, $0\le x\le4$. $f&apos;=\tfrac32x^{1/2}$, nên&lt;/p&gt;

\[L=\int_0^4\sqrt{1+\tfrac94x}\,dx=\frac8{27}\Big[\left(1+\tfrac94x\right)^{3/2}\Big]_0^4=\frac8{27}\left(10\sqrt{10}-1\right)\approx9.073 .\]

&lt;/div&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Ví dụ 2 (Dây xích).&lt;/strong&gt; Dây treo tự do có dạng $y=\cosh x=\tfrac{e^x+e^{-x}}2$. Vì $1+\sinh^2x=\cosh^2x$, độ dài trên $[-1,1]$ là&lt;/p&gt;

\[L=\int_{-1}^1\cosh x\,dx=2\sinh1\approx2.350 .\]

&lt;/div&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Ví dụ 3 (Cycloid).&lt;/strong&gt; Một điểm trên vành bánh xe bán kính $r$ lăn trên mặt đường vẽ ra $x=r(t-\sin t)$, $y=r(1-\cos t)$. Một vòm ứng với $t\in[0,2\pi]$:&lt;/p&gt;

\[x&apos;^2+y&apos;^2=r^2\bigl((1-\cos t)^2+\sin^2t\bigr)=2r^2(1-\cos t)=4r^2\sin^2\tfrac t2,\]

  &lt;p&gt;nên $L=\int_0^{2\pi}2r\sin\tfrac t2\,dt=8r$. Một vòm dài đúng 8 lần bán kính.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;content-box warning-box textbook-block&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Độ dài cung thường không tính được bằng hàm sơ cấp.&lt;/strong&gt; Với $y=x^2$ trên $[0,1]$ vẫn tính được (thế $2x=\sinh u$): $L=\tfrac14\bigl(2\sqrt5+\ln(2+\sqrt5)\bigr)\approx1.479$. Nhưng chu vi elip $x=2\cos t$, $y=\sin t$ là $\int_0^{2\pi}\sqrt{4\sin^2t+\cos^2t}\,dt$, một “tích phân elliptic” không có nguyên hàm sơ cấp; Simpson cho $\approx9.688$.&lt;/p&gt;
&lt;/div&gt;

&lt;h2 id=&quot;diện-tích-mặt-tròn-xoay&quot;&gt;Diện tích mặt tròn xoay&lt;/h2&gt;

&lt;p&gt;Quay đoạn gấp khúc nhỏ dài $ds=\sqrt{1+f&apos;^2}\,dx$ ở độ cao $f(x)$ quanh trục $x$ được một dải nón cụt có diện tích xấp xỉ $2\pi f(x)\,ds$.&lt;/p&gt;

&lt;div class=&quot;textbook-theorem&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Định lý 2 (Diện tích mặt tròn xoay).&lt;/strong&gt; Với $f\ge0$ có đạo hàm liên tục, mặt tạo bởi quay đồ thị $f$ trên $[a,b]$ quanh trục $x$ có diện tích&lt;/p&gt;

\[S=2\pi\int_a^bf(x)\sqrt{1+f&apos;(x)^2}\,dx .\]

&lt;/div&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Ví dụ 4 (Mặt cầu).&lt;/strong&gt; $f=\sqrt{R^2-x^2}$, $f&apos;=-\dfrac x{\sqrt{R^2-x^2}}$, nên $f\sqrt{1+f&apos;^2}=R$. Vậy $S=2\pi\int_{-R}^RR\,dx=4\pi R^2$. Hơn nữa, đới cầu giữa hai mặt phẳng cách nhau $h$ có diện tích $2\pi Rh$, không phụ thuộc vị trí (Archimedes).&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Ví dụ 5 (Sừng Gabriel).&lt;/strong&gt; Quay $y=\tfrac1x$, $x\ge1$, quanh trục $x$. Thể tích $\pi\int_1^\infty\tfrac{dx}{x^2}=\pi$, hữu hạn. Diện tích mặt $2\pi\int_1^\infty\tfrac1x\sqrt{1+\tfrac1{x^4}}\,dx\ge2\pi\int_1^\infty\tfrac{dx}x=\infty$. Một cái sừng chứa được lượng sơn hữu hạn nhưng không sơn được hết mặt trong.&lt;/p&gt;
&lt;/div&gt;

&lt;h2 id=&quot;video-ngắn&quot;&gt;Video ngắn&lt;/h2&gt;

&lt;div class=&quot;reel-video&quot;&gt;
  &lt;video controls=&quot;&quot; playsinline=&quot;&quot; preload=&quot;metadata&quot; src=&quot;/public/videos/reels/arc-length-polyline.mp4&quot;&gt;&lt;/video&gt;
  &lt;p class=&quot;reel-caption&quot;&gt;Độ dài cung bằng đường gấp khúc: bánh xe lăn vẽ cycloid, đường gấp khúc 4, 16, 64 đoạn dần khít đường cong, tam giác vuông nhỏ cho Δs = √(Δx² + Δy²) (video không lời, khoảng 1 phút 59 giây).&lt;/p&gt;
&lt;/div&gt;

&lt;h2 id=&quot;ứng-dụng&quot;&gt;Ứng dụng&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Vật lý: quãng đường bay.&lt;/strong&gt; Quả bóng bay theo $y=x-\tfrac{x^2}{20}$ (m) từ $x=0$ đến $x=20$. Đặt $u=1-\tfrac x{10}$:&lt;/p&gt;

\[L=\int_0^{20}\sqrt{1+\left(1-\tfrac x{10}\right)^2}\,dx=20\int_0^1\sqrt{1+u^2}\,du=10\bigl(\sqrt2+\ln(1+\sqrt2)\bigr)\approx22.96\ \text{m},\]

&lt;p&gt;dài hơn tầm xa 20 m khoảng 15%.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Kỹ thuật: dây điện và cầu treo.&lt;/strong&gt; Dây treo giữa hai cột có dạng dây xích $y=a\cosh\tfrac xa$. Độ dài dây giữa $x=-d$ và $x=d$ là $2a\sinh\tfrac da$; từ độ võng cho phép, kỹ sư tính được chiều dài dây cần mua.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Học máy.&lt;/strong&gt; Độ dài đường đi của tham số trong quá trình huấn luyện, $\int\lVert\theta&apos;(t)\rVert\,dt$ (bản nhiều chiều của công thức tham số), được dùng để so sánh các thuật toán tối ưu: hai thuật toán đến cùng một điểm nhưng một thuật toán “đi vòng” xa hơn.&lt;/p&gt;

&lt;h2 id=&quot;bài-tập&quot;&gt;Bài tập&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Cơ bản.&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;Tính độ dài đoạn $y=2x+1$, $0\le x\le3$, bằng tích phân và kiểm tra bằng Pythagoras.&lt;/li&gt;
  &lt;li&gt;Tính chu vi đường tròn bán kính $r$ bằng $x=r\cos t$, $y=r\sin t$.&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Đáp án&lt;/summary&gt;

  &lt;ol&gt;
    &lt;li&gt;$\int_0^3\sqrt5\,dx=3\sqrt5$; đoạn nối $(0,1)$ và $(3,7)$ dài $\sqrt{9+36}=3\sqrt5$.&lt;/li&gt;
    &lt;li&gt;$\int_0^{2\pi}r\,dt=2\pi r$.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;p&gt;&lt;strong&gt;Trung bình.&lt;/strong&gt;&lt;/p&gt;

&lt;ol start=&quot;3&quot;&gt;
  &lt;li&gt;Tính độ dài của $y=\tfrac{x^2}4-\tfrac{\ln x}2$, $1\le x\le e$.&lt;/li&gt;
  &lt;li&gt;Tính độ dài toàn bộ đường astroid $x=\cos^3t$, $y=\sin^3t$.&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Đáp án&lt;/summary&gt;

  &lt;ol start=&quot;3&quot;&gt;
    &lt;li&gt;$1+f&apos;^2=\left(\tfrac x2+\tfrac1{2x}\right)^2$, nên $L=\int_1^e\left(\tfrac x2+\tfrac1{2x}\right)dx=\dfrac{e^2+1}4\approx2.097$.&lt;/li&gt;
    &lt;li&gt;$\sqrt{x&apos;^2+y&apos;^2}=3\lvert\sin t\cos t\rvert$; bốn phần bằng nhau: $4\int_0^{\pi/2}3\sin t\cos t\,dt=6$.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;p&gt;&lt;strong&gt;Nâng cao.&lt;/strong&gt;&lt;/p&gt;

&lt;ol start=&quot;5&quot;&gt;
  &lt;li&gt;Tính diện tích mặt tạo bởi quay $y=\sqrt x$, $0\le x\le2$, quanh trục $x$.&lt;/li&gt;
  &lt;li&gt;Chứng minh khẳng định của Archimedes trong ví dụ 4: đới cầu giữa $x=c$ và $x=c+h$ ($-R\le c&amp;lt;c+h\le R$) có diện tích $2\pi Rh$.&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Gợi ý&lt;/summary&gt;

  &lt;ol start=&quot;5&quot;&gt;
    &lt;li&gt;$f\sqrt{1+f&apos;^2}=\sqrt{x+\tfrac14}$: $S=2\pi\cdot\tfrac23\Big[(x+\tfrac14)^{3/2}\Big]_0^2=\tfrac{4\pi}3\left(\tfrac{27}8-\tfrac18\right)=\tfrac{13\pi}3\approx13.61$.&lt;/li&gt;
    &lt;li&gt;Như ví dụ 4, hàm dưới dấu tích phân là hằng số $R$: $2\pi\int_c^{c+h}R\,dx=2\pi Rh$.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;h2 id=&quot;tóm-tắt&quot;&gt;Tóm tắt&lt;/h2&gt;

&lt;div class=&quot;content-box summary-box textbook-block&quot;&gt;
  &lt;ul&gt;
    &lt;li&gt;Độ dài đồ thị: $L=\int_a^b\sqrt{1+f&apos;^2}\,dx$; đường tham số: $L=\int\sqrt{x&apos;^2+y&apos;^2}\,dt$ (tích phân của tốc độ).&lt;/li&gt;
    &lt;li&gt;Diện tích mặt tròn xoay quanh trục $x$: $S=2\pi\int f\sqrt{1+f&apos;^2}\,dx$.&lt;/li&gt;
    &lt;li&gt;Dây xích $\cosh x$ và cycloid cho tích phân đẹp; elip thì không, khi đó tính bằng số.&lt;/li&gt;
    &lt;li&gt;Sừng Gabriel: thể tích hữu hạn, diện tích mặt vô hạn.&lt;/li&gt;
  &lt;/ul&gt;
&lt;/div&gt;
</content>
 </entry>
 
 <entry>
   <title>Diện tích hình phẳng và thể tích vật thể</title>
   <link href="https://calculus-self-learning.pages.dev/contents/vi/chapter06/06_01_Dien_tich_hinh_phang_va_the_tich/"/>
   <updated>2026-12-01T00:00:00+00:00</updated>
   <id>https://calculus-self-learning.pages.dev/contents/vi/chapter06/06_01_Dien_tich_hinh_phang_va_the_tich</id>
   <content type="html">&lt;div class=&quot;textbook-objectives&quot;&gt;

  &lt;p&gt;&lt;strong&gt;Mục tiêu.&lt;/strong&gt; Sau bài này bạn có thể:&lt;/p&gt;

  &lt;ul&gt;
    &lt;li&gt;tính diện tích giữa hai đường cong, theo $x$ hoặc theo $y$;&lt;/li&gt;
    &lt;li&gt;tính thể tích vật thể khi biết diện tích thiết diện $A(x)$;&lt;/li&gt;
    &lt;li&gt;tính thể tích vật thể tròn xoay bằng phương pháp đĩa, vòng đệm và vỏ trụ, và chọn phương pháp thuận tiện;&lt;/li&gt;
    &lt;li&gt;tính thể tích bồn chứa có thành cong.&lt;/li&gt;
  &lt;/ul&gt;

&lt;/div&gt;

&lt;h2 id=&quot;vì-sao-cần-bài-này&quot;&gt;Vì sao cần bài này&lt;/h2&gt;

&lt;p&gt;Mọi công thức trong chương này đến từ cùng một ý: chia đại lượng cần tính thành nhiều phần nhỏ, xấp xỉ mỗi phần bằng một biểu thức đơn giản (hình chữ nhật, đĩa mỏng, vỏ trụ mỏng), cộng lại, rồi lấy giới hạn. Kết quả là một tổng Riemann, nên giới hạn là một tích phân. Khi đã quen cách nghĩ “phần tử nhỏ” này, ta tự lập được công thức thay vì học thuộc.&lt;/p&gt;

&lt;h2 id=&quot;diện-tích-giữa-hai-đường-cong&quot;&gt;Diện tích giữa hai đường cong&lt;/h2&gt;

&lt;p&gt;Nếu $f\ge g$ trên $[a,b]$, dải hẹp tại $x$ có chiều cao $f(x)-g(x)$ và bề rộng $dx$. Cộng lại:&lt;/p&gt;

\[A=\int_a^b\bigl(f(x)-g(x)\bigr)\,dx .\]

&lt;p&gt;Nếu hai đường cắt nhau, tìm các giao điểm và chia đoạn, hoặc dùng $\int_a^b\lvert f-g\rvert\,dx$.&lt;/p&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Ví dụ 1.&lt;/strong&gt; Tính diện tích giới hạn bởi $y=x^2-2$ và $y=x$.&lt;/p&gt;

  &lt;p&gt;Giao điểm: $x^2-2=x$, tức $x=-1$ hoặc $x=2$. Trên $[-1,2]$, $x\ge x^2-2$. Vậy&lt;/p&gt;

\[A=\int_{-1}^2\bigl(x-x^2+2\bigr)\,dx=\Big[\tfrac{x^2}2-\tfrac{x^3}3+2x\Big]_{-1}^2=\tfrac{10}3-\left(-\tfrac76\right)=\tfrac92 .\]

&lt;/div&gt;

&lt;p&gt;Đôi khi tích phân theo $y$ đơn giản hơn: $A=\int_c^d\bigl(\text{phải}-\text{trái}\bigr)\,dy$.&lt;/p&gt;

&lt;h2 id=&quot;thể-tích-bằng-lát-cắt&quot;&gt;Thể tích bằng lát cắt&lt;/h2&gt;

&lt;p&gt;Nếu thiết diện vuông góc với trục $x$ tại $x$ có diện tích $A(x)$, lát cắt dày $dx$ có thể tích xấp xỉ $A(x)\,dx$:&lt;/p&gt;

\[V=\int_a^bA(x)\,dx .\]

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Ví dụ 2 (Hình chóp).&lt;/strong&gt; Hình chóp đáy vuông cạnh $a$, cao $h$. Ở độ sâu $y$ tính từ đỉnh, thiết diện là hình vuông cạnh $\tfrac{ay}h$. Vậy&lt;/p&gt;

\[V=\int_0^h\frac{a^2y^2}{h^2}\,dy=\frac{a^2h}3,\]

  &lt;p&gt;đúng công thức “một phần ba diện tích đáy nhân chiều cao”.&lt;/p&gt;
&lt;/div&gt;

&lt;h2 id=&quot;vật-thể-tròn-xoay&quot;&gt;Vật thể tròn xoay&lt;/h2&gt;

&lt;div class=&quot;textbook-theorem&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Công thức (Đĩa, vòng đệm, vỏ trụ).&lt;/strong&gt; Cho $0\le g\le f$ trên $[a,b]$.&lt;/p&gt;

  &lt;ul&gt;
    &lt;li&gt;Quay miền dưới $y=f(x)$ quanh trục $x$ (&lt;strong&gt;đĩa&lt;/strong&gt;): $V=\pi\displaystyle\int_a^bf(x)^2\,dx$.&lt;/li&gt;
    &lt;li&gt;Quay miền giữa $g$ và $f$ quanh trục $x$ (&lt;strong&gt;vòng đệm&lt;/strong&gt;): $V=\pi\displaystyle\int_a^b\bigl(f(x)^2-g(x)^2\bigr)\,dx$.&lt;/li&gt;
    &lt;li&gt;Quay miền giữa $g$ và $f$, với $0\le a&amp;lt;b$, quanh trục $y$ (&lt;strong&gt;vỏ trụ&lt;/strong&gt;): $V=2\pi\displaystyle\int_a^bx\bigl(f(x)-g(x)\bigr)\,dx$.&lt;/li&gt;
  &lt;/ul&gt;
&lt;/div&gt;

&lt;p&gt;Lý do: quay dải hẹp tại $x$ quanh trục $x$ tạo một đĩa bán kính $f(x)$, dày $dx$, thể tích $\pi f(x)^2dx$. Quay cùng dải đó quanh trục $y$ tạo một vỏ trụ bán kính $x$, cao $f(x)-g(x)$, dày $dx$; trải phẳng ra là một tấm gần như hình hộp kích thước $2\pi x\times(f-g)\times dx$.&lt;/p&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Ví dụ 3 (Hình cầu).&lt;/strong&gt; Quay nửa hình tròn $y=\sqrt{R^2-x^2}$ quanh trục $x$:&lt;/p&gt;

\[V=\pi\int_{-R}^R(R^2-x^2)\,dx=\pi\Big[R^2x-\tfrac{x^3}3\Big]_{-R}^R=\frac43\pi R^3 .\]

&lt;/div&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Ví dụ 4 (Hai phương pháp, cùng một miền).&lt;/strong&gt; Miền giữa $y=x$ và $y=x^2$, $0\le x\le1$.&lt;/p&gt;

  &lt;ul&gt;
    &lt;li&gt;Quay quanh trục $x$ (vòng đệm): $V=\pi\int_0^1(x^2-x^4)\,dx=\pi\left(\tfrac13-\tfrac15\right)=\tfrac{2\pi}{15}$.&lt;/li&gt;
    &lt;li&gt;Quay quanh trục $y$ (vỏ trụ): $V=2\pi\int_0^1x(x-x^2)\,dx=2\pi\left(\tfrac13-\tfrac14\right)=\tfrac\pi6$.&lt;/li&gt;
  &lt;/ul&gt;

  &lt;p&gt;Kiểm tra lần hai bằng vòng đệm theo $y$: với $y\in[0,1]$, bán kính ngoài $\sqrt y$, bán kính trong $y$, nên $V=\pi\int_0^1(y-y^2)\,dy=\tfrac\pi6$. Khớp.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;interactive-frame&quot;&gt;
  &lt;div class=&quot;interactive-frame-head&quot;&gt;
    &lt;div class=&quot;interactive-frame-title&quot;&gt;Vật thể tròn xoay&lt;/div&gt;
    &lt;div class=&quot;interactive-frame-desc&quot;&gt;Dựng vật thể bằng đĩa hoặc vỏ trụ, tăng số lát để tổng gần thể tích đúng.&lt;/div&gt;
  &lt;/div&gt;
  &lt;iframe src=&quot;/interactives/chapter06/solid-of-revolution.html&quot; title=&quot;Vật thể tròn xoay&quot; loading=&quot;lazy&quot; style=&quot;height: 720px;&quot;&gt;&lt;/iframe&gt;
  &lt;div class=&quot;interactive-frame-foot&quot;&gt;
    &lt;a href=&quot;/interactives/chapter06/solid-of-revolution.html&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;Mở minh hoạ ở cửa sổ riêng&lt;/a&gt;
  &lt;/div&gt;
&lt;/div&gt;

&lt;h2 id=&quot;video-ngắn&quot;&gt;Video ngắn&lt;/h2&gt;

&lt;div class=&quot;reel-video&quot;&gt;
  &lt;video controls=&quot;&quot; playsinline=&quot;&quot; preload=&quot;metadata&quot; src=&quot;/public/videos/reels/solids-of-revolution.mp4&quot;&gt;&lt;/video&gt;
  &lt;p class=&quot;reel-caption&quot;&gt;Vật thể tròn xoay của y = √x trên [0, 4]: cắt thành đĩa hay cuộn thành vỏ trụ đều ra 8π (video không lời, khoảng 2 phút).&lt;/p&gt;
&lt;/div&gt;

&lt;h2 id=&quot;ứng-dụng&quot;&gt;Ứng dụng&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Kỹ thuật: thể tích bồn chứa.&lt;/strong&gt; Bồn hình paraboloid được tạo bằng cách quay $y=x^2$ (mét) quanh trục $y$, cao 4 m. Thiết diện ngang ở độ cao $y$ là hình tròn bán kính $\sqrt y$, nên $V=\pi\int_0^4y\,dy=8\pi\approx25.1$ m³. Khi mực nước cao $h$, thể tích $\tfrac\pi2h^2$: bồn đầy một nửa chiều cao chỉ chứa một phần tư thể tích.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Kinh tế: hệ số Gini.&lt;/strong&gt; Diện tích giữa đường bình đẳng $y=p$ và đường cong Lorenz $L(p)$ là $\int_0^1\bigl(p-L(p)\bigr)\,dp$; hệ số Gini bằng hai lần diện tích này (bài 04_05).&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Học máy.&lt;/strong&gt; Diện tích giữa hai mật độ $\tfrac12\int\lvert p-q\rvert$ là khoảng cách biến phân toàn phần, dùng để đo hai phân phối khác nhau bao nhiêu, chẳng hạn giữa dữ liệu huấn luyện và dữ liệu thật.&lt;/p&gt;

&lt;h2 id=&quot;bài-tập&quot;&gt;Bài tập&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Cơ bản.&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;Tính diện tích giới hạn bởi $y=x^2$ và $y=2x$.&lt;/li&gt;
  &lt;li&gt;Quay miền dưới $y=\sqrt x$, $0\le x\le4$, quanh trục $x$. Tính thể tích.&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Đáp án&lt;/summary&gt;

  &lt;ol&gt;
    &lt;li&gt;Giao điểm $x=0,2$: $\int_0^2(2x-x^2)\,dx=4-\tfrac83=\tfrac43$.&lt;/li&gt;
    &lt;li&gt;$\pi\int_0^4x\,dx=8\pi$.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;p&gt;&lt;strong&gt;Trung bình.&lt;/strong&gt;&lt;/p&gt;

&lt;ol start=&quot;3&quot;&gt;
  &lt;li&gt;Tính diện tích miền giữa $y=\sin x$ và $y=\cos x$ với $\tfrac\pi4\le x\le\tfrac{5\pi}4$.&lt;/li&gt;
  &lt;li&gt;Quay miền dưới $y=x^2$, $0\le x\le2$, quanh trục $y$. Tính thể tích bằng vỏ trụ.&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Đáp án&lt;/summary&gt;

  &lt;ol start=&quot;3&quot;&gt;
    &lt;li&gt;$\int_{\pi/4}^{5\pi/4}(\sin x-\cos x)\,dx=\Big[-\cos x-\sin x\Big]_{\pi/4}^{5\pi/4}=2\sqrt2$.&lt;/li&gt;
    &lt;li&gt;$2\pi\int_0^2x\cdot x^2\,dx=8\pi$.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;p&gt;&lt;strong&gt;Nâng cao.&lt;/strong&gt;&lt;/p&gt;

&lt;ol start=&quot;5&quot;&gt;
  &lt;li&gt;Hình xuyến: quay hình tròn $(x-R)^2+y^2\le r^2$ ($0&amp;lt;r&amp;lt;R$) quanh trục $y$. Chứng minh $V=2\pi^2Rr^2$.&lt;/li&gt;
  &lt;li&gt;Vật thể có đáy là hình tròn $x^2+y^2\le1$, mọi thiết diện vuông góc với trục $x$ là hình vuông. Tính thể tích.&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Gợi ý&lt;/summary&gt;

  &lt;ol start=&quot;5&quot;&gt;
    &lt;li&gt;Vỏ trụ: $V=2\pi\int_{R-r}^{R+r}x\cdot2\sqrt{r^2-(x-R)^2}\,dx$. Đặt $u=x-R$: phần $\int u\sqrt{r^2-u^2}\,du=0$ (hàm lẻ), phần còn lại $2\pi R\cdot2\cdot\tfrac{\pi r^2}2$.&lt;/li&gt;
    &lt;li&gt;Cạnh hình vuông $2\sqrt{1-x^2}$: $V=\int_{-1}^14(1-x^2)\,dx=\tfrac{16}3$.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;h2 id=&quot;tóm-tắt&quot;&gt;Tóm tắt&lt;/h2&gt;

&lt;div class=&quot;content-box summary-box textbook-block&quot;&gt;
  &lt;ul&gt;
    &lt;li&gt;Diện tích giữa hai đường: $\int(\text{trên}-\text{dưới})\,dx$ hoặc $\int(\text{phải}-\text{trái})\,dy$; tìm giao điểm trước.&lt;/li&gt;
    &lt;li&gt;Thể tích bằng lát cắt: $V=\int A(x)\,dx$.&lt;/li&gt;
    &lt;li&gt;Quay quanh trục $x$: đĩa $\pi\int f^2$, vòng đệm $\pi\int(f^2-g^2)$. Quay quanh trục $y$: vỏ trụ $2\pi\int x(f-g)$.&lt;/li&gt;
    &lt;li&gt;Cách lập công thức: chọn phần tử nhỏ, viết thể tích (diện tích) của nó, rồi tích phân.&lt;/li&gt;
  &lt;/ul&gt;
&lt;/div&gt;
</content>
 </entry>
 
 <entry>
   <title>Tích phân Gauss và hàm Gamma</title>
   <link href="https://calculus-self-learning.pages.dev/contents/vi/chapter05/05_06_Tich_phan_Gauss_va_ham_Gamma/"/>
   <updated>2026-12-01T00:00:00+00:00</updated>
   <id>https://calculus-self-learning.pages.dev/contents/vi/chapter05/05_06_Tich_phan_Gauss_va_ham_Gamma</id>
   <content type="html">&lt;div class=&quot;textbook-objectives&quot;&gt;

  &lt;p&gt;&lt;strong&gt;Mục tiêu.&lt;/strong&gt; Sau bài này bạn có thể:&lt;/p&gt;

  &lt;ul&gt;
    &lt;li&gt;định nghĩa hàm Gamma và chứng minh nó hội tụ với $s&amp;gt;0$;&lt;/li&gt;
    &lt;li&gt;chứng minh $\Gamma(s+1)=s\Gamma(s)$ và $\Gamma(n)=(n-1)!$;&lt;/li&gt;
    &lt;li&gt;dùng tích phân Gauss $\int_{-\infty}^\infty e^{-x^2}\,dx=\sqrt\pi$ (chứng minh ở chương 13) để tính $\Gamma(\tfrac12)$ và chuẩn hoá phân phối chuẩn;&lt;/li&gt;
    &lt;li&gt;đưa các tích phân dạng $\int_0^\infty x^ne^{-ax}\,dx$, $\int_0^\infty x^ne^{-x^2}\,dx$ về hàm Gamma.&lt;/li&gt;
  &lt;/ul&gt;

&lt;/div&gt;

&lt;h2 id=&quot;vì-sao-cần-bài-này&quot;&gt;Vì sao cần bài này&lt;/h2&gt;

&lt;p&gt;Hàm mật độ của phân phối chuẩn là $\dfrac1{\sqrt{2\pi}}e^{-x^2/2}$. Hằng số $\sqrt{2\pi}$ ở đâu ra? Hàm $e^{-x^2}$ không có nguyên hàm sơ cấp (bài 04_04), nhưng tích phân trên cả trục số lại tính đúng được. Tương tự, $n!$ chỉ định nghĩa cho số nguyên, nhưng thống kê cần “$(\tfrac12)!$”. Cả hai câu hỏi dẫn đến cùng một họ tích phân suy rộng.&lt;/p&gt;

&lt;h2 id=&quot;hàm-gamma&quot;&gt;Hàm Gamma&lt;/h2&gt;

&lt;div class=&quot;textbook-definition&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Định nghĩa 1 (Hàm Gamma).&lt;/strong&gt; Với $s&amp;gt;0$,&lt;/p&gt;

\[\Gamma(s)=\int_0^\infty x^{s-1}e^{-x}\,dx .\]

&lt;/div&gt;

&lt;div class=&quot;textbook-theorem&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Định lý 1.&lt;/strong&gt; Tích phân $\Gamma(s)$ hội tụ với mọi $s&amp;gt;0$.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-proof&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Chứng minh.&lt;/strong&gt; Tách tại 1. Trên $(0,1]$: $0&amp;lt;x^{s-1}e^{-x}\le x^{s-1}=\dfrac1{x^{1-s}}$, và $1-s&amp;lt;1$, nên hội tụ theo định lý 1 bài 05_05. Trên $[1,\infty)$: $x^{s-1}e^{-x/2}\to0$ khi $x\to\infty$ (hàm mũ thắng lũy thừa, bài 02_06), nên có $C$ để $x^{s-1}e^{-x/2}\le C$, tức $x^{s-1}e^{-x}\le Ce^{-x/2}$; tích phân $\int_1^\infty Ce^{-x/2}$ hội tụ. Áp dụng tiêu chuẩn so sánh.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-theorem&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Định lý 2 (Hàm Gamma mở rộng giai thừa).&lt;/strong&gt; $\Gamma(1)=1$ và $\Gamma(s+1)=s\,\Gamma(s)$ với $s&amp;gt;0$. Do đó $\Gamma(n)=(n-1)!$ với mọi số nguyên dương $n$.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-proof&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Chứng minh.&lt;/strong&gt; $\Gamma(1)=\int_0^\infty e^{-x}\,dx=1$. Từng phần với $u=x^s$, $dv=e^{-x}dx$ trên $[c,b]$ rồi cho $c\to0^+$, $b\to\infty$:&lt;/p&gt;

\[\Gamma(s+1)=\Big[-x^se^{-x}\Big]_0^\infty+s\int_0^\infty x^{s-1}e^{-x}\,dx=0+s\,\Gamma(s),\]

  &lt;p&gt;vì $b^se^{-b}\to0$ và $c^s\to0$. Quy nạp: $\Gamma(n)=(n-1)\Gamma(n-1)=\dots=(n-1)!\,\Gamma(1)$.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Ví dụ 1.&lt;/strong&gt; Với $a&amp;gt;0$, đổi biến $t=ax$:&lt;/p&gt;

\[\int_0^\infty x^ne^{-ax}\,dx=\frac1{a^{n+1}}\int_0^\infty t^ne^{-t}\,dt=\frac{\Gamma(n+1)}{a^{n+1}}=\frac{n!}{a^{n+1}} .\]

  &lt;p&gt;Ví dụ $\int_0^\infty x^3e^{-2x}\,dx=\dfrac{3!}{2^4}=\dfrac38$.&lt;/p&gt;
&lt;/div&gt;

&lt;h2 id=&quot;tích-phân-gauss&quot;&gt;Tích phân Gauss&lt;/h2&gt;

&lt;div class=&quot;textbook-theorem&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Định lý 3 (Tích phân Gauss).&lt;/strong&gt;&lt;/p&gt;

\[\int_{-\infty}^\infty e^{-x^2}\,dx=\sqrt\pi,\qquad\int_0^\infty e^{-x^2}\,dx=\frac{\sqrt\pi}2 .\]

&lt;/div&gt;

&lt;p&gt;Tích phân hội tụ (ví dụ 2 bài 05_05). Giá trị $\sqrt\pi$ được chứng minh ở chương 13 bằng một mẹo: bình phương tích phân thành tích phân kép trên mặt phẳng rồi chuyển sang toạ độ cực. Bài 04_05 đã kiểm tra bằng số: $\int_0^1e^{-x^2}\,dx\approx0.7468$, và phần còn lại $\int_1^\infty$ khoảng $0.1394$, tổng $0.8862\approx\sqrt\pi/2$.&lt;/p&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Ví dụ 2 ($\Gamma(\frac12)$).&lt;/strong&gt; Đổi biến $x=u^2$, $dx=2u\,du$:&lt;/p&gt;

\[\Gamma\left(\tfrac12\right)=\int_0^\infty x^{-1/2}e^{-x}\,dx=\int_0^\infty\frac1ue^{-u^2}\,2u\,du=2\int_0^\infty e^{-u^2}\,du=\sqrt\pi .\]

  &lt;p&gt;Từ đó $\Gamma(\tfrac32)=\tfrac12\sqrt\pi$, $\Gamma(\tfrac52)=\tfrac32\cdot\tfrac12\sqrt\pi=\tfrac34\sqrt\pi$.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Ví dụ 3.&lt;/strong&gt; $\int_0^\infty x^2e^{-x^2}\,dx$. Đặt $t=x^2$, $x=\sqrt t$, $dx=\dfrac{dt}{2\sqrt t}$:&lt;/p&gt;

\[\int_0^\infty t\,e^{-t}\frac{dt}{2\sqrt t}=\frac12\int_0^\infty t^{1/2}e^{-t}\,dt=\frac12\Gamma\left(\tfrac32\right)=\frac{\sqrt\pi}4 .\]

  &lt;p&gt;Tổng quát: $\int_0^\infty x^ne^{-x^2}\,dx=\tfrac12\Gamma\left(\tfrac{n+1}2\right)$.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;content-box insight-box textbook-block&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Công thức Stirling.&lt;/strong&gt; Với $n$ lớn, $n!=\Gamma(n+1)\approx\sqrt{2\pi n}\left(\dfrac ne\right)^n$. Với $n=10$: $3\,598\,696$ so với $10!=3\,628\,800$, sai 0.83%. Công thức này cũng chứng minh được từ tích phân Gamma và tích phân Gauss.&lt;/p&gt;
&lt;/div&gt;

&lt;h2 id=&quot;ứng-dụng&quot;&gt;Ứng dụng&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Học máy và xác suất: phân phối chuẩn.&lt;/strong&gt; Đổi biến $x=\mu+\sigma\sqrt2\,u$ trong định lý 3:&lt;/p&gt;

\[\int_{-\infty}^\infty e^{-(x-\mu)^2/(2\sigma^2)}\,dx=\sigma\sqrt{2\pi} .\]

&lt;p&gt;Vậy $p(x)=\dfrac1{\sigma\sqrt{2\pi}}e^{-(x-\mu)^2/(2\sigma^2)}$ có tổng xác suất bằng 1. Hằng số chuẩn hoá này xuất hiện trong hàm mất mát log-likelihood của hồi quy tuyến tính, trong mô hình hỗn hợp Gauss, và trong VAE.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Thống kê: phân phối Gamma.&lt;/strong&gt; Thời gian chờ đến sự kiện thứ $k$ trong một dòng sự kiện ngẫu nhiên có mật độ $p(x)=\dfrac{x^{k-1}e^{-x/\theta}}{\Gamma(k)\,\theta^k}$, $x&amp;gt;0$. Ví dụ 1 cho $\int_0^\infty p=1$ và kỳ vọng $k\theta$ (bài tập 6). Phân phối khi bình phương là trường hợp riêng $\theta=2$, $k=\tfrac\nu2$, nên cần $\Gamma$ tại nửa số nguyên.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Vật lý: phân bố Maxwell.&lt;/strong&gt; Tốc độ phân tử khí có mật độ tỉ lệ với $v^2e^{-av^2}$. Hằng số chuẩn hoá và tốc độ trung bình cần $\int_0^\infty v^2e^{-av^2}\,dv=\dfrac{\sqrt\pi}{4a^{3/2}}$ và $\int_0^\infty v^3e^{-av^2}\,dv=\dfrac1{2a^2}$, đều suy từ ví dụ 3 bằng đổi biến.&lt;/p&gt;

&lt;h2 id=&quot;bài-tập&quot;&gt;Bài tập&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Cơ bản.&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;Tính $\Gamma(5)$ và $\Gamma(\tfrac72)$.&lt;/li&gt;
  &lt;li&gt;Tính $\int_0^\infty x^4e^{-x}\,dx$ và $\int_0^\infty\sqrt x\,e^{-x}\,dx$.&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Đáp án&lt;/summary&gt;

  &lt;ol&gt;
    &lt;li&gt;$4!=24$; $\tfrac52\cdot\tfrac32\cdot\tfrac12\sqrt\pi=\tfrac{15}8\sqrt\pi\approx3.323$.&lt;/li&gt;
    &lt;li&gt;$\Gamma(5)=24$; $\Gamma(\tfrac32)=\tfrac{\sqrt\pi}2\approx0.886$.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;p&gt;&lt;strong&gt;Trung bình.&lt;/strong&gt;&lt;/p&gt;

&lt;ol start=&quot;3&quot;&gt;
  &lt;li&gt;Tính $\int_0^\infty e^{-x^2/2}\,dx$ và $\int_0^\infty x^3e^{-x^2}\,dx$.&lt;/li&gt;
  &lt;li&gt;Chứng minh $\int_0^1\left(\ln\dfrac1x\right)^n\,dx=n!$.&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Đáp án&lt;/summary&gt;

  &lt;ol start=&quot;3&quot;&gt;
    &lt;li&gt;$x=\sqrt2u$: $\sqrt2\cdot\tfrac{\sqrt\pi}2=\sqrt{\tfrac\pi2}\approx1.2533$. $\tfrac12\Gamma(2)=\tfrac12$.&lt;/li&gt;
    &lt;li&gt;Đặt $x=e^{-t}$, $dx=-e^{-t}dt$, $x:0\to1$ ứng với $t:\infty\to0$: được $\int_0^\infty t^ne^{-t}\,dt=\Gamma(n+1)=n!$.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;p&gt;&lt;strong&gt;Nâng cao.&lt;/strong&gt;&lt;/p&gt;

&lt;ol start=&quot;5&quot;&gt;
  &lt;li&gt;Chứng minh biến chuẩn tắc $Z$ có $E[Z^2]=\dfrac1{\sqrt{2\pi}}\int_{-\infty}^\infty x^2e^{-x^2/2}\,dx=1$.&lt;/li&gt;
  &lt;li&gt;Chứng minh phân phối Gamma ở phần ứng dụng có tổng xác suất 1 và kỳ vọng $k\theta$.&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Gợi ý&lt;/summary&gt;

  &lt;ol start=&quot;5&quot;&gt;
    &lt;li&gt;Hàm chẵn: $\tfrac2{\sqrt{2\pi}}\int_0^\infty x^2e^{-x^2/2}\,dx$. Đặt $x=\sqrt2u$ và dùng ví dụ 3: $\tfrac2{\sqrt{2\pi}}\cdot2\sqrt2\cdot\tfrac{\sqrt\pi}4=1$.&lt;/li&gt;
    &lt;li&gt;Đặt $t=x/\theta$: $\int_0^\infty p=\tfrac{\Gamma(k)}{\Gamma(k)}=1$ và $\int_0^\infty xp=\theta\tfrac{\Gamma(k+1)}{\Gamma(k)}=k\theta$.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;h2 id=&quot;tóm-tắt&quot;&gt;Tóm tắt&lt;/h2&gt;

&lt;div class=&quot;content-box summary-box textbook-block&quot;&gt;
  &lt;ul&gt;
    &lt;li&gt;$\Gamma(s)=\int_0^\infty x^{s-1}e^{-x}\,dx$ hội tụ với $s&amp;gt;0$, $\Gamma(s+1)=s\Gamma(s)$, $\Gamma(n)=(n-1)!$.&lt;/li&gt;
    &lt;li&gt;$\int_{-\infty}^\infty e^{-x^2}\,dx=\sqrt\pi$ (chứng minh ở chương 13), $\Gamma(\tfrac12)=\sqrt\pi$.&lt;/li&gt;
    &lt;li&gt;$\int_0^\infty x^ne^{-ax}\,dx=\dfrac{n!}{a^{n+1}}$, $\int_0^\infty x^ne^{-x^2}\,dx=\tfrac12\Gamma\left(\tfrac{n+1}2\right)$.&lt;/li&gt;
    &lt;li&gt;Hằng số $\sigma\sqrt{2\pi}$ của phân phối chuẩn và $\Gamma(k)\theta^k$ của phân phối Gamma đều đến từ các tích phân này.&lt;/li&gt;
  &lt;/ul&gt;
&lt;/div&gt;
</content>
 </entry>
 
 <entry>
   <title>Tích phân suy rộng</title>
   <link href="https://calculus-self-learning.pages.dev/contents/vi/chapter05/05_05_Tich_phan_suy_rong/"/>
   <updated>2026-12-01T00:00:00+00:00</updated>
   <id>https://calculus-self-learning.pages.dev/contents/vi/chapter05/05_05_Tich_phan_suy_rong</id>
   <content type="html">&lt;div class=&quot;textbook-objectives&quot;&gt;

  &lt;p&gt;&lt;strong&gt;Mục tiêu.&lt;/strong&gt; Sau bài này bạn có thể:&lt;/p&gt;

  &lt;ul&gt;
    &lt;li&gt;định nghĩa tích phân suy rộng loại 1 (cận vô hạn) và loại 2 (hàm không bị chặn) qua giới hạn;&lt;/li&gt;
    &lt;li&gt;biết khi nào $\int_1^\infty x^{-p}\,dx$ và $\int_0^1x^{-p}\,dx$ hội tụ;&lt;/li&gt;
    &lt;li&gt;xét hội tụ bằng tiêu chuẩn so sánh, so sánh giới hạn và hội tụ tuyệt đối;&lt;/li&gt;
    &lt;li&gt;tính vận tốc thoát, giá trị hiện tại của dòng tiền vĩnh viễn và biến đổi Laplace của các hàm đơn giản.&lt;/li&gt;
  &lt;/ul&gt;

&lt;/div&gt;

&lt;h2 id=&quot;vì-sao-cần-bài-này&quot;&gt;Vì sao cần bài này&lt;/h2&gt;

&lt;p&gt;Xác suất để thời gian chờ lớn hơn 10 phút là tích phân của hàm mật độ từ 10 đến vô cùng. Công để đưa một vệ tinh ra xa Trái Đất mãi mãi là tích phân lực hấp dẫn đến vô cùng. Ở bài 04_03 ta thấy $\int_{-1}^1\frac{dx}{x^2}$ cho kết quả vô lý vì hàm không bị chặn. Tích phân Riemann chỉ định nghĩa cho hàm bị chặn trên đoạn hữu hạn; bài này mở rộng nó bằng giới hạn.&lt;/p&gt;

&lt;h2 id=&quot;định-nghĩa&quot;&gt;Định nghĩa&lt;/h2&gt;

&lt;div class=&quot;textbook-definition&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Định nghĩa 1 (Tích phân suy rộng).&lt;/strong&gt;&lt;/p&gt;

  &lt;p&gt;&lt;strong&gt;Loại 1.&lt;/strong&gt; Nếu $f$ khả tích trên $[a,b]$ với mọi $b&amp;gt;a$:&lt;/p&gt;

\[\int_a^\infty f(x)\,dx=\lim_{b\to\infty}\int_a^bf(x)\,dx .\]

  &lt;p&gt;Tương tự cho $\int_{-\infty}^b$. Với $\int_{-\infty}^\infty f$, chọn $c$ bất kỳ và yêu cầu cả $\int_{-\infty}^cf$ và $\int_c^\infty f$ cùng hội tụ.
&lt;strong&gt;Loại 2.&lt;/strong&gt; Nếu $f$ khả tích trên $[a,c]$ với mọi $c&amp;lt;b$ nhưng không bị chặn gần $b$:&lt;/p&gt;

\[\int_a^bf(x)\,dx=\lim_{c\to b^-}\int_a^cf(x)\,dx .\]

  &lt;p&gt;Tương tự khi $f$ không bị chặn gần $a$, hoặc gần một điểm bên trong (khi đó tách tại điểm đó).&lt;/p&gt;

  &lt;p&gt;Nếu giới hạn tồn tại và hữu hạn, tích phân &lt;strong&gt;hội tụ&lt;/strong&gt;; ngược lại, tích phân &lt;strong&gt;phân kỳ&lt;/strong&gt;.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Ví dụ 1.&lt;/strong&gt;&lt;/p&gt;

  &lt;ul&gt;
    &lt;li&gt;$\int_0^\infty e^{-x}\,dx=\lim_{b\to\infty}\bigl(1-e^{-b}\bigr)=1$.&lt;/li&gt;
    &lt;li&gt;$\int_{-\infty}^\infty\dfrac{dx}{1+x^2}=\lim_{b\to\infty}\arctan b-\lim_{a\to-\infty}\arctan a=\dfrac\pi2+\dfrac\pi2=\pi$.&lt;/li&gt;
    &lt;li&gt;$\int_0^1\ln x\,dx=\lim_{c\to0^+}\Big[x\ln x-x\Big]_c^1=-1-\lim_{c\to0^+}(c\ln c-c)=-1$ (vì $c\ln c\to0$, bài 02_06).&lt;/li&gt;
    &lt;li&gt;$\int_{-1}^1\dfrac{dx}{x^2}$: tách tại 0; $\int_0^1\dfrac{dx}{x^2}=\lim_{c\to0^+}\left(\dfrac1c-1\right)=\infty$. Phân kỳ.&lt;/li&gt;
  &lt;/ul&gt;
&lt;/div&gt;

&lt;div class=&quot;content-box warning-box textbook-block&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Hai đầu vô hạn phải xét riêng.&lt;/strong&gt; $\int_{-b}^bx\,dx=0$ với mọi $b$, nhưng $\int_0^\infty x\,dx=\infty$, nên $\int_{-\infty}^\infty x\,dx$ phân kỳ. Giới hạn đối xứng $\lim_{b\to\infty}\int_{-b}^b$ gọi là giá trị chính Cauchy; nó không phải định nghĩa của tích phân suy rộng.&lt;/p&gt;
&lt;/div&gt;

&lt;h2 id=&quot;tích-phân-p&quot;&gt;Tích phân p&lt;/h2&gt;

&lt;div class=&quot;textbook-theorem&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Định lý 1.&lt;/strong&gt;&lt;/p&gt;

  &lt;ul&gt;
    &lt;li&gt;$\displaystyle\int_1^\infty\frac{dx}{x^p}$ hội tụ khi và chỉ khi $p&amp;gt;1$, và khi đó bằng $\dfrac1{p-1}$.&lt;/li&gt;
    &lt;li&gt;$\displaystyle\int_0^1\frac{dx}{x^p}$ hội tụ khi và chỉ khi $p&amp;lt;1$, và khi đó bằng $\dfrac1{1-p}$.&lt;/li&gt;
  &lt;/ul&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-proof&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Chứng minh.&lt;/strong&gt; Với $p\ne1$: $\int_1^bx^{-p}\,dx=\dfrac{b^{1-p}-1}{1-p}$. Khi $b\to\infty$, $b^{1-p}\to0$ nếu $p&amp;gt;1$ và $\to\infty$ nếu $p&amp;lt;1$. Với $p=1$: $\int_1^b\frac{dx}x=\ln b\to\infty$. Phần thứ hai tương tự với $\int_c^1x^{-p}\,dx=\dfrac{1-c^{1-p}}{1-p}$ khi $c\to0^+$: $c^{1-p}\to0$ khi và chỉ khi $p&amp;lt;1$; với $p=1$ được $-\ln c\to\infty$.&lt;/p&gt;
&lt;/div&gt;

&lt;p&gt;Nhớ: ở vô cùng, hàm phải giảm &lt;strong&gt;nhanh hơn&lt;/strong&gt; $1/x$; gần 0, hàm phải tăng &lt;strong&gt;chậm hơn&lt;/strong&gt; $1/x$. Hàm $1/x$ phân kỳ ở cả hai đầu.&lt;/p&gt;

&lt;h2 id=&quot;tiêu-chuẩn-so-sánh&quot;&gt;Tiêu chuẩn so sánh&lt;/h2&gt;

&lt;div class=&quot;textbook-theorem&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Định lý 2 (So sánh).&lt;/strong&gt; Giả sử $0\le f(x)\le g(x)$ với $x\ge a$, và $f,g$ khả tích trên mọi $[a,b]$.&lt;/p&gt;

  &lt;ul&gt;
    &lt;li&gt;Nếu $\int_a^\infty g$ hội tụ thì $\int_a^\infty f$ hội tụ.&lt;/li&gt;
    &lt;li&gt;Nếu $\int_a^\infty f$ phân kỳ thì $\int_a^\infty g$ phân kỳ.&lt;/li&gt;
  &lt;/ul&gt;

  &lt;p&gt;&lt;strong&gt;Định lý 3 (So sánh giới hạn).&lt;/strong&gt; Nếu $f,g&amp;gt;0$ và $\displaystyle\lim_{x\to\infty}\frac{f(x)}{g(x)}=L\in(0,\infty)$ thì $\int_a^\infty f$ và $\int_a^\infty g$ cùng hội tụ hoặc cùng phân kỳ.&lt;/p&gt;

  &lt;p&gt;&lt;strong&gt;Định lý 4 (Hội tụ tuyệt đối).&lt;/strong&gt; Nếu $\int_a^\infty\lvert f\rvert$ hội tụ thì $\int_a^\infty f$ hội tụ.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-proof&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Chứng minh (định lý 2).&lt;/strong&gt; $F(b)=\int_a^bf$ là hàm tăng theo $b$ vì $f\ge0$, và $F(b)\le\int_a^bg\le\int_a^\infty g$. Một hàm tăng và bị chặn trên có giới hạn hữu hạn khi $b\to\infty$ (tính đầy đủ của $\mathbb R$, bài 00_01). Phần thứ hai là phản đảo của phần thứ nhất.&lt;/p&gt;
&lt;/div&gt;

&lt;p&gt;Định lý 3 suy ra từ định lý 2: với $x$ đủ lớn, $\tfrac L2g\le f\le2Lg$. Định lý 4: $0\le f+\lvert f\rvert\le2\lvert f\rvert$, áp dụng định lý 2 rồi trừ đi $\int\lvert f\rvert$.&lt;/p&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Ví dụ 2.&lt;/strong&gt;&lt;/p&gt;

  &lt;ul&gt;
    &lt;li&gt;$\int_1^\infty e^{-x^2}\,dx$ hội tụ: với $x\ge1$, $e^{-x^2}\le e^{-x}$ và $\int_1^\infty e^{-x}$ hội tụ.&lt;/li&gt;
    &lt;li&gt;$\int_1^\infty\dfrac{1+\sin^2x}x\,dx$ phân kỳ: hàm $\ge\dfrac1x$.&lt;/li&gt;
    &lt;li&gt;$\int_1^\infty\dfrac{dx}{\sqrt{x^3+1}}$ hội tụ: so sánh giới hạn với $x^{-3/2}$ ($p=\tfrac32&amp;gt;1$), tỉ số dần về 1.&lt;/li&gt;
    &lt;li&gt;$\int_1^\infty\dfrac{\sin x}{x^2}\,dx$ hội tụ tuyệt đối: $\left\lvert\dfrac{\sin x}{x^2}\right\rvert\le\dfrac1{x^2}$.&lt;/li&gt;
  &lt;/ul&gt;
&lt;/div&gt;

&lt;div class=&quot;interactive-frame&quot;&gt;
  &lt;div class=&quot;interactive-frame-head&quot;&gt;
    &lt;div class=&quot;interactive-frame-title&quot;&gt;Tích phân suy rộng của 1/xᵖ&lt;/div&gt;
    &lt;div class=&quot;interactive-frame-desc&quot;&gt;Kéo cận ra xa và kéo p qua ngưỡng 1.&lt;/div&gt;
  &lt;/div&gt;
  &lt;iframe src=&quot;/interactives/chapter05/improper-integral.html&quot; title=&quot;Tích phân suy rộng của 1/xᵖ&quot; loading=&quot;lazy&quot; style=&quot;height: 680px;&quot;&gt;&lt;/iframe&gt;
  &lt;div class=&quot;interactive-frame-foot&quot;&gt;
    &lt;a href=&quot;/interactives/chapter05/improper-integral.html&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;Mở minh hoạ ở cửa sổ riêng&lt;/a&gt;
  &lt;/div&gt;
&lt;/div&gt;

&lt;h2 id=&quot;video-ngắn&quot;&gt;Video ngắn&lt;/h2&gt;

&lt;div class=&quot;reel-video&quot;&gt;
  &lt;video controls=&quot;&quot; playsinline=&quot;&quot; preload=&quot;metadata&quot; src=&quot;/public/videos/reels/gabriel-horn.mp4&quot;&gt;&lt;/video&gt;
  &lt;p class=&quot;reel-caption&quot;&gt;Sừng Gabriel: thể tích hữu hạn bằng π nhưng diện tích mặt vô hạn, cùng lời giải nghịch lý lớp sơn (video không lời, khoảng 2 phút).&lt;/p&gt;
&lt;/div&gt;

&lt;h2 id=&quot;ứng-dụng&quot;&gt;Ứng dụng&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Vật lý: vận tốc thoát.&lt;/strong&gt; Công để đưa vật khối lượng $m$ từ mặt đất (bán kính $R$) ra vô cùng là&lt;/p&gt;

\[W=\int_R^\infty\frac{GMm}{r^2}\,dr=\frac{GMm}R .\]

&lt;p&gt;Cho động năng $\tfrac12mv^2=W$ và dùng $g=GM/R^2$: $v=\sqrt{2gR}=\sqrt{2\cdot9.8\cdot6.37\cdot10^6}\approx11.2$ km/s.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Kinh tế: dòng tiền vĩnh viễn.&lt;/strong&gt; Một trái phiếu vĩnh viễn trả $R=100$ triệu đồng/năm, lãi suất liên tục $r=8\%$: $PV=\int_0^\infty Re^{-rt}\,dt=\dfrac Rr=1250$ triệu đồng. So với 688.3 triệu cho 10 năm (bài 05_01).&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Kỹ thuật: biến đổi Laplace.&lt;/strong&gt; $\mathcal L\lbrace f\rbrace(s)=\int_0^\infty e^{-st}f(t)\,dt$. Ví dụ $\mathcal L\lbrace e^{at}\rbrace(s)=\int_0^\infty e^{-(s-a)t}\,dt=\dfrac1{s-a}$, hội tụ khi $s&amp;gt;a$. Khoá Phương trình vi phân dùng phép biến đổi này để giải phương trình tuyến tính.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Học máy và xác suất.&lt;/strong&gt; Mật độ phải có $\int_{-\infty}^\infty p=1$, một tích phân suy rộng. Phân phối Cauchy $p(x)=\dfrac1{\pi(1+x^2)}$ thoả điều kiện này (ví dụ 1), nhưng $\int_{-\infty}^\infty\lvert x\rvert p(x)\,dx$ phân kỳ (so sánh giới hạn với $1/x$): phân phối Cauchy không có kỳ vọng, nên trung bình mẫu của nó không hội tụ.&lt;/p&gt;

&lt;h2 id=&quot;bài-tập&quot;&gt;Bài tập&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Cơ bản.&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;Tính $\int_1^\infty\dfrac{dx}{x^3}$ và $\int_0^1\dfrac{dx}{\sqrt x}$.&lt;/li&gt;
  &lt;li&gt;Tính $\int_0^\infty xe^{-x^2}\,dx$. Xét hội tụ của $\int_2^\infty\dfrac{dx}{x\ln x}$.&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Đáp án&lt;/summary&gt;

  &lt;ol&gt;
    &lt;li&gt;$\tfrac12$; $2$.&lt;/li&gt;
    &lt;li&gt;$\Big[-\tfrac12e^{-x^2}\Big]_0^\infty=\tfrac12$. $\int_2^b\dfrac{dx}{x\ln x}=\ln\ln b-\ln\ln2\to\infty$: phân kỳ.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;p&gt;&lt;strong&gt;Trung bình.&lt;/strong&gt;&lt;/p&gt;

&lt;ol start=&quot;3&quot;&gt;
  &lt;li&gt;Xét hội tụ: $\int_1^\infty\dfrac{dx}{x^2+\sqrt x}$ và $\int_1^\infty\dfrac{2+\cos x}{\sqrt x}\,dx$.&lt;/li&gt;
  &lt;li&gt;Tính $\displaystyle\int_0^\infty\frac{dx}{\sqrt x\,(1+x)}$ (tích phân suy rộng ở cả hai đầu).&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Đáp án&lt;/summary&gt;

  &lt;ol start=&quot;3&quot;&gt;
    &lt;li&gt;Hội tụ, vì hàm $\le\tfrac1{x^2}$. Phân kỳ, vì hàm $\ge\tfrac1{\sqrt x}$ ($p=\tfrac12$).&lt;/li&gt;
    &lt;li&gt;$u=\sqrt x$, $dx=2u\,du$: $\int_0^\infty\dfrac{2\,du}{1+u^2}=\pi$.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;p&gt;&lt;strong&gt;Nâng cao.&lt;/strong&gt;&lt;/p&gt;

&lt;ol start=&quot;5&quot;&gt;
  &lt;li&gt;Với giá trị nào của $p$ thì $\int_2^\infty\dfrac{dx}{x(\ln x)^p}$ hội tụ?&lt;/li&gt;
  &lt;li&gt;Chứng minh $\mathcal L\lbrace t\rbrace(s)=\int_0^\infty te^{-st}\,dt=\dfrac1{s^2}$ với $s&amp;gt;0$.&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Gợi ý&lt;/summary&gt;

  &lt;ol start=&quot;5&quot;&gt;
    &lt;li&gt;$u=\ln x$ đưa về $\int_{\ln2}^\infty\dfrac{du}{u^p}$: hội tụ khi và chỉ khi $p&amp;gt;1$.&lt;/li&gt;
    &lt;li&gt;Từng phần với $u=t$ (như phần kỳ vọng của phân phối mũ ở bài 05_02), dùng $be^{-sb}\to0$.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;h2 id=&quot;tóm-tắt&quot;&gt;Tóm tắt&lt;/h2&gt;

&lt;div class=&quot;content-box summary-box textbook-block&quot;&gt;
  &lt;ul&gt;
    &lt;li&gt;Tích phân suy rộng là giới hạn của tích phân thường khi cận dần ra vô cùng hoặc dần tới điểm hàm không bị chặn.&lt;/li&gt;
    &lt;li&gt;$\int_1^\infty x^{-p}$ hội tụ khi $p&amp;gt;1$; $\int_0^1x^{-p}$ hội tụ khi $p&amp;lt;1$.&lt;/li&gt;
    &lt;li&gt;So sánh với $x^{-p}$ hoặc $e^{-x}$; so sánh giới hạn cho các hàm “cùng cỡ”; hội tụ tuyệt đối kéo theo hội tụ.&lt;/li&gt;
    &lt;li&gt;$\int_{-\infty}^\infty$ cần cả hai nửa hội tụ; giới hạn đối xứng không đủ.&lt;/li&gt;
    &lt;li&gt;Ứng dụng: vận tốc thoát, dòng tiền vĩnh viễn, biến đổi Laplace, chuẩn hoá mật độ.&lt;/li&gt;
  &lt;/ul&gt;
&lt;/div&gt;
</content>
 </entry>
 
 <entry>
   <title>Tích phân hàm lượng giác và hàm vô tỉ</title>
   <link href="https://calculus-self-learning.pages.dev/contents/vi/chapter05/05_04_Tich_phan_ham_luong_giac_va_ham_vo_ti/"/>
   <updated>2026-12-01T00:00:00+00:00</updated>
   <id>https://calculus-self-learning.pages.dev/contents/vi/chapter05/05_04_Tich_phan_ham_luong_giac_va_ham_vo_ti</id>
   <content type="html">&lt;div class=&quot;textbook-objectives&quot;&gt;

  &lt;p&gt;&lt;strong&gt;Mục tiêu.&lt;/strong&gt; Sau bài này bạn có thể:&lt;/p&gt;

  &lt;ul&gt;
    &lt;li&gt;tính $\int\sin^mx\cos^nx\,dx$ bằng cách tách một thừa số (lũy thừa lẻ) hoặc hạ bậc (lũy thừa chẵn);&lt;/li&gt;
    &lt;li&gt;dùng công thức biến tích thành tổng và quan hệ trực giao của $\sin nx$, $\cos nx$;&lt;/li&gt;
    &lt;li&gt;chọn phép thế lượng giác cho $\sqrt{a^2-x^2}$, $\sqrt{a^2+x^2}$, $\sqrt{x^2-a^2}$;&lt;/li&gt;
    &lt;li&gt;dùng $t=\tan\frac x2$ để đưa hàm hữu tỉ của $\sin x,\cos x$ về hàm hữu tỉ của $t$, và cẩn thận với điểm gián đoạn của phép thế.&lt;/li&gt;
  &lt;/ul&gt;

&lt;/div&gt;

&lt;h2 id=&quot;vì-sao-cần-bài-này&quot;&gt;Vì sao cần bài này&lt;/h2&gt;

&lt;p&gt;Diện tích hình tròn, hình elip, giá trị hiệu dụng của dòng xoay chiều, hệ số Fourier của tín hiệu đều dẫn đến tích phân hàm lượng giác hoặc căn bậc hai. Bài này gom các phép thế chuẩn để đưa chúng về các dạng ở bài 05_01 và 05_03.&lt;/p&gt;

&lt;h2 id=&quot;lũy-thừa-của-sin-và-cos&quot;&gt;Lũy thừa của sin và cos&lt;/h2&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;strong&gt;Có một lũy thừa lẻ&lt;/strong&gt;, chẳng hạn $\sin^{2k+1}x$: tách $\sin x\,dx$, viết phần còn lại theo $\cos x$ bằng $\sin^2x=1-\cos^2x$, rồi đặt $u=\cos x$.&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Cả hai lũy thừa chẵn&lt;/strong&gt;: hạ bậc bằng $\sin^2x=\dfrac{1-\cos2x}2$, $\cos^2x=\dfrac{1+\cos2x}2$, $\sin x\cos x=\dfrac{\sin2x}2$.&lt;/li&gt;
&lt;/ul&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Ví dụ 1.&lt;/strong&gt;&lt;/p&gt;

  &lt;ul&gt;
    &lt;li&gt;$\int\sin^3x\,dx=\int(1-\cos^2x)\sin x\,dx$. Đặt $u=\cos x$: $-\int(1-u^2)\,du=-\cos x+\dfrac{\cos^3x}3+C$.&lt;/li&gt;
    &lt;li&gt;$\int\sin^2x\cos^2x\,dx=\int\dfrac{\sin^22x}4\,dx=\int\dfrac{1-\cos4x}8\,dx=\dfrac x8-\dfrac{\sin4x}{32}+C$.&lt;/li&gt;
  &lt;/ul&gt;
&lt;/div&gt;

&lt;p&gt;&lt;strong&gt;Tích với tần số khác nhau.&lt;/strong&gt; Dùng công thức biến tích thành tổng, ví dụ $\sin mx\sin nx=\tfrac12\bigl(\cos(m-n)x-\cos(m+n)x\bigr)$.&lt;/p&gt;

&lt;div class=&quot;textbook-theorem&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Định lý 1 (Trực giao).&lt;/strong&gt; Với số nguyên dương $m,n$:&lt;/p&gt;

\[\int_0^{2\pi}\sin mx\sin nx\,dx=\int_0^{2\pi}\cos mx\cos nx\,dx=\begin{cases}0,&amp;amp;m\ne n\\ \pi,&amp;amp;m=n\end{cases},\qquad\int_0^{2\pi}\sin mx\cos nx\,dx=0 .\]

&lt;/div&gt;

&lt;div class=&quot;textbook-proof&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Chứng minh (tích sin).&lt;/strong&gt; Với $m\ne n$: $\int_0^{2\pi}\tfrac12\bigl(\cos(m-n)x-\cos(m+n)x\bigr)dx=0$ vì $\int_0^{2\pi}\cos kx\,dx=\Big[\tfrac{\sin kx}k\Big]_0^{2\pi}=0$ với mọi số nguyên $k\ne0$. Với $m=n$: $\int_0^{2\pi}\tfrac12(1-\cos2nx)\,dx=\pi$. Hai đẳng thức còn lại làm tương tự với $\cos mx\cos nx=\tfrac12(\cos(m-n)x+\cos(m+n)x)$ và $\sin mx\cos nx=\tfrac12(\sin(m+n)x+\sin(m-n)x)$.&lt;/p&gt;
&lt;/div&gt;

&lt;h2 id=&quot;phép-thế-lượng-giác&quot;&gt;Phép thế lượng giác&lt;/h2&gt;

&lt;table&gt;
  &lt;thead&gt;
    &lt;tr&gt;
      &lt;th&gt;Biểu thức&lt;/th&gt;
      &lt;th&gt;Phép thế&lt;/th&gt;
      &lt;th&gt;Đồng nhất thức dùng&lt;/th&gt;
    &lt;/tr&gt;
  &lt;/thead&gt;
  &lt;tbody&gt;
    &lt;tr&gt;
      &lt;td&gt;$\sqrt{a^2-x^2}$&lt;/td&gt;
      &lt;td&gt;$x=a\sin t$, $t\in[-\tfrac\pi2,\tfrac\pi2]$&lt;/td&gt;
      &lt;td&gt;$1-\sin^2t=\cos^2t$&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;$\sqrt{a^2+x^2}$&lt;/td&gt;
      &lt;td&gt;$x=a\tan t$, $t\in(-\tfrac\pi2,\tfrac\pi2)$&lt;/td&gt;
      &lt;td&gt;$1+\tan^2t=\dfrac1{\cos^2t}$&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;$\sqrt{x^2-a^2}$&lt;/td&gt;
      &lt;td&gt;$x=\dfrac a{\cos t}$&lt;/td&gt;
      &lt;td&gt;$\dfrac1{\cos^2t}-1=\tan^2t$&lt;/td&gt;
    &lt;/tr&gt;
  &lt;/tbody&gt;
&lt;/table&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Ví dụ 2 (Diện tích hình elip).&lt;/strong&gt; Elip $\dfrac{x^2}{a^2}+\dfrac{y^2}{b^2}=1$ có diện tích $4\displaystyle\int_0^a\frac ba\sqrt{a^2-x^2}\,dx$. Đặt $x=a\sin t$, $dx=a\cos t\,dt$, $t$ đi từ $0$ đến $\tfrac\pi2$:&lt;/p&gt;

\[4\frac ba\int_0^{\pi/2}a^2\cos^2t\,dt=4ab\cdot\frac\pi4=\pi ab .\]

  &lt;p&gt;Với $a=b=1$: $\int_0^1\sqrt{1-x^2}\,dx=\tfrac\pi4$, một phần tư hình tròn đơn vị.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Ví dụ 3.&lt;/strong&gt; $\int\dfrac{dx}{\sqrt{x^2+a^2}}$. Đặt $x=a\tan t$: $dx=\dfrac{a\,dt}{\cos^2t}$, $\sqrt{x^2+a^2}=\dfrac a{\cos t}$, được $\int\dfrac{dt}{\cos t}=\ln\left\lvert\dfrac1{\cos t}+\tan t\right\rvert+C$. Quay về $x$:&lt;/p&gt;

\[\int\frac{dx}{\sqrt{x^2+a^2}}=\ln\left(x+\sqrt{x^2+a^2}\right)+C .\]

  &lt;p&gt;(Kiểm tra bằng đạo hàm.)&lt;/p&gt;
&lt;/div&gt;

&lt;h2 id=&quot;phép-đổi-biến-ttanfrac-x2&quot;&gt;Phép đổi biến $t=\tan\frac x2$&lt;/h2&gt;

&lt;p&gt;Với $t=\tan\dfrac x2$, $x\in(-\pi,\pi)$:&lt;/p&gt;

\[\sin x=\frac{2t}{1+t^2},\qquad\cos x=\frac{1-t^2}{1+t^2},\qquad dx=\frac{2\,dt}{1+t^2}.\]

&lt;p&gt;Mọi hàm hữu tỉ của $\sin x,\cos x$ trở thành hàm hữu tỉ của $t$ (bài 05_03). Phép thế này luôn dùng được nhưng thường dài; chỉ dùng khi các cách trên không áp dụng được.&lt;/p&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Ví dụ 4.&lt;/strong&gt; $\int\dfrac{dx}{2+\cos x}$. Thay vào: $\displaystyle\int\frac{2\,dt}{2(1+t^2)+1-t^2}=\int\frac{2\,dt}{t^2+3}=\frac2{\sqrt3}\arctan\frac t{\sqrt3}+C$. Vậy&lt;/p&gt;

\[\int\frac{dx}{2+\cos x}=\frac2{\sqrt3}\arctan\left(\frac{\tan(x/2)}{\sqrt3}\right)+C\quad\text{trên }(-\pi,\pi).\]

&lt;/div&gt;

&lt;div class=&quot;content-box warning-box textbook-block&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Cẩn thận với điểm gián đoạn.&lt;/strong&gt; Thay cận “ngây thơ” vào ví dụ 4 trên $[0,2\pi]$: $\tan\pi=\tan0=0$, nên kết quả bằng 0. Sai, vì hàm dưới dấu tích phân dương. Nguyên hàm trên chỉ đúng trên $(-\pi,\pi)$; $\tan(x/2)$ gián đoạn tại $x=\pi$. Cách đúng: do đối xứng, $\int_0^{2\pi}=2\int_0^\pi$, và khi $x\to\pi^-$ thì $\tan(x/2)\to+\infty$:&lt;/p&gt;

\[\int_0^{2\pi}\frac{dx}{2+\cos x}=2\cdot\frac2{\sqrt3}\cdot\frac\pi2=\frac{2\pi}{\sqrt3}\approx3.628 .\]

&lt;/div&gt;

&lt;h2 id=&quot;ứng-dụng&quot;&gt;Ứng dụng&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Xử lý tín hiệu và học máy: chuỗi Fourier.&lt;/strong&gt; Định lý 1 nói các hàm $1,\cos x,\sin x,\cos2x,\dots$ “vuông góc” với nhau trên $[0,2\pi]$. Nhờ đó hệ số của tín hiệu $f$ theo tần số $n$ tính được riêng rẽ: $a_n=\tfrac1\pi\int_0^{2\pi}f(x)\cos nx\,dx$. Đặc trưng Fourier (Fourier features) và phổ tần số của âm thanh trong học máy dựa trên đúng tính chất này.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Vật lý: điện trường của dây tích điện.&lt;/strong&gt; Dây thẳng dài $2L$, mật độ điện tích $\lambda$, điểm cách dây $a$ trên đường trung trực. Thành phần vuông góc của điện trường là $E=k\lambda a\displaystyle\int_{-L}^{L}\frac{dx}{(x^2+a^2)^{3/2}}$. Thế $x=a\tan t$ cho $\displaystyle\int\frac{dx}{(x^2+a^2)^{3/2}}=\frac{x}{a^2\sqrt{x^2+a^2}}$, nên $E=\dfrac{2k\lambda L}{a\sqrt{L^2+a^2}}$; khi $L\to\infty$, $E\to\dfrac{2k\lambda}a$.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Kỹ thuật điện.&lt;/strong&gt; $\int_0^{2\pi}\sin^2t\,dt=\pi$ cho giá trị trung bình của $\sin^2$ trên một chu kỳ bằng $\tfrac12$: đây là nguồn gốc hệ số $\tfrac1{\sqrt2}$ của điện áp hiệu dụng (bài 06_04).&lt;/p&gt;

&lt;h2 id=&quot;bài-tập&quot;&gt;Bài tập&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Cơ bản.&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;Tính $\int\cos^3x\,dx$ và $\int_0^\pi\sin^2x\,dx$.&lt;/li&gt;
  &lt;li&gt;Tính $\int\dfrac{dx}{\sqrt{4-x^2}}$.&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Đáp án&lt;/summary&gt;

  &lt;ol&gt;
    &lt;li&gt;$\sin x-\dfrac{\sin^3x}3+C$; $\dfrac\pi2$.&lt;/li&gt;
    &lt;li&gt;$x=2\sin t$: $\arcsin\dfrac x2+C$.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;p&gt;&lt;strong&gt;Trung bình.&lt;/strong&gt;&lt;/p&gt;

&lt;ol start=&quot;3&quot;&gt;
  &lt;li&gt;Tính $\int\dfrac{x^2}{\sqrt{1-x^2}}\,dx$.&lt;/li&gt;
  &lt;li&gt;Tính $\int\dfrac{dx}{1+\sin x}$ bằng $t=\tan\frac x2$.&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Đáp án&lt;/summary&gt;

  &lt;ol start=&quot;3&quot;&gt;
    &lt;li&gt;$x=\sin t$: $\int\sin^2t\,dt=\tfrac t2-\tfrac{\sin2t}4$, tức $\dfrac{\arcsin x-x\sqrt{1-x^2}}2+C$.&lt;/li&gt;
    &lt;li&gt;$\displaystyle\int\frac{2\,dt}{(1+t)^2}=-\frac2{1+\tan(x/2)}+C$.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;p&gt;&lt;strong&gt;Nâng cao.&lt;/strong&gt;&lt;/p&gt;

&lt;ol start=&quot;5&quot;&gt;
  &lt;li&gt;Chứng minh $\int_0^{2\pi}\cos mx\cos nx\,dx=0$ với $m\ne n$, và tính $\int_0^{2\pi}(3\sin x+4\cos2x)^2\,dx$.&lt;/li&gt;
  &lt;li&gt;Chứng minh $\displaystyle\int_0^{2\pi}\frac{dx}{a+b\cos x}=\frac{2\pi}{\sqrt{a^2-b^2}}$ với $a&amp;gt;\lvert b\rvert$, và áp dụng với $a=5$, $b=3$.&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Gợi ý&lt;/summary&gt;

  &lt;ol start=&quot;5&quot;&gt;
    &lt;li&gt;Biến tích thành tổng. Khai triển bình phương, các tích chéo có tích phân 0: $9\pi+16\pi=25\pi$.&lt;/li&gt;
    &lt;li&gt;Làm như ví dụ 4 và lời cảnh báo: $t=\tan\frac x2$ cho $\displaystyle2\int_0^\infty\frac{2\,dt}{(a+b)+(a-b)t^2}=\frac{2\pi}{\sqrt{a^2-b^2}}$. Với $a=5$, $b=3$: $\dfrac\pi2$.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;h2 id=&quot;tóm-tắt&quot;&gt;Tóm tắt&lt;/h2&gt;

&lt;div class=&quot;content-box summary-box textbook-block&quot;&gt;
  &lt;ul&gt;
    &lt;li&gt;Lũy thừa lẻ: tách một thừa số rồi đổi biến; lũy thừa chẵn: hạ bậc.&lt;/li&gt;
    &lt;li&gt;Tích khác tần số: biến tích thành tổng; trên $[0,2\pi]$ các hàm $\sin nx$, $\cos nx$ trực giao.&lt;/li&gt;
    &lt;li&gt;$\sqrt{a^2-x^2}$: $x=a\sin t$; $\sqrt{a^2+x^2}$: $x=a\tan t$; $\sqrt{x^2-a^2}$: $x=a/\cos t$.&lt;/li&gt;
    &lt;li&gt;$t=\tan\frac x2$ đưa hàm hữu tỉ của $\sin,\cos$ về hàm hữu tỉ, nhưng chỉ đúng trên $(-\pi,\pi)$: tách cận tại điểm gián đoạn.&lt;/li&gt;
  &lt;/ul&gt;
&lt;/div&gt;
</content>
 </entry>
 
 <entry>
   <title>Tích phân hàm hữu tỉ</title>
   <link href="https://calculus-self-learning.pages.dev/contents/vi/chapter05/05_03_Tich_phan_ham_huu_ti/"/>
   <updated>2026-12-01T00:00:00+00:00</updated>
   <id>https://calculus-self-learning.pages.dev/contents/vi/chapter05/05_03_Tich_phan_ham_huu_ti</id>
   <content type="html">&lt;div class=&quot;textbook-objectives&quot;&gt;

  &lt;p&gt;&lt;strong&gt;Mục tiêu.&lt;/strong&gt; Sau bài này bạn có thể:&lt;/p&gt;

  &lt;ul&gt;
    &lt;li&gt;đưa phân thức hữu tỉ về dạng thực sự (bậc tử nhỏ hơn bậc mẫu) bằng phép chia đa thức;&lt;/li&gt;
    &lt;li&gt;phân tích phân thức thành tổng các phân thức đơn giản và tìm hệ số;&lt;/li&gt;
    &lt;li&gt;tích phân các phân thức đơn giản, kể cả dạng có mẫu bậc hai vô nghiệm;&lt;/li&gt;
    &lt;li&gt;giải phương trình logistic bằng phân thức đơn giản.&lt;/li&gt;
  &lt;/ul&gt;

&lt;/div&gt;

&lt;h2 id=&quot;vì-sao-cần-bài-này&quot;&gt;Vì sao cần bài này&lt;/h2&gt;

&lt;p&gt;Phân thức hữu tỉ $\dfrac{P(x)}{Q(x)}$ xuất hiện khi giải phương trình vi phân tách biến (mô hình logistic), khi lấy biến đổi Laplace ngược, và sau nhiều phép đổi biến (bài 05_04). Mọi phân thức hữu tỉ đều tích phân được bằng hàm sơ cấp, với một quy trình cố định.&lt;/p&gt;

&lt;h2 id=&quot;quy-trình&quot;&gt;Quy trình&lt;/h2&gt;

&lt;ol&gt;
  &lt;li&gt;Nếu $\deg P\ge\deg Q$, chia đa thức: $\dfrac PQ=S(x)+\dfrac{R(x)}{Q(x)}$ với $\deg R&amp;lt;\deg Q$.&lt;/li&gt;
  &lt;li&gt;Phân tích $Q$ thành tích các nhân tử bậc nhất $(x-a)^k$ và bậc hai vô nghiệm $(x^2+px+q)^m$ ($p^2-4q&amp;lt;0$).&lt;/li&gt;
  &lt;li&gt;Viết $\dfrac RQ$ thành tổng các phân thức đơn giản (định lý 1) và tìm hệ số.&lt;/li&gt;
  &lt;li&gt;Tích phân từng số hạng.&lt;/li&gt;
&lt;/ol&gt;

&lt;div class=&quot;textbook-theorem&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Định lý 1 (Phân tích thành phân thức đơn giản).&lt;/strong&gt; Cho $\deg R&amp;lt;\deg Q$. Mỗi nhân tử $(x-a)^k$ của $Q$ đóng góp các số hạng&lt;/p&gt;

\[\frac{A_1}{x-a}+\frac{A_2}{(x-a)^2}+\dots+\frac{A_k}{(x-a)^k},\]

  &lt;p&gt;mỗi nhân tử $(x^2+px+q)^m$ vô nghiệm đóng góp&lt;/p&gt;

\[\frac{B_1x+C_1}{x^2+px+q}+\dots+\frac{B_mx+C_m}{(x^2+px+q)^m},\]

  &lt;p&gt;và $\dfrac RQ$ bằng tổng tất cả các số hạng đó với các hằng số duy nhất.&lt;/p&gt;
&lt;/div&gt;

&lt;p&gt;Chứng minh dùng đại số tuyến tính trên không gian đa thức; ta nhận kết quả. Để tìm hệ số: quy đồng, rồi thay các giá trị $x$ thuận tiện (nghiệm của mẫu) hoặc đồng nhất hệ số.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Các tích phân cơ bản.&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;$\int\dfrac{dx}{x-a}=\ln\lvert x-a\rvert+C$, $\int\dfrac{dx}{(x-a)^k}=-\dfrac{1}{(k-1)(x-a)^{k-1}}+C$ ($k\ge2$).&lt;/li&gt;
  &lt;li&gt;Với mẫu bậc hai vô nghiệm, tách tử thành (hằng số) × đạo hàm của mẫu + hằng số, rồi hoàn thành bình phương: $\int\dfrac{dx}{(x+\alpha)^2+\beta^2}=\dfrac1\beta\arctan\dfrac{x+\alpha}\beta+C$.&lt;/li&gt;
&lt;/ul&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Ví dụ 1 (Nghiệm đơn).&lt;/strong&gt; $\displaystyle\int\frac{x+5}{x^2+x-2}\,dx$. Mẫu $=(x-1)(x+2)$. Viết $\dfrac{x+5}{(x-1)(x+2)}=\dfrac A{x-1}+\dfrac B{x+2}$, tức $x+5=A(x+2)+B(x-1)$. Thay $x=1$: $6=3A$, $A=2$. Thay $x=-2$: $3=-3B$, $B=-1$. Vậy&lt;/p&gt;

\[\int\frac{x+5}{x^2+x-2}\,dx=2\ln\lvert x-1\rvert-\ln\lvert x+2\rvert+C .\]

&lt;/div&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Ví dụ 2 (Nghiệm bội).&lt;/strong&gt; $\displaystyle\int\frac{x^2+1}{x(x-1)^2}\,dx$. Viết $\dfrac Ax+\dfrac B{x-1}+\dfrac C{(x-1)^2}$: $x^2+1=A(x-1)^2+Bx(x-1)+Cx$. $x=0$: $A=1$. $x=1$: $C=2$. Hệ số $x^2$: $1=A+B$, $B=0$. Vậy&lt;/p&gt;

\[\int\frac{x^2+1}{x(x-1)^2}\,dx=\ln\lvert x\rvert-\frac2{x-1}+C .\]

&lt;/div&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Ví dụ 3 (Bậc hai vô nghiệm và chia đa thức).&lt;/strong&gt;&lt;/p&gt;

  &lt;ul&gt;
    &lt;li&gt;$\displaystyle\int\frac{dx}{x^2+2x+5}=\int\frac{dx}{(x+1)^2+4}=\frac12\arctan\frac{x+1}2+C$.&lt;/li&gt;
    &lt;li&gt;$\displaystyle\int\frac{x^3}{x^2+1}\,dx$: chia được $x-\dfrac x{x^2+1}$, nên tích phân bằng $\dfrac{x^2}2-\dfrac12\ln(x^2+1)+C$.&lt;/li&gt;
  &lt;/ul&gt;
&lt;/div&gt;

&lt;div class=&quot;interactive-frame&quot;&gt;
  &lt;div class=&quot;interactive-frame-head&quot;&gt;
    &lt;div class=&quot;interactive-frame-title&quot;&gt;Phân tích thành phân thức đơn giản&lt;/div&gt;
    &lt;div class=&quot;interactive-frame-desc&quot;&gt;Đổi tử số và các nghiệm của mẫu, xem từng bước tìm hệ số.&lt;/div&gt;
  &lt;/div&gt;
  &lt;iframe src=&quot;/interactives/chapter05/partial-fractions.html&quot; title=&quot;Phân tích thành phân thức đơn giản&quot; loading=&quot;lazy&quot; style=&quot;height: 760px;&quot;&gt;&lt;/iframe&gt;
  &lt;div class=&quot;interactive-frame-foot&quot;&gt;
    &lt;a href=&quot;/interactives/chapter05/partial-fractions.html&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;Mở minh hoạ ở cửa sổ riêng&lt;/a&gt;
  &lt;/div&gt;
&lt;/div&gt;

&lt;h2 id=&quot;ứng-dụng&quot;&gt;Ứng dụng&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Sinh học, kinh tế: mô hình logistic.&lt;/strong&gt; Số lượng $P(t)$ (dân số, số người dùng một sản phẩm) tăng theo $\dfrac{dP}{dt}=kP\left(1-\dfrac PM\right)$ với sức chứa $M$. Tách biến: $\displaystyle\int\frac{M\,dP}{P(M-P)}=\int k\,dt$. Phân tích $\dfrac M{P(M-P)}=\dfrac1P+\dfrac1{M-P}$, được $\ln\dfrac P{M-P}=kt+c$, tức&lt;/p&gt;

\[P(t)=\frac{M}{1+Ae^{-kt}},\qquad A=\frac{M-P(0)}{P(0)} .\]

&lt;p&gt;&lt;strong&gt;Học máy.&lt;/strong&gt; Với $M=1$, $A=1$, $k=1$, đó chính là hàm sigmoid $\sigma(t)=\dfrac1{1+e^{-t}}$ dùng trong hồi quy logistic. Đạo hàm $\sigma&apos;=\sigma(1-\sigma)$ chính là phương trình logistic.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Kỹ thuật: biến đổi Laplace ngược.&lt;/strong&gt; Trong mạch điện và hệ điều khiển, nghiệm thường có dạng $Y(s)=\dfrac{1}{(s+1)(s+2)}=\dfrac1{s+1}-\dfrac1{s+2}$; mỗi số hạng $\dfrac1{s+a}$ ứng với $e^{-at}$, nên $y(t)=e^{-t}-e^{-2t}$ (khoá Phương trình vi phân).&lt;/p&gt;

&lt;h2 id=&quot;bài-tập&quot;&gt;Bài tập&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Cơ bản.&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;Tính $\int\dfrac{dx}{x(x+1)}$.&lt;/li&gt;
  &lt;li&gt;Tính $\displaystyle\int_2^3\frac{dx}{x^2-1}$.&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Đáp án&lt;/summary&gt;

  &lt;ol&gt;
    &lt;li&gt;$\dfrac1x-\dfrac1{x+1}$: $\ln\left\lvert\dfrac x{x+1}\right\rvert+C$.&lt;/li&gt;
    &lt;li&gt;$\dfrac12\Big[\ln\dfrac{x-1}{x+1}\Big]_2^3=\dfrac12\left(\ln\dfrac12-\ln\dfrac13\right)=\dfrac12\ln\dfrac32\approx0.2027$.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;p&gt;&lt;strong&gt;Trung bình.&lt;/strong&gt;&lt;/p&gt;

&lt;ol start=&quot;3&quot;&gt;
  &lt;li&gt;Tính $\int\dfrac{2x+3}{x^2+2x+2}\,dx$.&lt;/li&gt;
  &lt;li&gt;Tính $\int\dfrac{dx}{x^3+x}$.&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Đáp án&lt;/summary&gt;

  &lt;ol start=&quot;3&quot;&gt;
    &lt;li&gt;$2x+3=(2x+2)+1$: $\ln(x^2+2x+2)+\arctan(x+1)+C$.&lt;/li&gt;
    &lt;li&gt;$\dfrac1{x(x^2+1)}=\dfrac1x-\dfrac x{x^2+1}$: $\ln\lvert x\rvert-\tfrac12\ln(x^2+1)+C$.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;p&gt;&lt;strong&gt;Nâng cao.&lt;/strong&gt;&lt;/p&gt;

&lt;ol start=&quot;5&quot;&gt;
  &lt;li&gt;Tính $\int\dfrac{dx}{x^4-1}$.&lt;/li&gt;
  &lt;li&gt;Trong mô hình logistic với $M=1000$, $P(0)=100$, $P(5)=500$, tìm $k$ và thời điểm $P=900$.&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Gợi ý&lt;/summary&gt;

  &lt;ol start=&quot;5&quot;&gt;
    &lt;li&gt;$x^4-1=(x-1)(x+1)(x^2+1)$ và $\dfrac1{x^4-1}=\dfrac14\cdot\dfrac1{x-1}-\dfrac14\cdot\dfrac1{x+1}-\dfrac12\cdot\dfrac1{x^2+1}$. Đáp số $\dfrac14\ln\left\lvert\dfrac{x-1}{x+1}\right\rvert-\dfrac12\arctan x+C$.&lt;/li&gt;
    &lt;li&gt;$A=9$. $P(5)=500$ cho $9e^{-5k}=1$, $k=\tfrac{\ln9}5\approx0.439$. $P=900$ khi $9e^{-kt}=\tfrac19$, tức $t=\tfrac{\ln81}k=10$.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;h2 id=&quot;tóm-tắt&quot;&gt;Tóm tắt&lt;/h2&gt;

&lt;div class=&quot;content-box summary-box textbook-block&quot;&gt;
  &lt;ul&gt;
    &lt;li&gt;Chia đa thức trước nếu bậc tử không nhỏ hơn bậc mẫu.&lt;/li&gt;
    &lt;li&gt;Nghiệm đơn $a$: số hạng $\tfrac A{x-a}$; nghiệm bội $k$: $\tfrac{A_1}{x-a}+\dots+\tfrac{A_k}{(x-a)^k}$; bậc hai vô nghiệm: $\tfrac{Bx+C}{x^2+px+q}$.&lt;/li&gt;
    &lt;li&gt;Tìm hệ số bằng cách thay nghiệm của mẫu, rồi đồng nhất các hệ số còn lại.&lt;/li&gt;
    &lt;li&gt;Tích phân cho các hàm $\ln$, phân thức và $\arctan$.&lt;/li&gt;
    &lt;li&gt;Phương trình logistic giải được bằng phân thức đơn giản; nghiệm là hàm sigmoid.&lt;/li&gt;
  &lt;/ul&gt;
&lt;/div&gt;
</content>
 </entry>
 
 <entry>
   <title>Tích phân từng phần</title>
   <link href="https://calculus-self-learning.pages.dev/contents/vi/chapter05/05_02_Tich_phan_tung_phan/"/>
   <updated>2026-12-01T00:00:00+00:00</updated>
   <id>https://calculus-self-learning.pages.dev/contents/vi/chapter05/05_02_Tich_phan_tung_phan</id>
   <content type="html">&lt;div class=&quot;textbook-objectives&quot;&gt;

  &lt;p&gt;&lt;strong&gt;Mục tiêu.&lt;/strong&gt; Sau bài này bạn có thể:&lt;/p&gt;

  &lt;ul&gt;
    &lt;li&gt;suy ra công thức $\int u\,dv=uv-\int v\,du$ từ quy tắc đạo hàm của tích;&lt;/li&gt;
    &lt;li&gt;chọn $u$ và $dv$ hợp lý (thứ tự ưu tiên: logarit, lượng giác ngược, đa thức, lượng giác, mũ);&lt;/li&gt;
    &lt;li&gt;xử lý tích phân “quay vòng” như $\int e^x\sin x\,dx$;&lt;/li&gt;
    &lt;li&gt;lập và dùng công thức truy hồi như $\int_0^{\pi/2}\sin^nx\,dx$.&lt;/li&gt;
  &lt;/ul&gt;

&lt;/div&gt;

&lt;h2 id=&quot;vì-sao-cần-bài-này&quot;&gt;Vì sao cần bài này&lt;/h2&gt;

&lt;p&gt;Đổi biến xử lý được hàm hợp, nhưng không xử lý được tích của hai loại hàm khác nhau như $xe^x$, $x\sin x$, $\ln x$ (xem như $1\cdot\ln x$). Quy tắc đạo hàm của tích $(uv)&apos;=u&apos;v+uv&apos;$, khi lấy tích phân, cho một cách chuyển đạo hàm từ thừa số này sang thừa số kia.&lt;/p&gt;

&lt;h2 id=&quot;công-thức&quot;&gt;Công thức&lt;/h2&gt;

&lt;div class=&quot;textbook-theorem&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Định lý 1 (Tích phân từng phần).&lt;/strong&gt; Cho $u,v$ có đạo hàm liên tục. Khi đó&lt;/p&gt;

\[\int u\,dv=uv-\int v\,du,\qquad \int_a^bu(x)v&apos;(x)\,dx=\Big[u(x)v(x)\Big]_a^b-\int_a^bv(x)u&apos;(x)\,dx .\]

&lt;/div&gt;

&lt;div class=&quot;textbook-proof&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Chứng minh.&lt;/strong&gt; $(uv)&apos;=u&apos;v+uv&apos;$, nên $uv$ là một nguyên hàm của $u&apos;v+uv&apos;$. Lấy tích phân hai vế rồi chuyển $\int u&apos;v$ sang vế phải. Với tích phân xác định, áp dụng Newton–Leibniz cho $(uv)&apos;$ trên $[a,b]$.&lt;/p&gt;
&lt;/div&gt;

&lt;p&gt;&lt;strong&gt;Chọn $u$.&lt;/strong&gt; Chọn $u$ là thừa số đơn giản đi khi lấy đạo hàm, $dv$ là phần lấy nguyên hàm được. Thứ tự ưu tiên cho $u$ (hay dùng): logarit, lượng giác ngược, đa thức, lượng giác, mũ.&lt;/p&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Ví dụ 1.&lt;/strong&gt;&lt;/p&gt;

  &lt;ul&gt;
    &lt;li&gt;$\int xe^x\,dx$: $u=x$, $dv=e^x\,dx$, nên $du=dx$, $v=e^x$. Được $xe^x-\int e^x\,dx=(x-1)e^x+C$.&lt;/li&gt;
    &lt;li&gt;$\int\ln x\,dx$: $u=\ln x$, $dv=dx$, nên $du=\tfrac{dx}x$, $v=x$. Được $x\ln x-\int1\,dx=x\ln x-x+C$.&lt;/li&gt;
  &lt;/ul&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Ví dụ 2 (Lặp hai lần).&lt;/strong&gt; $\int x^2\sin x\,dx$. Lần 1: $u=x^2$, $dv=\sin x\,dx$:&lt;/p&gt;

\[\int x^2\sin x\,dx=-x^2\cos x+\int2x\cos x\,dx .\]

  &lt;p&gt;Lần 2: $u=2x$, $dv=\cos x\,dx$: $\int2x\cos x\,dx=2x\sin x-\int2\sin x\,dx=2x\sin x+2\cos x$. Vậy&lt;/p&gt;

\[\int x^2\sin x\,dx=-x^2\cos x+2x\sin x+2\cos x+C .\]

&lt;/div&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Ví dụ 3 (Quay vòng).&lt;/strong&gt; $I=\int e^x\sin x\,dx$. Từng phần với $u=\sin x$, $dv=e^x\,dx$: $I=e^x\sin x-\int e^x\cos x\,dx$. Từng phần lần nữa với $u=\cos x$: $\int e^x\cos x\,dx=e^x\cos x+I$. Vậy $I=e^x\sin x-e^x\cos x-I$, nên&lt;/p&gt;

\[I=\frac{e^x(\sin x-\cos x)}2+C .\]

&lt;/div&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Ví dụ 4 (Công thức truy hồi).&lt;/strong&gt; Đặt $I_n=\int_0^{\pi/2}\sin^nx\,dx$. Với $n\ge2$, $u=\sin^{n-1}x$, $dv=\sin x\,dx$:&lt;/p&gt;

\[I_n=\Big[-\sin^{n-1}x\cos x\Big]_0^{\pi/2}+(n-1)\int_0^{\pi/2}\sin^{n-2}x\cos^2x\,dx=(n-1)(I_{n-2}-I_n),\]

  &lt;p&gt;dùng $\cos^2x=1-\sin^2x$. Suy ra $I_n=\dfrac{n-1}nI_{n-2}$. Với $I_0=\tfrac\pi2$, $I_1=1$: $I_4=\tfrac34\cdot\tfrac12\cdot\tfrac\pi2=\tfrac{3\pi}{16}$, $I_5=\tfrac45\cdot\tfrac23\cdot1=\tfrac8{15}$.&lt;/p&gt;
&lt;/div&gt;

&lt;h2 id=&quot;video-ngắn&quot;&gt;Video ngắn&lt;/h2&gt;

&lt;div class=&quot;reel-video&quot;&gt;
  &lt;video controls=&quot;&quot; playsinline=&quot;&quot; preload=&quot;metadata&quot; src=&quot;/public/videos/reels/integration-by-parts-picture.mp4&quot;&gt;&lt;/video&gt;
  &lt;p class=&quot;reel-caption&quot;&gt;Tích phân từng phần bằng hình: trong mặt phẳng (u, v), diện tích ∫u dv cộng ∫v du bằng hiệu hai hình chữ nhật uv; ví dụ ∫x cos x, ∫x²eˣ (dùng hai lần), vòng lặp ∫eˣ sin x, chọn u theo LIATE và ∫ln x (video không lời, khoảng 3 phút 6 giây).&lt;/p&gt;
&lt;/div&gt;

&lt;h2 id=&quot;ứng-dụng&quot;&gt;Ứng dụng&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Vật lý: điện lượng.&lt;/strong&gt; Dòng điện $i(t)=te^{-t}$ (A). Điện lượng chạy qua trong giây đầu: $Q=\int_0^1te^{-t}\,dt=\Big[-(t+1)e^{-t}\Big]_0^1=1-\tfrac2e\approx0.264$ C.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Kinh tế: dòng tiền tăng dần.&lt;/strong&gt; Dòng tiền $R(t)=t$ (triệu đồng/năm) trong 10 năm, lãi suất liên tục $r=0.08$. Từng phần với $u=t$, $dv=e^{-rt}dt$:&lt;/p&gt;

\[PV=\int_0^{10}te^{-rt}\,dt=\frac{1-e^{-rT}(1+rT)}{r^2}=\frac{1-1.8e^{-0.8}}{0.0064}\approx29.88\ \text{triệu đồng}.\]

&lt;p&gt;&lt;strong&gt;Học máy và xác suất: kỳ vọng.&lt;/strong&gt; Kỳ vọng của phân phối mũ là $E[X]=\int_0^\infty t\lambda e^{-\lambda t}\,dt$. Từng phần với $u=t$ cho $\int_0^bt\lambda e^{-\lambda t}\,dt=\dfrac1\lambda-\Bigl(b+\dfrac1\lambda\Bigr)e^{-\lambda b}$, và khi $b\to\infty$ được $E[X]=\dfrac1\lambda$ (tích phân suy rộng, bài 05_05). Thời gian chờ trung bình bằng nghịch đảo tần suất.&lt;/p&gt;

&lt;h2 id=&quot;bài-tập&quot;&gt;Bài tập&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Cơ bản.&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;Tính $\int x\cos x\,dx$ và $\int\arctan x\,dx$.&lt;/li&gt;
  &lt;li&gt;Tính $\int_1^ex\ln x\,dx$.&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Đáp án&lt;/summary&gt;

  &lt;ol&gt;
    &lt;li&gt;$x\sin x+\cos x+C$; $x\arctan x-\tfrac12\ln(1+x^2)+C$.&lt;/li&gt;
    &lt;li&gt;$u=\ln x$, $v=\tfrac{x^2}2$: $\Big[\tfrac{x^2}2\ln x-\tfrac{x^2}4\Big]_1^e=\dfrac{e^2+1}4\approx2.097$.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;p&gt;&lt;strong&gt;Trung bình.&lt;/strong&gt;&lt;/p&gt;

&lt;ol start=&quot;3&quot;&gt;
  &lt;li&gt;Tính $\int e^{2x}\cos x\,dx$.&lt;/li&gt;
  &lt;li&gt;Tính $\int(\ln x)^2\,dx$.&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Đáp án&lt;/summary&gt;

  &lt;ol start=&quot;3&quot;&gt;
    &lt;li&gt;Quay vòng như ví dụ 3: $\dfrac{e^{2x}(2\cos x+\sin x)}5+C$.&lt;/li&gt;
    &lt;li&gt;$u=(\ln x)^2$, $dv=dx$, rồi dùng ví dụ 1: $x(\ln x)^2-2x\ln x+2x+C$.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;p&gt;&lt;strong&gt;Nâng cao.&lt;/strong&gt;&lt;/p&gt;

&lt;ol start=&quot;5&quot;&gt;
  &lt;li&gt;Với $J_n=\int_0^1x^ne^x\,dx$, chứng minh $J_n=e-nJ_{n-1}$ và tính $J_3$.&lt;/li&gt;
  &lt;li&gt;Dùng $I_{2n+1}\le I_{2n}\le I_{2n-1}$ (vì $0\le\sin x\le1$) và ví dụ 4 để chứng minh công thức Wallis $\dfrac\pi2=\displaystyle\lim_{n\to\infty}\frac{2\cdot2\cdot4\cdot4\cdots2n\cdot2n}{1\cdot3\cdot3\cdot5\cdots(2n-1)(2n+1)}$.&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Gợi ý&lt;/summary&gt;

  &lt;ol start=&quot;5&quot;&gt;
    &lt;li&gt;$u=x^n$, $dv=e^xdx$. $J_0=e-1$, $J_1=1$, $J_2=e-2$, $J_3=6-2e\approx0.563$.&lt;/li&gt;
    &lt;li&gt;Chia bất đẳng thức cho $I_{2n+1}$: $1\le\dfrac{I_{2n}}{I_{2n+1}}\le\dfrac{I_{2n-1}}{I_{2n+1}}=\dfrac{2n+1}{2n}\to1$. Viết $I_{2n}$, $I_{2n+1}$ dưới dạng tích từ công thức truy hồi.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;h2 id=&quot;tóm-tắt&quot;&gt;Tóm tắt&lt;/h2&gt;

&lt;div class=&quot;content-box summary-box textbook-block&quot;&gt;
  &lt;ul&gt;
    &lt;li&gt;$\int u\,dv=uv-\int v\,du$, là quy tắc đạo hàm của tích đọc ngược.&lt;/li&gt;
    &lt;li&gt;Chọn $u$ đơn giản đi khi lấy đạo hàm (logarit, lượng giác ngược, đa thức trước), $dv$ lấy nguyên hàm được.&lt;/li&gt;
    &lt;li&gt;Đa thức nhân mũ hoặc lượng giác: lặp từng phần đến khi đa thức hết.&lt;/li&gt;
    &lt;li&gt;Mũ nhân lượng giác: từng phần hai lần rồi giải phương trình theo $I$.&lt;/li&gt;
    &lt;li&gt;Công thức truy hồi giảm số mũ, ví dụ $I_n=\tfrac{n-1}nI_{n-2}$.&lt;/li&gt;
  &lt;/ul&gt;
&lt;/div&gt;
</content>
 </entry>
 
 <entry>
   <title>Phương pháp đổi biến</title>
   <link href="https://calculus-self-learning.pages.dev/contents/vi/chapter05/05_01_Doi_bien/"/>
   <updated>2026-12-01T00:00:00+00:00</updated>
   <id>https://calculus-self-learning.pages.dev/contents/vi/chapter05/05_01_Doi_bien</id>
   <content type="html">&lt;div class=&quot;textbook-objectives&quot;&gt;

  &lt;p&gt;&lt;strong&gt;Mục tiêu.&lt;/strong&gt; Sau bài này bạn có thể:&lt;/p&gt;

  &lt;ul&gt;
    &lt;li&gt;phát biểu và chứng minh quy tắc đổi biến cho tích phân bất định và xác định;&lt;/li&gt;
    &lt;li&gt;nhận ra dạng $f(g(x))\,g&apos;(x)$ và chọn $u=g(x)$ phù hợp;&lt;/li&gt;
    &lt;li&gt;đổi cận đúng khi đổi biến trong tích phân xác định;&lt;/li&gt;
    &lt;li&gt;dùng đổi biến để chứng minh các đẳng thức tích phân (đối xứng, tịnh tiến).&lt;/li&gt;
  &lt;/ul&gt;

&lt;/div&gt;

&lt;h2 id=&quot;vì-sao-cần-bài-này&quot;&gt;Vì sao cần bài này&lt;/h2&gt;

&lt;p&gt;Bảng nguyên hàm (bài 04_04) không chứa $\int2x\cos(x^2)\,dx$. Nhưng $\bigl(\sin(x^2)\bigr)&apos;=\cos(x^2)\cdot2x$ theo quy tắc chuỗi. Vậy đáp án là $\sin(x^2)+C$. Đổi biến là cách làm việc này có hệ thống: nhận ra “hàm hợp nhân với đạo hàm của hàm bên trong”.&lt;/p&gt;

&lt;h2 id=&quot;quy-tắc-đổi-biến&quot;&gt;Quy tắc đổi biến&lt;/h2&gt;

&lt;div class=&quot;textbook-theorem&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Định lý 1 (Đổi biến).&lt;/strong&gt; Cho $g$ có đạo hàm liên tục trên $[a,b]$ và $f$ liên tục trên tập giá trị của $g$. Khi đó&lt;/p&gt;

\[\int f\bigl(g(x)\bigr)g&apos;(x)\,dx=\int f(u)\,du\Big\vert_{u=g(x)},\qquad \int_a^bf\bigl(g(x)\bigr)g&apos;(x)\,dx=\int_{g(a)}^{g(b)}f(u)\,du .\]

&lt;/div&gt;

&lt;div class=&quot;textbook-proof&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Chứng minh.&lt;/strong&gt; Gọi $F$ là một nguyên hàm của $f$. Theo quy tắc chuỗi, $\bigl(F(g(x))\bigr)&apos;=f(g(x))g&apos;(x)$, nên $F(g(x))$ là nguyên hàm của vế trái: đó là công thức thứ nhất. Áp dụng Newton–Leibniz cho cả hai vế của công thức thứ hai: vế trái bằng $F(g(b))-F(g(a))$, vế phải bằng $F(u)\big\vert_{g(a)}^{g(b)}$, hai số bằng nhau.&lt;/p&gt;
&lt;/div&gt;

&lt;p&gt;Cách viết thực hành: đặt $u=g(x)$, khi đó $du=g&apos;(x)\,dx$. Thay mọi chỗ có $x$ bằng $u$. Với tích phân xác định, đổi luôn cận: $x=a\mapsto u=g(a)$, $x=b\mapsto u=g(b)$, và không cần quay về $x$.&lt;/p&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Ví dụ 1 (Tích phân bất định).&lt;/strong&gt;&lt;/p&gt;

  &lt;ul&gt;
    &lt;li&gt;$\int2x\cos(x^2)\,dx$: $u=x^2$, $du=2x\,dx$, được $\int\cos u\,du=\sin(x^2)+C$.&lt;/li&gt;
    &lt;li&gt;$\int\tan x\,dx=\int\dfrac{\sin x}{\cos x}\,dx$: $u=\cos x$, $du=-\sin x\,dx$, được $-\int\dfrac{du}u=-\ln\lvert\cos x\rvert+C$.&lt;/li&gt;
    &lt;li&gt;$\int\dfrac{dx}{x\ln x}$: $u=\ln x$, $du=\dfrac{dx}x$, được $\int\dfrac{du}u=\ln\lvert\ln x\rvert+C$.&lt;/li&gt;
  &lt;/ul&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Ví dụ 2 (Đổi cận).&lt;/strong&gt; Tính $\displaystyle\int_0^2\frac{x}{(1+x^2)^2}\,dx$.&lt;/p&gt;

  &lt;p&gt;$u=1+x^2$, $du=2x\,dx$; $x=0\mapsto u=1$, $x=2\mapsto u=5$:&lt;/p&gt;

\[\int_1^5\frac{1}{2u^2}\,du=\frac12\Big[-\frac1u\Big]_1^5=\frac12\left(1-\frac15\right)=\frac25 .\]

&lt;/div&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Ví dụ 3 (Đổi biến để chứng minh).&lt;/strong&gt; Với $f$ liên tục trên $[0,a]$: $\int_0^af(x)\,dx=\int_0^af(a-x)\,dx$ (đặt $u=a-x$). Áp dụng cho $I=\displaystyle\int_0^{\pi/2}\frac{\sin x}{\sin x+\cos x}\,dx$: thay $x$ bởi $\tfrac\pi2-x$ được $I=\displaystyle\int_0^{\pi/2}\frac{\cos x}{\cos x+\sin x}\,dx$. Cộng hai biểu thức: $2I=\int_0^{\pi/2}1\,dx=\tfrac\pi2$, nên $I=\tfrac\pi4$.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;content-box warning-box textbook-block&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Lỗi hay gặp.&lt;/strong&gt; (1) Quên đổi cận, hoặc đổi cận rồi vẫn thay $x$ trở lại. (2) Còn sót $x$ trong tích phân theo $u$: mọi $x$ phải được biểu diễn qua $u$. (3) Quên hệ số: $du=2x\,dx$ nên $x\,dx=\tfrac12du$.&lt;/p&gt;
&lt;/div&gt;

&lt;h2 id=&quot;ứng-dụng&quot;&gt;Ứng dụng&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Kinh tế: giá trị hiện tại của dòng tiền liên tục.&lt;/strong&gt; Một dự án tạo dòng tiền đều $R=100$ triệu đồng/năm trong $T=10$ năm, lãi suất liên tục $r=8\%$. Giá trị hiện tại:&lt;/p&gt;

\[PV=\int_0^{T}Re^{-rt}\,dt=\frac Rr\left(1-e^{-rT}\right)=1250\,(1-e^{-0.8})\approx688.3\ \text{triệu đồng}\]

&lt;p&gt;(đổi biến $u=-rt$).&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Học máy và xác suất.&lt;/strong&gt; Với mật độ chuẩn $\varphi(x)=\tfrac1{\sqrt{2\pi}}e^{-x^2/2}$, đổi biến $u=x^2/2$ cho $\int_0^ax\varphi(x)\,dx=\tfrac1{\sqrt{2\pi}}\bigl(1-e^{-a^2/2}\bigr)$. Đổi biến $z=(x-\mu)/\sigma$ đưa mọi phân phối chuẩn về phân phối chuẩn tắc: đây là “chuẩn hoá” dữ liệu trong học máy.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Vật lý.&lt;/strong&gt; Công của lực đàn hồi phi tuyến $F(x)=kx\sqrt{1+x^2}$ khi kéo từ $0$ đến $1$: $W=\int_0^1kx\sqrt{1+x^2}\,dx=\tfrac k3\bigl(2\sqrt2-1\bigr)$ (đặt $u=1+x^2$).&lt;/p&gt;

&lt;h2 id=&quot;bài-tập&quot;&gt;Bài tập&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Cơ bản.&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;Tính $\int(3x+2)^5\,dx$ và $\int\sin x\cos^3x\,dx$.&lt;/li&gt;
  &lt;li&gt;Tính $\int_0^{\pi/2}\sin x\cos x\,dx$.&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Đáp án&lt;/summary&gt;

  &lt;ol&gt;
    &lt;li&gt;$\dfrac{(3x+2)^6}{18}+C$; $-\dfrac{\cos^4x}4+C$.&lt;/li&gt;
    &lt;li&gt;$u=\sin x$: $\int_0^1u\,du=\tfrac12$.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;p&gt;&lt;strong&gt;Trung bình.&lt;/strong&gt;&lt;/p&gt;

&lt;ol start=&quot;3&quot;&gt;
  &lt;li&gt;Tính $\int\dfrac{e^x}{1+e^{2x}}\,dx$ và $\displaystyle\int_0^3\frac{x}{\sqrt{16-x^2}}\,dx$.&lt;/li&gt;
  &lt;li&gt;Tính $\displaystyle\int_e^{e^2}\frac{dx}{x\ln x}$.&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Đáp án&lt;/summary&gt;

  &lt;ol start=&quot;3&quot;&gt;
    &lt;li&gt;$u=e^x$: $\arctan(e^x)+C$. $u=16-x^2$: $\Big[-\sqrt{16-x^2}\Big]_0^3=4-\sqrt7\approx1.354$.&lt;/li&gt;
    &lt;li&gt;$\Big[\ln\ln x\Big]_e^{e^2}=\ln2-\ln1=\ln2$.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;p&gt;&lt;strong&gt;Nâng cao.&lt;/strong&gt;&lt;/p&gt;

&lt;ol start=&quot;5&quot;&gt;
  &lt;li&gt;Chứng minh bằng đổi biến: nếu $f$ lẻ và liên tục trên $[-a,a]$ thì $\int_{-a}^af=0$.&lt;/li&gt;
  &lt;li&gt;Cho $f$ liên tục và tuần hoàn chu kỳ $T$. Chứng minh $\int_a^{a+T}f=\int_0^Tf$ với mọi $a$.&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Gợi ý&lt;/summary&gt;

  &lt;ol start=&quot;5&quot;&gt;
    &lt;li&gt;Tách $\int_{-a}^0+\int_0^a$; trong tích phân đầu đặt $u=-x$ được $\int_0^af(-u)\,du=-\int_0^af$.&lt;/li&gt;
    &lt;li&gt;Viết $\int_a^{a+T}=\int_a^T+\int_T^{a+T}$; trong tích phân sau đặt $u=x-T$ và dùng $f(u+T)=f(u)$, được $\int_0^af$.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;h2 id=&quot;tóm-tắt&quot;&gt;Tóm tắt&lt;/h2&gt;

&lt;div class=&quot;content-box summary-box textbook-block&quot;&gt;
  &lt;ul&gt;
    &lt;li&gt;Đổi biến là quy tắc chuỗi đọc ngược: $\int f(g(x))g&apos;(x)\,dx=\int f(u)\,du$ với $u=g(x)$.&lt;/li&gt;
    &lt;li&gt;Tìm “hàm bên trong” có đạo hàm xuất hiện (sai khác hằng số) trong biểu thức.&lt;/li&gt;
    &lt;li&gt;Tích phân xác định: đổi cận theo $u$ và không quay về $x$.&lt;/li&gt;
    &lt;li&gt;Đổi biến còn dùng để chứng minh các tính chất: đối xứng, tịnh tiến, tuần hoàn.&lt;/li&gt;
  &lt;/ul&gt;
&lt;/div&gt;
</content>
 </entry>
 
 <entry>
   <title>Tích phân gần đúng</title>
   <link href="https://calculus-self-learning.pages.dev/contents/vi/chapter04/04_05_Tich_phan_gan_dung/"/>
   <updated>2026-12-01T00:00:00+00:00</updated>
   <id>https://calculus-self-learning.pages.dev/contents/vi/chapter04/04_05_Tich_phan_gan_dung</id>
   <content type="html">&lt;div class=&quot;textbook-objectives&quot;&gt;

  &lt;p&gt;&lt;strong&gt;Mục tiêu.&lt;/strong&gt; Sau bài này bạn có thể:&lt;/p&gt;

  &lt;ul&gt;
    &lt;li&gt;tính tích phân gần đúng bằng quy tắc điểm giữa, hình thang và Simpson;&lt;/li&gt;
    &lt;li&gt;dùng công thức chặn sai số để chọn số đoạn chia $n$;&lt;/li&gt;
    &lt;li&gt;giải thích vì sao sai số hình thang giảm như $h^2$ còn Simpson giảm như $h^4$;&lt;/li&gt;
    &lt;li&gt;tính AUC của đường cong ROC và hệ số Gini từ dữ liệu rời rạc.&lt;/li&gt;
  &lt;/ul&gt;

&lt;/div&gt;

&lt;h2 id=&quot;vì-sao-cần-bài-này&quot;&gt;Vì sao cần bài này&lt;/h2&gt;

&lt;p&gt;$\int_0^1e^{-x^2}\,dx$ xuất hiện trong xác suất (phân phối chuẩn) nhưng không có nguyên hàm sơ cấp (bài 04_04). Nhiều khi hàm chỉ được biết qua một bảng số đo. Trong cả hai trường hợp, ta cần các công thức tính gần đúng và biết sai số lớn đến đâu.&lt;/p&gt;

&lt;h2 id=&quot;ba-quy-tắc&quot;&gt;Ba quy tắc&lt;/h2&gt;

&lt;p&gt;Chia $[a,b]$ thành $n$ đoạn đều, bước $h=\dfrac{b-a}n$, $x_i=a+ih$, $y_i=f(x_i)$.&lt;/p&gt;

&lt;div class=&quot;textbook-definition&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Định nghĩa 1 (Các quy tắc cầu phương).&lt;/strong&gt;&lt;/p&gt;

  &lt;ul&gt;
    &lt;li&gt;Điểm giữa: $M_n=h\sum_{i=1}^nf\!\left(\dfrac{x_{i-1}+x_i}2\right)$.&lt;/li&gt;
    &lt;li&gt;Hình thang: $T_n=h\left(\dfrac{y_0}2+y_1+y_2+\dots+y_{n-1}+\dfrac{y_n}2\right)=\dfrac{L_n+R_n}2$.&lt;/li&gt;
    &lt;li&gt;Simpson ($n$ chẵn): $S_n=\dfrac h3\bigl(y_0+4y_1+2y_2+4y_3+\dots+2y_{n-2}+4y_{n-1}+y_n\bigr)$.&lt;/li&gt;
  &lt;/ul&gt;
&lt;/div&gt;

&lt;p&gt;Quy tắc hình thang thay đồ thị trên mỗi đoạn bằng một đoạn thẳng. Simpson thay đồ thị trên mỗi cặp đoạn $[x_{2k},x_{2k+2}]$ bằng parabol đi qua ba điểm.&lt;/p&gt;

&lt;div class=&quot;textbook-theorem&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Định lý 1 (Simpson đúng với đa thức bậc ba).&lt;/strong&gt; Với mọi đa thức $p$ bậc không quá 3,&lt;/p&gt;

\[\int_{-h}^{h}p(x)\,dx=\frac h3\bigl(p(-h)+4p(0)+p(h)\bigr).\]

&lt;/div&gt;

&lt;div class=&quot;textbook-proof&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Chứng minh.&lt;/strong&gt; Cả hai vế tuyến tính theo $p$, nên chỉ cần kiểm tra $p=1,x,x^2,x^3$. Với $p=1$: hai vế đều bằng $2h$. Với $p=x$ và $p=x^3$ (hàm lẻ): hai vế đều bằng 0. Với $p=x^2$: vế trái $\tfrac{2h^3}3$, vế phải $\tfrac h3(h^2+0+h^2)=\tfrac{2h^3}3$.&lt;/p&gt;
&lt;/div&gt;

&lt;p&gt;Simpson được xây để đúng với parabol, nhưng nhờ đối xứng nó đúng cả với bậc ba. Đó là lý do sai số của nó nhỏ hơn hẳn.&lt;/p&gt;

&lt;h2 id=&quot;chặn-sai-số&quot;&gt;Chặn sai số&lt;/h2&gt;

&lt;div class=&quot;textbook-theorem&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Định lý 2 (Sai số).&lt;/strong&gt; Giả sử $\lvert f&apos;&apos;\rvert\le K_2$ và $\lvert f^{(4)}\rvert\le K_4$ trên $[a,b]$. Khi đó&lt;/p&gt;

\[\lvert E_T\rvert\le\frac{K_2(b-a)h^2}{12},\qquad\lvert E_M\rvert\le\frac{K_2(b-a)h^2}{24},\qquad\lvert E_S\rvert\le\frac{K_4(b-a)h^4}{180},\]

  &lt;p&gt;với $E$ là hiệu giữa giá trị đúng và giá trị xấp xỉ.&lt;/p&gt;
&lt;/div&gt;

&lt;p&gt;Chứng minh dùng khai triển Taylor (chương 8), ta nhận kết quả. Hệ quả thực hành: gấp đôi $n$ thì sai số hình thang, điểm giữa giảm khoảng 4 lần, sai số Simpson giảm khoảng 16 lần.&lt;/p&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Ví dụ 1.&lt;/strong&gt; Tính gần đúng $\int_0^1e^{-x^2}\,dx$ với $n=4$, $h=0.25$.&lt;/p&gt;

  &lt;table&gt;
    &lt;thead&gt;
      &lt;tr&gt;
        &lt;th&gt;$x_i$&lt;/th&gt;
        &lt;th&gt;0&lt;/th&gt;
        &lt;th&gt;0.25&lt;/th&gt;
        &lt;th&gt;0.5&lt;/th&gt;
        &lt;th&gt;0.75&lt;/th&gt;
        &lt;th&gt;1&lt;/th&gt;
      &lt;/tr&gt;
    &lt;/thead&gt;
    &lt;tbody&gt;
      &lt;tr&gt;
        &lt;td&gt;$y_i=e^{-x_i^2}$&lt;/td&gt;
        &lt;td&gt;1&lt;/td&gt;
        &lt;td&gt;0.93941&lt;/td&gt;
        &lt;td&gt;0.77880&lt;/td&gt;
        &lt;td&gt;0.56978&lt;/td&gt;
        &lt;td&gt;0.36788&lt;/td&gt;
      &lt;/tr&gt;
    &lt;/tbody&gt;
  &lt;/table&gt;

  &lt;ul&gt;
    &lt;li&gt;$T_4=0.25\,(0.5+0.93941+0.77880+0.56978+0.18394)\approx0.742983$.&lt;/li&gt;
    &lt;li&gt;$S_4=\dfrac{0.25}3\bigl(1+4\cdot0.93941+2\cdot0.77880+4\cdot0.56978+0.36788\bigr)\approx0.746853$.&lt;/li&gt;
  &lt;/ul&gt;

  &lt;p&gt;Giá trị đúng $0.746824$. So sánh sai số:&lt;/p&gt;

  &lt;table&gt;
    &lt;thead&gt;
      &lt;tr&gt;
        &lt;th&gt;$n$&lt;/th&gt;
        &lt;th&gt;$T_n$&lt;/th&gt;
        &lt;th&gt;$M_n$&lt;/th&gt;
        &lt;th&gt;$S_n$&lt;/th&gt;
      &lt;/tr&gt;
    &lt;/thead&gt;
    &lt;tbody&gt;
      &lt;tr&gt;
        &lt;td&gt;4&lt;/td&gt;
        &lt;td&gt;$-3.8\cdot10^{-3}$&lt;/td&gt;
        &lt;td&gt;$+1.9\cdot10^{-3}$&lt;/td&gt;
        &lt;td&gt;$+3.1\cdot10^{-5}$&lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr&gt;
        &lt;td&gt;8&lt;/td&gt;
        &lt;td&gt;$-9.6\cdot10^{-4}$&lt;/td&gt;
        &lt;td&gt;$+4.8\cdot10^{-4}$&lt;/td&gt;
        &lt;td&gt;$+2.0\cdot10^{-6}$&lt;/td&gt;
      &lt;/tr&gt;
    &lt;/tbody&gt;
  &lt;/table&gt;

  &lt;p&gt;(Bảng ghi giá trị xấp xỉ trừ giá trị đúng.) Gấp đôi $n$: hình thang giảm 4 lần, Simpson giảm 16 lần. Sai số điểm giữa bằng khoảng một nửa sai số hình thang, ngược dấu.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Ví dụ 2 (Chọn $n$).&lt;/strong&gt; Cần bao nhiêu đoạn để tính $\ln2=\int_1^2\dfrac{dx}x$ với sai số dưới $10^{-4}$?&lt;/p&gt;

  &lt;p&gt;$f&apos;&apos;=\dfrac2{x^3}\le2$ trên $[1,2]$. Hình thang: $\lvert E_T\rvert\le\dfrac{2\cdot1\cdot h^2}{12}=\dfrac1{6n^2}&amp;lt;10^{-4}$ khi $n^2&amp;gt;1667$, tức $n\ge41$.&lt;/p&gt;

  &lt;p&gt;$f^{(4)}=\dfrac{24}{x^5}\le24$. Simpson: $\lvert E_S\rvert\le\dfrac{24}{180n^4}=\dfrac2{15n^4}&amp;lt;10^{-4}$ khi $n^4&amp;gt;1334$, tức $n\ge7$; $n$ phải chẵn nên $n=8$.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;interactive-frame&quot;&gt;
  &lt;div class=&quot;interactive-frame-head&quot;&gt;
    &lt;div class=&quot;interactive-frame-title&quot;&gt;So sánh các công thức gần đúng&lt;/div&gt;
    &lt;div class=&quot;interactive-frame-desc&quot;&gt;Trái, giữa, hình thang, Simpson và sai số theo n trên thang log–log.&lt;/div&gt;
  &lt;/div&gt;
  &lt;iframe src=&quot;/interactives/chapter04/numerical-integration.html&quot; title=&quot;So sánh các công thức gần đúng&quot; loading=&quot;lazy&quot; style=&quot;height: 680px;&quot;&gt;&lt;/iframe&gt;
  &lt;div class=&quot;interactive-frame-foot&quot;&gt;
    &lt;a href=&quot;/interactives/chapter04/numerical-integration.html&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;Mở minh hoạ ở cửa sổ riêng&lt;/a&gt;
  &lt;/div&gt;
&lt;/div&gt;

&lt;h2 id=&quot;ứng-dụng&quot;&gt;Ứng dụng&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Học máy: AUC của đường cong ROC.&lt;/strong&gt; Một bộ phân loại cho các điểm (tỉ lệ dương tính giả, tỉ lệ dương tính thật): $(0,0)$, $(0.1,0.5)$, $(0.3,0.75)$, $(0.6,0.9)$, $(1,1)$. Các bước không đều, nên dùng hình thang trên từng đoạn:&lt;/p&gt;

\[\text{AUC}=0.1\cdot\tfrac{0+0.5}2+0.2\cdot\tfrac{0.5+0.75}2+0.3\cdot\tfrac{0.75+0.9}2+0.4\cdot\tfrac{0.9+1}2=0.7775 .\]

&lt;p&gt;Bộ phân loại đoán ngẫu nhiên có AUC $0.5$, bộ phân loại hoàn hảo có AUC $1$. Đây cũng là cách &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;sklearn.metrics.auc&lt;/code&gt; tính.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Kinh tế: hệ số Gini.&lt;/strong&gt; Đường cong Lorenz $L(p)$ cho biết $p\%$ dân nghèo nhất nắm bao nhiêu phần thu nhập. Hệ số Gini là $G=1-2\int_0^1L(p)\,dp$. Với số liệu $L(0)=0$, $L(0.2)=0.05$, $L(0.4)=0.15$, $L(0.6)=0.30$, $L(0.8)=0.52$, $L(1)=1$, quy tắc hình thang với $h=0.2$ cho&lt;/p&gt;

\[\int_0^1L\approx0.2\left(\tfrac{0+1}2+0.05+0.15+0.30+0.52\right)=0.304,\qquad G\approx1-0.608=0.392 .\]

&lt;p&gt;&lt;strong&gt;Vật lý.&lt;/strong&gt; Với bảng vận tốc ở bài 04_01, quy tắc hình thang cho quãng đường $T_5=\dfrac{L_5+R_5}2=520$ m.&lt;/p&gt;

&lt;h2 id=&quot;bài-tập&quot;&gt;Bài tập&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Cơ bản.&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;Tính $T_4$ và $S_4$ cho $\int_0^2x^3\,dx$. So với giá trị đúng 4.&lt;/li&gt;
  &lt;li&gt;Tính $T_4$ và $S_4$ cho $\int_0^\pi\sin x\,dx$. So với giá trị đúng 2.&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Đáp án&lt;/summary&gt;

  &lt;ol&gt;
    &lt;li&gt;$h=0.5$, $y=0,\ 0.125,\ 1,\ 3.375,\ 8$. $T_4=0.5(0+0.125+1+3.375+4)=4.25$. $S_4=\tfrac{0.5}3(0+0.5+2+13.5+8)=4$: đúng tuyệt đối, theo định lý 1.&lt;/li&gt;
    &lt;li&gt;$T_4\approx1.8961$, $S_4\approx2.0046$.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;p&gt;&lt;strong&gt;Trung bình.&lt;/strong&gt;&lt;/p&gt;

&lt;ol start=&quot;3&quot;&gt;
  &lt;li&gt;Cần $n$ bao nhiêu để quy tắc hình thang tính $\int_0^1e^{-x^2}\,dx$ với sai số dưới $10^{-6}$? (Dùng $\lvert f&apos;&apos;\rvert=\lvert(4x^2-2)e^{-x^2}\rvert\le2$ trên $[0,1]$.)&lt;/li&gt;
  &lt;li&gt;Chứng minh $T_n=\dfrac{L_n+R_n}2$.&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Đáp án&lt;/summary&gt;

  &lt;ol start=&quot;3&quot;&gt;
    &lt;li&gt;$\dfrac{2h^2}{12}=\dfrac1{6n^2}&amp;lt;10^{-6}$ khi $n\ge409$.&lt;/li&gt;
    &lt;li&gt;$L_n=h(y_0+\dots+y_{n-1})$, $R_n=h(y_1+\dots+y_n)$. Trung bình cộng cho $h\bigl(\tfrac{y_0}2+y_1+\dots+y_{n-1}+\tfrac{y_n}2\bigr)$.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;p&gt;&lt;strong&gt;Nâng cao.&lt;/strong&gt;&lt;/p&gt;

&lt;ol start=&quot;5&quot;&gt;
  &lt;li&gt;Chứng minh nếu $f$ lồi trên $[a,b]$ thì $T_n\ge\int_a^bf$ (hình thang ước lượng thừa).&lt;/li&gt;
  &lt;li&gt;Chứng minh $S_{2n}=\dfrac{T_n+2M_n}3$ và kiểm tra bằng số với $\int_0^1e^{-x^2}\,dx$, $n=4$.&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Gợi ý&lt;/summary&gt;

  &lt;ol start=&quot;5&quot;&gt;
    &lt;li&gt;Hàm lồi nằm dưới dây cung (bài 03_02), nên trên mỗi đoạn diện tích dưới đồ thị không vượt diện tích hình thang.&lt;/li&gt;
    &lt;li&gt;Trên đoạn $[x_{i-1},x_i]$ với điểm giữa $m_i$, bước của $S_{2n}$ là $h/2$: $\tfrac{h}{6}\bigl(y_{i-1}+4f(m_i)+y_i\bigr)=\tfrac13\cdot\tfrac h2(y_{i-1}+y_i)+\tfrac23\cdot hf(m_i)$. Cộng lại. Bằng số: $\tfrac{0.742984+2\cdot0.748747}3\approx0.746826=S_8$.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;h2 id=&quot;tóm-tắt&quot;&gt;Tóm tắt&lt;/h2&gt;

&lt;div class=&quot;content-box summary-box textbook-block&quot;&gt;
  &lt;ul&gt;
    &lt;li&gt;Hình thang: $T_n=h\bigl(\tfrac{y_0}2+y_1+\dots+\tfrac{y_n}2\bigr)$; điểm giữa: $M_n$; Simpson ($n$ chẵn): hệ số $1,4,2,4,\dots,4,1$ nhân $h/3$.&lt;/li&gt;
    &lt;li&gt;Sai số: $T$ và $M$ cỡ $h^2$ (cần chặn $f&apos;&apos;$), Simpson cỡ $h^4$ (cần chặn $f^{(4)}$) và đúng với đa thức bậc ba.&lt;/li&gt;
    &lt;li&gt;Gấp đôi $n$: sai số $T$, $M$ giảm 4 lần, sai số Simpson giảm 16 lần.&lt;/li&gt;
    &lt;li&gt;Dữ liệu rời rạc, bước không đều (ROC, Lorenz): dùng hình thang trên từng đoạn.&lt;/li&gt;
  &lt;/ul&gt;
&lt;/div&gt;
</content>
 </entry>
 
 <entry>
   <title>Nguyên hàm và tích phân bất định</title>
   <link href="https://calculus-self-learning.pages.dev/contents/vi/chapter04/04_04_Nguyen_ham_va_tich_phan_bat_dinh/"/>
   <updated>2026-12-01T00:00:00+00:00</updated>
   <id>https://calculus-self-learning.pages.dev/contents/vi/chapter04/04_04_Nguyen_ham_va_tich_phan_bat_dinh</id>
   <content type="html">&lt;div class=&quot;textbook-objectives&quot;&gt;

  &lt;p&gt;&lt;strong&gt;Mục tiêu.&lt;/strong&gt; Sau bài này bạn có thể:&lt;/p&gt;

  &lt;ul&gt;
    &lt;li&gt;định nghĩa nguyên hàm và chứng minh hai nguyên hàm trên một khoảng sai khác một hằng số;&lt;/li&gt;
    &lt;li&gt;dùng bảng nguyên hàm cơ bản, tính tuyến tính và quy tắc $\int f(ax+b)\,dx$;&lt;/li&gt;
    &lt;li&gt;kiểm tra kết quả bằng cách lấy đạo hàm;&lt;/li&gt;
    &lt;li&gt;giải bài toán giá trị ban đầu: tìm vị trí từ gia tốc, doanh thu từ doanh thu biên.&lt;/li&gt;
  &lt;/ul&gt;

&lt;/div&gt;

&lt;h2 id=&quot;vì-sao-cần-bài-này&quot;&gt;Vì sao cần bài này&lt;/h2&gt;

&lt;p&gt;Công thức Newton–Leibniz (bài 04_03) chuyển việc tính tích phân xác định thành việc tìm nguyên hàm. Bài này xây dựng “bảng tra” và các quy tắc đơn giản nhất. Các kỹ thuật mạnh hơn (đổi biến, từng phần) ở chương 5.&lt;/p&gt;

&lt;h2 id=&quot;nguyên-hàm&quot;&gt;Nguyên hàm&lt;/h2&gt;

&lt;div class=&quot;textbook-definition&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Định nghĩa 1 (Nguyên hàm, tích phân bất định).&lt;/strong&gt; Hàm $F$ là một nguyên hàm của $f$ trên khoảng $I$ nếu $F&apos;(x)=f(x)$ với mọi $x\in I$. Tập tất cả nguyên hàm của $f$ trên $I$ ký hiệu là&lt;/p&gt;

\[\int f(x)\,dx=F(x)+C,\]

  &lt;p&gt;gọi là tích phân bất định của $f$; $C$ là hằng số tuỳ ý.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-theorem&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Định lý 1.&lt;/strong&gt; Nếu $F$ và $G$ đều là nguyên hàm của $f$ trên một khoảng $I$ thì $G=F+C$ với hằng số $C$ nào đó.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-proof&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Chứng minh.&lt;/strong&gt; $(G-F)&apos;=f-f=0$ trên $I$. Với $x_1&amp;lt;x_2$ trong $I$, định lý Lagrange (bài 02_05) cho $(G-F)(x_2)-(G-F)(x_1)=0\cdot(x_2-x_1)=0$. Vậy $G-F$ là hằng số trên $I$.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;content-box warning-box textbook-block&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Cần $I$ là một khoảng.&lt;/strong&gt; Trên $\mathbb R\setminus\lbrace0\rbrace$, hàm $F(x)=\ln\lvert x\rvert$ với $x&amp;gt;0$ và $F(x)=\ln\lvert x\rvert+5$ với $x&amp;lt;0$ vẫn có $F&apos;=1/x$, nhưng không có dạng $\ln\lvert x\rvert+C$ với một hằng số chung. Khi viết $\int\frac{dx}x=\ln\lvert x\rvert+C$, ta hiểu là trên từng khoảng $(0,\infty)$ hoặc $(-\infty,0)$.&lt;/p&gt;
&lt;/div&gt;

&lt;h2 id=&quot;bảng-nguyên-hàm-cơ-bản&quot;&gt;Bảng nguyên hàm cơ bản&lt;/h2&gt;

&lt;p&gt;Mỗi dòng kiểm tra được bằng cách lấy đạo hàm vế phải.&lt;/p&gt;

&lt;table&gt;
  &lt;thead&gt;
    &lt;tr&gt;
      &lt;th&gt;$f(x)$&lt;/th&gt;
      &lt;th&gt;$\int f(x)\,dx$&lt;/th&gt;
    &lt;/tr&gt;
  &lt;/thead&gt;
  &lt;tbody&gt;
    &lt;tr&gt;
      &lt;td&gt;$x^\alpha$ ($\alpha\ne-1$)&lt;/td&gt;
      &lt;td&gt;$\dfrac{x^{\alpha+1}}{\alpha+1}+C$&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;$\dfrac1x$&lt;/td&gt;
      &lt;td&gt;$\ln\lvert x\rvert+C$&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;$e^x$&lt;/td&gt;
      &lt;td&gt;$e^x+C$&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;$a^x$ ($a&amp;gt;0$, $a\ne1$)&lt;/td&gt;
      &lt;td&gt;$\dfrac{a^x}{\ln a}+C$&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;$\sin x$&lt;/td&gt;
      &lt;td&gt;$-\cos x+C$&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;$\cos x$&lt;/td&gt;
      &lt;td&gt;$\sin x+C$&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;$\dfrac1{\cos^2x}$&lt;/td&gt;
      &lt;td&gt;$\tan x+C$&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;$\dfrac1{\sin^2x}$&lt;/td&gt;
      &lt;td&gt;$-\cot x+C$&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;$\dfrac1{\sqrt{1-x^2}}$&lt;/td&gt;
      &lt;td&gt;$\arcsin x+C$&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;$\dfrac1{1+x^2}$&lt;/td&gt;
      &lt;td&gt;$\arctan x+C$&lt;/td&gt;
    &lt;/tr&gt;
  &lt;/tbody&gt;
&lt;/table&gt;

&lt;div class=&quot;textbook-theorem&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Định lý 2 (Quy tắc đơn giản).&lt;/strong&gt;&lt;/p&gt;

  &lt;ol&gt;
    &lt;li&gt;Tuyến tính: $\int\bigl(\alpha f+\beta g\bigr)\,dx=\alpha\int f\,dx+\beta\int g\,dx$.&lt;/li&gt;
    &lt;li&gt;Nếu $\int f(x)\,dx=F(x)+C$ và $a\ne0$ thì $\int f(ax+b)\,dx=\dfrac1aF(ax+b)+C$.&lt;/li&gt;
  &lt;/ol&gt;
&lt;/div&gt;

&lt;p&gt;Cả hai suy ra trực tiếp từ quy tắc đạo hàm: $\bigl(\tfrac1aF(ax+b)\bigr)&apos;=\tfrac1aF&apos;(ax+b)\cdot a=f(ax+b)$.&lt;/p&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Ví dụ 1.&lt;/strong&gt;&lt;/p&gt;

  &lt;ul&gt;
    &lt;li&gt;$\int\left(3x^2-\dfrac4x+e^x\right)dx=x^3-4\ln\lvert x\rvert+e^x+C$.&lt;/li&gt;
    &lt;li&gt;$\int\dfrac{(x+1)^2}{\sqrt x}\,dx=\int\bigl(x^{3/2}+2x^{1/2}+x^{-1/2}\bigr)dx=\tfrac25x^{5/2}+\tfrac43x^{3/2}+2x^{1/2}+C$.&lt;/li&gt;
    &lt;li&gt;$\int\tan^2x\,dx=\int\left(\dfrac1{\cos^2x}-1\right)dx=\tan x-x+C$.&lt;/li&gt;
    &lt;li&gt;$\int\cos(3x+1)\,dx=\tfrac13\sin(3x+1)+C$ và $\int e^{-2x}\,dx=-\tfrac12e^{-2x}+C$.&lt;/li&gt;
  &lt;/ul&gt;
&lt;/div&gt;

&lt;h2 id=&quot;bài-toán-giá-trị-ban-đầu&quot;&gt;Bài toán giá trị ban đầu&lt;/h2&gt;

&lt;p&gt;Biết đạo hàm và một giá trị của hàm thì xác định được hàm: hằng số $C$ được chọn để khớp điều kiện.&lt;/p&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Ví dụ 2.&lt;/strong&gt; Tìm $f$ với $f&apos;(x)=6x-2$ và $f(1)=4$.&lt;/p&gt;

  &lt;p&gt;$f(x)=3x^2-2x+C$. Từ $f(1)=3-2+C=4$ được $C=3$. Vậy $f(x)=3x^2-2x+3$.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Ví dụ 3 (Ném thẳng đứng).&lt;/strong&gt; Một quả bóng được ném lên từ mặt đất với vận tốc 20 m/s; gia tốc $a(t)=-9.8$ m/s².&lt;/p&gt;

  &lt;p&gt;$v(t)=\int a\,dt=-9.8t+C_1$, $v(0)=20$ nên $v(t)=20-9.8t$. $s(t)=\int v\,dt=20t-4.9t^2+C_2$, $s(0)=0$ nên $C_2=0$.&lt;/p&gt;

  &lt;p&gt;Bóng lên cao nhất khi $v=0$, tức $t=\tfrac{20}{9.8}\approx2.04$ s, độ cao $s=\tfrac{20^2}{2\cdot9.8}\approx20.4$ m.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;content-box insight-box textbook-block&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Không phải hàm nào cũng có nguyên hàm sơ cấp.&lt;/strong&gt; $e^{-x^2}$, $\dfrac{\sin x}x$, $\sin(x^2)$, $\dfrac1{\ln x}$ đều liên tục nên có nguyên hàm (định lý 1 bài 04_03), nhưng các nguyên hàm này không viết được bằng hữu hạn phép toán trên các hàm sơ cấp. Khi đó ta dùng tích phân gần đúng (bài 04_05) hoặc chuỗi (chương 8).&lt;/p&gt;
&lt;/div&gt;

&lt;h2 id=&quot;ứng-dụng&quot;&gt;Ứng dụng&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Kinh tế: từ doanh thu biên đến hàm cầu.&lt;/strong&gt; Doanh thu biên $R&apos;(q)=100-0.4q$ (nghìn đồng), $R(0)=0$. Khi đó $R(q)=100q-0.2q^2$, và giá bán tương ứng $p=R/q=100-0.2q$: tích phân doanh thu biên cho lại hàm cầu.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Học máy: softplus là nguyên hàm của sigmoid.&lt;/strong&gt; Hàm sigmoid $\sigma(x)=\dfrac{1}{1+e^{-x}}=\dfrac{e^x}{1+e^x}$. Vì $\bigl(\ln(1+e^x)\bigr)&apos;=\dfrac{e^x}{1+e^x}$,&lt;/p&gt;

\[\int\sigma(x)\,dx=\ln(1+e^x)+C .\]

&lt;p&gt;Hàm $\ln(1+e^x)$ gọi là softplus, một hàm kích hoạt trơn gần với ReLU $\max(0,x)$.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Vật lý.&lt;/strong&gt; Ví dụ 3: gia tốc → vận tốc → vị trí, mỗi bước là một nguyên hàm với một điều kiện ban đầu.&lt;/p&gt;

&lt;h2 id=&quot;bài-tập&quot;&gt;Bài tập&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Cơ bản.&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;Tính $\int\left(5x^4-3\sqrt x+\dfrac2x\right)dx$.&lt;/li&gt;
  &lt;li&gt;Tính $\int(2\sin x+3\cos x)\,dx$ và $\int\dfrac{dx}{2x+5}$.&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Đáp án&lt;/summary&gt;

  &lt;ol&gt;
    &lt;li&gt;$x^5-2x^{3/2}+2\ln\lvert x\rvert+C$.&lt;/li&gt;
    &lt;li&gt;$-2\cos x+3\sin x+C$; $\tfrac12\ln\lvert2x+5\rvert+C$.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;p&gt;&lt;strong&gt;Trung bình.&lt;/strong&gt;&lt;/p&gt;

&lt;ol start=&quot;3&quot;&gt;
  &lt;li&gt;Tính $\int\dfrac{dx}{x^2(1+x^2)}$ (gợi ý: $\dfrac1{x^2(1+x^2)}=\dfrac1{x^2}-\dfrac1{1+x^2}$).&lt;/li&gt;
  &lt;li&gt;Tính $\int\sin^2x\,dx$ bằng công thức hạ bậc.&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Đáp án&lt;/summary&gt;

  &lt;ol start=&quot;3&quot;&gt;
    &lt;li&gt;$-\dfrac1x-\arctan x+C$.&lt;/li&gt;
    &lt;li&gt;$\sin^2x=\dfrac{1-\cos2x}2$, nên $\int\sin^2x\,dx=\dfrac x2-\dfrac{\sin2x}4+C$.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;p&gt;&lt;strong&gt;Nâng cao.&lt;/strong&gt;&lt;/p&gt;

&lt;ol start=&quot;5&quot;&gt;
  &lt;li&gt;Tìm $f$ biết $f&apos;&apos;(x)=12x$, $f&apos;(0)=-2$, $f(0)=1$.&lt;/li&gt;
  &lt;li&gt;Tìm $F$ xác định trên $\mathbb R\setminus\lbrace0\rbrace$ với $F&apos;(x)=\dfrac1x$, $F(1)=0$ và $F(-1)=5$. Vì sao điều này không mâu thuẫn với định lý 1?&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Gợi ý&lt;/summary&gt;

  &lt;ol start=&quot;5&quot;&gt;
    &lt;li&gt;$f&apos;(x)=6x^2-2$, $f(x)=2x^3-2x+1$.&lt;/li&gt;
    &lt;li&gt;$F(x)=\ln x$ với $x&amp;gt;0$ và $F(x)=\ln(-x)+5$ với $x&amp;lt;0$. Định lý 1 chỉ áp dụng trên một khoảng; miền này gồm hai khoảng rời nhau, mỗi khoảng có hằng số riêng.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;h2 id=&quot;tóm-tắt&quot;&gt;Tóm tắt&lt;/h2&gt;

&lt;div class=&quot;content-box summary-box textbook-block&quot;&gt;
  &lt;ul&gt;
    &lt;li&gt;$F$ là nguyên hàm của $f$ nếu $F&apos;=f$; trên một khoảng, mọi nguyên hàm có dạng $F+C$.&lt;/li&gt;
    &lt;li&gt;Học thuộc bảng nguyên hàm cơ bản và luôn kiểm tra bằng đạo hàm.&lt;/li&gt;
    &lt;li&gt;$\int f(ax+b)\,dx=\tfrac1aF(ax+b)+C$.&lt;/li&gt;
    &lt;li&gt;Bài toán giá trị ban đầu: lấy nguyên hàm, rồi dùng điều kiện ban đầu để tìm $C$.&lt;/li&gt;
    &lt;li&gt;Có hàm liên tục không có nguyên hàm sơ cấp, chẳng hạn $e^{-x^2}$.&lt;/li&gt;
  &lt;/ul&gt;
&lt;/div&gt;
</content>
 </entry>
 
 <entry>
   <title>Định lý cơ bản của giải tích</title>
   <link href="https://calculus-self-learning.pages.dev/contents/vi/chapter04/04_03_Dinh_ly_co_ban_cua_giai_tich/"/>
   <updated>2026-12-01T00:00:00+00:00</updated>
   <id>https://calculus-self-learning.pages.dev/contents/vi/chapter04/04_03_Dinh_ly_co_ban_cua_giai_tich</id>
   <content type="html">&lt;div class=&quot;textbook-objectives&quot;&gt;

  &lt;p&gt;&lt;strong&gt;Mục tiêu.&lt;/strong&gt; Sau bài này bạn có thể:&lt;/p&gt;

  &lt;ul&gt;
    &lt;li&gt;phát biểu và chứng minh hai phần của định lý cơ bản của giải tích;&lt;/li&gt;
    &lt;li&gt;tính tích phân xác định bằng công thức Newton–Leibniz;&lt;/li&gt;
    &lt;li&gt;đạo hàm các hàm dạng $\int_{u(x)}^{v(x)}f(t)\,dt$;&lt;/li&gt;
    &lt;li&gt;nhận ra khi nào không được dùng Newton–Leibniz (hàm không liên tục trên đoạn).&lt;/li&gt;
  &lt;/ul&gt;

&lt;/div&gt;

&lt;h2 id=&quot;vì-sao-cần-bài-này&quot;&gt;Vì sao cần bài này&lt;/h2&gt;

&lt;p&gt;Tính $\int_0^1x^2\,dx$ bằng tổng Riemann cần công thức $\sum i^2$ và một giới hạn. Với $\int_0^\pi\sin x\,dx$ cách đó rất vất vả. Newton và Leibniz nhận ra: tích phân và đạo hàm là hai phép toán ngược nhau. Nếu tìm được một hàm có đạo hàm là $f$, tích phân chỉ còn là một phép trừ.&lt;/p&gt;

&lt;p&gt;Hình dung: $v(t)$ là vận tốc, $s(t)$ là vị trí. Ta biết $s&apos;=v$, và quãng đường trên $[a,b]$ là $\int_a^bv\,dt$, cũng bằng $s(b)-s(a)$. Định lý cơ bản biến nhận xét này thành định lý cho mọi hàm liên tục.&lt;/p&gt;

&lt;h2 id=&quot;hàm-diện-tích&quot;&gt;Hàm diện tích&lt;/h2&gt;

&lt;p&gt;Cho $f$ liên tục trên $[a,b]$. Đặt&lt;/p&gt;

\[F(x)=\int_a^xf(t)\,dt,\qquad a\le x\le b .\]

&lt;p&gt;$F(x)$ là diện tích có dấu dưới đồ thị từ $a$ đến $x$. Khi $x$ tăng một lượng nhỏ $h$, diện tích tăng thêm một dải hẹp gần như hình chữ nhật cao $f(x)$, rộng $h$. Vậy $F(x+h)-F(x)\approx f(x)h$, tức $F&apos;(x)=f(x)$.&lt;/p&gt;

&lt;div class=&quot;textbook-theorem&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Định lý 1 (Định lý cơ bản, phần 1).&lt;/strong&gt; Nếu $f$ liên tục trên $[a,b]$ thì $F(x)=\int_a^xf(t)\,dt$ khả vi trên $(a,b)$ (đạo hàm một phía tại hai đầu) và&lt;/p&gt;

\[F&apos;(x)=f(x).\]

&lt;/div&gt;

&lt;div class=&quot;textbook-proof&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Chứng minh.&lt;/strong&gt; Xét $h&amp;gt;0$ (trường hợp $h&amp;lt;0$ tương tự). Theo tính cộng khoảng,&lt;/p&gt;

\[\frac{F(x+h)-F(x)}h=\frac1h\int_x^{x+h}f(t)\,dt .\]

  &lt;p&gt;Gọi $m_h$, $M_h$ là giá trị nhỏ nhất và lớn nhất của $f$ trên $[x,x+h]$ (tồn tại theo định lý Weierstrass). Tính chất chặn cho $m_h\le\dfrac1h\int_x^{x+h}f\le M_h$. Khi $h\to0^+$, do $f$ liên tục tại $x$, cả $m_h$ và $M_h$ dần về $f(x)$. Theo nguyên lý kẹp, thương sai phân dần về $f(x)$.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-theorem&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Định lý 2 (Định lý cơ bản, phần 2: công thức Newton–Leibniz).&lt;/strong&gt; Nếu $f$ liên tục trên $[a,b]$ và $G$ là một nguyên hàm của $f$, tức $G&apos;=f$ trên $[a,b]$, thì&lt;/p&gt;

\[\int_a^bf(x)\,dx=G(b)-G(a)=\Big[G(x)\Big]_a^b .\]

&lt;/div&gt;

&lt;div class=&quot;textbook-proof&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Chứng minh.&lt;/strong&gt; Theo định lý 1, $F(x)=\int_a^xf$ cũng thoả $F&apos;=f$. Vậy $(F-G)&apos;=0$ trên $[a,b]$, nên $F-G$ là hằng số $C$ (hệ quả của định lý giá trị trung bình, bài 02_05). Thay $x=a$: $C=F(a)-G(a)=-G(a)$. Thay $x=b$: $\int_a^bf=F(b)=G(b)+C=G(b)-G(a)$.&lt;/p&gt;
&lt;/div&gt;

&lt;h2 id=&quot;ví-dụ&quot;&gt;Ví dụ&lt;/h2&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Ví dụ 1.&lt;/strong&gt; Dùng các nguyên hàm quen thuộc (bài 04_04 sẽ lập bảng):&lt;/p&gt;

  &lt;ul&gt;
    &lt;li&gt;$\int_0^1x^2\,dx=\Big[\tfrac{x^3}3\Big]_0^1=\tfrac13$, khớp với bài 04_01.&lt;/li&gt;
    &lt;li&gt;$\int_0^\pi\sin x\,dx=\Big[-\cos x\Big]_0^\pi=1-(-1)=2$.&lt;/li&gt;
    &lt;li&gt;$\int_0^1\sqrt x\,dx=\Big[\tfrac23x^{3/2}\Big]_0^1=\tfrac23$.&lt;/li&gt;
    &lt;li&gt;$\int_0^1\dfrac{dx}{1+x^2}=\Big[\arctan x\Big]_0^1=\dfrac\pi4$. Kết hợp với bài tập 6 bài 04_01: $\displaystyle\lim_{n\to\infty}\sum_{i=1}^n\frac n{n^2+i^2}=\frac\pi4$.&lt;/li&gt;
  &lt;/ul&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Ví dụ 2 (Cận là hàm của $x$).&lt;/strong&gt; Tính $\dfrac{d}{dx}\displaystyle\int_0^{x^2}\sin(t^2)\,dt$.&lt;/p&gt;

  &lt;p&gt;Đặt $F(u)=\int_0^u\sin(t^2)\,dt$, khi đó biểu thức là $F(x^2)$. Theo định lý 1 và quy tắc chuỗi: $\dfrac{d}{dx}F(x^2)=F&apos;(x^2)\cdot2x=2x\sin(x^4)$.&lt;/p&gt;

  &lt;p&gt;Tổng quát, với $f$ liên tục và $u,v$ khả vi:&lt;/p&gt;

\[\frac{d}{dx}\int_{u(x)}^{v(x)}f(t)\,dt=f\bigl(v(x)\bigr)v&apos;(x)-f\bigl(u(x)\bigr)u&apos;(x).\]

&lt;/div&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Ví dụ 3 (Không liên tục thì không được dùng).&lt;/strong&gt; Tính “ngây thơ”: $\int_{-1}^1\dfrac{dx}{x^2}=\Big[-\dfrac1x\Big]_{-1}^1=-1-1=-2$. Kết quả âm cho một hàm dương: sai. Lý do: $1/x^2$ không bị chặn gần $0$, không khả tích trên $[-1,1]$, và định lý 2 đòi $f$ liên tục trên cả đoạn. Đây là tích phân suy rộng, phân kỳ (bài 05_05).&lt;/p&gt;
&lt;/div&gt;

&lt;h2 id=&quot;video-ngắn&quot;&gt;Video ngắn&lt;/h2&gt;

&lt;div class=&quot;reel-video&quot;&gt;
  &lt;video controls=&quot;&quot; playsinline=&quot;&quot; preload=&quot;metadata&quot; src=&quot;/public/videos/reels/fundamental-theorem.mp4&quot;&gt;&lt;/video&gt;
  &lt;p class=&quot;reel-caption&quot;&gt;Định lý cơ bản của giải tích: đồ thị vận tốc, diện tích tích luỹ được vẽ thành đồ thị quãng đường, độ dốc của đồ thị này bằng chiều cao đồ thị vận tốc (video không lời, khoảng 1 phút 55 giây).&lt;/p&gt;
&lt;/div&gt;

&lt;h2 id=&quot;ứng-dụng&quot;&gt;Ứng dụng&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Vật lý: rơi tự do.&lt;/strong&gt; Vận tốc $v(t)=9.8t$ (m/s). Quãng đường rơi trong 3 giây đầu: $\int_0^39.8t\,dt=\Big[4.9t^2\Big]_0^3=44.1$ m.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Kinh tế: chi phí biên.&lt;/strong&gt; Với $C&apos;(q)=50-0.2q$, chi phí tăng thêm khi sản xuất từ 0 lên 100 sản phẩm là $C(100)-C(0)=\int_0^{100}(50-0.2q)\,dq=\Big[50q-0.1q^2\Big]_0^{100}=4000$ nghìn đồng, đúng như tổng giữa ở bài 04_01.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Học máy và xác suất: hàm phân phối.&lt;/strong&gt; Nếu $X$ có hàm mật độ $p$, hàm phân phối $F(x)=P(X\le x)=\int_{-\infty}^xp(t)\,dt$ có $F&apos;=p$ (định lý 1). Ví dụ phân phối mũ (thời gian chờ) có $p(t)=\lambda e^{-\lambda t}$ với $t\ge0$, nên&lt;/p&gt;

\[P(X\le x)=\int_0^x\lambda e^{-\lambda t}\,dt=\Big[-e^{-\lambda t}\Big]_0^x=1-e^{-\lambda x}.\]

&lt;h2 id=&quot;bài-tập&quot;&gt;Bài tập&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Cơ bản.&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;Tính $\int_1^4\left(2x-\dfrac1{\sqrt x}\right)dx$ và $\int_0^{\pi/2}\cos x\,dx$.&lt;/li&gt;
  &lt;li&gt;Tính $\dfrac{d}{dx}\displaystyle\int_1^x\sqrt{1+t^3}\,dt$.&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Đáp án&lt;/summary&gt;

  &lt;ol&gt;
    &lt;li&gt;$\Big[x^2-2\sqrt x\Big]_1^4=(16-4)-(1-2)=13$; $\Big[\sin x\Big]_0^{\pi/2}=1$.&lt;/li&gt;
    &lt;li&gt;$\sqrt{1+x^3}$.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;p&gt;&lt;strong&gt;Trung bình.&lt;/strong&gt;&lt;/p&gt;

&lt;ol start=&quot;3&quot;&gt;
  &lt;li&gt;Tính $\dfrac{d}{dx}\displaystyle\int_x^{x^3}e^{t^2}\,dt$.&lt;/li&gt;
  &lt;li&gt;Tìm hàm liên tục $f$ thoả $\int_0^xf(t)\,dt=x^2+\sin x$ với mọi $x$.&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Đáp án&lt;/summary&gt;

  &lt;ol start=&quot;3&quot;&gt;
    &lt;li&gt;$3x^2e^{x^6}-e^{x^2}$.&lt;/li&gt;
    &lt;li&gt;Đạo hàm hai vế: $f(x)=2x+\cos x$. (Kiểm tra tại $x=0$: hai vế đều bằng 0.)&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;p&gt;&lt;strong&gt;Nâng cao.&lt;/strong&gt;&lt;/p&gt;

&lt;ol start=&quot;5&quot;&gt;
  &lt;li&gt;Tính $\displaystyle\lim_{x\to0}\frac1x\int_0^x\cos(t^2)\,dt$.&lt;/li&gt;
  &lt;li&gt;Tính $\displaystyle\lim_{x\to0}\frac{\int_0^x\sin(t^2)\,dt}{x^3}$.&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Gợi ý&lt;/summary&gt;

  &lt;ol start=&quot;5&quot;&gt;
    &lt;li&gt;Đây là thương sai phân của $F(x)=\int_0^x\cos(t^2)\,dt$ tại 0, nên giới hạn là $F&apos;(0)=\cos0=1$.&lt;/li&gt;
    &lt;li&gt;Dạng $0/0$; L’Hôpital và định lý 1: $\displaystyle\lim\frac{\sin(x^2)}{3x^2}=\frac13$.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;h2 id=&quot;tóm-tắt&quot;&gt;Tóm tắt&lt;/h2&gt;

&lt;div class=&quot;content-box summary-box textbook-block&quot;&gt;
  &lt;ul&gt;
    &lt;li&gt;Phần 1: với $f$ liên tục, $\dfrac{d}{dx}\int_a^xf(t)\,dt=f(x)$. Tích phân với cận trên thay đổi là một nguyên hàm.&lt;/li&gt;
    &lt;li&gt;Phần 2: $\int_a^bf=G(b)-G(a)$ với mọi nguyên hàm $G$ của $f$ liên tục.&lt;/li&gt;
    &lt;li&gt;Cận là hàm: $\frac{d}{dx}\int_{u}^{v}f=f(v)v&apos;-f(u)u&apos;$.&lt;/li&gt;
    &lt;li&gt;Newton–Leibniz cần $f$ liên tục trên cả đoạn; nếu không, kết quả có thể sai hoàn toàn.&lt;/li&gt;
    &lt;li&gt;Quãng đường là hiệu vị trí; tổng chi phí là hiệu chi phí; xác suất là hiệu hàm phân phối.&lt;/li&gt;
  &lt;/ul&gt;
&lt;/div&gt;
</content>
 </entry>
 
 <entry>
   <title>Tích phân xác định và tính chất</title>
   <link href="https://calculus-self-learning.pages.dev/contents/vi/chapter04/04_02_Tich_phan_xac_dinh_va_tinh_chat/"/>
   <updated>2026-12-01T00:00:00+00:00</updated>
   <id>https://calculus-self-learning.pages.dev/contents/vi/chapter04/04_02_Tich_phan_xac_dinh_va_tinh_chat</id>
   <content type="html">&lt;div class=&quot;textbook-objectives&quot;&gt;

  &lt;p&gt;&lt;strong&gt;Mục tiêu.&lt;/strong&gt; Sau bài này bạn có thể:&lt;/p&gt;

  &lt;ul&gt;
    &lt;li&gt;phát biểu định nghĩa tích phân xác định qua tổng Riemann;&lt;/li&gt;
    &lt;li&gt;biết hàm liên tục và hàm đơn điệu trên đoạn là khả tích, và có hàm bị chặn không khả tích;&lt;/li&gt;
    &lt;li&gt;dùng tính tuyến tính, cộng khoảng, so sánh và đối xứng để tính hoặc ước lượng tích phân;&lt;/li&gt;
    &lt;li&gt;phân biệt độ dời và quãng đường đi được.&lt;/li&gt;
  &lt;/ul&gt;

&lt;/div&gt;

&lt;h2 id=&quot;vì-sao-cần-bài-này&quot;&gt;Vì sao cần bài này&lt;/h2&gt;

&lt;p&gt;Ở bài 04_01, tổng Riemann của $x^2$ trên $[0,1]$ tiến về $1/3$ với cả ba kiểu điểm mẫu. Ta muốn một định nghĩa không phụ thuộc vào cách chia và cách chọn điểm mẫu, và các quy tắc tính toán để không phải lấy giới hạn của tổng mỗi lần.&lt;/p&gt;

&lt;h2 id=&quot;định-nghĩa&quot;&gt;Định nghĩa&lt;/h2&gt;

&lt;p&gt;Với phân hoạch $P$, gọi $\lVert P\rVert=\max_i\Delta x_i$ là độ mịn (bước lớn nhất) của $P$.&lt;/p&gt;

&lt;div class=&quot;textbook-definition&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Định nghĩa 1 (Tích phân xác định).&lt;/strong&gt; Hàm $f$ xác định trên $[a,b]$ gọi là khả tích (Riemann) nếu có số $I$ sao cho: với mọi $\varepsilon&amp;gt;0$ có $\delta&amp;gt;0$ để mọi tổng Riemann với $\lVert P\rVert&amp;lt;\delta$, bất kể chọn điểm mẫu thế nào, đều thoả $\left\lvert\sum f(\xi_i)\Delta x_i-I\right\rvert&amp;lt;\varepsilon$. Khi đó&lt;/p&gt;

\[\int_a^b f(x)\,dx=I=\lim_{\lVert P\rVert\to0}\sum_{i=1}^n f(\xi_i)\,\Delta x_i .\]

&lt;/div&gt;

&lt;p&gt;Ký hiệu $\int$ là chữ S kéo dài (sum), $dx$ nhắc đến $\Delta x$. Biến $x$ là biến câm: $\int_a^bf(x)\,dx=\int_a^bf(t)\,dt$.&lt;/p&gt;

&lt;p&gt;Quy ước: $\int_a^af=0$ và $\int_b^af=-\int_a^bf$.&lt;/p&gt;

&lt;div class=&quot;textbook-theorem&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Định lý 1 (Hàm khả tích).&lt;/strong&gt; Trên đoạn $[a,b]$:&lt;/p&gt;

  &lt;ol&gt;
    &lt;li&gt;hàm liên tục thì khả tích;&lt;/li&gt;
    &lt;li&gt;hàm đơn điệu thì khả tích;&lt;/li&gt;
    &lt;li&gt;hàm bị chặn, chỉ có hữu hạn điểm gián đoạn thì khả tích, và giá trị tại hữu hạn điểm không ảnh hưởng đến tích phân.&lt;/li&gt;
  &lt;/ol&gt;

  &lt;p&gt;Hàm khả tích thì bị chặn.&lt;/p&gt;
&lt;/div&gt;

&lt;p&gt;Chứng minh phần 1 dùng tính liên tục đều (bài 01_06) và để trong phần đọc thêm. Phần 2 với phân hoạch đều được suy ra từ định lý 1 bài 04_01: mọi tổng Riemann nằm giữa $L_n$ và $R_n$, hai tổng này cách nhau $\lvert f(b)-f(a)\rvert(b-a)/n\to0$.&lt;/p&gt;

&lt;div class=&quot;content-box warning-box textbook-block&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Hàm bị chặn nhưng không khả tích.&lt;/strong&gt; Hàm Dirichlet $D(x)=1$ nếu $x$ hữu tỉ, $D(x)=0$ nếu $x$ vô tỉ. Trên $[0,1]$, mọi đoạn con đều chứa cả số hữu tỉ lẫn vô tỉ. Chọn mọi $\xi_i$ hữu tỉ thì tổng Riemann bằng 1; chọn mọi $\xi_i$ vô tỉ thì bằng 0. Không có giới hạn chung, nên $D$ không khả tích Riemann.&lt;/p&gt;
&lt;/div&gt;

&lt;h2 id=&quot;tính-chất&quot;&gt;Tính chất&lt;/h2&gt;

&lt;div class=&quot;textbook-theorem&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Định lý 2 (Tính chất của tích phân).&lt;/strong&gt; Cho $f,g$ khả tích trên các đoạn liên quan, $c$ là hằng số.&lt;/p&gt;

  &lt;ol&gt;
    &lt;li&gt;Tuyến tính: $\int_a^b(f+g)=\int_a^bf+\int_a^bg$ và $\int_a^bcf=c\int_a^bf$.&lt;/li&gt;
    &lt;li&gt;Cộng khoảng: $\int_a^bf=\int_a^cf+\int_c^bf$ với mọi $a,b,c$ (khi các tích phân tồn tại).&lt;/li&gt;
    &lt;li&gt;So sánh: nếu $f\le g$ trên $[a,b]$ ($a&amp;lt;b$) thì $\int_a^bf\le\int_a^bg$.&lt;/li&gt;
    &lt;li&gt;Chặn: nếu $m\le f\le M$ trên $[a,b]$ thì $m(b-a)\le\int_a^bf\le M(b-a)$.&lt;/li&gt;
    &lt;li&gt;$\left\lvert\int_a^bf\right\rvert\le\int_a^b\lvert f\rvert$.&lt;/li&gt;
  &lt;/ol&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-proof&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Chứng minh (1, 3, 4).&lt;/strong&gt; Với cùng phân hoạch và điểm mẫu, $\sum(f+g)(\xi_i)\Delta x_i=\sum f(\xi_i)\Delta x_i+\sum g(\xi_i)\Delta x_i$ và $\sum cf(\xi_i)\Delta x_i=c\sum f(\xi_i)\Delta x_i$. Cho $\lVert P\rVert\to0$ được (1). Nếu $f\le g$ thì mọi tổng Riemann của $f$ không lớn hơn tổng tương ứng của $g$; qua giới hạn giữ nguyên dấu $\le$, được (3). Áp dụng (3) cho $m\le f\le M$ và dùng $\int_a^bm\,dx=m(b-a)$ được (4).&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-theorem&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Định lý 3 (Đối xứng).&lt;/strong&gt; Cho $f$ khả tích trên $[-a,a]$.&lt;/p&gt;

  &lt;ul&gt;
    &lt;li&gt;Nếu $f$ lẻ thì $\int_{-a}^af=0$.&lt;/li&gt;
    &lt;li&gt;Nếu $f$ chẵn thì $\int_{-a}^af=2\int_0^af$.&lt;/li&gt;
  &lt;/ul&gt;
&lt;/div&gt;

&lt;p&gt;Lý do: với phân hoạch đối xứng qua 0 và điểm mẫu đối xứng, các số hạng của tổng Riemann ở hai bên triệt tiêu nhau (hàm lẻ) hoặc bằng nhau (hàm chẵn).&lt;/p&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Ví dụ 1 (Tính bằng hình học).&lt;/strong&gt;&lt;/p&gt;

  &lt;ul&gt;
    &lt;li&gt;$\int_0^2(2x+1)\,dx$ là diện tích hình thang có hai đáy $f(0)=1$, $f(2)=5$, cao 2: bằng $\dfrac{1+5}2\cdot2=6$.&lt;/li&gt;
    &lt;li&gt;$\int_{-2}^2\sqrt{4-x^2}\,dx$ là diện tích nửa hình tròn bán kính 2: bằng $2\pi$.&lt;/li&gt;
    &lt;li&gt;$\int_{-1}^1x^3\,dx=0$ vì $x^3$ lẻ.&lt;/li&gt;
  &lt;/ul&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Ví dụ 2 (Dùng tính tuyến tính).&lt;/strong&gt; Biết $\int_0^1x^2\,dx=\tfrac13$ và $\int_0^1x\,dx=\tfrac12$ (bài 04_01). Khi đó&lt;/p&gt;

\[\int_0^1(3x^2-2x+5)\,dx=3\cdot\tfrac13-2\cdot\tfrac12+5\cdot1=5 .\]

&lt;/div&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Ví dụ 3 (Ước lượng).&lt;/strong&gt; Trên $[0,1]$, $e^{-1}\le e^{-x^2}\le1$, nên&lt;/p&gt;

\[0.367\approx e^{-1}\le\int_0^1e^{-x^2}\,dx\le1 .\]

  &lt;p&gt;Tích phân này không tính được bằng hàm sơ cấp; giá trị gần đúng $0.7468$ (bài 04_05).&lt;/p&gt;
&lt;/div&gt;

&lt;h2 id=&quot;ứng-dụng&quot;&gt;Ứng dụng&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Vật lý: độ dời và quãng đường.&lt;/strong&gt; Vật chuyển động thẳng với vận tốc $v(t)=t-2$ (m/s), $0\le t\le4$. Độ dời là $\int_0^4v\,dt$: hai tam giác diện tích $2$ (dưới trục, $0\le t\le2$) và $2$ (trên trục), nên độ dời bằng $-2+2=0$: vật quay về chỗ cũ. Quãng đường đi được là $\int_0^4\lvert v\rvert\,dt=4$ m.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Học máy và xác suất: hàm mật độ.&lt;/strong&gt; Một biến ngẫu nhiên liên tục $X$ có hàm mật độ $p(x)\ge0$ với $\int_{-\infty}^{\infty}p=1$, và $P(a\le X\le b)=\int_a^bp(x)\,dx$. Ví dụ $X$ phân phối đều trên $[0,10]$ có $p=0.1$ trên $[0,10]$, nên $P(2\le X\le5)=0.1\cdot3=0.3$. Tính cộng khoảng ứng với cộng xác suất của các khoảng rời nhau.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Kinh tế.&lt;/strong&gt; Tổng doanh thu từ thời điểm $t=a$ đến $t=b$ khi biết tốc độ doanh thu $r(t)$ (đồng/ngày) là $\int_a^br(t)\,dt$; tính cộng khoảng cho phép cộng doanh thu theo từng quý.&lt;/p&gt;

&lt;h2 id=&quot;bài-tập&quot;&gt;Bài tập&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Cơ bản.&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;Tính $\int_0^3\lvert x-1\rvert\,dx$ bằng hình học.&lt;/li&gt;
  &lt;li&gt;Biết $\int_0^2f=3$ và $\int_0^5f=7$. Tính $\int_2^5f$ và $\int_5^22f$.&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Đáp án&lt;/summary&gt;

  &lt;ol&gt;
    &lt;li&gt;Hai tam giác: diện tích $\tfrac12\cdot1\cdot1+\tfrac12\cdot2\cdot2=2.5$.&lt;/li&gt;
    &lt;li&gt;$\int_2^5f=7-3=4$; $\int_5^22f=-2\cdot4=-8$.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;p&gt;&lt;strong&gt;Trung bình.&lt;/strong&gt;&lt;/p&gt;

&lt;ol start=&quot;3&quot;&gt;
  &lt;li&gt;Chứng minh $\dfrac12\le\int_1^2\dfrac{dx}x\le1$.&lt;/li&gt;
  &lt;li&gt;Tính $\int_{-\pi}^{\pi}x^2\sin x\,dx$ và $\int_{-1}^1(x^5+3)\,dx$ không cần tính nguyên hàm.&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Đáp án&lt;/summary&gt;

  &lt;ol start=&quot;3&quot;&gt;
    &lt;li&gt;Trên $[1,2]$, $\tfrac12\le\tfrac1x\le1$; dùng tính chất chặn với $b-a=1$. (Giá trị đúng $\ln2\approx0.693$.)&lt;/li&gt;
    &lt;li&gt;$x^2\sin x$ lẻ nên tích phân bằng 0. $\int_{-1}^1x^5=0$, $\int_{-1}^13=6$, tổng bằng 6.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;p&gt;&lt;strong&gt;Nâng cao.&lt;/strong&gt;&lt;/p&gt;

&lt;ol start=&quot;5&quot;&gt;
  &lt;li&gt;Chứng minh $\left\lvert\int_a^bf\right\rvert\le\int_a^b\lvert f\rvert$ (giả sử $f$ và $\lvert f\rvert$ khả tích).&lt;/li&gt;
  &lt;li&gt;Cho $f$ liên tục, $f\ge0$ trên $[a,b]$ và $\int_a^bf=0$. Chứng minh $f\equiv0$ trên $[a,b]$. Kết luận còn đúng nếu bỏ giả thiết liên tục không?&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Gợi ý&lt;/summary&gt;

  &lt;ol start=&quot;5&quot;&gt;
    &lt;li&gt;$-\lvert f\rvert\le f\le\lvert f\rvert$, dùng so sánh.&lt;/li&gt;
    &lt;li&gt;Nếu $f(c)&amp;gt;0$ thì do liên tục có đoạn $[c-\delta,c+\delta]\cap[a,b]$ (độ dài $\ell&amp;gt;0$) trên đó $f\ge f(c)/2$; cộng khoảng và so sánh cho $\int_a^bf\ge\ell f(c)/2&amp;gt;0$. Bỏ liên tục thì sai: hàm bằng 1 tại một điểm và 0 ở nơi khác có tích phân 0.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;h2 id=&quot;tóm-tắt&quot;&gt;Tóm tắt&lt;/h2&gt;

&lt;div class=&quot;content-box summary-box textbook-block&quot;&gt;
  &lt;ul&gt;
    &lt;li&gt;$\int_a^bf=\lim_{\lVert P\rVert\to0}\sum f(\xi_i)\Delta x_i$, giới hạn không phụ thuộc cách chọn điểm mẫu.&lt;/li&gt;
    &lt;li&gt;Hàm liên tục, hàm đơn điệu, hàm bị chặn có hữu hạn điểm gián đoạn đều khả tích. Hàm Dirichlet không khả tích.&lt;/li&gt;
    &lt;li&gt;Tính chất: tuyến tính, cộng khoảng, so sánh, chặn $m(b-a)\le\int\le M(b-a)$, $\lvert\int f\rvert\le\int\lvert f\rvert$.&lt;/li&gt;
    &lt;li&gt;Hàm lẻ trên $[-a,a]$ có tích phân 0; hàm chẵn có tích phân gấp đôi trên $[0,a]$.&lt;/li&gt;
    &lt;li&gt;Tích phân của vận tốc là độ dời; tích phân của tốc độ $\lvert v\rvert$ là quãng đường.&lt;/li&gt;
  &lt;/ul&gt;
&lt;/div&gt;
</content>
 </entry>
 
 <entry>
   <title>Diện tích và tổng Riemann</title>
   <link href="https://calculus-self-learning.pages.dev/contents/vi/chapter04/04_01_Dien_tich_va_tong_Riemann/"/>
   <updated>2026-12-01T00:00:00+00:00</updated>
   <id>https://calculus-self-learning.pages.dev/contents/vi/chapter04/04_01_Dien_tich_va_tong_Riemann</id>
   <content type="html">&lt;div class=&quot;textbook-objectives&quot;&gt;

  &lt;p&gt;&lt;strong&gt;Mục tiêu.&lt;/strong&gt; Sau bài này bạn có thể:&lt;/p&gt;

  &lt;ul&gt;
    &lt;li&gt;chia đoạn $[a,b]$ và lập tổng Riemann trái, phải, giữa của một hàm;&lt;/li&gt;
    &lt;li&gt;tính tổng Riemann bằng công thức tổng $\sum i$, $\sum i^2$ và lấy giới hạn khi $n\to\infty$;&lt;/li&gt;
    &lt;li&gt;chặn diện tích của hàm đơn điệu giữa tổng trái và tổng phải, và chọn $n$ để đạt độ chính xác cho trước;&lt;/li&gt;
    &lt;li&gt;tính xấp xỉ quãng đường từ bảng vận tốc và tổng chi phí từ chi phí biên.&lt;/li&gt;
  &lt;/ul&gt;

&lt;/div&gt;

&lt;h2 id=&quot;vì-sao-cần-bài-này&quot;&gt;Vì sao cần bài này&lt;/h2&gt;

&lt;p&gt;Đồng hồ tốc độ của một ô tô được ghi lại mỗi 10 giây. Xe đi được bao xa trong 50 giây? Nếu vận tốc không đổi thì quãng đường là vận tốc nhân thời gian. Vận tốc thay đổi, nên ta chia thời gian thành các khoảng ngắn, coi vận tốc gần như không đổi trên mỗi khoảng, rồi cộng lại. Trên đồ thị vận tốc, mỗi tích “vận tốc × thời gian” là diện tích một hình chữ nhật. Quãng đường là diện tích dưới đồ thị.&lt;/p&gt;

&lt;p&gt;Đạo hàm trả lời câu hỏi “thay đổi nhanh bao nhiêu”. Tích phân trả lời câu hỏi ngược lại: “cộng dồn được bao nhiêu”.&lt;/p&gt;

&lt;h2 id=&quot;phân-hoạch-và-tổng-riemann&quot;&gt;Phân hoạch và tổng Riemann&lt;/h2&gt;

&lt;div class=&quot;textbook-definition&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Định nghĩa 1 (Phân hoạch, tổng Riemann).&lt;/strong&gt; Một phân hoạch của $[a,b]$ là dãy điểm $a=x_0&amp;lt;x_1&amp;lt;\dots&amp;lt;x_n=b$. Đặt $\Delta x_i=x_i-x_{i-1}$. Chọn điểm mẫu $\xi_i\in[x_{i-1},x_i]$. Tổng&lt;/p&gt;

\[S=\sum_{i=1}^n f(\xi_i)\,\Delta x_i\]

  &lt;p&gt;gọi là tổng Riemann của $f$ ứng với phân hoạch và các điểm mẫu đó.&lt;/p&gt;
&lt;/div&gt;

&lt;p&gt;Thường dùng phân hoạch đều: $\Delta x=\dfrac{b-a}n$, $x_i=a+i\Delta x$. Ba cách chọn điểm mẫu hay gặp:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;tổng trái $L_n$: $\xi_i=x_{i-1}$;&lt;/li&gt;
  &lt;li&gt;tổng phải $R_n$: $\xi_i=x_i$;&lt;/li&gt;
  &lt;li&gt;tổng giữa $M_n$: $\xi_i=\dfrac{x_{i-1}+x_i}2$.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Khi $f\ge0$, mỗi số hạng $f(\xi_i)\Delta x_i$ là diện tích một hình chữ nhật cao $f(\xi_i)$, rộng $\Delta x_i$. Nếu $f$ có chỗ âm, các số hạng đó mang dấu âm: tổng Riemann đo “diện tích có dấu”.&lt;/p&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Ví dụ 1.&lt;/strong&gt; Xấp xỉ diện tích dưới $y=x^2$ trên $[0,1]$ với $n=4$.&lt;/p&gt;

  &lt;p&gt;$\Delta x=0.25$, các điểm chia $0,\ 0.25,\ 0.5,\ 0.75,\ 1$.&lt;/p&gt;

  &lt;ul&gt;
    &lt;li&gt;$L_4=0.25\,(0^2+0.25^2+0.5^2+0.75^2)=\dfrac{0+1+4+9}{64}=0.21875$.&lt;/li&gt;
    &lt;li&gt;$R_4=0.25\,(0.25^2+0.5^2+0.75^2+1^2)=\dfrac{1+4+9+16}{64}=0.46875$.&lt;/li&gt;
    &lt;li&gt;$M_4=0.25\,(0.125^2+0.375^2+0.625^2+0.875^2)=\dfrac{1+9+25+49}{256}=0.328125$.&lt;/li&gt;
  &lt;/ul&gt;

  &lt;p&gt;Tăng $n$:&lt;/p&gt;

  &lt;table&gt;
    &lt;thead&gt;
      &lt;tr&gt;
        &lt;th&gt;$n$&lt;/th&gt;
        &lt;th&gt;$L_n$&lt;/th&gt;
        &lt;th&gt;$R_n$&lt;/th&gt;
        &lt;th&gt;$M_n$&lt;/th&gt;
      &lt;/tr&gt;
    &lt;/thead&gt;
    &lt;tbody&gt;
      &lt;tr&gt;
        &lt;td&gt;4&lt;/td&gt;
        &lt;td&gt;0.21875&lt;/td&gt;
        &lt;td&gt;0.46875&lt;/td&gt;
        &lt;td&gt;0.328125&lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr&gt;
        &lt;td&gt;10&lt;/td&gt;
        &lt;td&gt;0.285&lt;/td&gt;
        &lt;td&gt;0.385&lt;/td&gt;
        &lt;td&gt;0.3325&lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr&gt;
        &lt;td&gt;100&lt;/td&gt;
        &lt;td&gt;0.32835&lt;/td&gt;
        &lt;td&gt;0.33835&lt;/td&gt;
        &lt;td&gt;0.333325&lt;/td&gt;
      &lt;/tr&gt;
    &lt;/tbody&gt;
  &lt;/table&gt;

  &lt;p&gt;Cả ba cột tiến về $1/3$. Tổng giữa chính xác hơn hẳn với cùng $n$.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;interactive-frame&quot;&gt;
  &lt;div class=&quot;interactive-frame-head&quot;&gt;
    &lt;div class=&quot;interactive-frame-title&quot;&gt;Tổng Riemann&lt;/div&gt;
    &lt;div class=&quot;interactive-frame-desc&quot;&gt;Chọn hàm, số đoạn n và kiểu điểm mẫu; so tổng với tích phân đúng.&lt;/div&gt;
  &lt;/div&gt;
  &lt;iframe src=&quot;/interactives/chapter04/riemann-sum.html&quot; title=&quot;Tổng Riemann&quot; loading=&quot;lazy&quot; style=&quot;height: 720px;&quot;&gt;&lt;/iframe&gt;
  &lt;div class=&quot;interactive-frame-foot&quot;&gt;
    &lt;a href=&quot;/interactives/chapter04/riemann-sum.html&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;Mở minh hoạ ở cửa sổ riêng&lt;/a&gt;
  &lt;/div&gt;
&lt;/div&gt;

&lt;h2 id=&quot;tính-giới-hạn-bằng-công-thức-tổng&quot;&gt;Tính giới hạn bằng công thức tổng&lt;/h2&gt;

&lt;p&gt;Cần hai công thức (chứng minh bằng quy nạp, bài 00_04):&lt;/p&gt;

\[\sum_{i=1}^n i=\frac{n(n+1)}2,\qquad \sum_{i=1}^n i^2=\frac{n(n+1)(2n+1)}6 .\]

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Ví dụ 2.&lt;/strong&gt; Tính chính xác diện tích dưới $y=x^2$ trên $[0,1]$.&lt;/p&gt;

  &lt;p&gt;Với $x_i=i/n$:&lt;/p&gt;

\[R_n=\sum_{i=1}^n\left(\frac in\right)^2\frac1n=\frac1{n^3}\cdot\frac{n(n+1)(2n+1)}6=\frac{(n+1)(2n+1)}{6n^2}\ \longrightarrow\ \frac26=\frac13 .\]

  &lt;p&gt;Tương tự $L_n=\dfrac{(n-1)(2n-1)}{6n^2}\to\dfrac13$. Diện tích bằng $\dfrac13$.&lt;/p&gt;
&lt;/div&gt;

&lt;h2 id=&quot;hàm-đơn-điệu-chặn-trên-và-chặn-dưới&quot;&gt;Hàm đơn điệu: chặn trên và chặn dưới&lt;/h2&gt;

&lt;div class=&quot;textbook-theorem&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Định lý 1.&lt;/strong&gt; Giả sử $f$ tăng trên $[a,b]$ và $A$ là diện tích có dấu dưới đồ thị. Với phân hoạch đều $n$ đoạn,&lt;/p&gt;

\[L_n\le A\le R_n,\qquad R_n-L_n=\frac{\bigl(f(b)-f(a)\bigr)(b-a)}n .\]

  &lt;p&gt;Với $f$ giảm, đổi vai trò $L_n$ và $R_n$.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-proof&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Chứng minh.&lt;/strong&gt; Trên $[x_{i-1},x_i]$ ta có $f(x_{i-1})\le f(x)\le f(x_i)$, nên vùng dưới đồ thị trên đoạn này chứa hình chữ nhật cao $f(x_{i-1})$ và nằm trong hình chữ nhật cao $f(x_i)$. Cộng lại được $L_n\le A\le R_n$. Hiệu&lt;/p&gt;

\[R_n-L_n=\Delta x\sum_{i=1}^n\bigl(f(x_i)-f(x_{i-1})\bigr)=\Delta x\,\bigl(f(x_n)-f(x_0)\bigr)=\frac{b-a}n\bigl(f(b)-f(a)\bigr)\]

  &lt;p&gt;vì tổng là tổng lồng nhau (telescoping).&lt;/p&gt;
&lt;/div&gt;

&lt;p&gt;Hệ quả: với hàm đơn điệu, sai số của $L_n$ hay $R_n$ không quá $\dfrac{\lvert f(b)-f(a)\rvert(b-a)}n$, giảm như $1/n$.&lt;/p&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Ví dụ 3 (Quãng đường từ bảng vận tốc).&lt;/strong&gt; Vận tốc ô tô (m/s):&lt;/p&gt;

  &lt;table&gt;
    &lt;thead&gt;
      &lt;tr&gt;
        &lt;th&gt;$t$ (s)&lt;/th&gt;
        &lt;th&gt;0&lt;/th&gt;
        &lt;th&gt;10&lt;/th&gt;
        &lt;th&gt;20&lt;/th&gt;
        &lt;th&gt;30&lt;/th&gt;
        &lt;th&gt;40&lt;/th&gt;
        &lt;th&gt;50&lt;/th&gt;
      &lt;/tr&gt;
    &lt;/thead&gt;
    &lt;tbody&gt;
      &lt;tr&gt;
        &lt;td&gt;$v$ (m/s)&lt;/td&gt;
        &lt;td&gt;0&lt;/td&gt;
        &lt;td&gt;6&lt;/td&gt;
        &lt;td&gt;10&lt;/td&gt;
        &lt;td&gt;13&lt;/td&gt;
        &lt;td&gt;15&lt;/td&gt;
        &lt;td&gt;16&lt;/td&gt;
      &lt;/tr&gt;
    &lt;/tbody&gt;
  &lt;/table&gt;

  &lt;p&gt;Với $\Delta t=10$: $L_5=10(0+6+10+13+15)=440$ m, $R_5=10(6+10+13+15+16)=600$ m. Xe tăng tốc suốt (giả sử $v$ tăng), nên theo định lý 1 quãng đường thật nằm giữa 440 m và 600 m. Trung bình hai tổng cho ước lượng 520 m (đây là quy tắc hình thang, bài 04_05).&lt;/p&gt;
&lt;/div&gt;

&lt;h2 id=&quot;video-ngắn&quot;&gt;Video ngắn&lt;/h2&gt;

&lt;div class=&quot;reel-video&quot;&gt;
  &lt;video controls=&quot;&quot; playsinline=&quot;&quot; preload=&quot;metadata&quot; src=&quot;/public/videos/reels/riemann-sums.mp4&quot;&gt;&lt;/video&gt;
  &lt;p class=&quot;reel-caption&quot;&gt;Tổng Riemann trái, phải, giữa của x² trên [0, 2] với n từ 4 tới 2048, hội tụ về 8/3 (video không lời, khoảng 2 phút).&lt;/p&gt;
&lt;/div&gt;

&lt;h2 id=&quot;ứng-dụng&quot;&gt;Ứng dụng&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Vật lý.&lt;/strong&gt; Ví dụ 3: quãng đường là “diện tích” dưới đồ thị vận tốc. Tương tự, điện lượng là diện tích dưới đồ thị cường độ dòng điện, công là diện tích dưới đồ thị lực theo quãng đường.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Kinh tế: tổng chi phí từ chi phí biên.&lt;/strong&gt; Chi phí biên của một xưởng là $C&apos;(q)=50-0.2q$ (nghìn đồng/sản phẩm) với $0\le q\le100$. Chi phí tăng thêm khi sản xuất từ 0 đến 100 sản phẩm xấp xỉ bằng tổng giữa với $n=4$, $\Delta q=25$: các điểm giữa $12.5,\ 37.5,\ 62.5,\ 87.5$ cho&lt;/p&gt;

\[M_4=25\,(47.5+42.5+37.5+32.5)=4000\ \text{nghìn đồng}.\]

&lt;p&gt;Với hàm bậc nhất, tổng giữa cho đúng giá trị thật (bài tập 5).&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Học máy.&lt;/strong&gt; Diện tích dưới đường cong ROC (AUC) đo chất lượng một bộ phân loại. Đường cong chỉ biết tại vài điểm, nên AUC được tính bằng một tổng kiểu Riemann (quy tắc hình thang, bài 04_05).&lt;/p&gt;

&lt;h2 id=&quot;bài-tập&quot;&gt;Bài tập&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Cơ bản.&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;Tính $L_4$, $R_4$ cho $f(x)=x^3$ trên $[0,2]$. Diện tích thật bằng 4; giá trị này có nằm giữa hai tổng không?&lt;/li&gt;
  &lt;li&gt;Tính $R_n$ cho $f(x)=x$ trên $[0,1]$ và lấy giới hạn.&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Đáp án&lt;/summary&gt;

  &lt;ol&gt;
    &lt;li&gt;$\Delta x=0.5$. $L_4=0.5(0+0.125+1+3.375)=2.25$, $R_4=0.5(0.125+1+3.375+8)=6.25$. Có: $2.25\le4\le6.25$, vì $x^3$ tăng.&lt;/li&gt;
    &lt;li&gt;$R_n=\dfrac1{n^2}\cdot\dfrac{n(n+1)}2=\dfrac{n+1}{2n}\to\dfrac12$ (diện tích tam giác).&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;p&gt;&lt;strong&gt;Trung bình.&lt;/strong&gt;&lt;/p&gt;

&lt;ol start=&quot;3&quot;&gt;
  &lt;li&gt;Với $f(x)=x^2$ trên $[0,1]$, cần $n$ bao nhiêu để $R_n-L_n&amp;lt;0.01$?&lt;/li&gt;
  &lt;li&gt;Viết giới hạn $\displaystyle\lim_{n\to\infty}\sum_{i=1}^n\frac1n\sqrt{\frac in}$ dưới dạng diện tích dưới một đồ thị và đoán giá trị (sẽ tính được ở bài 04_03).&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Đáp án&lt;/summary&gt;

  &lt;ol start=&quot;3&quot;&gt;
    &lt;li&gt;$R_n-L_n=\dfrac{(1-0)(1-0)}n=\dfrac1n&amp;lt;0.01$ khi $n\ge101$.&lt;/li&gt;
    &lt;li&gt;Là $R_n$ của $f(x)=\sqrt x$ trên $[0,1]$. Giá trị $\tfrac23$.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;p&gt;&lt;strong&gt;Nâng cao.&lt;/strong&gt;&lt;/p&gt;

&lt;ol start=&quot;5&quot;&gt;
  &lt;li&gt;Chứng minh với $f(x)=px+q$, tổng giữa $M_n$ bằng diện tích thật với mọi $n$.&lt;/li&gt;
  &lt;li&gt;Chứng minh $\displaystyle\lim_{n\to\infty}\sum_{i=1}^n\frac{n}{n^2+i^2}$ là diện tích dưới $y=\dfrac1{1+x^2}$ trên $[0,1]$. (Giá trị là $\pi/4$, bài 04_03.)&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Gợi ý&lt;/summary&gt;

  &lt;ol start=&quot;5&quot;&gt;
    &lt;li&gt;Trên mỗi đoạn con, hình thang dưới đường thẳng có diện tích $\Delta x\cdot\dfrac{f(x_{i-1})+f(x_i)}2=\Delta x\,f(\text{điểm giữa})$ vì $f$ tuyến tính.&lt;/li&gt;
    &lt;li&gt;$\dfrac{n}{n^2+i^2}=\dfrac1n\cdot\dfrac1{1+(i/n)^2}$: đây là $R_n$ của $\dfrac1{1+x^2}$.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;h2 id=&quot;tóm-tắt&quot;&gt;Tóm tắt&lt;/h2&gt;

&lt;div class=&quot;content-box summary-box textbook-block&quot;&gt;
  &lt;ul&gt;
    &lt;li&gt;Tổng Riemann $\sum f(\xi_i)\Delta x_i$ xấp xỉ diện tích có dấu dưới đồ thị.&lt;/li&gt;
    &lt;li&gt;Tổng trái, phải, giữa ứng với ba cách chọn điểm mẫu; tổng giữa thường chính xác hơn.&lt;/li&gt;
    &lt;li&gt;Với phân hoạch đều, công thức $\sum i$, $\sum i^2$ cho phép tính $R_n$ và lấy giới hạn.&lt;/li&gt;
    &lt;li&gt;Hàm đơn điệu: diện tích nằm giữa $L_n$ và $R_n$, hai tổng cách nhau $\lvert f(b)-f(a)\rvert(b-a)/n$.&lt;/li&gt;
    &lt;li&gt;Quãng đường, điện lượng, tổng chi phí đều là “diện tích” dưới đồ thị tốc độ thay đổi.&lt;/li&gt;
  &lt;/ul&gt;
&lt;/div&gt;
</content>
 </entry>
 
 <entry>
   <title>Phương pháp Newton và tốc độ liên quan</title>
   <link href="https://calculus-self-learning.pages.dev/contents/vi/chapter03/03_05_Phuong_phap_Newton_va_toc_do_lien_quan/"/>
   <updated>2026-12-01T00:00:00+00:00</updated>
   <id>https://calculus-self-learning.pages.dev/contents/vi/chapter03/03_05_Phuong_phap_Newton_va_toc_do_lien_quan</id>
   <content type="html">&lt;div class=&quot;textbook-objectives&quot;&gt;

  &lt;p&gt;&lt;strong&gt;Mục tiêu.&lt;/strong&gt; Sau bài này bạn có thể:&lt;/p&gt;

  &lt;ul&gt;
    &lt;li&gt;viết công thức lặp Newton cho một phương trình $f(x)=0$ và tính vài bước lặp;&lt;/li&gt;
    &lt;li&gt;giải thích vì sao Newton hội tụ bậc hai gần nghiệm đơn, và nhận ra các trường hợp Newton thất bại;&lt;/li&gt;
    &lt;li&gt;giải bài toán tốc độ liên quan: lập hệ thức giữa các đại lượng, đạo hàm theo thời gian, thay số;&lt;/li&gt;
    &lt;li&gt;dùng Newton để tìm cực tiểu của một hàm (bước Newton trong tối ưu).&lt;/li&gt;
  &lt;/ul&gt;

&lt;/div&gt;

&lt;h2 id=&quot;vì-sao-cần-bài-này&quot;&gt;Vì sao cần bài này&lt;/h2&gt;

&lt;p&gt;Phương trình $x^3-2x-5=0$ có nghiệm giữa 2 và 3 (định lý giá trị trung gian, bài 01_06), nhưng không có công thức đơn giản. Máy tính tìm nghiệm như thế nào? Ý tưởng: thay đồ thị bằng tiếp tuyến (xấp xỉ tuyến tính, bài 02_04), giải phương trình tuyến tính, rồi lặp lại.&lt;/p&gt;

&lt;p&gt;Ý thứ hai của bài: khi các đại lượng liên hệ với nhau và cùng thay đổi theo thời gian, quy tắc chuỗi cho biết tốc độ của chúng liên hệ ra sao. Ví dụ: chân thang trượt ra xa tường với tốc độ biết trước, đỉnh thang trượt xuống nhanh bao nhiêu?&lt;/p&gt;

&lt;h2 id=&quot;phương-pháp-newton&quot;&gt;Phương pháp Newton&lt;/h2&gt;

&lt;p&gt;Tại $x_n$, tiếp tuyến của đồ thị là $y=f(x_n)+f&apos;(x_n)(x-x_n)$. Cho $y=0$ được điểm tiếp theo.&lt;/p&gt;

&lt;div class=&quot;textbook-definition&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Định nghĩa 1 (Lặp Newton).&lt;/strong&gt; Cho $f$ khả vi và điểm xuất phát $x_0$. Dãy Newton là&lt;/p&gt;

\[x_{n+1}=x_n-\frac{f(x_n)}{f&apos;(x_n)},\qquad n=0,1,2,\dots\]

  &lt;p&gt;với điều kiện $f&apos;(x_n)\ne0$.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Ví dụ 1 (Tính $\sqrt2$).&lt;/strong&gt; Với $f(x)=x^2-2$: $x_{n+1}=x_n-\dfrac{x_n^2-2}{2x_n}=\dfrac12\left(x_n+\dfrac2{x_n}\right)$. Từ $x_0=1$:&lt;/p&gt;

  &lt;table&gt;
    &lt;thead&gt;
      &lt;tr&gt;
        &lt;th&gt;$n$&lt;/th&gt;
        &lt;th&gt;$x_n$&lt;/th&gt;
        &lt;th&gt;sai số $\lvert x_n-\sqrt2\rvert$&lt;/th&gt;
      &lt;/tr&gt;
    &lt;/thead&gt;
    &lt;tbody&gt;
      &lt;tr&gt;
        &lt;td&gt;0&lt;/td&gt;
        &lt;td&gt;1&lt;/td&gt;
        &lt;td&gt;$4.1\cdot10^{-1}$&lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr&gt;
        &lt;td&gt;1&lt;/td&gt;
        &lt;td&gt;1.5&lt;/td&gt;
        &lt;td&gt;$8.6\cdot10^{-2}$&lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr&gt;
        &lt;td&gt;2&lt;/td&gt;
        &lt;td&gt;1.416667&lt;/td&gt;
        &lt;td&gt;$2.5\cdot10^{-3}$&lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr&gt;
        &lt;td&gt;3&lt;/td&gt;
        &lt;td&gt;1.4142157&lt;/td&gt;
        &lt;td&gt;$2.1\cdot10^{-6}$&lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr&gt;
        &lt;td&gt;4&lt;/td&gt;
        &lt;td&gt;1.41421356237&lt;/td&gt;
        &lt;td&gt;$1.6\cdot10^{-12}$&lt;/td&gt;
      &lt;/tr&gt;
    &lt;/tbody&gt;
  &lt;/table&gt;

  &lt;p&gt;Số chữ số đúng gần như gấp đôi sau mỗi bước. Đây chính là phương pháp “Babylon” tính căn bậc hai.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-theorem&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Định lý 1 (Hội tụ bậc hai).&lt;/strong&gt; Giả sử $f$ có đạo hàm cấp hai liên tục gần $r$, $f(r)=0$ và $f&apos;(r)\ne0$. Khi đó với $x_n$ đủ gần $r$,&lt;/p&gt;

\[x_{n+1}-r=\frac{f&apos;&apos;(\xi_n)}{2f&apos;(x_n)}(x_n-r)^2\]

  &lt;p&gt;với $\xi_n$ nằm giữa $x_n$ và $r$. Do đó tồn tại $\delta&amp;gt;0$ và $M$ sao cho nếu $\lvert x_0-r\rvert&amp;lt;\delta$ thì dãy hội tụ về $r$ và $\lvert x_{n+1}-r\rvert\le M\lvert x_n-r\rvert^2$.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-proof&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Chứng minh.&lt;/strong&gt; Khai triển Taylor bậc nhất có phần dư Lagrange (chương 4) quanh $x_n$:&lt;/p&gt;

\[0=f(r)=f(x_n)+f&apos;(x_n)(r-x_n)+\tfrac12f&apos;&apos;(\xi_n)(r-x_n)^2 .\]

  &lt;p&gt;Chia cho $f&apos;(x_n)$ và chuyển vế: $x_n-\dfrac{f(x_n)}{f&apos;(x_n)}-r=\dfrac{f&apos;&apos;(\xi_n)}{2f&apos;(x_n)}(x_n-r)^2$, vế trái là $x_{n+1}-r$.&lt;/p&gt;

  &lt;p&gt;Vì $f&apos;(r)\ne0$ và $f&apos;,f&apos;&apos;$ liên tục, có $\delta&amp;gt;0$ để trên $[r-\delta,r+\delta]$ ta có $\lvert f&apos;\rvert\ge m&amp;gt;0$ và $\lvert f&apos;&apos;\rvert\le K$. Đặt $M=K/(2m)$ và thu nhỏ $\delta$ để $M\delta&amp;lt;1$. Nếu $\lvert x_n-r\rvert&amp;lt;\delta$ thì $\lvert x_{n+1}-r\rvert\le M\lvert x_n-r\rvert^2\le (M\delta)\lvert x_n-r\rvert&amp;lt;\delta$. Quy nạp, sai số giảm ít nhất theo cấp số nhân công bội $M\delta&amp;lt;1$, nên dãy hội tụ về $r$.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;content-box warning-box textbook-block&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Khi nào Newton thất bại.&lt;/strong&gt;&lt;/p&gt;

  &lt;ul&gt;
    &lt;li&gt;$f&apos;(x_n)=0$ hoặc rất nhỏ: tiếp tuyến gần nằm ngang, bước nhảy rất xa.&lt;/li&gt;
    &lt;li&gt;Xuất phát quá xa nghiệm: dãy có thể dao động hoặc chạy sang nghiệm khác.&lt;/li&gt;
    &lt;li&gt;$f&apos;(r)$ không tồn tại: với $f(x)=x^{1/3}$, $x_{n+1}=x_n-\dfrac{x_n^{1/3}}{\tfrac13x_n^{-2/3}}=-2x_n$, dãy phân kỳ với mọi $x_0\ne0$.&lt;/li&gt;
    &lt;li&gt;Nghiệm bội ($f&apos;(r)=0$): vẫn hội tụ nhưng chỉ tuyến tính (bài tập 6).&lt;/li&gt;
  &lt;/ul&gt;
&lt;/div&gt;

&lt;div class=&quot;interactive-frame&quot;&gt;
  &lt;div class=&quot;interactive-frame-head&quot;&gt;
    &lt;div class=&quot;interactive-frame-title&quot;&gt;Phương pháp Newton&lt;/div&gt;
    &lt;div class=&quot;interactive-frame-desc&quot;&gt;Kéo x₀, tăng số bước và xem sai số giảm.&lt;/div&gt;
  &lt;/div&gt;
  &lt;iframe src=&quot;/interactives/chapter03/newton-method.html&quot; title=&quot;Phương pháp Newton&quot; loading=&quot;lazy&quot; style=&quot;height: 700px;&quot;&gt;&lt;/iframe&gt;
  &lt;div class=&quot;interactive-frame-foot&quot;&gt;
    &lt;a href=&quot;/interactives/chapter03/newton-method.html&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;Mở minh hoạ ở cửa sổ riêng&lt;/a&gt;
  &lt;/div&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Ví dụ 2.&lt;/strong&gt; Giải $x^3-2x-5=0$ với $x_0=2$: $f&apos;(x)=3x^2-2$.&lt;/p&gt;

  &lt;p&gt;$x_1=2-\dfrac{-1}{10}=2.1$, $x_2=2.1-\dfrac{0.061}{11.23}\approx2.094568$, $x_3\approx2.0945515$. Nghiệm $r\approx2.0945515$ (đúng 7 chữ số sau 3 bước).&lt;/p&gt;
&lt;/div&gt;

&lt;h2 id=&quot;video-ngắn&quot;&gt;Video ngắn&lt;/h2&gt;

&lt;div class=&quot;reel-video&quot;&gt;
  &lt;video controls=&quot;&quot; playsinline=&quot;&quot; preload=&quot;metadata&quot; src=&quot;/public/videos/reels/newton-method.mp4&quot;&gt;&lt;/video&gt;
  &lt;p class=&quot;reel-caption&quot;&gt;Phương pháp Newton tìm √2 từ x₀ = 3: số chữ số đúng gần như gấp đôi mỗi bước, so với chia đôi (video không lời, khoảng 2 phút).&lt;/p&gt;
&lt;/div&gt;

&lt;h2 id=&quot;tốc-độ-liên-quan&quot;&gt;Tốc độ liên quan&lt;/h2&gt;

&lt;p&gt;Nếu các đại lượng $x(t),y(t)$ liên hệ bởi một phương trình $F(x,y)=0$ đúng với mọi $t$, đạo hàm hai vế theo $t$ (quy tắc chuỗi, đạo hàm hàm ẩn ở bài 02_03) cho hệ thức giữa $\dfrac{dx}{dt}$ và $\dfrac{dy}{dt}$.&lt;/p&gt;

&lt;p&gt;Quy trình:&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;Vẽ hình, đặt tên các đại lượng thay đổi theo thời gian.&lt;/li&gt;
  &lt;li&gt;Viết hệ thức giữa chúng (đúng tại mọi thời điểm, chưa thay số).&lt;/li&gt;
  &lt;li&gt;Đạo hàm theo $t$.&lt;/li&gt;
  &lt;li&gt;Bây giờ mới thay các giá trị tại thời điểm cần tính.&lt;/li&gt;
&lt;/ol&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Ví dụ 3 (Cái thang).&lt;/strong&gt; Thang dài 5 m dựa vào tường. Chân thang trượt ra xa tường với tốc độ 0.5 m/s. Khi chân thang cách tường 3 m, đỉnh thang trượt xuống nhanh bao nhiêu?&lt;/p&gt;

  &lt;p&gt;Gọi $x$ là khoảng cách chân thang đến tường, $y$ là độ cao đỉnh thang. $x^2+y^2=25$. Đạo hàm theo $t$: $2x\dfrac{dx}{dt}+2y\dfrac{dy}{dt}=0$. Khi $x=3$ thì $y=4$, nên&lt;/p&gt;

\[\frac{dy}{dt}=-\frac xy\frac{dx}{dt}=-\frac34\cdot0.5=-0.375\ \text{m/s}.\]

  &lt;p&gt;Đỉnh thang đi xuống với tốc độ 0.375 m/s. Khi $y\to0$ thì $\lvert dy/dt\rvert\to\infty$: mô hình không còn đúng khi đỉnh thang rời tường.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;interactive-frame&quot;&gt;
  &lt;div class=&quot;interactive-frame-head&quot;&gt;
    &lt;div class=&quot;interactive-frame-title&quot;&gt;Cái thang trượt&lt;/div&gt;
    &lt;div class=&quot;interactive-frame-desc&quot;&gt;Bấm Chạy hoặc kéo chân thang; so dx/dt với dy/dt.&lt;/div&gt;
  &lt;/div&gt;
  &lt;iframe src=&quot;/interactives/chapter03/ladder-related-rates.html&quot; title=&quot;Cái thang trượt&quot; loading=&quot;lazy&quot; style=&quot;height: 700px;&quot;&gt;&lt;/iframe&gt;
  &lt;div class=&quot;interactive-frame-foot&quot;&gt;
    &lt;a href=&quot;/interactives/chapter03/ladder-related-rates.html&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;Mở minh hoạ ở cửa sổ riêng&lt;/a&gt;
  &lt;/div&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Ví dụ 4 (Bể hình nón).&lt;/strong&gt; Bể hình nón ngược có bán kính đáy 2 m và cao 4 m. Nước chảy vào với tốc độ 2 m³/phút. Khi mực nước cao 3 m, mực nước dâng nhanh bao nhiêu?&lt;/p&gt;

  &lt;p&gt;Ở độ cao $h$, mặt nước có bán kính $r=h/2$ (tam giác đồng dạng). Thể tích $V=\tfrac13\pi r^2h=\dfrac{\pi h^3}{12}$. Đạo hàm: $\dfrac{dV}{dt}=\dfrac{\pi h^2}{4}\dfrac{dh}{dt}$. Tại $h=3$:&lt;/p&gt;

\[\frac{dh}{dt}=\frac{4\cdot2}{9\pi}=\frac{8}{9\pi}\approx0.283\ \text{m/phút}.\]

&lt;/div&gt;

&lt;h2 id=&quot;ứng-dụng&quot;&gt;Ứng dụng&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Học máy: bước Newton trong tối ưu.&lt;/strong&gt; Tìm cực tiểu của $f$ là tìm nghiệm của $f&apos;(x)=0$. Áp dụng Newton cho $f&apos;$:&lt;/p&gt;

\[x_{n+1}=x_n-\frac{f&apos;(x_n)}{f&apos;&apos;(x_n)} .\]

&lt;p&gt;Ví dụ $f(x)=x-\ln x$ trên $(0,\infty)$: $f&apos;=1-\tfrac1x$, $f&apos;&apos;=\tfrac1{x^2}$, nên $x_{n+1}=2x_n-x_n^2$ và $1-x_{n+1}=(1-x_n)^2$. Từ $x_0=0.5$: $0.75,\ 0.9375,\ 0.99609,\dots\to1$, sai số bình phương lên mỗi bước. So với gradient descent $x_{n+1}=x_n-\eta f&apos;(x_n)$, bước Newton tự chọn “tốc độ học” $\eta=1/f&apos;&apos;(x_n)$. Trong nhiều biến, $f&apos;&apos;$ được thay bằng ma trận Hessian (chương 12).&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Kinh tế: chi phí thay đổi theo thời gian.&lt;/strong&gt; Chi phí $C(q)=0.01q^2+5q+200$ và sản lượng tăng $10$ đơn vị/tuần. Khi $q=100$: $\dfrac{dC}{dt}=C&apos;(q)\dfrac{dq}{dt}=(0.02\cdot100+5)\cdot10=70$ (nghìn đồng/tuần).&lt;/p&gt;

&lt;h2 id=&quot;bài-tập&quot;&gt;Bài tập&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Cơ bản.&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;Viết công thức lặp Newton tính $\sqrt[3]{5}$ và tính $x_1,x_2$ từ $x_0=2$.&lt;/li&gt;
  &lt;li&gt;Bóng bay hình cầu được bơm với tốc độ 100 cm³/s. Bán kính tăng nhanh bao nhiêu khi $r=5$ cm?&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Đáp án&lt;/summary&gt;

  &lt;ol&gt;
    &lt;li&gt;$f(x)=x^3-5$: $x_{n+1}=x_n-\dfrac{x_n^3-5}{3x_n^2}=\dfrac{2x_n^3+5}{3x_n^2}$. $x_1=\tfrac{21}{12}=1.75$, $x_2\approx1.7109$ (giá trị đúng $1.70998$).&lt;/li&gt;
    &lt;li&gt;$V=\tfrac43\pi r^3$, $\dfrac{dV}{dt}=4\pi r^2\dfrac{dr}{dt}$, nên $\dfrac{dr}{dt}=\dfrac{100}{100\pi}=\dfrac1\pi\approx0.318$ cm/s.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;p&gt;&lt;strong&gt;Trung bình.&lt;/strong&gt;&lt;/p&gt;

&lt;ol start=&quot;3&quot;&gt;
  &lt;li&gt;Chứng minh lặp Newton cho $f(x)=\tfrac1x-a$ ($a&amp;gt;0$) là $x_{n+1}=x_n(2-ax_n)$: tính $1/a$ chỉ bằng phép nhân và trừ.&lt;/li&gt;
  &lt;li&gt;Một người cao 1.8 m đi ra xa cột đèn cao 6 m với tốc độ 1.2 m/s. Bóng người dài ra nhanh bao nhiêu? Đầu bóng di chuyển nhanh bao nhiêu?&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Đáp án&lt;/summary&gt;

  &lt;ol start=&quot;3&quot;&gt;
    &lt;li&gt;$f&apos;(x)=-\tfrac1{x^2}$, $x_{n+1}=x_n+x_n^2\left(\tfrac1{x_n}-a\right)=2x_n-ax_n^2$.&lt;/li&gt;
    &lt;li&gt;Gọi $x$ là khoảng cách đến cột, $s$ là chiều dài bóng. Tam giác đồng dạng: $\dfrac{s}{1.8}=\dfrac{x+s}{6}$, nên $s=\tfrac37x$. $\dfrac{ds}{dt}=\tfrac37\cdot1.2\approx0.514$ m/s. Đầu bóng ở vị trí $x+s$, tốc độ $1.2+0.514\approx1.714$ m/s, không phụ thuộc $x$.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;p&gt;&lt;strong&gt;Nâng cao.&lt;/strong&gt;&lt;/p&gt;

&lt;ol start=&quot;5&quot;&gt;
  &lt;li&gt;Với $f(x)=\arctan x$, thử Newton từ $x_0=1$ và $x_0=1.5$. Hiện tượng gì xảy ra?&lt;/li&gt;
  &lt;li&gt;Áp dụng Newton cho $f(x)=x^2$ (nghiệm kép $r=0$). Chứng minh $x_{n+1}=x_n/2$. Vì sao định lý 1 không áp dụng được? Đề xuất một sửa đổi cho nghiệm bội $m$.&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Gợi ý&lt;/summary&gt;

  &lt;ol start=&quot;5&quot;&gt;
    &lt;li&gt;$x_{n+1}=x_n-(1+x_n^2)\arctan x_n$. Từ $x_0=1$: $x_1\approx-0.571$, $x_2\approx0.117$, $x_3\approx-0.001$, hội tụ về 0. Từ $x_0=1.5$: $x_1\approx-1.694$, $x_2\approx2.321$, dãy đổi dấu và $\lvert x_n\rvert$ tăng, phân kỳ. Ngưỡng chuyển là $x_0\approx1.39$.&lt;/li&gt;
    &lt;li&gt;$x_n-\dfrac{x_n^2}{2x_n}=\dfrac{x_n}2$: hội tụ tuyến tính. Định lý 1 cần $f&apos;(r)\ne0$. Với nghiệm bội $m$, dùng $x_{n+1}=x_n-m\dfrac{f(x_n)}{f&apos;(x_n)}$ (với $f=x^2$, $m=2$ cho nghiệm đúng sau một bước).&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;h2 id=&quot;tóm-tắt&quot;&gt;Tóm tắt&lt;/h2&gt;

&lt;div class=&quot;content-box summary-box textbook-block&quot;&gt;
  &lt;ul&gt;
    &lt;li&gt;Newton: $x_{n+1}=x_n-f(x_n)/f&apos;(x_n)$, là nghiệm của tiếp tuyến.&lt;/li&gt;
    &lt;li&gt;Gần nghiệm đơn, sai số bước sau tỉ lệ với bình phương sai số bước trước: số chữ số đúng gần gấp đôi mỗi bước.&lt;/li&gt;
    &lt;li&gt;Newton có thể thất bại khi $f&apos;$ gần 0, khi xuất phát xa nghiệm, hoặc khi $f&apos;(r)$ không tồn tại; nghiệm bội chỉ hội tụ tuyến tính.&lt;/li&gt;
    &lt;li&gt;Tốc độ liên quan: viết hệ thức đúng mọi lúc, đạo hàm theo $t$, rồi mới thay số.&lt;/li&gt;
    &lt;li&gt;Tối ưu: Newton cho $f&apos;$ là $x_{n+1}=x_n-f&apos;(x_n)/f&apos;&apos;(x_n)$.&lt;/li&gt;
  &lt;/ul&gt;
&lt;/div&gt;
</content>
 </entry>
 
 <entry>
   <title>Bài toán tối ưu một biến</title>
   <link href="https://calculus-self-learning.pages.dev/contents/vi/chapter03/03_04_Bai_toan_toi_uu_mot_bien/"/>
   <updated>2026-12-01T00:00:00+00:00</updated>
   <id>https://calculus-self-learning.pages.dev/contents/vi/chapter03/03_04_Bai_toan_toi_uu_mot_bien</id>
   <content type="html">&lt;div class=&quot;textbook-objectives&quot;&gt;

  &lt;p&gt;&lt;strong&gt;Mục tiêu học tập.&lt;/strong&gt; Sau bài này, người học có thể:&lt;/p&gt;

  &lt;ul&gt;
    &lt;li&gt;chuyển một bài toán thực tế thành bài toán tìm max, min của một hàm một biến trên một miền xác định rõ;&lt;/li&gt;
    &lt;li&gt;tìm nghiệm tối ưu và kiểm tra nó là max hay min toàn cục, kể cả ở biên;&lt;/li&gt;
    &lt;li&gt;suy ra định luật khúc xạ Snell từ nguyên lý thời gian ngắn nhất;&lt;/li&gt;
    &lt;li&gt;giải bài toán bình phương tối thiểu một tham số, bước đầu của hồi quy tuyến tính.&lt;/li&gt;
  &lt;/ul&gt;

&lt;/div&gt;

&lt;h2 id=&quot;vì-sao-cần-bài-này&quot;&gt;Vì sao cần bài này&lt;/h2&gt;

&lt;p&gt;Một lon nước ngọt chứa 330 ml. Nhà sản xuất muốn dùng ít nhôm nhất. Lon thấp và to, hay cao và mảnh? Đây là bài toán: trong mọi hình trụ có thể tích 330 cm³, tìm hình có diện tích toàn phần nhỏ nhất. Hầu hết bài toán “tốt nhất” trong kỹ thuật và kinh tế đi theo cùng một quy trình.&lt;/p&gt;

&lt;h2 id=&quot;quy-trình&quot;&gt;Quy trình&lt;/h2&gt;

&lt;ol&gt;
  &lt;li&gt;Đặt biến, ghi đơn vị. Viết đại lượng cần tối ưu theo các biến.&lt;/li&gt;
  &lt;li&gt;Dùng ràng buộc để đưa về một biến. Xác định miền của biến (thường là một khoảng hoặc đoạn).&lt;/li&gt;
  &lt;li&gt;Tìm điểm tới hạn. Nếu miền là đoạn, so sánh với giá trị ở hai đầu.&lt;/li&gt;
  &lt;li&gt;Chứng minh đó là max hoặc min toàn cục: so sánh giá trị, hoặc dùng dấu $f&apos;$, hoặc hàm lồi (bài 03_02).&lt;/li&gt;
  &lt;li&gt;Trả lời câu hỏi ban đầu, có đơn vị, kiểm tra tính hợp lý.&lt;/li&gt;
&lt;/ol&gt;

&lt;div class=&quot;textbook-theorem&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Định lý 1 (Một điểm tới hạn duy nhất).&lt;/strong&gt; Cho $f$ khả vi trên khoảng $I$ và có đúng một điểm tới hạn $c$ trong $I$. Nếu $c$ là cực tiểu địa phương thì $c$ là cực tiểu toàn cục trên $I$ (tương tự cho cực đại).&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-proof&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Chứng minh.&lt;/strong&gt; Giả sử có $d\in I$, chẳng hạn $d&amp;gt;c$, với $f(d)&amp;lt;f(c)$. Vì $c$ là cực tiểu địa phương, có $\delta&amp;gt;0$ để $f(x)\ge f(c)$ trên $[c,c+\delta]$. Trên $[c,d]$, $f$ đạt max tại một điểm $e$, và $f(e)\ge f(c)&amp;gt;f(d)$ nên $e\ne d$. Nếu $e\in(c,d)$ thì theo Fermat $f&apos;(e)=0$: một điểm tới hạn thứ hai. Nếu $e=c$ thì $f\le f(c)$ trên $[c,d]$, kết hợp với trên ta có $f$ hằng trên $[c,c+\delta]$, nên mọi điểm của $(c,c+\delta)$ đều là điểm tới hạn. Cả hai trường hợp đều mâu thuẫn.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Ví dụ 1 (Rào đất ven sông).&lt;/strong&gt; Có 100 m lưới để rào một mảnh đất hình chữ nhật dọc bờ sông (cạnh giáp sông không cần rào). Diện tích lớn nhất bao nhiêu?&lt;/p&gt;

  &lt;p&gt;Gọi $x$ là cạnh vuông góc với sông. Cạnh song song dài $100-2x$. Diện tích $A(x)=x(100-2x)$, $x\in[0,50]$. $A&apos;(x)=100-4x=0$ tại $x=25$. $A(0)=A(50)=0$, $A(25)=1250$. Diện tích lớn nhất $1250$ m², với kích thước $25\times50$.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Ví dụ 2 (Lon nước).&lt;/strong&gt; Hình trụ bán kính $r$, chiều cao $h$, thể tích $V=\pi r^2h=330$. Diện tích toàn phần&lt;/p&gt;

\[S=2\pi r^2+2\pi rh=2\pi r^2+\frac{2V}r,\qquad r&amp;gt;0 .\]

  &lt;p&gt;$S&apos;(r)=4\pi r-\dfrac{2V}{r^2}=0$ khi $r^3=\dfrac V{2\pi}$, tức $r=\left(\tfrac{330}{2\pi}\right)^{1/3}\approx3{,}745$ cm. Khi đó $h=\dfrac V{\pi r^2}=2r\approx7{,}49$ cm và $S\approx264{,}4$ cm². $S&apos;&apos;=4\pi+\dfrac{4V}{r^3}&amp;gt;0$ nên $S$ lồi trên $(0,\infty)$, đây là min toàn cục.&lt;/p&gt;

  &lt;p&gt;Kết luận: lon tốn ít vật liệu nhất có chiều cao bằng đường kính. Với $r=3{,}3$ cm, gần cỡ lon thật, $S\approx268{,}4$ cm², chỉ hơn tối ưu 1,5%. Lon thật cao hơn vì nắp và đáy làm dày hơn thân, và vì lon mảnh dễ cầm.&lt;/p&gt;
&lt;/div&gt;

&lt;h2 id=&quot;video-ngắn&quot;&gt;Video ngắn&lt;/h2&gt;

&lt;div class=&quot;reel-video&quot;&gt;
  &lt;video controls=&quot;&quot; playsinline=&quot;&quot; preload=&quot;metadata&quot; src=&quot;/public/videos/reels/optimal-can.mp4&quot;&gt;&lt;/video&gt;
  &lt;p class=&quot;reel-caption&quot;&gt;Lon nước tiết kiệm nhất: lon trụ thể tích 330 cm³, đổi bán kính; diện tích nhỏ nhất khi chiều cao bằng đường kính, lúc đó A′(r) = 0 (video không lời, khoảng 2 phút).&lt;/p&gt;
&lt;/div&gt;

&lt;h2 id=&quot;ứng-dụng&quot;&gt;Ứng dụng&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Vật lý: định luật Snell từ nguyên lý Fermat.&lt;/strong&gt; Ánh sáng đi từ điểm $A$ (cao $a$ trên mặt nước) đến điểm $B$ (sâu $b$ dưới mặt nước), hai điểm cách nhau $d$ theo phương ngang; vận tốc trong không khí $v_1$, trong nước $v_2$. Nếu tia cắt mặt nước tại hoành độ $x$, thời gian đi là&lt;/p&gt;

\[T(x)=\frac{\sqrt{a^2+x^2}}{v_1}+\frac{\sqrt{b^2+(d-x)^2}}{v_2} .\]

&lt;p&gt;$T&apos;(x)=\dfrac{x}{v_1\sqrt{a^2+x^2}}-\dfrac{d-x}{v_2\sqrt{b^2+(d-x)^2}}=\dfrac{\sin\theta_1}{v_1}-\dfrac{\sin\theta_2}{v_2}$, với $\theta_1,\theta_2$ là góc tới và góc khúc xạ. $T&apos;=0$ cho $\dfrac{\sin\theta_1}{v_1}=\dfrac{\sin\theta_2}{v_2}$: định luật Snell. Cả hai số hạng của $T$ đều lồi, nên điểm dừng là min toàn cục.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Kinh tế: giá bán tối ưu.&lt;/strong&gt; Cầu $p=100-0{,}5q$ (nghìn đồng), chi phí $C=20q+500$. Lợi nhuận $P(q)=(100-0{,}5q)q-20q-500=80q-0{,}5q^2-500$, $P&apos;=80-q=0$ tại $q=80$, giá $p=60$, lợi nhuận $2700$. $P&apos;&apos;=-1&amp;lt;0$ nên là max.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Học máy: bình phương tối thiểu một tham số.&lt;/strong&gt; Tìm $w$ để đường $y=wx$ khớp nhất với dữ liệu $(1,2),(2,3),(3,7)$ theo nghĩa cực tiểu $L(w)=\sum(y_i-wx_i)^2$. $L&apos;(w)=-2\sum x_i(y_i-wx_i)=0$ cho&lt;/p&gt;

\[w=\frac{\sum x_iy_i}{\sum x_i^2}=\frac{2+6+21}{1+4+9}=\frac{29}{14}\approx2{,}071 .\]

&lt;p&gt;$L&apos;&apos;=2\sum x_i^2&amp;gt;0$, nên đây là min toàn cục. Hồi quy tuyến tính nhiều biến (chương 12) làm đúng việc này với gradient.&lt;/p&gt;

&lt;h2 id=&quot;bài-tập&quot;&gt;Bài tập&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Mức cơ bản.&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;Hai số dương có tổng 20. Tích lớn nhất bằng bao nhiêu?&lt;/li&gt;
  &lt;li&gt;Tìm điểm trên parabol $y=x^2$ gần điểm $(0,2)$ nhất.&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Đáp án&lt;/summary&gt;

  &lt;ol&gt;
    &lt;li&gt;$x(20-x)$ lớn nhất khi $x=10$: tích $100$.&lt;/li&gt;
    &lt;li&gt;Cực tiểu $D(x)=x^2+(x^2-2)^2$: $D&apos;=2x(2x^2-3)=0$, $x=\pm\sqrt{3/2}$. Điểm $(\pm\sqrt{1{,}5};\ 1{,}5)$, khoảng cách $\tfrac{\sqrt7}2\approx1{,}32$.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;p&gt;&lt;strong&gt;Mức vận dụng.&lt;/strong&gt;&lt;/p&gt;

&lt;ol start=&quot;3&quot;&gt;
  &lt;li&gt;Từ tấm bìa vuông cạnh 12 cm, cắt bốn hình vuông cạnh $x$ ở bốn góc rồi gấp thành hộp không nắp. Tìm $x$ để thể tích lớn nhất.&lt;/li&gt;
  &lt;li&gt;Một cửa sổ gồm hình chữ nhật và nửa hình tròn phía trên, chu vi 6 m. Tìm bán kính để cửa sổ có diện tích lớn nhất.&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Đáp án&lt;/summary&gt;

  &lt;ol start=&quot;3&quot;&gt;
    &lt;li&gt;$V=x(12-2x)^2$, $x\in[0,6]$. $V&apos;=(12-2x)(12-6x)=0$ tại $x=2$. $V=128$ cm³.&lt;/li&gt;
    &lt;li&gt;Chiều rộng $2r$, chiều cao $h$: $2r+2h+\pi r=6$. $A=2rh+\tfrac12\pi r^2=r(6-2r-\pi r)+\tfrac12\pi r^2$. $A&apos;=6-4r-\pi r=0$, $r=\tfrac6{4+\pi}\approx0{,}84$ m.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;p&gt;&lt;strong&gt;Mức nâng cao.&lt;/strong&gt;&lt;/p&gt;

&lt;ol start=&quot;5&quot;&gt;
  &lt;li&gt;Chứng minh rằng với lon có thể tích $V$ mà nắp và đáy dày gấp $k$ lần thân, lượng vật liệu nhỏ nhất khi $h=2kr$.&lt;/li&gt;
  &lt;li&gt;Tổng quát hoá bài bình phương tối thiểu: tìm $b$ cực tiểu $\sum(y_i-b)^2$. Còn $\sum\lvert y_i-b\rvert$ thì sao?&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Gợi ý&lt;/summary&gt;

  &lt;ol start=&quot;5&quot;&gt;
    &lt;li&gt;Vật liệu tỉ lệ $M=2k\pi r^2+2\pi rh=2k\pi r^2+\tfrac{2V}r$. $M&apos;=0$ cho $r^3=\tfrac V{2k\pi}$, tức $\pi r^2h=V=2k\pi r^3$, $h=2kr$.&lt;/li&gt;
    &lt;li&gt;$b=\bar y$ (trung bình). Với trị tuyệt đối, đạo hàm (khi tồn tại) là số điểm $y_i&amp;lt;b$ trừ số điểm $y_i&amp;gt;b$; cực tiểu tại trung vị.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;h2 id=&quot;tóm-tắt&quot;&gt;Tóm tắt&lt;/h2&gt;

&lt;div class=&quot;content-box summary-box textbook-block&quot;&gt;
  &lt;ul&gt;
    &lt;li&gt;Quy trình: đặt biến, viết hàm mục tiêu, đưa về một biến bằng ràng buộc, xác định miền, tìm điểm tới hạn, so sánh với biên, trả lời có đơn vị.&lt;/li&gt;
    &lt;li&gt;Một điểm tới hạn duy nhất là cực tiểu địa phương thì là cực tiểu toàn cục. Hàm lồi: điểm dừng là min toàn cục.&lt;/li&gt;
    &lt;li&gt;Lon tối ưu có $h=2r$; định luật Snell là điều kiện $T&apos;=0$; bình phương tối thiểu cho $w=\sum x_iy_i/\sum x_i^2$.&lt;/li&gt;
  &lt;/ul&gt;
&lt;/div&gt;
</content>
 </entry>
 
 <entry>
   <title>Khảo sát và vẽ đồ thị hàm số</title>
   <link href="https://calculus-self-learning.pages.dev/contents/vi/chapter03/03_03_Khao_sat_va_ve_do_thi_ham_so/"/>
   <updated>2026-12-01T00:00:00+00:00</updated>
   <id>https://calculus-self-learning.pages.dev/contents/vi/chapter03/03_03_Khao_sat_va_ve_do_thi_ham_so</id>
   <content type="html">&lt;div class=&quot;textbook-objectives&quot;&gt;

  &lt;p&gt;&lt;strong&gt;Mục tiêu học tập.&lt;/strong&gt; Sau bài này, người học có thể:&lt;/p&gt;

  &lt;ul&gt;
    &lt;li&gt;tìm tiệm cận xiên $y=ax+b$ bằng hai giới hạn;&lt;/li&gt;
    &lt;li&gt;khảo sát đầy đủ một hàm và vẽ đồ thị đúng dáng mà không cần máy;&lt;/li&gt;
    &lt;li&gt;đọc thông tin vật lý từ đồ thị: vị trí cân bằng, năng lượng liên kết, điểm tăng trưởng nhanh nhất.&lt;/li&gt;
  &lt;/ul&gt;

&lt;/div&gt;

&lt;h2 id=&quot;vì-sao-cần-bài-này&quot;&gt;Vì sao cần bài này&lt;/h2&gt;

&lt;p&gt;Phần mềm vẽ đồ thị chỉ vẽ trong khung bạn chọn. Đồ thị của $f(x)=\dfrac{x^2}{x-1}$ trên $[-100,100]$ trông như hai đường thẳng; trên $[0{,}9;1{,}1]$ trông như hai cột thẳng đứng. Cả hai đều không cho thấy cực trị ở đâu. Khảo sát bằng đạo hàm cho biết trước những điểm quan trọng, để chọn khung nhìn đúng và hiểu đồ thị đang nói gì.&lt;/p&gt;

&lt;h2 id=&quot;tiệm-cận-xiên&quot;&gt;Tiệm cận xiên&lt;/h2&gt;

&lt;div class=&quot;textbook-definition&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Định nghĩa 1 (Tiệm cận xiên).&lt;/strong&gt; Đường thẳng $y=ax+b$ là &lt;em&gt;tiệm cận xiên&lt;/em&gt; của đồ thị $f$ khi $x\to+\infty$ nếu $\lim_{x\to+\infty}\big(f(x)-ax-b\big)=0$. Tương tự với $x\to-\infty$.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-theorem&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Định lý 1.&lt;/strong&gt; $y=ax+b$ là tiệm cận xiên khi $x\to+\infty$ khi và chỉ khi&lt;/p&gt;

\[a=\lim_{x\to+\infty}\frac{f(x)}x,\qquad b=\lim_{x\to+\infty}\big(f(x)-ax\big)\]

  &lt;p&gt;và cả hai giới hạn hữu hạn.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-proof&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Chứng minh.&lt;/strong&gt; Nếu $f(x)-ax-b\to0$ thì chia cho $x$: $\dfrac{f(x)}x-a-\dfrac bx\to0$, nên $\dfrac{f(x)}x\to a$; và $f(x)-ax\to b$. Ngược lại, nếu hai giới hạn tồn tại thì $f(x)-ax-b\to b-b=0$.&lt;/p&gt;
&lt;/div&gt;

&lt;h2 id=&quot;quy-trình-khảo-sát&quot;&gt;Quy trình khảo sát&lt;/h2&gt;

&lt;ol&gt;
  &lt;li&gt;Miền xác định, tính chẵn lẻ, tuần hoàn (nếu có), giao với các trục.&lt;/li&gt;
  &lt;li&gt;Tiệm cận đứng (tại điểm biên của miền xác định), tiệm cận ngang hoặc xiên.&lt;/li&gt;
  &lt;li&gt;$f&apos;$: khoảng tăng giảm, cực trị. Lập bảng biến thiên.&lt;/li&gt;
  &lt;li&gt;$f&apos;&apos;$: khoảng lồi lõm, điểm uốn.&lt;/li&gt;
  &lt;li&gt;Tính vài giá trị, vẽ tiệm cận trước, rồi vẽ đồ thị theo bảng.&lt;/li&gt;
&lt;/ol&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Ví dụ 1.&lt;/strong&gt; Khảo sát $f(x)=\dfrac{x^2}{x-1}$.&lt;/p&gt;

  &lt;p&gt;&lt;em&gt;Miền xác định:&lt;/em&gt; $x\ne1$. Giao trục: $(0,0)$.&lt;/p&gt;

  &lt;p&gt;&lt;em&gt;Tiệm cận:&lt;/em&gt; $x\to1^\pm$ cho $f\to\pm\infty$, nên $x=1$ là tiệm cận đứng. Chia đa thức: $f(x)=x+1+\dfrac1{x-1}$, nên $y=x+1$ là tiệm cận xiên ở cả hai phía (Định lý 1 cho $a=1$, $b=1$).&lt;/p&gt;

  &lt;p&gt;&lt;em&gt;Đạo hàm:&lt;/em&gt; $f&apos;(x)=1-\dfrac1{(x-1)^2}=\dfrac{x(x-2)}{(x-1)^2}$.&lt;/p&gt;

  &lt;table&gt;
    &lt;thead&gt;
      &lt;tr&gt;
        &lt;th&gt;$x$&lt;/th&gt;
        &lt;th&gt;$(-\infty,0)$&lt;/th&gt;
        &lt;th&gt;$0$&lt;/th&gt;
        &lt;th&gt;$(0,1)$&lt;/th&gt;
        &lt;th&gt;$1$&lt;/th&gt;
        &lt;th&gt;$(1,2)$&lt;/th&gt;
        &lt;th&gt;$2$&lt;/th&gt;
        &lt;th&gt;$(2,\infty)$&lt;/th&gt;
      &lt;/tr&gt;
    &lt;/thead&gt;
    &lt;tbody&gt;
      &lt;tr&gt;
        &lt;td&gt;$f&apos;$&lt;/td&gt;
        &lt;td&gt;$+$&lt;/td&gt;
        &lt;td&gt;$0$&lt;/td&gt;
        &lt;td&gt;$-$&lt;/td&gt;
        &lt;td&gt;không xđ&lt;/td&gt;
        &lt;td&gt;$-$&lt;/td&gt;
        &lt;td&gt;$0$&lt;/td&gt;
        &lt;td&gt;$+$&lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr&gt;
        &lt;td&gt;$f$&lt;/td&gt;
        &lt;td&gt;tăng&lt;/td&gt;
        &lt;td&gt;CĐ $0$&lt;/td&gt;
        &lt;td&gt;giảm&lt;/td&gt;
        &lt;td&gt; &lt;/td&gt;
        &lt;td&gt;giảm&lt;/td&gt;
        &lt;td&gt;CT $4$&lt;/td&gt;
        &lt;td&gt;tăng&lt;/td&gt;
      &lt;/tr&gt;
    &lt;/tbody&gt;
  &lt;/table&gt;

  &lt;p&gt;&lt;em&gt;Lồi lõm:&lt;/em&gt; $f&apos;&apos;(x)=\dfrac2{(x-1)^3}$: lõm khi $x&amp;lt;1$, lồi khi $x&amp;gt;1$. Không có điểm uốn ($x=1$ không thuộc miền xác định).&lt;/p&gt;

  &lt;p&gt;Đồ thị có hai nhánh: nhánh trái nằm dưới tiệm cận xiên, đạt đỉnh $(0,0)$; nhánh phải nằm trên, đáy tại $(2,4)$. Chú ý cực đại $0$ nhỏ hơn cực tiểu $4$: cực trị địa phương không so sánh được giữa hai nhánh.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Ví dụ 2.&lt;/strong&gt; Khảo sát $f(x)=xe^{-x^2/2}$.&lt;/p&gt;

  &lt;p&gt;Hàm lẻ, xác định trên $\mathbb{R}$, $f(x)\to0$ khi $x\to\pm\infty$ (tiệm cận ngang $y=0$).&lt;/p&gt;

  &lt;p&gt;$f&apos;(x)=(1-x^2)e^{-x^2/2}$: tăng trên $(-1,1)$, giảm ngoài đoạn đó. Cực đại $f(1)=e^{-1/2}\approx0{,}607$, cực tiểu $f(-1)\approx-0{,}607$.&lt;/p&gt;

  &lt;p&gt;$f&apos;&apos;(x)=(x^3-3x)e^{-x^2/2}=x(x^2-3)e^{-x^2/2}$: đổi dấu tại $0$, $\pm\sqrt3$. Ba điểm uốn: $(0,0)$ và $(\pm\sqrt3,\pm\sqrt3e^{-3/2})\approx(\pm1{,}732;\ \pm0{,}386)$.&lt;/p&gt;
&lt;/div&gt;

&lt;h2 id=&quot;minh-hoạ&quot;&gt;Minh hoạ&lt;/h2&gt;

&lt;div class=&quot;interactive-frame&quot;&gt;
  &lt;div class=&quot;interactive-frame-head&quot;&gt;
    &lt;div class=&quot;interactive-frame-title&quot;&gt;Bảng biến thiên và đồ thị&lt;/div&gt;
    &lt;div class=&quot;interactive-frame-desc&quot;&gt;Kéo k để cực trị xuất hiện hay biến mất; bảng biến thiên cập nhật theo.&lt;/div&gt;
  &lt;/div&gt;
  &lt;iframe src=&quot;/interactives/chapter03/curve-sketch.html&quot; title=&quot;Bảng biến thiên và đồ thị&quot; loading=&quot;lazy&quot; style=&quot;height: 760px;&quot;&gt;&lt;/iframe&gt;
  &lt;div class=&quot;interactive-frame-foot&quot;&gt;
    &lt;a href=&quot;/interactives/chapter03/curve-sketch.html&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;Mở minh hoạ ở cửa sổ riêng&lt;/a&gt;
  &lt;/div&gt;
&lt;/div&gt;

&lt;h2 id=&quot;ứng-dụng&quot;&gt;Ứng dụng&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Vật lý: thế năng Lennard-Jones.&lt;/strong&gt; Lực giữa hai nguyên tử khí hiếm được mô tả bởi thế năng $V(r)=4\varepsilon\left[\left(\tfrac\sigma r\right)^{12}-\left(\tfrac\sigma r\right)^6\right]$, $r&amp;gt;0$. Khảo sát nhanh: $V\to+\infty$ khi $r\to0^+$ (đẩy mạnh), $V\to0^-$ khi $r\to\infty$. $V&apos;(r)=\dfrac{4\varepsilon}{r}\left[-12\left(\tfrac\sigma r\right)^{12}+6\left(\tfrac\sigma r\right)^6\right]=0$ khi $\left(\tfrac\sigma r\right)^6=\tfrac12$, tức $r^*=2^{1/6}\sigma\approx1{,}122\sigma$. Tại đó $V(r^*)=4\varepsilon\left(\tfrac14-\tfrac12\right)=-\varepsilon$. Đồ thị cho ngay khoảng cách cân bằng $r^*$ và năng lượng liên kết $\varepsilon$.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Kinh tế: đường cong logistic.&lt;/strong&gt; Số người dùng một sản phẩm mới thường theo $P(t)=\dfrac{K}{1+Ae^{-rt}}$. Ta có $P&apos;=rP\left(1-\tfrac PK\right)&amp;gt;0$ và $P&apos;&apos;=rP&apos;\left(1-\tfrac{2P}K\right)$. Điểm uốn tại $P=\tfrac K2$: khi đạt một nửa thị trường, tốc độ tăng lớn nhất, sau đó chậm dần. Doanh nghiệp dùng điểm uốn để đoán quy mô thị trường $K$ từ dữ liệu nửa đầu.&lt;/p&gt;

&lt;h2 id=&quot;bài-tập&quot;&gt;Bài tập&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Mức cơ bản.&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;Tìm các tiệm cận của $f(x)=\dfrac{2x^2+3x}{x+1}$.&lt;/li&gt;
  &lt;li&gt;Lập bảng biến thiên của $f(x)=x^3-3x+2$.&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Đáp án&lt;/summary&gt;

  &lt;ol&gt;
    &lt;li&gt;Tiệm cận đứng $x=-1$; $f=2x+1-\dfrac1{x+1}$, tiệm cận xiên $y=2x+1$.&lt;/li&gt;
    &lt;li&gt;$f&apos;=3(x^2-1)$. Tăng trên $(-\infty,-1)$, giảm trên $(-1,1)$, tăng trên $(1,\infty)$. CĐ $f(-1)=4$, CT $f(1)=0$.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;p&gt;&lt;strong&gt;Mức vận dụng.&lt;/strong&gt;&lt;/p&gt;

&lt;ol start=&quot;3&quot;&gt;
  &lt;li&gt;Khảo sát $f(x)=\dfrac{\ln x}{x}$.&lt;/li&gt;
  &lt;li&gt;Tìm tiệm cận xiên của $f(x)=\sqrt{x^2+2x}$ khi $x\to+\infty$ và $x\to-\infty$.&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Đáp án&lt;/summary&gt;

  &lt;ol start=&quot;3&quot;&gt;
    &lt;li&gt;Miền $x&amp;gt;0$. $x\to0^+$: $f\to-\infty$ (tiệm cận đứng $x=0$). $x\to\infty$: $f\to0$. $f&apos;=\dfrac{1-\ln x}{x^2}$: CĐ $\tfrac1e$ tại $x=e$. $f&apos;&apos;=\dfrac{2\ln x-3}{x^3}$: điểm uốn tại $x=e^{3/2}$.&lt;/li&gt;
    &lt;li&gt;$x\to+\infty$: $y=x+1$. $x\to-\infty$: $a=\lim\tfrac{f}{x}=-1$, $b=\lim(f+x)=-1$, nên $y=-x-1$.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;p&gt;&lt;strong&gt;Mức nâng cao.&lt;/strong&gt;&lt;/p&gt;

&lt;ol start=&quot;5&quot;&gt;
  &lt;li&gt;Khảo sát $f(x)=x^x$ trên $(0,\infty)$, kể cả giới hạn khi $x\to0^+$.&lt;/li&gt;
  &lt;li&gt;Chứng minh đồ thị một đa thức bậc ba luôn có đúng một điểm uốn, và đồ thị đối xứng qua điểm đó.&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Gợi ý&lt;/summary&gt;

  &lt;ol start=&quot;5&quot;&gt;
    &lt;li&gt;$x^x\to1$ khi $x\to0^+$ (bài 02_06). CT tại $x=\tfrac1e$, giá trị $e^{-1/e}\approx0{,}692$. $f&apos;&apos;=x^x\left[(\ln x+1)^2+\tfrac1x\right]&amp;gt;0$: lồi trên toàn miền.&lt;/li&gt;
    &lt;li&gt;$f&apos;&apos;=6ax+2b$ có đúng một nghiệm $x_0=-\tfrac b{3a}$. Dịch gốc về $(x_0,f(x_0))$, đa thức mới không còn hạng tử bậc hai nên có dạng $aX^3+pX$, là hàm lẻ.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;h2 id=&quot;tóm-tắt&quot;&gt;Tóm tắt&lt;/h2&gt;

&lt;div class=&quot;content-box summary-box textbook-block&quot;&gt;
  &lt;ul&gt;
    &lt;li&gt;Tiệm cận xiên: $a=\lim\tfrac{f(x)}x$, $b=\lim(f(x)-ax)$.&lt;/li&gt;
    &lt;li&gt;Quy trình: miền xác định và tiệm cận, rồi $f&apos;$ (bảng biến thiên), rồi $f&apos;&apos;$ (lồi lõm, điểm uốn), cuối cùng vẽ.&lt;/li&gt;
    &lt;li&gt;Đồ thị cho đọc trực tiếp các đại lượng ý nghĩa: điểm cân bằng là cực tiểu thế năng, điểm tăng nhanh nhất là điểm uốn.&lt;/li&gt;
  &lt;/ul&gt;
&lt;/div&gt;
</content>
 </entry>
 
 <entry>
   <title>Hàm lồi, lõm và điểm uốn</title>
   <link href="https://calculus-self-learning.pages.dev/contents/vi/chapter03/03_02_Ham_loi_lom_va_diem_uon/"/>
   <updated>2026-12-01T00:00:00+00:00</updated>
   <id>https://calculus-self-learning.pages.dev/contents/vi/chapter03/03_02_Ham_loi_lom_va_diem_uon</id>
   <content type="html">&lt;div class=&quot;textbook-objectives&quot;&gt;

  &lt;p&gt;&lt;strong&gt;Mục tiêu học tập.&lt;/strong&gt; Sau bài này, người học có thể:&lt;/p&gt;

  &lt;ul&gt;
    &lt;li&gt;phát biểu định nghĩa hàm lồi, lõm bằng dây cung;&lt;/li&gt;
    &lt;li&gt;chứng minh $f&apos;&apos;\ge0$ trên khoảng thì $f$ lồi, và dùng nó để tìm khoảng lồi, lõm, điểm uốn;&lt;/li&gt;
    &lt;li&gt;phát biểu bất đẳng thức Jensen và suy ra bất đẳng thức AM–GM;&lt;/li&gt;
    &lt;li&gt;giải thích vì sao hàm mất mát lồi dễ tối ưu và vì sao hàm lõm mô tả người ngại rủi ro.&lt;/li&gt;
  &lt;/ul&gt;

&lt;/div&gt;

&lt;h2 id=&quot;vì-sao-cần-bài-này&quot;&gt;Vì sao cần bài này&lt;/h2&gt;

&lt;p&gt;Một người có 100 triệu đồng được mời chơi: tung đồng xu, sấp thì còn 50 triệu, ngửa thì có 150 triệu. Kỳ vọng vẫn là 100 triệu, nhưng đa số từ chối. Kinh tế học giải thích bằng &lt;em&gt;độ thoả dụng&lt;/em&gt; $u(w)=\ln w$, một hàm lõm: mất 50 triệu đau hơn được 50 triệu sướng. Độ cong của đồ thị, đo bằng $f&apos;&apos;$, là nội dung của bài này.&lt;/p&gt;

&lt;h2 id=&quot;định-nghĩa&quot;&gt;Định nghĩa&lt;/h2&gt;

&lt;div class=&quot;textbook-definition&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Định nghĩa 1 (Hàm lồi, hàm lõm).&lt;/strong&gt; Hàm $f$ &lt;em&gt;lồi&lt;/em&gt; trên khoảng $I$ nếu với mọi $x,y\in I$ và $t\in[0,1]$,&lt;/p&gt;

\[f\big(tx+(1-t)y\big)\le t f(x)+(1-t)f(y).\]

  &lt;p&gt;Nghĩa là dây cung nối hai điểm trên đồ thị nằm phía trên đồ thị. $f$ &lt;em&gt;lõm&lt;/em&gt; nếu $-f$ lồi (bất đẳng thức đổi chiều).&lt;/p&gt;
&lt;/div&gt;

&lt;p&gt;Lưu ý thuật ngữ: một số sách phổ thông gọi ngược lại (lồi là “lồi lên”). Trong khoá này, &lt;em&gt;lồi&lt;/em&gt; theo nghĩa của Định nghĩa 1, giống tối ưu hoá và học máy: $x^2$, $e^x$ là hàm lồi.&lt;/p&gt;

&lt;div class=&quot;textbook-theorem&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Định lý 1.&lt;/strong&gt; Cho $f$ khả vi hai lần trên khoảng $I$. Nếu $f&apos;&apos;\ge0$ trên $I$ thì $f$ lồi; nếu $f&apos;&apos;\le0$ thì $f$ lõm.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-proof&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Chứng minh.&lt;/strong&gt; Lấy $x&amp;lt;z&amp;lt;y$ trong $I$, $z=tx+(1-t)y$. Theo Lagrange, có $\xi_1\in(x,z)$, $\xi_2\in(z,y)$ với&lt;/p&gt;

\[\frac{f(z)-f(x)}{z-x}=f&apos;(\xi_1),\qquad\frac{f(y)-f(z)}{y-z}=f&apos;(\xi_2).\]

  &lt;p&gt;Vì $f&apos;&apos;\ge0$ nên $f&apos;$ tăng, $f&apos;(\xi_1)\le f&apos;(\xi_2)$. Bất đẳng thức hệ số góc $\dfrac{f(z)-f(x)}{z-x}\le\dfrac{f(y)-f(z)}{y-z}$, sau khi nhân chéo với $z-x=(1-t)(y-x)$ và $y-z=t(y-x)$, thành $f(z)\le tf(x)+(1-t)f(y)$.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-definition&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Định nghĩa 2 (Điểm uốn).&lt;/strong&gt; Điểm $c$ mà $f$ liên tục tại đó và đổi từ lồi sang lõm (hoặc ngược lại) khi qua $c$ là &lt;em&gt;điểm uốn&lt;/em&gt;. Nếu $f&apos;&apos;(c)$ tồn tại tại điểm uốn thì $f&apos;&apos;(c)=0$.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Ví dụ 1.&lt;/strong&gt; $f(x)=x^4-4x^3$. $f&apos;&apos;(x)=12x^2-24x=12x(x-2)$.&lt;/p&gt;

  &lt;table&gt;
    &lt;thead&gt;
      &lt;tr&gt;
        &lt;th&gt;$x$&lt;/th&gt;
        &lt;th&gt;$(-\infty,0)$&lt;/th&gt;
        &lt;th&gt;$(0,2)$&lt;/th&gt;
        &lt;th&gt;$(2,\infty)$&lt;/th&gt;
      &lt;/tr&gt;
    &lt;/thead&gt;
    &lt;tbody&gt;
      &lt;tr&gt;
        &lt;td&gt;$f&apos;&apos;$&lt;/td&gt;
        &lt;td&gt;$+$&lt;/td&gt;
        &lt;td&gt;$-$&lt;/td&gt;
        &lt;td&gt;$+$&lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr&gt;
        &lt;td&gt;$f$&lt;/td&gt;
        &lt;td&gt;lồi&lt;/td&gt;
        &lt;td&gt;lõm&lt;/td&gt;
        &lt;td&gt;lồi&lt;/td&gt;
      &lt;/tr&gt;
    &lt;/tbody&gt;
  &lt;/table&gt;

  &lt;p&gt;Điểm uốn $(0,0)$ và $(2,-16)$. Chú ý $f&apos;&apos;(c)=0$ chưa đủ: $x^4$ có $f&apos;&apos;(0)=0$ nhưng lồi trên cả $\mathbb{R}$, không có điểm uốn.&lt;/p&gt;
&lt;/div&gt;

&lt;h2 id=&quot;bất-đẳng-thức-jensen&quot;&gt;Bất đẳng thức Jensen&lt;/h2&gt;

&lt;div class=&quot;textbook-theorem&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Định lý 2 (Jensen).&lt;/strong&gt; Nếu $f$ lồi trên $I$, $x_1,\dots,x_n\in I$ và $\lambda_i\ge0$ với $\lambda_1+\dots+\lambda_n=1$, thì&lt;/p&gt;

\[f\Big(\sum_{i=1}^n\lambda_ix_i\Big)\le\sum_{i=1}^n\lambda_if(x_i).\]

  &lt;p&gt;Với $f$ lõm, bất đẳng thức đổi chiều.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-proof&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Chứng minh.&lt;/strong&gt; Quy nạp theo $n$. Với $n=2$ là Định nghĩa 1. Giả sử đúng với $n$, xét $n+1$ điểm với $\lambda_{n+1}&amp;lt;1$. Đặt $s=1-\lambda_{n+1}=\lambda_1+\dots+\lambda_n$ và $y=\sum_{i\le n}\tfrac{\lambda_i}{s}x_i\in I$. Khi đó $\sum_{i\le n+1}\lambda_ix_i=sy+\lambda_{n+1}x_{n+1}$, và&lt;/p&gt;

\[f(sy+\lambda_{n+1}x_{n+1})\le sf(y)+\lambda_{n+1}f(x_{n+1})\le s\sum_{i\le n}\tfrac{\lambda_i}{s}f(x_i)+\lambda_{n+1}f(x_{n+1}).\]

&lt;/div&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Ví dụ 2 (AM–GM).&lt;/strong&gt; $\ln$ lõm vì $(\ln x)&apos;&apos;=-\tfrac1{x^2}&amp;lt;0$. Theo Jensen với $\lambda_i=\tfrac1n$:&lt;/p&gt;

\[\ln\frac{x_1+\dots+x_n}n\ge\frac{\ln x_1+\dots+\ln x_n}n=\ln\sqrt[n]{x_1\cdots x_n}.\]

  &lt;p&gt;Vì $\ln$ tăng: $\dfrac{x_1+\dots+x_n}n\ge\sqrt[n]{x_1\cdots x_n}$. Với $2,8$: trung bình cộng $5\ge$ trung bình nhân $4$.&lt;/p&gt;
&lt;/div&gt;

&lt;h2 id=&quot;ứng-dụng&quot;&gt;Ứng dụng&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Kinh tế: ngại rủi ro.&lt;/strong&gt; Với $u(w)=\ln w$, trò chơi đầu bài cho độ thoả dụng kỳ vọng $\tfrac12\ln50+\tfrac12\ln150=\ln\sqrt{7500}\approx\ln86{,}6$, nhỏ hơn $\ln100$. Theo Jensen, điều này đúng với mọi hàm lõm. Người chơi coi trò chơi tương đương với chắc chắn có 86,6 triệu, nên sẵn sàng trả tới 13,4 triệu phí bảo hiểm để tránh rủi ro.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Học máy: hàm mất mát lồi.&lt;/strong&gt; Hàm mất mát bình phương $L(w)=\sum_i(y_i-wx_i)^2$ có $L&apos;&apos;=2\sum x_i^2\ge0$, nên lồi. Với hàm lồi khả vi, mọi điểm có $L&apos;=0$ đều là cực tiểu toàn cục (bài tập 6). Đó là lý do hồi quy tuyến tính và hồi quy logistic luôn có lời giải tốt nhất tìm được bằng gradient descent, còn mạng nơ-ron sâu (không lồi) thì không có bảo đảm này.&lt;/p&gt;

&lt;h2 id=&quot;bài-tập&quot;&gt;Bài tập&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Mức cơ bản.&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;Tìm khoảng lồi, lõm và điểm uốn của $f(x)=x^3-6x^2+5$.&lt;/li&gt;
  &lt;li&gt;Hàm $f(x)=e^{-x^2}$ lồi trên khoảng nào?&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Đáp án&lt;/summary&gt;

  &lt;ol&gt;
    &lt;li&gt;$f&apos;&apos;=6x-12$. Lõm trên $(-\infty,2)$, lồi trên $(2,\infty)$, điểm uốn $(2,-11)$.&lt;/li&gt;
    &lt;li&gt;$f&apos;&apos;=(4x^2-2)e^{-x^2}\ge0$ khi $\lvert x\rvert\ge\tfrac1{\sqrt2}$. Lồi trên $(-\infty,-\tfrac1{\sqrt2})$ và $(\tfrac1{\sqrt2},\infty)$.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;p&gt;&lt;strong&gt;Mức vận dụng.&lt;/strong&gt;&lt;/p&gt;

&lt;ol start=&quot;3&quot;&gt;
  &lt;li&gt;Dùng Jensen cho $f(x)=x^2$ chứng minh $\left(\dfrac{a+b+c}3\right)^2\le\dfrac{a^2+b^2+c^2}3$.&lt;/li&gt;
  &lt;li&gt;Chứng minh hàm sigmoid $\sigma$ lồi trên $(-\infty,0)$ và lõm trên $(0,\infty)$.&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Đáp án&lt;/summary&gt;

  &lt;ol start=&quot;3&quot;&gt;
    &lt;li&gt;$x^2$ lồi; áp dụng Jensen với $\lambda_i=\tfrac13$.&lt;/li&gt;
    &lt;li&gt;$\sigma&apos;&apos;=\sigma(1-\sigma)(1-2\sigma)$. Dấu của $1-2\sigma$: dương khi $x&amp;lt;0$ ($\sigma&amp;lt;\tfrac12$), âm khi $x&amp;gt;0$. Điểm uốn $(0,\tfrac12)$.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;p&gt;&lt;strong&gt;Mức nâng cao.&lt;/strong&gt;&lt;/p&gt;

&lt;ol start=&quot;5&quot;&gt;
  &lt;li&gt;Chứng minh: hàm lồi khả vi nằm trên mọi tiếp tuyến của nó, $f(y)\ge f(x)+f&apos;(x)(y-x)$.&lt;/li&gt;
  &lt;li&gt;Suy ra từ bài 5: nếu $f$ lồi khả vi và $f&apos;(x^*)=0$ thì $x^*$ là cực tiểu toàn cục.&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Gợi ý&lt;/summary&gt;

  &lt;ol start=&quot;5&quot;&gt;
    &lt;li&gt;Từ định nghĩa: $\dfrac{f(x+t(y-x))-f(x)}{t}\le f(y)-f(x)$ với $t\in(0,1]$; cho $t\to0^+$.&lt;/li&gt;
    &lt;li&gt;Đặt $x=x^*$ vào bài 5: $f(y)\ge f(x^*)$ với mọi $y$.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;h2 id=&quot;tóm-tắt&quot;&gt;Tóm tắt&lt;/h2&gt;

&lt;div class=&quot;content-box summary-box textbook-block&quot;&gt;
  &lt;ul&gt;
    &lt;li&gt;Lồi: dây cung nằm trên đồ thị. $f&apos;&apos;\ge0$ thì lồi, $f&apos;&apos;\le0$ thì lõm.&lt;/li&gt;
    &lt;li&gt;Điểm uốn: nơi đổi chiều lồi lõm; tại đó $f&apos;&apos;=0$ nếu tồn tại, nhưng $f&apos;&apos;=0$ chưa đủ.&lt;/li&gt;
    &lt;li&gt;Jensen: $f(\sum\lambda_ix_i)\le\sum\lambda_if(x_i)$ với $f$ lồi. Hệ quả: AM–GM từ tính lõm của $\ln$.&lt;/li&gt;
    &lt;li&gt;Hàm lồi khả vi: điểm dừng là cực tiểu toàn cục, nền tảng của tối ưu lồi.&lt;/li&gt;
  &lt;/ul&gt;
&lt;/div&gt;
</content>
 </entry>
 
 <entry>
   <title>Tính đơn điệu và cực trị</title>
   <link href="https://calculus-self-learning.pages.dev/contents/vi/chapter03/03_01_Tinh_don_dieu_va_cuc_tri/"/>
   <updated>2026-12-01T00:00:00+00:00</updated>
   <id>https://calculus-self-learning.pages.dev/contents/vi/chapter03/03_01_Tinh_don_dieu_va_cuc_tri</id>
   <content type="html">&lt;div class=&quot;textbook-objectives&quot;&gt;

  &lt;p&gt;&lt;strong&gt;Mục tiêu học tập.&lt;/strong&gt; Sau bài này, người học có thể:&lt;/p&gt;

  &lt;ul&gt;
    &lt;li&gt;tìm khoảng tăng, khoảng giảm của hàm bằng dấu của $f&apos;$;&lt;/li&gt;
    &lt;li&gt;tìm các điểm tới hạn và xác định cực đại, cực tiểu bằng dấu hiệu bậc nhất hoặc bậc hai;&lt;/li&gt;
    &lt;li&gt;tìm giá trị lớn nhất, nhỏ nhất của hàm liên tục trên một đoạn;&lt;/li&gt;
    &lt;li&gt;áp dụng cho nồng độ thuốc trong máu và lợi nhuận.&lt;/li&gt;
  &lt;/ul&gt;

&lt;/div&gt;

&lt;h2 id=&quot;vì-sao-cần-bài-này&quot;&gt;Vì sao cần bài này&lt;/h2&gt;

&lt;p&gt;Sau khi uống một liều thuốc, nồng độ trong máu theo thời gian (giờ) được mô hình hoá bởi $C(t)=5te^{-0{,}5t}$ (mg/L). Nồng độ tăng rồi giảm. Bác sĩ cần biết lúc nào nồng độ cao nhất và cao nhất là bao nhiêu, để không vượt ngưỡng độc. Câu hỏi này được trả lời bằng dấu của đạo hàm.&lt;/p&gt;

&lt;h2 id=&quot;đơn-điệu&quot;&gt;Đơn điệu&lt;/h2&gt;

&lt;p&gt;Hệ quả 1 bài 02_05 đã cho: trên một khoảng, $f&apos;&amp;gt;0$ thì $f$ tăng ngặt, $f&apos;&amp;lt;0$ thì $f$ giảm ngặt. Vậy muốn biết hàm tăng hay giảm ở đâu, chỉ cần xét dấu $f&apos;$.&lt;/p&gt;

&lt;div class=&quot;textbook-definition&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Định nghĩa 1 (Cực trị, điểm tới hạn).&lt;/strong&gt; $f$ đạt &lt;em&gt;cực đại địa phương&lt;/em&gt; tại $c$ nếu $f(c)\ge f(x)$ với mọi $x$ gần $c$; &lt;em&gt;cực tiểu địa phương&lt;/em&gt; nếu $f(c)\le f(x)$. Điểm trong $c$ của miền xác định là &lt;em&gt;điểm tới hạn&lt;/em&gt; nếu $f&apos;(c)=0$ hoặc $f&apos;(c)$ không tồn tại.&lt;/p&gt;
&lt;/div&gt;

&lt;p&gt;Theo định lý Fermat (bài 02_05), cực trị địa phương tại điểm trong chỉ có thể xảy ra ở điểm tới hạn. Chiều ngược lại sai: $f(x)=x^3$ có $f&apos;(0)=0$ nhưng tăng trên cả $\mathbb{R}$, không có cực trị.&lt;/p&gt;

&lt;div class=&quot;textbook-theorem&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Định lý 1 (Dấu hiệu bậc nhất).&lt;/strong&gt; Cho $f$ liên tục tại điểm tới hạn $c$ và khả vi ở gần $c$ (có thể trừ $c$).&lt;/p&gt;

  &lt;ul&gt;
    &lt;li&gt;Nếu $f&apos;$ đổi dấu từ $+$ sang $-$ khi qua $c$ thì $f$ đạt cực đại địa phương tại $c$.&lt;/li&gt;
    &lt;li&gt;Nếu $f&apos;$ đổi dấu từ $-$ sang $+$ thì $f$ đạt cực tiểu địa phương.&lt;/li&gt;
    &lt;li&gt;Nếu $f&apos;$ không đổi dấu thì $c$ không phải cực trị.&lt;/li&gt;
  &lt;/ul&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-proof&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Chứng minh (trường hợp đầu).&lt;/strong&gt; Có $\delta&amp;gt;0$ để $f&apos;&amp;gt;0$ trên $(c-\delta,c)$ và $f&apos;&amp;lt;0$ trên $(c,c+\delta)$. Với $x\in(c-\delta,c)$, Lagrange cho $f(c)-f(x)=f&apos;(\xi)(c-x)&amp;gt;0$. Với $x\in(c,c+\delta)$, $f(x)-f(c)=f&apos;(\xi)(x-c)&amp;lt;0$. Vậy $f(x)&amp;lt;f(c)$ với mọi $x\ne c$ gần $c$.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-theorem&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Định lý 2 (Dấu hiệu bậc hai).&lt;/strong&gt; Nếu $f&apos;(c)=0$ và $f&apos;&apos;(c)$ tồn tại thì: $f&apos;&apos;(c)&amp;lt;0$ suy ra cực đại địa phương; $f&apos;&apos;(c)&amp;gt;0$ suy ra cực tiểu địa phương. Nếu $f&apos;&apos;(c)=0$ thì chưa kết luận được.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-proof&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Chứng minh.&lt;/strong&gt; Giả sử $f&apos;&apos;(c)&amp;lt;0$. Vì $f&apos;&apos;(c)=\lim_{h\to0}\dfrac{f&apos;(c+h)-f&apos;(c)}h=\lim_{h\to0}\dfrac{f&apos;(c+h)}h&amp;lt;0$, theo tính giữ dấu của giới hạn, $\dfrac{f&apos;(c+h)}h&amp;lt;0$ với $h$ nhỏ khác 0. Vậy $f&apos;(c+h)&amp;lt;0$ khi $h&amp;gt;0$ và $&amp;gt;0$ khi $h&amp;lt;0$: $f&apos;$ đổi dấu từ $+$ sang $-$. Áp dụng Định lý 1.&lt;/p&gt;
&lt;/div&gt;

&lt;p&gt;Các hàm $x^4$, $-x^4$, $x^3$ đều có $f&apos;(0)=f&apos;&apos;(0)=0$ nhưng lần lượt là cực tiểu, cực đại, không cực trị. Vì vậy khi $f&apos;&apos;(c)=0$ phải quay về dấu hiệu bậc nhất.&lt;/p&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Ví dụ 1.&lt;/strong&gt; Xét $f(x)=x^3-3x^2-9x+5$.&lt;/p&gt;

  &lt;p&gt;$f&apos;(x)=3x^2-6x-9=3(x+1)(x-3)$. Bảng dấu:&lt;/p&gt;

  &lt;table&gt;
    &lt;thead&gt;
      &lt;tr&gt;
        &lt;th&gt;$x$&lt;/th&gt;
        &lt;th&gt;$(-\infty,-1)$&lt;/th&gt;
        &lt;th&gt;$-1$&lt;/th&gt;
        &lt;th&gt;$(-1,3)$&lt;/th&gt;
        &lt;th&gt;$3$&lt;/th&gt;
        &lt;th&gt;$(3,\infty)$&lt;/th&gt;
      &lt;/tr&gt;
    &lt;/thead&gt;
    &lt;tbody&gt;
      &lt;tr&gt;
        &lt;td&gt;$f&apos;$&lt;/td&gt;
        &lt;td&gt;$+$&lt;/td&gt;
        &lt;td&gt;$0$&lt;/td&gt;
        &lt;td&gt;$-$&lt;/td&gt;
        &lt;td&gt;$0$&lt;/td&gt;
        &lt;td&gt;$+$&lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr&gt;
        &lt;td&gt;$f$&lt;/td&gt;
        &lt;td&gt;tăng&lt;/td&gt;
        &lt;td&gt;cực đại $10$&lt;/td&gt;
        &lt;td&gt;giảm&lt;/td&gt;
        &lt;td&gt;cực tiểu $-22$&lt;/td&gt;
        &lt;td&gt;tăng&lt;/td&gt;
      &lt;/tr&gt;
    &lt;/tbody&gt;
  &lt;/table&gt;

  &lt;p&gt;Kiểm tra bằng dấu hiệu bậc hai: $f&apos;&apos;(x)=6x-6$, $f&apos;&apos;(-1)=-12&amp;lt;0$ (cực đại), $f&apos;&apos;(3)=12&amp;gt;0$ (cực tiểu).&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Ví dụ 2.&lt;/strong&gt; $f(x)=\lvert x^2-1\rvert$ có điểm tới hạn tại $x=\pm1$ (không khả vi) và $x=0$ ($f&apos;(0)=0$). Hàm đạt cực tiểu bằng 0 tại $\pm1$ và cực đại địa phương bằng 1 tại $0$. Điểm không khả vi cũng phải được xét.&lt;/p&gt;
&lt;/div&gt;

&lt;h2 id=&quot;giá-trị-lớn-nhất-và-nhỏ-nhất-trên-một-đoạn&quot;&gt;Giá trị lớn nhất và nhỏ nhất trên một đoạn&lt;/h2&gt;

&lt;p&gt;Theo định lý Weierstrass, hàm liên tục trên $[a,b]$ có max và min. Chúng nằm ở điểm tới hạn trong $(a,b)$ hoặc ở hai đầu mút. Cách làm: tính $f$ tại tất cả các điểm đó rồi so sánh.&lt;/p&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Ví dụ 3.&lt;/strong&gt; Max, min của $f(x)=x^3-3x^2-9x+5$ trên $[-2,4]$.&lt;/p&gt;

  &lt;p&gt;Điểm tới hạn trong đoạn: $-1$, $3$. Giá trị: $f(-2)=3$, $f(-1)=10$, $f(3)=-22$, $f(4)=-15$. Vậy max bằng $10$ tại $x=-1$, min bằng $-22$ tại $x=3$. Trên đoạn $[-2,0]$: so sánh $f(-2)=3$, $f(-1)=10$, $f(0)=5$, nên min bằng $3$ tại đầu mút $x=-2$. Đầu mút có thể là nơi đạt cực trị toàn cục.&lt;/p&gt;
&lt;/div&gt;

&lt;h2 id=&quot;ứng-dụng&quot;&gt;Ứng dụng&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Y học: nồng độ thuốc cực đại.&lt;/strong&gt; $C&apos;(t)=5e^{-0{,}5t}(1-0{,}5t)$, bằng 0 tại $t=2$; $C&apos;&amp;gt;0$ khi $t&amp;lt;2$ và $&amp;lt;0$ khi $t&amp;gt;2$. Nồng độ cao nhất sau 2 giờ, bằng $C(2)=10e^{-1}\approx3{,}68$ mg/L.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Kinh tế: lợi nhuận tối đa.&lt;/strong&gt; Lợi nhuận $P(q)=-0{,}5q^2+80q-500$ (triệu đồng, $q$ nghìn sản phẩm) có $P&apos;(q)=-q+80$, đổi dấu từ $+$ sang $-$ tại $q=80$. Lợi nhuận lớn nhất $P(80)=2700$. Tại điểm này doanh thu biên bằng chi phí biên, đó là quy tắc “MR = MC” của kinh tế học.&lt;/p&gt;

&lt;h2 id=&quot;bài-tập&quot;&gt;Bài tập&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Mức cơ bản.&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;Tìm khoảng đơn điệu và cực trị của $f(x)=x^4-2x^2$.&lt;/li&gt;
  &lt;li&gt;Tìm max, min của $f(x)=x^2-4x+1$ trên $[0,5]$.&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Đáp án&lt;/summary&gt;

  &lt;ol&gt;
    &lt;li&gt;$f&apos;=4x(x-1)(x+1)$. Giảm trên $(-\infty,-1)$ và $(0,1)$, tăng trên $(-1,0)$ và $(1,\infty)$. Cực tiểu $-1$ tại $\pm1$, cực đại $0$ tại $0$.&lt;/li&gt;
    &lt;li&gt;$f(0)=1$, $f(2)=-3$, $f(5)=6$. Max $6$, min $-3$.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;p&gt;&lt;strong&gt;Mức vận dụng.&lt;/strong&gt;&lt;/p&gt;

&lt;ol start=&quot;3&quot;&gt;
  &lt;li&gt;Tìm cực trị của $f(x)=x^{2/3}(x-5)$.&lt;/li&gt;
  &lt;li&gt;Tìm cực trị của $f(x)=x\ln x$ trên $(0,\infty)$.&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Đáp án&lt;/summary&gt;

  &lt;ol start=&quot;3&quot;&gt;
    &lt;li&gt;$f&apos;=\dfrac{5(x-2)}{3x^{1/3}}$. Điểm tới hạn $0$ (không khả vi) và $2$. Cực đại $0$ tại $x=0$; cực tiểu $f(2)=-3\cdot2^{2/3}\approx-4{,}76$.&lt;/li&gt;
    &lt;li&gt;$f&apos;=\ln x+1=0$ tại $x=\tfrac1e$; cực tiểu $-\tfrac1e$.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;p&gt;&lt;strong&gt;Mức nâng cao.&lt;/strong&gt;&lt;/p&gt;

&lt;ol start=&quot;5&quot;&gt;
  &lt;li&gt;Chứng minh $e^x&amp;gt;1+x+\dfrac{x^2}2$ với mọi $x&amp;gt;0$ bằng cách xét đơn điệu.&lt;/li&gt;
  &lt;li&gt;Tìm $a$ để $f(x)=x^3+ax^2+3x$ tăng trên toàn $\mathbb{R}$.&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Gợi ý&lt;/summary&gt;

  &lt;ol start=&quot;5&quot;&gt;
    &lt;li&gt;$g(x)=e^x-1-x-\tfrac{x^2}2$ có $g(0)=0$, $g&apos;(x)=e^x-1-x&amp;gt;0$ khi $x&amp;gt;0$ (bài 02_05).&lt;/li&gt;
    &lt;li&gt;Cần $f&apos;=3x^2+2ax+3\ge0$ với mọi $x$: $\Delta&apos;=a^2-9\le0$, tức $\lvert a\rvert\le3$.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;h2 id=&quot;tóm-tắt&quot;&gt;Tóm tắt&lt;/h2&gt;

&lt;div class=&quot;content-box summary-box textbook-block&quot;&gt;
  &lt;ul&gt;
    &lt;li&gt;Dấu $f&apos;$ cho khoảng tăng, giảm. Cực trị địa phương tại điểm trong chỉ ở điểm tới hạn ($f&apos;=0$ hoặc không tồn tại).&lt;/li&gt;
    &lt;li&gt;Dấu hiệu bậc nhất: $f&apos;$ đổi dấu $+\to-$ là cực đại, $-\to+$ là cực tiểu. Bậc hai: $f&apos;&apos;(c)&amp;lt;0$ cực đại, $&amp;gt;0$ cực tiểu, $=0$ chưa kết luận.&lt;/li&gt;
    &lt;li&gt;Max, min trên đoạn: so sánh giá trị tại điểm tới hạn và hai đầu mút.&lt;/li&gt;
  &lt;/ul&gt;
&lt;/div&gt;
</content>
 </entry>
 
 <entry>
   <title>Quy tắc L'Hôpital và các dạng vô định</title>
   <link href="https://calculus-self-learning.pages.dev/contents/vi/chapter02/02_06_Quy_tac_LHopital/"/>
   <updated>2026-12-01T00:00:00+00:00</updated>
   <id>https://calculus-self-learning.pages.dev/contents/vi/chapter02/02_06_Quy_tac_LHopital</id>
   <content type="html">&lt;div class=&quot;textbook-objectives&quot;&gt;

  &lt;p&gt;&lt;strong&gt;Mục tiêu học tập.&lt;/strong&gt; Sau bài này, người học có thể:&lt;/p&gt;

  &lt;ul&gt;
    &lt;li&gt;phát biểu quy tắc L’Hôpital và chứng minh dạng $\tfrac00$ bằng định lý Cauchy;&lt;/li&gt;
    &lt;li&gt;khử các dạng $\tfrac00$, $\tfrac\infty\infty$, $0\cdot\infty$, $\infty-\infty$, $1^\infty$, $0^0$, $\infty^0$;&lt;/li&gt;
    &lt;li&gt;so sánh tốc độ tăng $\ln x\ll x^a\ll e^x$;&lt;/li&gt;
    &lt;li&gt;nhận ra khi quy tắc không áp dụng được hoặc dẫn đến lập luận vòng.&lt;/li&gt;
  &lt;/ul&gt;

&lt;/div&gt;

&lt;h2 id=&quot;vì-sao-cần-bài-này&quot;&gt;Vì sao cần bài này&lt;/h2&gt;

&lt;p&gt;Động năng theo thuyết tương đối là $K=mc^2\left(\dfrac1{\sqrt{1-v^2/c^2}}-1\right)$. Khi vận tốc $v$ nhỏ so với tốc độ ánh sáng $c$, công thức này phải gần với $\tfrac12mv^2$ của Newton. Kiểm tra điều đó là tính một giới hạn dạng $\tfrac00$. Thay tương đương (bài 01_04) làm được, nhưng quy tắc L’Hôpital cho một cách làm máy móc hơn, áp dụng cho nhiều dạng hơn.&lt;/p&gt;

&lt;h2 id=&quot;quy-tắc-lhôpital&quot;&gt;Quy tắc L’Hôpital&lt;/h2&gt;

&lt;div class=&quot;textbook-theorem&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Định lý 1 (L’Hôpital).&lt;/strong&gt; Cho $f,g$ khả vi trên một khoảng quanh $a$ (có thể trừ $a$), $g&apos;(x)\ne0$ ở đó. Giả sử $\lim_{x\to a}f(x)=\lim_{x\to a}g(x)=0$, hoặc cả hai cùng tiến ra $\pm\infty$. Nếu $\lim_{x\to a}\dfrac{f&apos;(x)}{g&apos;(x)}=L$ (hữu hạn hoặc $\pm\infty$) thì&lt;/p&gt;

\[\lim_{x\to a}\frac{f(x)}{g(x)}=L .\]

  &lt;p&gt;Kết quả vẫn đúng với giới hạn một phía và với $x\to\pm\infty$.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-proof&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Chứng minh (dạng $\tfrac00$, $x\to a^+$, $L$ hữu hạn).&lt;/strong&gt; Đặt $f(a)=g(a)=0$, khi đó $f,g$ liên tục trên $[a,x]$ với $x$ gần $a$. Theo định lý Cauchy (bài 02_05) có $c\in(a,x)$ với&lt;/p&gt;

\[\frac{f(x)}{g(x)}=\frac{f(x)-f(a)}{g(x)-g(a)}=\frac{f&apos;(c)}{g&apos;(c)} .\]

  &lt;p&gt;Khi $x\to a^+$ thì $c\to a^+$, nên vế phải tiến tới $L$. Giới hạn trái làm tương tự.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Ví dụ 1 (Dạng $\tfrac00$).&lt;/strong&gt;&lt;/p&gt;

  &lt;ul&gt;
    &lt;li&gt;$\lim_{x\to0}\dfrac{e^x-1-x}{x^2}=\lim_{x\to0}\dfrac{e^x-1}{2x}=\lim_{x\to0}\dfrac{e^x}{2}=\dfrac12$. Dùng quy tắc hai lần; mỗi lần phải kiểm tra lại vẫn là dạng $\tfrac00$.&lt;/li&gt;
    &lt;li&gt;$\lim_{x\to0}\dfrac{x-\sin x}{x^3}=\lim\dfrac{1-\cos x}{3x^2}=\lim\dfrac{\sin x}{6x}=\dfrac16$. Khớp với bài tập 5 bài 01_04.&lt;/li&gt;
  &lt;/ul&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Ví dụ 2 (Dạng $\tfrac\infty\infty$: so sánh tốc độ tăng).&lt;/strong&gt;&lt;/p&gt;

  &lt;ul&gt;
    &lt;li&gt;$\lim_{x\to\infty}\dfrac{x^2}{e^x}=\lim\dfrac{2x}{e^x}=\lim\dfrac2{e^x}=0$. Tổng quát $\dfrac{x^n}{e^x}\to0$ với mọi $n$.&lt;/li&gt;
    &lt;li&gt;$\lim_{x\to\infty}\dfrac{\ln x}{x^a}=\lim\dfrac{1/x}{ax^{a-1}}=\lim\dfrac1{ax^a}=0$ với mọi $a&amp;gt;0$.&lt;/li&gt;
  &lt;/ul&gt;

  &lt;p&gt;Vậy khi $x\to\infty$: $\ln x\ll x^a\ll e^x$ (mọi lũy thừa dương thắng logarit, hàm mũ thắng mọi lũy thừa).&lt;/p&gt;
&lt;/div&gt;

&lt;h2 id=&quot;các-dạng-vô-định-khác&quot;&gt;Các dạng vô định khác&lt;/h2&gt;

&lt;p&gt;Đưa về $\tfrac00$ hoặc $\tfrac\infty\infty$:&lt;/p&gt;

&lt;table&gt;
  &lt;thead&gt;
    &lt;tr&gt;
      &lt;th&gt;dạng&lt;/th&gt;
      &lt;th&gt;cách biến đổi&lt;/th&gt;
    &lt;/tr&gt;
  &lt;/thead&gt;
  &lt;tbody&gt;
    &lt;tr&gt;
      &lt;td&gt;$0\cdot\infty$&lt;/td&gt;
      &lt;td&gt;$fg=\dfrac{f}{1/g}$ hoặc $\dfrac{g}{1/f}$&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;$\infty-\infty$&lt;/td&gt;
      &lt;td&gt;quy đồng hoặc nhân liên hợp&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;$1^\infty$, $0^0$, $\infty^0$&lt;/td&gt;
      &lt;td&gt;$f^g=e^{g\ln f}$, tính giới hạn của $g\ln f$&lt;/td&gt;
    &lt;/tr&gt;
  &lt;/tbody&gt;
&lt;/table&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Ví dụ 3.&lt;/strong&gt;&lt;/p&gt;

  &lt;ul&gt;
    &lt;li&gt;$0\cdot\infty$: $\lim_{x\to0^+}x\ln x=\lim\dfrac{\ln x}{1/x}=\lim\dfrac{1/x}{-1/x^2}=\lim(-x)=0$.&lt;/li&gt;
    &lt;li&gt;$0^0$: $\lim_{x\to0^+}x^x=e^{\lim x\ln x}=e^0=1$. Với $x=0{,}01$: $0{,}01^{0{,}01}\approx0{,}955$.&lt;/li&gt;
    &lt;li&gt;$\infty-\infty$: $\lim_{x\to0}\left(\dfrac1x-\dfrac1{\sin x}\right)=\lim\dfrac{\sin x-x}{x\sin x}=\lim\dfrac{\cos x-1}{\sin x+x\cos x}=\lim\dfrac{-\sin x}{2\cos x-x\sin x}=0$.&lt;/li&gt;
    &lt;li&gt;$1^\infty$: $\lim_{x\to0}(1+2x)^{1/x}$. $\ln$ của biểu thức là $\dfrac{\ln(1+2x)}x\to\lim\dfrac{2/(1+2x)}1=2$, nên giới hạn bằng $e^2$.&lt;/li&gt;
  &lt;/ul&gt;
&lt;/div&gt;

&lt;h2 id=&quot;khi-nào-không-dùng-được&quot;&gt;Khi nào không dùng được&lt;/h2&gt;

&lt;div class=&quot;content-box warning-box textbook-block&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Lưu ý.&lt;/strong&gt;&lt;/p&gt;

  &lt;ol&gt;
    &lt;li&gt;&lt;em&gt;Phải là dạng vô định.&lt;/em&gt; $\lim_{x\to0}\dfrac{x+1}{x+2}=\dfrac12$, nhưng nếu đạo hàm tử và mẫu sẽ ra $1$, sai.&lt;/li&gt;
    &lt;li&gt;&lt;em&gt;Giới hạn của $f&apos;/g&apos;$ có thể không tồn tại trong khi giới hạn của $f/g$ vẫn tồn tại.&lt;/em&gt; $\lim_{x\to\infty}\dfrac{x+\sin x}{x}=1$ (chia cho $x$), nhưng $\dfrac{1+\cos x}{1}$ dao động. Quy tắc chỉ là điều kiện đủ.&lt;/li&gt;
    &lt;li&gt;&lt;em&gt;Lập luận vòng.&lt;/em&gt; Dùng L’Hôpital cho $\lim\dfrac{\sin x}x$ cần $(\sin x)&apos;=\cos x$, mà chứng minh của đẳng thức này (bài 02_02) lại dùng $\lim\dfrac{\sin x}x=1$. Với các giới hạn cơ bản, dùng chứng minh trực tiếp ở bài 01_04.&lt;/li&gt;
  &lt;/ol&gt;
&lt;/div&gt;

&lt;h2 id=&quot;minh-hoạ&quot;&gt;Minh hoạ&lt;/h2&gt;

&lt;div class=&quot;interactive-frame&quot;&gt;
  &lt;div class=&quot;interactive-frame-head&quot;&gt;
    &lt;div class=&quot;interactive-frame-title&quot;&gt;f/g và f′/g′ gần a&lt;/div&gt;
    &lt;div class=&quot;interactive-frame-desc&quot;&gt;Phóng to quanh a: f và g gần như hai đường thẳng.&lt;/div&gt;
  &lt;/div&gt;
  &lt;iframe src=&quot;/interactives/chapter02/lhopital-limit.html&quot; title=&quot;f/g và f′/g′ gần a&quot; loading=&quot;lazy&quot; style=&quot;height: 700px;&quot;&gt;&lt;/iframe&gt;
  &lt;div class=&quot;interactive-frame-foot&quot;&gt;
    &lt;a href=&quot;/interactives/chapter02/lhopital-limit.html&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;Mở minh hoạ ở cửa sổ riêng&lt;/a&gt;
  &lt;/div&gt;
&lt;/div&gt;

&lt;h2 id=&quot;ứng-dụng&quot;&gt;Ứng dụng&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Vật lý: tương đối tính về Newton.&lt;/strong&gt; Đặt $u=\tfrac{v^2}{c^2}$. Khi đó $\dfrac{K}{\tfrac12mv^2}=\dfrac{(1-u)^{-1/2}-1}{u/2}$. Khi $u\to0$, đây là dạng $\tfrac00$, và L’Hôpital cho $\dfrac{\tfrac12(1-u)^{-3/2}}{1/2}\to1$. Vậy $K\approx\tfrac12mv^2$ khi $v\ll c$. Với một vệ tinh bay $8$ km/s, $u\approx7\cdot10^{-10}$, hai công thức gần như trùng nhau.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Khoa học máy tính: độ phức tạp thuật toán.&lt;/strong&gt; Từ Ví dụ 2: $\dfrac{n\log n}{n^2}=\dfrac{\log n}{n}\to0$, nên thuật toán sắp xếp $O(n\log n)$ cuối cùng luôn nhanh hơn $O(n^2)$. Nhưng “cuối cùng” có thể rất xa: $x^{0{,}1}$ chỉ vượt $\ln x$ khi $x&amp;gt;3{,}4\cdot10^{15}$; tại $x=10^6$ vẫn có $\ln x\approx13{,}8&amp;gt;x^{0{,}1}\approx3{,}98$. Giới hạn chỉ nói về hành vi khi $x$ rất lớn.&lt;/p&gt;

&lt;h2 id=&quot;bài-tập&quot;&gt;Bài tập&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Mức cơ bản.&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;Tính $\lim_{x\to0}\dfrac{\tan x-x}{x^3}$.&lt;/li&gt;
  &lt;li&gt;Tính $\lim_{x\to\infty}\dfrac{\ln(x^2+1)}{x}$.&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Đáp án&lt;/summary&gt;

  &lt;ol&gt;
    &lt;li&gt;$\dfrac{1/\cos^2x-1}{3x^2}=\dfrac{\tan^2x}{3x^2}\to\dfrac13$.&lt;/li&gt;
    &lt;li&gt;$\dfrac{2x/(x^2+1)}{1}\to0$.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;p&gt;&lt;strong&gt;Mức vận dụng.&lt;/strong&gt;&lt;/p&gt;

&lt;ol start=&quot;3&quot;&gt;
  &lt;li&gt;Tính $\lim_{x\to0^+}x^{\sin x}$.&lt;/li&gt;
  &lt;li&gt;Tính $\lim_{x\to1}\left(\dfrac{x}{x-1}-\dfrac1{\ln x}\right)$.&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Đáp án&lt;/summary&gt;

  &lt;ol start=&quot;3&quot;&gt;
    &lt;li&gt;$\sin x\ln x\sim x\ln x\to0$, nên giới hạn bằng $1$.&lt;/li&gt;
    &lt;li&gt;Quy đồng: $\dfrac{x\ln x-x+1}{(x-1)\ln x}$. L’Hôpital hai lần: $\dfrac{\ln x}{\ln x+1-1/x}\to\dfrac{1/x}{1/x+1/x^2}\to\dfrac12$.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;p&gt;&lt;strong&gt;Mức nâng cao.&lt;/strong&gt;&lt;/p&gt;

&lt;ol start=&quot;5&quot;&gt;
  &lt;li&gt;Tính $\lim_{x\to0}\left(\dfrac{\sin x}x\right)^{1/x^2}$.&lt;/li&gt;
  &lt;li&gt;Chứng minh quy tắc L’Hôpital cho $x\to\infty$ (dạng $\tfrac00$) bằng cách đặt $x=\tfrac1t$.&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Gợi ý&lt;/summary&gt;

  &lt;ol start=&quot;5&quot;&gt;
    &lt;li&gt;$\ln$ của biểu thức là $\dfrac{\ln(\sin x/x)}{x^2}$. Dùng $\ln(1+u)\sim u$ với $u=\tfrac{\sin x}x-1\sim-\tfrac{x^2}6$: được $-\tfrac16$, nên giới hạn bằng $e^{-1/6}\approx0{,}846$.&lt;/li&gt;
    &lt;li&gt;$F(t)=f(1/t)$, $G(t)=g(1/t)$, $t\to0^+$. $\dfrac{F&apos;(t)}{G&apos;(t)}=\dfrac{-f&apos;(1/t)/t^2}{-g&apos;(1/t)/t^2}=\dfrac{f&apos;(x)}{g&apos;(x)}$.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;h2 id=&quot;tóm-tắt&quot;&gt;Tóm tắt&lt;/h2&gt;

&lt;div class=&quot;content-box summary-box textbook-block&quot;&gt;
  &lt;ul&gt;
    &lt;li&gt;Dạng $\tfrac00$ hoặc $\tfrac\infty\infty$: $\lim\tfrac fg=\lim\tfrac{f&apos;}{g&apos;}$ nếu vế phải tồn tại. Chứng minh bằng định lý Cauchy.&lt;/li&gt;
    &lt;li&gt;$0\cdot\infty$: chuyển thành thương. $\infty-\infty$: quy đồng. $1^\infty$, $0^0$, $\infty^0$: viết $f^g=e^{g\ln f}$.&lt;/li&gt;
    &lt;li&gt;$\ln x\ll x^a\ll e^x$ khi $x\to\infty$.&lt;/li&gt;
    &lt;li&gt;Kiểm tra dạng vô định trước mỗi lần dùng; quy tắc chỉ là điều kiện đủ; tránh lập luận vòng với giới hạn cơ bản.&lt;/li&gt;
  &lt;/ul&gt;
&lt;/div&gt;
</content>
 </entry>
 
 <entry>
   <title>Các định lý giá trị trung bình</title>
   <link href="https://calculus-self-learning.pages.dev/contents/vi/chapter02/02_05_Cac_dinh_ly_gia_tri_trung_binh/"/>
   <updated>2026-12-01T00:00:00+00:00</updated>
   <id>https://calculus-self-learning.pages.dev/contents/vi/chapter02/02_05_Cac_dinh_ly_gia_tri_trung_binh</id>
   <content type="html">&lt;div class=&quot;textbook-objectives&quot;&gt;

  &lt;p&gt;&lt;strong&gt;Mục tiêu học tập.&lt;/strong&gt; Sau bài này, người học có thể:&lt;/p&gt;

  &lt;ul&gt;
    &lt;li&gt;phát biểu và chứng minh các định lý Fermat, Rolle, Lagrange, Cauchy;&lt;/li&gt;
    &lt;li&gt;tìm điểm $c$ trong định lý Lagrange cho một hàm cụ thể;&lt;/li&gt;
    &lt;li&gt;suy ra: $f&apos;=0$ trên khoảng thì $f$ hằng, $f&apos;&amp;gt;0$ thì $f$ tăng;&lt;/li&gt;
    &lt;li&gt;dùng định lý Lagrange để chứng minh bất đẳng thức như $\lvert\sin a-\sin b\rvert\le\lvert a-b\rvert$ và $\ln(1+x)&amp;lt;x$.&lt;/li&gt;
  &lt;/ul&gt;

&lt;/div&gt;

&lt;h2 id=&quot;vì-sao-cần-bài-này&quot;&gt;Vì sao cần bài này&lt;/h2&gt;

&lt;p&gt;Một đoạn cao tốc dài 15 km có camera đo tốc độ trung bình ở hai đầu. Một xe đi hết đoạn đó trong 9 phút, tức vận tốc trung bình 100 km/h, trong khi giới hạn là 90 km/h. Tài xế cãi rằng lúc đi qua camera xe chỉ chạy 80 km/h. Định lý Lagrange khẳng định: nếu vị trí thay đổi liên tục và có vận tốc ở mọi thời điểm, thì chắc chắn có một thời điểm vận tốc tức thời bằng đúng 100 km/h. Xe đã vượt tốc độ ít nhất một lần.&lt;/p&gt;

&lt;h2 id=&quot;định-lý-fermat-và-rolle&quot;&gt;Định lý Fermat và Rolle&lt;/h2&gt;

&lt;div class=&quot;textbook-theorem&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Định lý 1 (Fermat).&lt;/strong&gt; Nếu $f$ đạt cực đại hoặc cực tiểu địa phương tại điểm trong $c$ và $f$ khả vi tại $c$ thì $f&apos;(c)=0$.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-proof&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Chứng minh.&lt;/strong&gt; Giả sử $f$ đạt cực đại địa phương tại $c$: $f(c+h)\le f(c)$ với $\lvert h\rvert$ nhỏ. Với $h&amp;gt;0$, $\dfrac{f(c+h)-f(c)}h\le0$, nên $f&apos;(c)=f&apos;_+(c)\le0$. Với $h&amp;lt;0$, tỉ số $\ge0$, nên $f&apos;(c)=f&apos;_-(c)\ge0$. Vậy $f&apos;(c)=0$. Cực tiểu làm tương tự.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-theorem&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Định lý 2 (Rolle).&lt;/strong&gt; Nếu $f$ liên tục trên $[a,b]$, khả vi trên $(a,b)$ và $f(a)=f(b)$ thì có $c\in(a,b)$ với $f&apos;(c)=0$.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-proof&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Chứng minh.&lt;/strong&gt; Theo định lý Weierstrass (bài 01_06), $f$ đạt max $M$ và min $m$ trên $[a,b]$. Nếu $M=m$ thì $f$ hằng và $f&apos;=0$ khắp nơi. Nếu $M&amp;gt;m$ thì ít nhất một trong hai giá trị khác $f(a)=f(b)$, nên đạt tại một điểm trong $c\in(a,b)$. Theo Định lý 1, $f&apos;(c)=0$.&lt;/p&gt;
&lt;/div&gt;

&lt;h2 id=&quot;định-lý-lagrange&quot;&gt;Định lý Lagrange&lt;/h2&gt;

&lt;div class=&quot;textbook-theorem&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Định lý 3 (Lagrange, giá trị trung bình).&lt;/strong&gt; Nếu $f$ liên tục trên $[a,b]$ và khả vi trên $(a,b)$ thì có $c\in(a,b)$ sao cho&lt;/p&gt;

\[f&apos;(c)=\frac{f(b)-f(a)}{b-a} .\]

&lt;/div&gt;

&lt;div class=&quot;textbook-proof&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Chứng minh.&lt;/strong&gt; Trừ đi dây cung: đặt $g(x)=f(x)-f(a)-\dfrac{f(b)-f(a)}{b-a}(x-a)$. Hàm $g$ liên tục trên $[a,b]$, khả vi trên $(a,b)$, và $g(a)=g(b)=0$. Theo Rolle có $c$ với $g&apos;(c)=0$, tức $f&apos;(c)=\dfrac{f(b)-f(a)}{b-a}$.&lt;/p&gt;
&lt;/div&gt;

&lt;p&gt;Hình học: có một điểm mà tiếp tuyến song song với dây cung nối hai đầu. Dạng hay dùng: $f(b)-f(a)=f&apos;(c)(b-a)$.&lt;/p&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Ví dụ 1.&lt;/strong&gt; Với $f(x)=x^3$ trên $[0,2]$: hệ số góc dây cung $\tfrac{8-0}{2}=4$. Giải $3c^2=4$: $c=\tfrac2{\sqrt3}\approx1{,}1547\in(0,2)$.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-theorem&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Hệ quả 1.&lt;/strong&gt; Cho $f$ khả vi trên khoảng $I$.&lt;/p&gt;

  &lt;ol&gt;
    &lt;li&gt;Nếu $f&apos;(x)=0$ với mọi $x\in I$ thì $f$ là hằng trên $I$.&lt;/li&gt;
    &lt;li&gt;Nếu $f&apos;(x)&amp;gt;0$ với mọi $x\in I$ thì $f$ tăng ngặt trên $I$ (tương tự $f&apos;&amp;lt;0$ thì giảm ngặt).&lt;/li&gt;
    &lt;li&gt;Nếu $\lvert f&apos;(x)\rvert\le K$ trên $I$ thì $\lvert f(x)-f(y)\rvert\le K\lvert x-y\rvert$ với mọi $x,y\in I$.&lt;/li&gt;
  &lt;/ol&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-proof&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Chứng minh.&lt;/strong&gt; Với $x&amp;lt;y$ trong $I$, Định lý 3 cho $f(y)-f(x)=f&apos;(c)(y-x)$ với $c\in(x,y)$. Nếu $f&apos;=0$ thì $f(y)=f(x)$. Nếu $f&apos;&amp;gt;0$ thì $f(y)&amp;gt;f(x)$. Nếu $\lvert f&apos;\rvert\le K$ thì $\lvert f(y)-f(x)\rvert\le K(y-x)$.&lt;/p&gt;
&lt;/div&gt;

&lt;p&gt;Hệ quả 1.1 là lý do hai nguyên hàm của cùng một hàm chỉ khác nhau một hằng số (chương 4).&lt;/p&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Ví dụ 2 (Bất đẳng thức).&lt;/strong&gt;&lt;/p&gt;

  &lt;ul&gt;
    &lt;li&gt;$\lvert\sin a-\sin b\rvert\le\lvert a-b\rvert$: vì $\lvert(\sin)&apos;\rvert=\lvert\cos\rvert\le1$, theo Hệ quả 1.3.&lt;/li&gt;
    &lt;li&gt;Với $x&amp;gt;0$: $\dfrac x{1+x}&amp;lt;\ln(1+x)&amp;lt;x$. Áp dụng Lagrange cho $\ln$ trên $[1,1+x]$: $\ln(1+x)-\ln1=\dfrac1c\cdot x$ với $1&amp;lt;c&amp;lt;1+x$. Vì $\dfrac1{1+x}&amp;lt;\dfrac1c&amp;lt;1$, ta được bất đẳng thức. Với $x=0{,}5$: $0{,}333&amp;lt;0{,}405&amp;lt;0{,}5$.&lt;/li&gt;
    &lt;li&gt;$e^x\ge1+x$ với mọi $x$: với $x&amp;gt;0$, $e^x-1=e^cx&amp;gt;x$; với $x&amp;lt;0$, $e^x-1=e^cx$ với $c\in(x,0)$, $e^c&amp;lt;1$ và $x&amp;lt;0$ nên $e^cx&amp;gt;x$.&lt;/li&gt;
  &lt;/ul&gt;
&lt;/div&gt;

&lt;h2 id=&quot;định-lý-cauchy&quot;&gt;Định lý Cauchy&lt;/h2&gt;

&lt;div class=&quot;textbook-theorem&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Định lý 4 (Cauchy).&lt;/strong&gt; Nếu $f,g$ liên tục trên $[a,b]$, khả vi trên $(a,b)$, và $g&apos;(x)\ne0$ trên $(a,b)$, thì có $c\in(a,b)$ với&lt;/p&gt;

\[\frac{f(b)-f(a)}{g(b)-g(a)}=\frac{f&apos;(c)}{g&apos;(c)} .\]

&lt;/div&gt;

&lt;div class=&quot;textbook-proof&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Chứng minh.&lt;/strong&gt; $g(b)\ne g(a)$, vì nếu bằng thì Rolle cho $g&apos;$ bằng 0 ở đâu đó. Đặt $h(x)=\big(f(b)-f(a)\big)g(x)-\big(g(b)-g(a)\big)f(x)$. Tính trực tiếp $h(a)=f(b)g(a)-g(b)f(a)=h(b)$. Theo Rolle có $c$ với $h&apos;(c)=0$, tức $\big(f(b)-f(a)\big)g&apos;(c)=\big(g(b)-g(a)\big)f&apos;(c)$. Chia cho $g&apos;(c)\big(g(b)-g(a)\big)$.&lt;/p&gt;
&lt;/div&gt;

&lt;p&gt;Lagrange là trường hợp riêng $g(x)=x$. Cauchy là chìa khoá chứng minh quy tắc L’Hôpital ở bài sau.&lt;/p&gt;

&lt;h2 id=&quot;video-ngắn&quot;&gt;Video ngắn&lt;/h2&gt;

&lt;div class=&quot;reel-video&quot;&gt;
  &lt;video controls=&quot;&quot; playsinline=&quot;&quot; preload=&quot;metadata&quot; src=&quot;/public/videos/reels/mean-value-theorem.mp4&quot;&gt;&lt;/video&gt;
  &lt;p class=&quot;reel-caption&quot;&gt;Định lý giá trị trung bình: xe đi 120 km hết 2 giờ, có lúc đồng hồ chỉ đúng 60 km/h, nơi tiếp tuyến song song với cát tuyến (video không lời, khoảng 1 phút 52 giây).&lt;/p&gt;
&lt;/div&gt;

&lt;h2 id=&quot;ứng-dụng&quot;&gt;Ứng dụng&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Giao thông: camera đo tốc độ trung bình.&lt;/strong&gt; Đã nêu ở đầu bài: vị trí $s(t)$ khả vi, $s(9\text{ phút})-s(0)=15$ km, nên có $c$ với $s&apos;(c)=\tfrac{15}{0{,}15}=100$ km/h.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Học máy: hằng số Lipschitz từ đạo hàm.&lt;/strong&gt; Hệ quả 1.3 cho cách tính hằng số Lipschitz đã dùng ở bài 01_02: $K=\sup\lvert f&apos;\rvert$. Ví dụ $\lvert\sigma&apos;\rvert\le\tfrac14$, nên $\lvert\sigma(x)-\sigma(y)\rvert\le\tfrac14\lvert x-y\rvert$. Một mạng nhiều lớp có hằng số Lipschitz không quá tích các hằng số của từng lớp; kỹ thuật “spectral normalization” giữ tích này nhỏ để mạng ổn định.&lt;/p&gt;

&lt;h2 id=&quot;bài-tập&quot;&gt;Bài tập&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Mức cơ bản.&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;Tìm $c$ trong định lý Lagrange cho $f(x)=x^2-3x$ trên $[1,4]$.&lt;/li&gt;
  &lt;li&gt;Kiểm tra giả thiết định lý Rolle cho $f(x)=\lvert x\rvert$ trên $[-1,1]$. Kết luận có đúng không?&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Đáp án&lt;/summary&gt;

  &lt;ol&gt;
    &lt;li&gt;Dây cung: $\tfrac{4-(-2)}{3}=2$. $2c-3=2$, $c=2{,}5$.&lt;/li&gt;
    &lt;li&gt;$f$ không khả vi tại 0; không có $c$ với $f&apos;(c)=0$. Giả thiết khả vi là cần.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;p&gt;&lt;strong&gt;Mức vận dụng.&lt;/strong&gt;&lt;/p&gt;

&lt;ol start=&quot;3&quot;&gt;
  &lt;li&gt;Chứng minh $\lvert\arctan a-\arctan b\rvert\le\lvert a-b\rvert$.&lt;/li&gt;
  &lt;li&gt;Chứng minh phương trình $x^5+x-1=0$ có đúng một nghiệm thực.&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Đáp án&lt;/summary&gt;

  &lt;ol start=&quot;3&quot;&gt;
    &lt;li&gt;$\lvert(\arctan x)&apos;\rvert=\tfrac1{1+x^2}\le1$.&lt;/li&gt;
    &lt;li&gt;Có nghiệm theo định lý giá trị trung gian ($f(0)=-1$, $f(1)=1$). Nếu có hai nghiệm, Rolle cho $f&apos;(c)=5c^4+1=0$, vô lý.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;p&gt;&lt;strong&gt;Mức nâng cao.&lt;/strong&gt;&lt;/p&gt;

&lt;ol start=&quot;5&quot;&gt;
  &lt;li&gt;Chứng minh $\sqrt{1+x}&amp;lt;1+\dfrac x2$ với $x&amp;gt;0$.&lt;/li&gt;
  &lt;li&gt;Cho $f$ khả vi trên $\mathbb{R}$ với $f&apos;(x)=f(x)$ mọi $x$. Chứng minh $f(x)=Ce^x$.&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Gợi ý&lt;/summary&gt;

  &lt;ol start=&quot;5&quot;&gt;
    &lt;li&gt;Lagrange cho $\sqrt t$ trên $[1,1+x]$: $\sqrt{1+x}-1=\dfrac{x}{2\sqrt c}&amp;lt;\dfrac x2$.&lt;/li&gt;
    &lt;li&gt;Xét $g(x)=f(x)e^{-x}$: $g&apos;=f&apos;e^{-x}-fe^{-x}=0$, nên $g$ hằng.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;h2 id=&quot;tóm-tắt&quot;&gt;Tóm tắt&lt;/h2&gt;

&lt;div class=&quot;content-box summary-box textbook-block&quot;&gt;
  &lt;ul&gt;
    &lt;li&gt;Fermat: cực trị tại điểm trong và khả vi thì $f&apos;=0$.&lt;/li&gt;
    &lt;li&gt;Rolle: $f(a)=f(b)$ thì có $c$ với $f&apos;(c)=0$. Lagrange: $f(b)-f(a)=f&apos;(c)(b-a)$. Cauchy: $\dfrac{f(b)-f(a)}{g(b)-g(a)}=\dfrac{f&apos;(c)}{g&apos;(c)}$.&lt;/li&gt;
    &lt;li&gt;Hệ quả: $f&apos;=0$ thì hằng; $f&apos;&amp;gt;0$ thì tăng ngặt; $\lvert f&apos;\rvert\le K$ thì $\lvert f(x)-f(y)\rvert\le K\lvert x-y\rvert$.&lt;/li&gt;
    &lt;li&gt;Chứng minh bất đẳng thức: áp dụng Lagrange rồi chặn $f&apos;(c)$.&lt;/li&gt;
  &lt;/ul&gt;
&lt;/div&gt;
</content>
 </entry>
 
 <entry>
   <title>Đạo hàm cấp cao, vi phân và xấp xỉ tuyến tính</title>
   <link href="https://calculus-self-learning.pages.dev/contents/vi/chapter02/02_04_Dao_ham_cap_cao_vi_phan_xap_xi_tuyen_tinh/"/>
   <updated>2026-12-01T00:00:00+00:00</updated>
   <id>https://calculus-self-learning.pages.dev/contents/vi/chapter02/02_04_Dao_ham_cap_cao_vi_phan_xap_xi_tuyen_tinh</id>
   <content type="html">&lt;div class=&quot;textbook-objectives&quot;&gt;

  &lt;p&gt;&lt;strong&gt;Mục tiêu học tập.&lt;/strong&gt; Sau bài này, người học có thể:&lt;/p&gt;

  &lt;ul&gt;
    &lt;li&gt;tính đạo hàm cấp hai, cấp $n$ của các hàm thường gặp và dùng công thức Leibniz cho tích;&lt;/li&gt;
    &lt;li&gt;phát biểu và chứng minh: khả vi tại $a$ tương đương với $f(a+h)=f(a)+Ah+o(h)$;&lt;/li&gt;
    &lt;li&gt;dùng xấp xỉ tuyến tính để tính gần đúng và ước lượng sai số;&lt;/li&gt;
    &lt;li&gt;dùng vi phân để lan truyền sai số đo trong vật lý.&lt;/li&gt;
  &lt;/ul&gt;

&lt;/div&gt;

&lt;h2 id=&quot;vì-sao-cần-bài-này&quot;&gt;Vì sao cần bài này&lt;/h2&gt;

&lt;p&gt;Đo bán kính một quả cầu được $r=10$ cm, sai số $\pm0{,}05$ cm. Thể tích $V=\tfrac43\pi r^3\approx4189$ cm³ sai bao nhiêu? Tính $V(10{,}05)-V(10)$ cũng được, nhưng nếu công thức phức tạp hơn và có nhiều đại lượng đo thì không thực tế. Vi phân cho câu trả lời trong một dòng: $dV=4\pi r^2\,dr\approx62{,}8$ cm³, tức khoảng $1{,}5\%$.&lt;/p&gt;

&lt;h2 id=&quot;đạo-hàm-cấp-cao&quot;&gt;Đạo hàm cấp cao&lt;/h2&gt;

&lt;div class=&quot;textbook-definition&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Định nghĩa 1.&lt;/strong&gt; Nếu $f&apos;$ khả vi thì đạo hàm của nó là &lt;em&gt;đạo hàm cấp hai&lt;/em&gt; $f&apos;&apos;=(f&apos;)&apos;$. Tổng quát, $f^{(n)}=(f^{(n-1)})&apos;$. Ký hiệu Leibniz: $\dfrac{d^ny}{dx^n}$.&lt;/p&gt;
&lt;/div&gt;

&lt;p&gt;Trong vật lý, $s&apos;&apos;$ là gia tốc. Trong hình học (chương 3), dấu của $f&apos;&apos;$ cho biết đồ thị lồi hay lõm.&lt;/p&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Ví dụ 1.&lt;/strong&gt;&lt;/p&gt;

  &lt;ul&gt;
    &lt;li&gt;$(\sin x)^{(n)}=\sin\left(x+\tfrac{n\pi}2\right)$: mỗi lần đạo hàm, đồ thị dịch trái $\tfrac\pi2$. Kiểm tra $n=1$: $\sin(x+\tfrac\pi2)=\cos x$.&lt;/li&gt;
    &lt;li&gt;$\left(\dfrac1{1+x}\right)^{(n)}=\dfrac{(-1)^nn!}{(1+x)^{n+1}}$. Kiểm tra $n=2$: $\left(-\tfrac1{(1+x)^2}\right)&apos;=\tfrac{2}{(1+x)^3}$.&lt;/li&gt;
    &lt;li&gt;$(e^{ax})^{(n)}=a^ne^{ax}$.&lt;/li&gt;
  &lt;/ul&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-theorem&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Định lý 1 (Công thức Leibniz).&lt;/strong&gt; Nếu $u,v$ có đạo hàm đến cấp $n$ thì&lt;/p&gt;

\[(uv)^{(n)}=\sum_{k=0}^n\binom nk u^{(k)}v^{(n-k)} .\]

&lt;/div&gt;

&lt;p&gt;Chứng minh bằng quy nạp theo $n$, giống chứng minh nhị thức Newton, dùng $\binom nk+\binom n{k-1}=\binom{n+1}k$.&lt;/p&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Ví dụ 2.&lt;/strong&gt; Tính $(x^2e^x)^{(10)}$. Với $u=x^2$ chỉ có ba đạo hàm khác 0: $u=x^2$, $u&apos;=2x$, $u&apos;&apos;=2$. Vậy&lt;/p&gt;

\[(x^2e^x)^{(10)}=x^2e^x+10\cdot2x\,e^x+45\cdot2\,e^x=(x^2+20x+90)e^x .\]

&lt;/div&gt;

&lt;h2 id=&quot;xấp-xỉ-tuyến-tính-và-vi-phân&quot;&gt;Xấp xỉ tuyến tính và vi phân&lt;/h2&gt;

&lt;div class=&quot;textbook-theorem&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Định lý 2.&lt;/strong&gt; $f$ khả vi tại $a$ khi và chỉ khi có số $A$ sao cho&lt;/p&gt;

\[f(a+h)=f(a)+Ah+o(h)\quad(h\to0),\]

  &lt;p&gt;và khi đó $A=f&apos;(a)$.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-proof&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Chứng minh.&lt;/strong&gt; Nếu $f$ khả vi, đặt $r(h)=f(a+h)-f(a)-f&apos;(a)h$. Khi đó $\dfrac{r(h)}h=\dfrac{f(a+h)-f(a)}h-f&apos;(a)\to0$, tức $r(h)=o(h)$. Ngược lại, nếu $f(a+h)=f(a)+Ah+r(h)$ với $r(h)/h\to0$ thì $\dfrac{f(a+h)-f(a)}h=A+\dfrac{r(h)}h\to A$, nên $f&apos;(a)=A$.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-definition&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Định nghĩa 2 (Vi phân, xấp xỉ tuyến tính).&lt;/strong&gt; &lt;em&gt;Vi phân&lt;/em&gt; của $f$ tại $x$ ứng với số gia $dx$ là $dy=f&apos;(x)\,dx$. Hàm $L(x)=f(a)+f&apos;(a)(x-a)$ là &lt;em&gt;xấp xỉ tuyến tính&lt;/em&gt; của $f$ tại $a$; đồ thị của nó là tiếp tuyến.&lt;/p&gt;
&lt;/div&gt;

&lt;p&gt;Định lý 2 nói: số gia thật $\Delta y=f(a+h)-f(a)$ và vi phân $dy=f&apos;(a)h$ chỉ khác nhau một VCB bậc cao hơn $h$. Chương 8 sẽ cho sai số cụ thể: nếu $f&apos;&apos;$ tồn tại thì sai số xấp xỉ $\tfrac12f&apos;&apos;(\xi)h^2$.&lt;/p&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Ví dụ 3.&lt;/strong&gt; Tính gần đúng $\sqrt{4{,}1}$.&lt;/p&gt;

  &lt;p&gt;$f(x)=\sqrt x$, $a=4$, $h=0{,}1$, $f&apos;(4)=\tfrac14$. Vậy $\sqrt{4{,}1}\approx2+\tfrac{0{,}1}4=2{,}025$. Giá trị đúng $2{,}024846$, sai số $0{,}000154$. Dự đoán sai số: $\tfrac12\lvert f&apos;&apos;(4)\rvert h^2=\tfrac12\cdot\tfrac1{32}\cdot0{,}01\approx0{,}000156$, rất khớp.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Ví dụ 4.&lt;/strong&gt; Tính gần đúng $\sin31^\circ$.&lt;/p&gt;

  &lt;p&gt;$31^\circ=\tfrac\pi6+\tfrac{\pi}{180}$. Với $f=\sin$, $a=\tfrac\pi6$, $h=\tfrac\pi{180}\approx0{,}017453$: $\sin31^\circ\approx\tfrac12+\tfrac{\sqrt3}2\cdot0{,}017453\approx0{,}51511$. Giá trị đúng $0{,}51504$.&lt;/p&gt;
&lt;/div&gt;

&lt;h2 id=&quot;ứng-dụng&quot;&gt;Ứng dụng&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Vật lý: lan truyền sai số.&lt;/strong&gt; Với $V=\tfrac43\pi r^3$: $dV=4\pi r^2dr=4\pi\cdot100\cdot0{,}05\approx62{,}8$ cm³. Sai số tương đối $\dfrac{dV}V=3\dfrac{dr}r=3\cdot0{,}5\%=1{,}5\%$. Quy tắc chung: với $y=Cx^n$, sai số tương đối của $y$ gấp $\lvert n\rvert$ lần sai số tương đối của $x$. Khi đo $g$ bằng con lắc, $g=\tfrac{4\pi^2L}{T^2}$, sai số 1% của chu kỳ $T$ gây sai số 2% của $g$, nên phải đo $T$ cẩn thận hơn đo $L$.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Học máy: vì sao gradient descent đi xuống.&lt;/strong&gt; Theo xấp xỉ tuyến tính, $f(x-\eta f&apos;(x))\approx f(x)-\eta f&apos;(x)^2$. Nếu $f&apos;(x)\ne0$ và $\eta&amp;gt;0$ đủ nhỏ thì vế phải nhỏ hơn $f(x)$: mỗi bước làm hàm mất mát giảm. “Đủ nhỏ” là để phần $o(h)$ bị bỏ qua không lấn át, đúng như phản ví dụ $\eta=1{,}5$ ở bài 00_04.&lt;/p&gt;

&lt;h2 id=&quot;bài-tập&quot;&gt;Bài tập&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Mức cơ bản.&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;Tính $f&apos;&apos;$ của $f(x)=x\ln x$ và $f(x)=e^{-x^2}$.&lt;/li&gt;
  &lt;li&gt;Tính gần đúng $\sqrt[3]{8{,}06}$ và $\ln(1{,}02)$.&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Đáp án&lt;/summary&gt;

  &lt;ol&gt;
    &lt;li&gt;$\tfrac1x$; $(4x^2-2)e^{-x^2}$.&lt;/li&gt;
    &lt;li&gt;$2+\tfrac{0{,}06}{12}=2{,}005$; $\ln(1{,}02)\approx0{,}02$ (đúng $0{,}0198$).&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;p&gt;&lt;strong&gt;Mức vận dụng.&lt;/strong&gt;&lt;/p&gt;

&lt;ol start=&quot;3&quot;&gt;
  &lt;li&gt;Tìm công thức $(\ln x)^{(n)}$.&lt;/li&gt;
  &lt;li&gt;Cạnh hình lập phương đo được 5 cm với sai số 0,1 mm. Ước lượng sai số tuyệt đối và tương đối của thể tích.&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Đáp án&lt;/summary&gt;

  &lt;ol start=&quot;3&quot;&gt;
    &lt;li&gt;$\dfrac{(-1)^{n-1}(n-1)!}{x^n}$.&lt;/li&gt;
    &lt;li&gt;$dV=3\cdot25\cdot0{,}01=0{,}75$ cm³; tương đối $3\cdot0{,}2\%=0{,}6\%$.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;p&gt;&lt;strong&gt;Mức nâng cao.&lt;/strong&gt;&lt;/p&gt;

&lt;ol start=&quot;5&quot;&gt;
  &lt;li&gt;Dùng công thức Leibniz tính $(x^3\sin x)^{(20)}$ tại $x=0$.&lt;/li&gt;
  &lt;li&gt;Chứng minh nếu $f&apos;&apos;$ liên tục gần $a$ thì $\lim_{h\to0}\dfrac{f(a+h)-2f(a)+f(a-h)}{h^2}=f&apos;&apos;(a)$. Công thức này dùng để tính đạo hàm cấp hai bằng số.&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Gợi ý&lt;/summary&gt;

  &lt;ol start=&quot;5&quot;&gt;
    &lt;li&gt;Chỉ số hạng $k=3$ khác 0 tại $x=0$: $\binom{20}{3}\cdot6\cdot(\sin)^{(17)}(0)=1140\cdot6\cdot\sin\tfrac{17\pi}2=6840$.&lt;/li&gt;
    &lt;li&gt;Dùng quy tắc L’Hôpital (bài 02_06) hai lần theo $h$, hoặc khai triển Taylor ở chương 8.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;h2 id=&quot;tóm-tắt&quot;&gt;Tóm tắt&lt;/h2&gt;

&lt;div class=&quot;content-box summary-box textbook-block&quot;&gt;
  &lt;ul&gt;
    &lt;li&gt;$f&apos;&apos;=(f&apos;)&apos;$; $(\sin x)^{(n)}=\sin(x+\tfrac{n\pi}2)$; công thức Leibniz cho $(uv)^{(n)}$.&lt;/li&gt;
    &lt;li&gt;Khả vi tại $a$ tương đương $f(a+h)=f(a)+f&apos;(a)h+o(h)$.&lt;/li&gt;
    &lt;li&gt;Vi phân $dy=f&apos;(x)dx$; xấp xỉ $f(a+h)\approx f(a)+f&apos;(a)h$, sai số cỡ $\tfrac12f&apos;&apos;h^2$.&lt;/li&gt;
    &lt;li&gt;Với $y=Cx^n$: sai số tương đối của $y$ bằng $\lvert n\rvert$ lần sai số tương đối của $x$.&lt;/li&gt;
  &lt;/ul&gt;
&lt;/div&gt;
</content>
 </entry>
 
 <entry>
   <title>Đạo hàm của hàm ngược, hàm ẩn, hàm cho bởi tham số</title>
   <link href="https://calculus-self-learning.pages.dev/contents/vi/chapter02/02_03_Dao_ham_ham_nguoc_ham_an_ham_tham_so/"/>
   <updated>2026-12-01T00:00:00+00:00</updated>
   <id>https://calculus-self-learning.pages.dev/contents/vi/chapter02/02_03_Dao_ham_ham_nguoc_ham_an_ham_tham_so</id>
   <content type="html">&lt;div class=&quot;textbook-objectives&quot;&gt;

  &lt;p&gt;&lt;strong&gt;Mục tiêu học tập.&lt;/strong&gt; Sau bài này, người học có thể:&lt;/p&gt;

  &lt;ul&gt;
    &lt;li&gt;dùng công thức $(f^{-1})&apos;(y)=\dfrac1{f&apos;(x)}$ để suy ra đạo hàm của $\ln x$, $\arcsin x$, $\arctan x$;&lt;/li&gt;
    &lt;li&gt;tính $y&apos;$ khi $y$ cho ẩn bởi một phương trình $F(x,y)=0$;&lt;/li&gt;
    &lt;li&gt;tính hệ số góc tiếp tuyến của đường cong cho bởi tham số $x=x(t)$, $y=y(t)$;&lt;/li&gt;
    &lt;li&gt;dùng đạo hàm logarit cho hàm dạng $u(x)^{v(x)}$ và tính độ co giãn trong kinh tế.&lt;/li&gt;
  &lt;/ul&gt;

&lt;/div&gt;

&lt;h2 id=&quot;vì-sao-cần-bài-này&quot;&gt;Vì sao cần bài này&lt;/h2&gt;

&lt;p&gt;Đường tròn $x^2+y^2=25$ không phải đồ thị của một hàm $y=f(x)$, nhưng tại điểm $(3,4)$ nó vẫn có tiếp tuyến. Quỹ đạo của quả bóng ném xiên được cho theo thời gian: $x(t)$, $y(t)$. Hàm $\arctan x$ được định nghĩa như hàm ngược, không có công thức tường minh để áp dụng các quy tắc bài trước. Cả ba trường hợp cần một cách lấy đạo hàm mà không cần công thức $y=f(x)$ tường minh.&lt;/p&gt;

&lt;h2 id=&quot;đạo-hàm-của-hàm-ngược&quot;&gt;Đạo hàm của hàm ngược&lt;/h2&gt;

&lt;div class=&quot;textbook-theorem&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Định lý 1.&lt;/strong&gt; Cho $f$ liên tục, đơn điệu ngặt trên một khoảng, khả vi tại $x$ với $f&apos;(x)\ne0$. Khi đó $f^{-1}$ khả vi tại $y=f(x)$ và&lt;/p&gt;

\[(f^{-1})&apos;(y)=\frac1{f&apos;(x)}=\frac{1}{f&apos;(f^{-1}(y))}.\]

&lt;/div&gt;

&lt;div class=&quot;textbook-proof&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Chứng minh.&lt;/strong&gt; Đặt $g=f^{-1}$; $g$ liên tục (hàm ngược của hàm liên tục đơn điệu). Với $k\ne0$, đặt $h=g(y+k)-g(y)$; vì $g$ đơn ánh nên $h\ne0$, và $h\to0$ khi $k\to0$. Ta có $f(x+h)=y+k$, nên&lt;/p&gt;

\[\frac{g(y+k)-g(y)}k=\frac{h}{f(x+h)-f(x)}=\frac1{\dfrac{f(x+h)-f(x)}h}\to\frac1{f&apos;(x)} .\]

&lt;/div&gt;

&lt;p&gt;Ý nghĩa hình học: đồ thị $f^{-1}$ là ảnh đối xứng của đồ thị $f$ qua $y=x$ (bài 00_02), nên hệ số góc đổi thành nghịch đảo.&lt;/p&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Ví dụ 1.&lt;/strong&gt;&lt;/p&gt;

  &lt;ul&gt;
    &lt;li&gt;$y=\ln x$ là hàm ngược của $x=e^y$. Vậy $(\ln x)&apos;=\dfrac1{e^y}=\dfrac1x$.&lt;/li&gt;
    &lt;li&gt;$y=\arcsin x$, $x=\sin y$ với $y\in(-\tfrac\pi2,\tfrac\pi2)$. Vậy $(\arcsin x)&apos;=\dfrac1{\cos y}=\dfrac1{\sqrt{1-x^2}}$ (lấy căn dương vì $\cos y&amp;gt;0$).&lt;/li&gt;
    &lt;li&gt;$y=\arctan x$, $x=\tan y$. Vậy $(\arctan x)&apos;=\cos^2y=\dfrac1{1+\tan^2y}=\dfrac1{1+x^2}$.&lt;/li&gt;
    &lt;li&gt;$a^x=e^{x\ln a}$, nên $(a^x)&apos;=a^x\ln a$. Với $x^\alpha=e^{\alpha\ln x}$ ($x&amp;gt;0$): $(x^\alpha)&apos;=x^\alpha\cdot\tfrac\alpha x=\alpha x^{\alpha-1}$.&lt;/li&gt;
  &lt;/ul&gt;
&lt;/div&gt;

&lt;h2 id=&quot;đạo-hàm-hàm-ẩn&quot;&gt;Đạo hàm hàm ẩn&lt;/h2&gt;

&lt;p&gt;Khi $y$ là hàm của $x$ cho bởi phương trình $F(x,y)=0$, ta lấy đạo hàm hai vế theo $x$, coi $y=y(x)$ và dùng quy tắc hàm hợp cho mọi biểu thức chứa $y$, rồi giải ra $y&apos;$.&lt;/p&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Ví dụ 2.&lt;/strong&gt; Tiếp tuyến của đường tròn $x^2+y^2=25$ tại $(3,4)$.&lt;/p&gt;

  &lt;p&gt;Đạo hàm hai vế: $2x+2y\,y&apos;=0$, nên $y&apos;=-\dfrac xy$. Tại $(3,4)$: $y&apos;=-\tfrac34$. Tiếp tuyến $y=4-\tfrac34(x-3)$. Kiểm tra hình học: bán kính từ gốc đến $(3,4)$ có hệ số góc $\tfrac43$, vuông góc với tiếp tuyến vì $\tfrac43\cdot\left(-\tfrac34\right)=-1$.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Ví dụ 3.&lt;/strong&gt; Lá Descartes $x^3+y^3=6xy$. Tính $y&apos;$ tại $(3,3)$.&lt;/p&gt;

  &lt;p&gt;Đạo hàm: $3x^2+3y^2y&apos;=6y+6xy&apos;$. Giải: $y&apos;(3y^2-6x)=6y-3x^2$, $y&apos;=\dfrac{2y-x^2}{y^2-2x}$. Tại $(3,3)$: $y&apos;=\dfrac{6-9}{9-6}=-1$.&lt;/p&gt;
&lt;/div&gt;

&lt;h2 id=&quot;hàm-cho-bởi-tham-số&quot;&gt;Hàm cho bởi tham số&lt;/h2&gt;

&lt;div class=&quot;textbook-theorem&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Định lý 2.&lt;/strong&gt; Cho đường cong $x=x(t)$, $y=y(t)$ với $x,y$ khả vi và $x&apos;(t)\ne0$. Khi đó&lt;/p&gt;

\[\frac{dy}{dx}=\frac{y&apos;(t)}{x&apos;(t)} .\]

&lt;/div&gt;

&lt;div class=&quot;textbook-proof&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Chứng minh.&lt;/strong&gt; Vì $x&apos;(t)\ne0$ và $x&apos;$ liên tục gần $t$ (giả thiết thêm), $x(t)$ đơn điệu ngặt gần $t$, nên có hàm ngược $t=t(x)$. Khi đó $y=y(t(x))$, và theo quy tắc hàm hợp cùng Định lý 1, $\dfrac{dy}{dx}=y&apos;(t)\cdot\dfrac1{x&apos;(t)}$.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Ví dụ 4.&lt;/strong&gt; Đường cycloid $x=t-\sin t$, $y=1-\cos t$ là quỹ đạo của một điểm trên vành bánh xe bán kính 1. Ta có $\dfrac{dy}{dx}=\dfrac{\sin t}{1-\cos t}$. Tại $t=\tfrac\pi2$: $\dfrac{dy}{dx}=1$. Khi $t\to0^+$, $\dfrac{\sin t}{1-\cos t}\sim\dfrac{t}{t^2/2}\to+\infty$: tiếp tuyến thẳng đứng tại điểm chạm đất.&lt;/p&gt;
&lt;/div&gt;

&lt;h2 id=&quot;đạo-hàm-logarit&quot;&gt;Đạo hàm logarit&lt;/h2&gt;

&lt;p&gt;Với $y=u(x)^{v(x)}$, $u&amp;gt;0$: lấy $\ln$ hai vế, $\ln y=v\ln u$, rồi đạo hàm:&lt;/p&gt;

\[\frac{y&apos;}y=v&apos;\ln u+v\frac{u&apos;}u .\]

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Ví dụ 5.&lt;/strong&gt; $y=x^x$, $x&amp;gt;0$: $\ln y=x\ln x$, $\dfrac{y&apos;}y=\ln x+1$, nên $y&apos;=x^x(\ln x+1)$. Đạo hàm bằng 0 tại $x=\tfrac1e$, nơi $x^x$ nhỏ nhất, giá trị $e^{-1/e}\approx0{,}692$.&lt;/p&gt;
&lt;/div&gt;

&lt;h2 id=&quot;ứng-dụng&quot;&gt;Ứng dụng&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Kinh tế: độ co giãn của cầu.&lt;/strong&gt; Độ co giãn $E=\dfrac{dQ/Q}{dp/p}=\dfrac{d\ln Q}{d\ln p}$ là phần trăm thay đổi lượng cầu khi giá tăng 1%. Với $Q=1000p^{-1{,}5}$: $\ln Q=\ln1000-1{,}5\ln p$, nên $E=-1{,}5$. Giá tăng 1% thì lượng cầu giảm khoảng 1,5%, và doanh thu $pQ$ giảm. Đạo hàm logarit cho kết quả ngay, không cần tính $Q&apos;$ rồi chia.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Vật lý: hướng bay của vật ném xiên.&lt;/strong&gt; $x=v_0\cos\theta\,t$, $y=v_0\sin\theta\,t-\tfrac12gt^2$. Hệ số góc $\dfrac{dy}{dx}=\dfrac{v_0\sin\theta-gt}{v_0\cos\theta}$, bằng 0 tại $t=\dfrac{v_0\sin\theta}{g}$: đỉnh quỹ đạo. Với $v_0=20$ m/s, $\theta=30^\circ$, $g=9{,}8$: đỉnh đạt sau khoảng $1{,}02$ s.&lt;/p&gt;

&lt;h2 id=&quot;bài-tập&quot;&gt;Bài tập&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Mức cơ bản.&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;Tính đạo hàm của $\arctan(2x)$ và $\ln(\cos x)$.&lt;/li&gt;
  &lt;li&gt;Tìm $y&apos;$ nếu $xy+y^2=6$, tính tại $(1,2)$.&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Đáp án&lt;/summary&gt;

  &lt;ol&gt;
    &lt;li&gt;$\dfrac{2}{1+4x^2}$; $-\tan x$.&lt;/li&gt;
    &lt;li&gt;$y+xy&apos;+2yy&apos;=0$, $y&apos;=-\dfrac{y}{x+2y}$. Tại $(1,2)$: $-\tfrac25$.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;p&gt;&lt;strong&gt;Mức vận dụng.&lt;/strong&gt;&lt;/p&gt;

&lt;ol start=&quot;3&quot;&gt;
  &lt;li&gt;Đường cong $x=\cos^3t$, $y=\sin^3t$. Tính $\dfrac{dy}{dx}$.&lt;/li&gt;
  &lt;li&gt;Tính đạo hàm của $y=(\sin x)^{x}$ trên $(0,\pi)$.&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Đáp án&lt;/summary&gt;

  &lt;ol start=&quot;3&quot;&gt;
    &lt;li&gt;$\dfrac{3\sin^2t\cos t}{-3\cos^2t\sin t}=-\tan t$.&lt;/li&gt;
    &lt;li&gt;$y&apos;=(\sin x)^x\left(\ln\sin x+x\cot x\right)$.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;p&gt;&lt;strong&gt;Mức nâng cao.&lt;/strong&gt;&lt;/p&gt;

&lt;ol start=&quot;5&quot;&gt;
  &lt;li&gt;Chứng minh $(\arccos x)&apos;=-\dfrac1{\sqrt{1-x^2}}$ bằng hai cách: Định lý 1, và từ $\arcsin x+\arccos x=\tfrac\pi2$.&lt;/li&gt;
  &lt;li&gt;Cho $f(x)=x^3+x$. Tính $(f^{-1})&apos;(2)$ mà không tìm công thức của $f^{-1}$.&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Gợi ý&lt;/summary&gt;

  &lt;ol start=&quot;5&quot;&gt;
    &lt;li&gt;$y=\arccos x$, $x=\cos y$, $y\in(0,\pi)$, $\sin y&amp;gt;0$: $(\arccos x)&apos;=-\tfrac1{\sin y}$. Cách hai: đạo hàm hằng đẳng thức.&lt;/li&gt;
    &lt;li&gt;$f(1)=2$, $f&apos;(1)=4$, nên $(f^{-1})&apos;(2)=\tfrac14$.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;h2 id=&quot;tóm-tắt&quot;&gt;Tóm tắt&lt;/h2&gt;

&lt;div class=&quot;content-box summary-box textbook-block&quot;&gt;
  &lt;ul&gt;
    &lt;li&gt;Hàm ngược: $(f^{-1})&apos;(y)=1/f&apos;(x)$. Từ đó $(\ln x)&apos;=\tfrac1x$, $(\arcsin x)&apos;=\tfrac1{\sqrt{1-x^2}}$, $(\arctan x)&apos;=\tfrac1{1+x^2}$.&lt;/li&gt;
    &lt;li&gt;Hàm ẩn: đạo hàm hai vế theo $x$, coi $y=y(x)$, rồi giải $y&apos;$.&lt;/li&gt;
    &lt;li&gt;Tham số: $\dfrac{dy}{dx}=\dfrac{y&apos;(t)}{x&apos;(t)}$.&lt;/li&gt;
    &lt;li&gt;Đạo hàm logarit cho $u^v$ và cho độ co giãn $E=\dfrac{d\ln Q}{d\ln p}$.&lt;/li&gt;
  &lt;/ul&gt;
&lt;/div&gt;
</content>
 </entry>
 
 <entry>
   <title>Quy tắc tính đạo hàm</title>
   <link href="https://calculus-self-learning.pages.dev/contents/vi/chapter02/02_02_Quy_tac_tinh_dao_ham/"/>
   <updated>2026-12-01T00:00:00+00:00</updated>
   <id>https://calculus-self-learning.pages.dev/contents/vi/chapter02/02_02_Quy_tac_tinh_dao_ham</id>
   <content type="html">&lt;div class=&quot;textbook-objectives&quot;&gt;

  &lt;p&gt;&lt;strong&gt;Mục tiêu học tập.&lt;/strong&gt; Sau bài này, người học có thể:&lt;/p&gt;

  &lt;ul&gt;
    &lt;li&gt;chứng minh quy tắc tích và quy tắc hàm hợp;&lt;/li&gt;
    &lt;li&gt;chứng minh $(\sin x)&apos;=\cos x$ và $(e^x)&apos;=e^x$ từ các giới hạn cơ bản;&lt;/li&gt;
    &lt;li&gt;đạo hàm nhanh mọi hàm sơ cấp bằng bảng đạo hàm và bốn quy tắc;&lt;/li&gt;
    &lt;li&gt;nhận ra quy tắc hàm hợp là cơ sở của lan truyền ngược trong mạng nơ-ron.&lt;/li&gt;
  &lt;/ul&gt;

&lt;/div&gt;

&lt;h2 id=&quot;vì-sao-cần-bài-này&quot;&gt;Vì sao cần bài này&lt;/h2&gt;

&lt;p&gt;Tính đạo hàm của $f(x)=x^2\sin x$ bằng định nghĩa thì phải xử lý $\dfrac{(x+h)^2\sin(x+h)-x^2\sin x}h$, khá dài. Với $e^{-x^2/2}\sin(3x)$ thì gần như không làm nổi. Kỹ sư và máy tính không làm như vậy: họ dùng một bảng đạo hàm ngắn và bốn quy tắc ghép. Phần mềm học sâu như PyTorch cũng chỉ làm đúng điều đó, tự động.&lt;/p&gt;

&lt;h2 id=&quot;bốn-quy-tắc&quot;&gt;Bốn quy tắc&lt;/h2&gt;

&lt;div class=&quot;textbook-theorem&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Định lý 1.&lt;/strong&gt; Nếu $f,g$ khả vi tại $x$ thì&lt;/p&gt;

  &lt;ol&gt;
    &lt;li&gt;$(f\pm g)&apos;=f&apos;\pm g&apos;$, $(cf)&apos;=cf&apos;$;&lt;/li&gt;
    &lt;li&gt;$(fg)&apos;=f&apos;g+fg&apos;$ (quy tắc tích);&lt;/li&gt;
    &lt;li&gt;$\left(\dfrac fg\right)&apos;=\dfrac{f&apos;g-fg&apos;}{g^2}$ nếu $g(x)\ne0$ (quy tắc thương).&lt;/li&gt;
  &lt;/ol&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-proof&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Chứng minh (quy tắc tích).&lt;/strong&gt; Thêm bớt $f(x+h)g(x)$:&lt;/p&gt;

\[\frac{f(x+h)g(x+h)-f(x)g(x)}h=f(x+h)\frac{g(x+h)-g(x)}h+g(x)\frac{f(x+h)-f(x)}h .\]

  &lt;p&gt;Khi $h\to0$: $f(x+h)\to f(x)$ (khả vi nên liên tục, Định lý 1 bài 02_01), hai tỉ số sai phân tiến tới $g&apos;(x)$ và $f&apos;(x)$. Vậy giới hạn là $f(x)g&apos;(x)+g(x)f&apos;(x)$.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-theorem&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Định lý 2 (Quy tắc hàm hợp).&lt;/strong&gt; Nếu $g$ khả vi tại $x$ và $f$ khả vi tại $g(x)$ thì&lt;/p&gt;

\[(f\circ g)&apos;(x)=f&apos;(g(x))\,g&apos;(x).\]

  &lt;p&gt;Viết theo Leibniz với $y=f(u)$, $u=g(x)$: $\dfrac{dy}{dx}=\dfrac{dy}{du}\cdot\dfrac{du}{dx}$.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-proof&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Chứng minh.&lt;/strong&gt; Đặt $b=g(x)$ và định nghĩa $\varphi(k)=\dfrac{f(b+k)-f(b)}k$ khi $k\ne0$, $\varphi(0)=f&apos;(b)$. Hàm $\varphi$ liên tục tại 0 và $f(b+k)-f(b)=\varphi(k)\,k$ với mọi $k$, kể cả $k=0$. Đặt $k=g(x+h)-g(x)$:&lt;/p&gt;

\[\frac{f(g(x+h))-f(g(x))}h=\varphi(k)\cdot\frac{g(x+h)-g(x)}h .\]

  &lt;p&gt;Khi $h\to0$ thì $k\to0$ (vì $g$ liên tục), nên $\varphi(k)\to f&apos;(b)$, còn thừa số sau tiến tới $g&apos;(x)$.&lt;/p&gt;
&lt;/div&gt;

&lt;p&gt;Hàm phụ $\varphi$ cần thiết vì $g(x+h)-g(x)$ có thể bằng 0 với những $h$ khác 0, khi đó không chia được.&lt;/p&gt;

&lt;h2 id=&quot;đạo-hàm-các-hàm-cơ-bản&quot;&gt;Đạo hàm các hàm cơ bản&lt;/h2&gt;

&lt;div class=&quot;textbook-theorem&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Định lý 3.&lt;/strong&gt; $(\sin x)&apos;=\cos x$, $(\cos x)&apos;=-\sin x$, $(e^x)&apos;=e^x$, và $(x^n)&apos;=nx^{n-1}$ với $n$ nguyên dương.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-proof&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Chứng minh.&lt;/strong&gt; Dùng công thức cộng:&lt;/p&gt;

\[\frac{\sin(x+h)-\sin x}h=\sin x\cdot\frac{\cos h-1}h+\cos x\cdot\frac{\sin h}h\to\sin x\cdot0+\cos x\cdot1 .\]

  &lt;p&gt;Ở đây $\dfrac{\cos h-1}h=-h\cdot\dfrac{1-\cos h}{h^2}\to0\cdot\tfrac12=0$ và $\dfrac{\sin h}h\to1$ (bài 01_04). Tương tự cho $\cos$. Với $e^x$: $\dfrac{e^{x+h}-e^x}h=e^x\dfrac{e^h-1}h\to e^x$. Với $x^n$: quy nạp bằng quy tắc tích, $(x^{n+1})&apos;=(x\cdot x^n)&apos;=x^n+x\cdot nx^{n-1}=(n+1)x^n$.&lt;/p&gt;
&lt;/div&gt;

&lt;p&gt;Bảng đạo hàm (các dòng còn lại chứng minh ở bài 02_03):&lt;/p&gt;

&lt;table&gt;
  &lt;thead&gt;
    &lt;tr&gt;
      &lt;th&gt;$f(x)$&lt;/th&gt;
      &lt;th&gt;$f&apos;(x)$&lt;/th&gt;
      &lt;th&gt;$f(x)$&lt;/th&gt;
      &lt;th&gt;$f&apos;(x)$&lt;/th&gt;
    &lt;/tr&gt;
  &lt;/thead&gt;
  &lt;tbody&gt;
    &lt;tr&gt;
      &lt;td&gt;$x^\alpha$&lt;/td&gt;
      &lt;td&gt;$\alpha x^{\alpha-1}$&lt;/td&gt;
      &lt;td&gt;$\ln x$&lt;/td&gt;
      &lt;td&gt;$\tfrac1x$&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;$e^x$&lt;/td&gt;
      &lt;td&gt;$e^x$&lt;/td&gt;
      &lt;td&gt;$a^x$&lt;/td&gt;
      &lt;td&gt;$a^x\ln a$&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;$\sin x$&lt;/td&gt;
      &lt;td&gt;$\cos x$&lt;/td&gt;
      &lt;td&gt;$\cos x$&lt;/td&gt;
      &lt;td&gt;$-\sin x$&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;$\tan x$&lt;/td&gt;
      &lt;td&gt;$\tfrac1{\cos^2x}$&lt;/td&gt;
      &lt;td&gt;$\arctan x$&lt;/td&gt;
      &lt;td&gt;$\tfrac1{1+x^2}$&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;$\arcsin x$&lt;/td&gt;
      &lt;td&gt;$\tfrac1{\sqrt{1-x^2}}$&lt;/td&gt;
      &lt;td&gt;$\arccos x$&lt;/td&gt;
      &lt;td&gt;$-\tfrac1{\sqrt{1-x^2}}$&lt;/td&gt;
    &lt;/tr&gt;
  &lt;/tbody&gt;
&lt;/table&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Ví dụ 1.&lt;/strong&gt;&lt;/p&gt;

  &lt;ul&gt;
    &lt;li&gt;$(x^2\sin x)&apos;=2x\sin x+x^2\cos x$.&lt;/li&gt;
    &lt;li&gt;$\left(\dfrac{x}{x^2+1}\right)&apos;=\dfrac{(x^2+1)-x\cdot2x}{(x^2+1)^2}=\dfrac{1-x^2}{(x^2+1)^2}$. Đạo hàm bằng 0 tại $x=\pm1$, đó là chỗ đồ thị đạt cực đại, cực tiểu (chương 3).&lt;/li&gt;
    &lt;li&gt;$(\tan x)&apos;=\left(\dfrac{\sin x}{\cos x}\right)&apos;=\dfrac{\cos^2x+\sin^2x}{\cos^2x}=\dfrac1{\cos^2x}$.&lt;/li&gt;
  &lt;/ul&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Ví dụ 2 (Hàm hợp).&lt;/strong&gt; Tách lớp ngoài, lớp trong rồi nhân.&lt;/p&gt;

  &lt;ul&gt;
    &lt;li&gt;$\left((3x+1)^5\right)&apos;=5(3x+1)^4\cdot3=15(3x+1)^4$.&lt;/li&gt;
    &lt;li&gt;$\left(\sin(x^2)\right)&apos;=\cos(x^2)\cdot2x$.&lt;/li&gt;
    &lt;li&gt;$\left(e^{-x^2/2}\sin3x\right)&apos;=-x\,e^{-x^2/2}\sin3x+3e^{-x^2/2}\cos3x$.&lt;/li&gt;
    &lt;li&gt;$\left(\sqrt{1+\cos^2x}\right)&apos;=\dfrac{1}{2\sqrt{1+\cos^2x}}\cdot2\cos x\cdot(-\sin x)=-\dfrac{\sin x\cos x}{\sqrt{1+\cos^2x}}$.&lt;/li&gt;
  &lt;/ul&gt;
&lt;/div&gt;

&lt;h2 id=&quot;video-ngắn&quot;&gt;Video ngắn&lt;/h2&gt;

&lt;div class=&quot;reel-video&quot;&gt;
  &lt;video controls=&quot;&quot; playsinline=&quot;&quot; preload=&quot;metadata&quot; src=&quot;/public/videos/reels/why-sin-prime-is-cos.mp4&quot;&gt;&lt;/video&gt;
  &lt;p class=&quot;reel-caption&quot;&gt;Vì sao đạo hàm của sin là cos: vận tốc của điểm chuyển động tròn đều, phần dọc của vận tốc là cos t (video không lời, khoảng 2 phút).&lt;/p&gt;
&lt;/div&gt;

&lt;h2 id=&quot;ứng-dụng&quot;&gt;Ứng dụng&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Vật lý: dao động.&lt;/strong&gt; Vật dao động $s(t)=5\sin2t$ (cm). Vận tốc $v=s&apos;=10\cos2t$, gia tốc $a=v&apos;=-20\sin2t=-4s$. Gia tốc tỉ lệ với li độ và ngược dấu: đúng phương trình của dao động điều hoà $s&apos;&apos;=-\omega^2s$ với $\omega=2$.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Học máy: đạo hàm của sigmoid và lan truyền ngược.&lt;/strong&gt; Với $\sigma(x)=(1+e^{-x})^{-1}$, quy tắc hàm hợp cho&lt;/p&gt;

\[\sigma&apos;(x)=\frac{e^{-x}}{(1+e^{-x})^2}=\sigma(x)\big(1-\sigma(x)\big).\]

&lt;p&gt;Tại $x=0$: $\sigma&apos;(0)=\tfrac14$. Một nơ-ron $y=\sigma(wx+b)$ có $\dfrac{\partial y}{\partial w}=\sigma&apos;(wx+b)\cdot x$: đúng là quy tắc hàm hợp. Mạng nhiều lớp là hợp của nhiều hàm, và &lt;em&gt;lan truyền ngược&lt;/em&gt; chỉ là áp dụng quy tắc hàm hợp từ lớp cuối về lớp đầu, lưu lại các tích trung gian để không tính lặp.&lt;/p&gt;

&lt;h2 id=&quot;bài-tập&quot;&gt;Bài tập&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Mức cơ bản.&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;Tính đạo hàm của $x^3e^x$ và $\dfrac{x^2-1}{x^2+1}$.&lt;/li&gt;
  &lt;li&gt;Tính đạo hàm của $\cos(5x-2)$ và $(1-x^2)^{10}$.&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Đáp án&lt;/summary&gt;

  &lt;ol&gt;
    &lt;li&gt;$(3x^2+x^3)e^x$; $\dfrac{4x}{(x^2+1)^2}$.&lt;/li&gt;
    &lt;li&gt;$-5\sin(5x-2)$; $-20x(1-x^2)^9$.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;p&gt;&lt;strong&gt;Mức vận dụng.&lt;/strong&gt;&lt;/p&gt;

&lt;ol start=&quot;3&quot;&gt;
  &lt;li&gt;Tính đạo hàm của $e^{\sin x}\cos x$ và $\ln(x^2+1)$ (dùng $(\ln u)&apos;=\tfrac{u&apos;}u$).&lt;/li&gt;
  &lt;li&gt;Tìm điểm trên đồ thị $y=x^3-3x$ mà tiếp tuyến nằm ngang.&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Đáp án&lt;/summary&gt;

  &lt;ol start=&quot;3&quot;&gt;
    &lt;li&gt;$e^{\sin x}(\cos^2x-\sin x)$; $\dfrac{2x}{x^2+1}$.&lt;/li&gt;
    &lt;li&gt;$3x^2-3=0$, $x=\pm1$: các điểm $(1,-2)$ và $(-1,2)$.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;p&gt;&lt;strong&gt;Mức nâng cao.&lt;/strong&gt;&lt;/p&gt;

&lt;ol start=&quot;5&quot;&gt;
  &lt;li&gt;Chứng minh quy tắc thương từ quy tắc tích và $(1/g)&apos;=-g&apos;/g^2$.&lt;/li&gt;
  &lt;li&gt;Cho $\tanh x$. Chứng minh $(\tanh x)&apos;=1-\tanh^2x$ và giải thích vì sao hàm kích hoạt $\tanh$ “bão hoà” (gradient gần 0) khi $\lvert x\rvert$ lớn.&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Gợi ý&lt;/summary&gt;

  &lt;ol start=&quot;5&quot;&gt;
    &lt;li&gt;$(1/g)&apos;$: hàm hợp của $u\mapsto1/u$ với $g$. Rồi $(f\cdot\tfrac1g)&apos;=\tfrac{f&apos;}g-\tfrac{fg&apos;}{g^2}$.&lt;/li&gt;
    &lt;li&gt;Quy tắc thương với $\sinh&apos;=\cosh$, $\cosh&apos;=\sinh$ và $\cosh^2-\sinh^2=1$. Khi $\lvert x\rvert$ lớn, $\tanh x\to\pm1$ nên đạo hàm $\to0$.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;h2 id=&quot;tóm-tắt&quot;&gt;Tóm tắt&lt;/h2&gt;

&lt;div class=&quot;content-box summary-box textbook-block&quot;&gt;
  &lt;ul&gt;
    &lt;li&gt;$(fg)&apos;=f&apos;g+fg&apos;$, $\left(\tfrac fg\right)&apos;=\tfrac{f&apos;g-fg&apos;}{g^2}$, $(f\circ g)&apos;=f&apos;(g)\,g&apos;$.&lt;/li&gt;
    &lt;li&gt;$(\sin x)&apos;=\cos x$ và $(e^x)&apos;=e^x$ đến từ $\tfrac{\sin h}h\to1$ và $\tfrac{e^h-1}h\to1$.&lt;/li&gt;
    &lt;li&gt;Đạo hàm hàm phức tạp: tách thành các lớp, dùng bảng đạo hàm cho từng lớp, nhân lại.&lt;/li&gt;
    &lt;li&gt;$\sigma&apos;=\sigma(1-\sigma)$; lan truyền ngược là quy tắc hàm hợp áp dụng có hệ thống.&lt;/li&gt;
  &lt;/ul&gt;
&lt;/div&gt;
</content>
 </entry>
 
 <entry>
   <title>Định nghĩa đạo hàm</title>
   <link href="https://calculus-self-learning.pages.dev/contents/vi/chapter02/02_01_Dinh_nghia_dao_ham/"/>
   <updated>2026-12-01T00:00:00+00:00</updated>
   <id>https://calculus-self-learning.pages.dev/contents/vi/chapter02/02_01_Dinh_nghia_dao_ham</id>
   <content type="html">&lt;div class=&quot;textbook-objectives&quot;&gt;

  &lt;p&gt;&lt;strong&gt;Mục tiêu học tập.&lt;/strong&gt; Sau bài này, người học có thể:&lt;/p&gt;

  &lt;ul&gt;
    &lt;li&gt;tính đạo hàm của $x^2$, $\tfrac1x$, $\sqrt x$ trực tiếp từ định nghĩa;&lt;/li&gt;
    &lt;li&gt;viết phương trình tiếp tuyến của đồ thị tại một điểm;&lt;/li&gt;
    &lt;li&gt;giải thích đạo hàm là tốc độ biến thiên tức thời trong vật lý và kinh tế;&lt;/li&gt;
    &lt;li&gt;chứng minh hàm khả vi thì liên tục, và chỉ ra hàm liên tục nhưng không khả vi.&lt;/li&gt;
  &lt;/ul&gt;

&lt;/div&gt;

&lt;h2 id=&quot;vì-sao-cần-bài-này&quot;&gt;Vì sao cần bài này&lt;/h2&gt;

&lt;p&gt;Bài 01_01 đã tính vận tốc tức thời của viên bi rơi: lấy vận tốc trung bình trên $[2,2+h]$ rồi cho $h\to0$, được 19,6 m/s. Cùng một phép tính cho ta hệ số góc của tiếp tuyến với đồ thị, chi phí biên của nhà máy, tốc độ phản ứng hoá học. Đạo hàm là tên chung của phép tính này.&lt;/p&gt;

&lt;h2 id=&quot;định-nghĩa&quot;&gt;Định nghĩa&lt;/h2&gt;

&lt;div class=&quot;textbook-definition&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Định nghĩa 1 (Đạo hàm).&lt;/strong&gt; Cho $f$ xác định trên một khoảng mở chứa $a$. Nếu giới hạn&lt;/p&gt;

\[f&apos;(a)=\lim_{h\to0}\frac{f(a+h)-f(a)}{h}\]

  &lt;p&gt;tồn tại (hữu hạn) thì ta nói $f$ &lt;em&gt;khả vi&lt;/em&gt; tại $a$ và gọi $f&apos;(a)$ là &lt;em&gt;đạo hàm&lt;/em&gt; của $f$ tại $a$. Tỉ số $\dfrac{f(a+h)-f(a)}h$ gọi là &lt;em&gt;tỉ số sai phân&lt;/em&gt;. Nếu giới hạn chỉ lấy khi $h\to0^+$ (hoặc $h\to0^-$) thì ta có &lt;em&gt;đạo hàm phải&lt;/em&gt; $f&apos;_+(a)$ (hoặc &lt;em&gt;đạo hàm trái&lt;/em&gt; $f&apos;_-(a)$).&lt;/p&gt;
&lt;/div&gt;

&lt;p&gt;Viết $x=a+h$ ta được dạng tương đương $f&apos;(a)=\lim_{x\to a}\dfrac{f(x)-f(a)}{x-a}$. Ký hiệu khác: $\dfrac{df}{dx}(a)$, $\dfrac{dy}{dx}\Big\vert_{x=a}$.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Ý nghĩa hình học.&lt;/strong&gt; Tỉ số sai phân là hệ số góc của cát tuyến qua $(a,f(a))$ và $(a+h,f(a+h))$. Khi $h\to0$, cát tuyến quay về &lt;em&gt;tiếp tuyến&lt;/em&gt;, có phương trình&lt;/p&gt;

\[y=f(a)+f&apos;(a)(x-a).\]

&lt;p&gt;&lt;strong&gt;Ý nghĩa vật lý.&lt;/strong&gt; Nếu $s(t)$ là vị trí thì $s&apos;(t)$ là vận tốc tức thời.&lt;/p&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Ví dụ 1.&lt;/strong&gt; Tính đạo hàm của $f(x)=x^2$ tại điểm $x$ bất kỳ.&lt;/p&gt;

\[\frac{(x+h)^2-x^2}{h}=\frac{2xh+h^2}{h}=2x+h\ \xrightarrow{h\to0}\ 2x .\]

  &lt;p&gt;Vậy $(x^2)&apos;=2x$. Tiếp tuyến tại $(3,9)$: $y=9+6(x-3)=6x-9$.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Ví dụ 2.&lt;/strong&gt;&lt;/p&gt;

  &lt;ul&gt;
    &lt;li&gt;$f(x)=\dfrac1x$, $x\ne0$: $\dfrac{\frac1{x+h}-\frac1x}{h}=\dfrac{-h}{h\,x(x+h)}=\dfrac{-1}{x(x+h)}\to-\dfrac1{x^2}$.&lt;/li&gt;
    &lt;li&gt;$f(x)=\sqrt x$, $x&amp;gt;0$: nhân liên hợp, $\dfrac{\sqrt{x+h}-\sqrt x}{h}=\dfrac{1}{\sqrt{x+h}+\sqrt x}\to\dfrac1{2\sqrt x}$.&lt;/li&gt;
  &lt;/ul&gt;

  &lt;p&gt;Cả ba kết quả $x^2$, $x^{-1}$, $x^{1/2}$ đều khớp với công thức $(x^n)&apos;=nx^{n-1}$ sẽ chứng minh ở bài sau.&lt;/p&gt;
&lt;/div&gt;

&lt;h2 id=&quot;khả-vi-và-liên-tục&quot;&gt;Khả vi và liên tục&lt;/h2&gt;

&lt;div class=&quot;textbook-theorem&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Định lý 1.&lt;/strong&gt; Nếu $f$ khả vi tại $a$ thì $f$ liên tục tại $a$.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-proof&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Chứng minh.&lt;/strong&gt; Với $h\ne0$, $f(a+h)-f(a)=\dfrac{f(a+h)-f(a)}h\cdot h$. Khi $h\to0$, thừa số đầu tiến tới $f&apos;(a)$, thừa số sau tiến tới $0$. Theo quy tắc tích, $f(a+h)-f(a)\to f&apos;(a)\cdot0=0$, tức $\lim_{h\to0}f(a+h)=f(a)$.&lt;/p&gt;
&lt;/div&gt;

&lt;p&gt;Chiều ngược lại sai.&lt;/p&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Ví dụ 3.&lt;/strong&gt; $f(x)=\lvert x\rvert$ liên tục tại 0 nhưng không khả vi tại 0. Tỉ số sai phân là $\dfrac{\lvert h\rvert}h$, bằng $1$ khi $h&amp;gt;0$ và $-1$ khi $h&amp;lt;0$. Vậy $f&apos;_+(0)=1\ne f&apos;_-(0)=-1$. Đồ thị có một “góc” tại gốc toạ độ, không có tiếp tuyến duy nhất.&lt;/p&gt;
&lt;/div&gt;

&lt;h2 id=&quot;minh-hoạ&quot;&gt;Minh hoạ&lt;/h2&gt;

&lt;div class=&quot;interactive-frame&quot;&gt;
  &lt;div class=&quot;interactive-frame-head&quot;&gt;
    &lt;div class=&quot;interactive-frame-title&quot;&gt;Cát tuyến, tiếp tuyến và đồ thị f′&lt;/div&gt;
    &lt;div class=&quot;interactive-frame-desc&quot;&gt;Kéo h về 0 để cát tuyến thành tiếp tuyến; đồ thị dưới là f′.&lt;/div&gt;
  &lt;/div&gt;
  &lt;iframe src=&quot;/interactives/chapter02/derivative-tangent.html&quot; title=&quot;Cát tuyến, tiếp tuyến và đồ thị f′&quot; loading=&quot;lazy&quot; style=&quot;height: 800px;&quot;&gt;&lt;/iframe&gt;
  &lt;div class=&quot;interactive-frame-foot&quot;&gt;
    &lt;a href=&quot;/interactives/chapter02/derivative-tangent.html&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;Mở minh hoạ ở cửa sổ riêng&lt;/a&gt;
  &lt;/div&gt;
&lt;/div&gt;

&lt;h2 id=&quot;video-ngắn&quot;&gt;Video ngắn&lt;/h2&gt;

&lt;div class=&quot;reel-video&quot;&gt;
  &lt;video controls=&quot;&quot; playsinline=&quot;&quot; preload=&quot;metadata&quot; src=&quot;/public/videos/reels/secant-to-tangent.mp4&quot;&gt;&lt;/video&gt;
  &lt;p class=&quot;reel-caption&quot;&gt;Cát tuyến quay về tiếp tuyến khi h → 0, cùng lúc với đồng hồ tốc độ của một xe chạy s = 1.5t² (video không lời, khoảng 2 phút).&lt;/p&gt;
&lt;/div&gt;

&lt;h2 id=&quot;ứng-dụng&quot;&gt;Ứng dụng&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Kinh tế: chi phí biên.&lt;/strong&gt; Chi phí sản xuất $q$ sản phẩm là $C(q)=0{,}01q^2+5q+100$ (nghìn đồng). Chi phí biên $C&apos;(q)=0{,}02q+5$. Tại $q=100$: $C&apos;(100)=7$. Chi phí thật để làm thêm sản phẩm thứ 101 là $C(101)-C(100)=7{,}01$. Đạo hàm cho một xấp xỉ rất sát mà không phải tính hai giá trị.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Học máy: đạo hàm số.&lt;/strong&gt; Khi không có công thức, người ta xấp xỉ $f&apos;(a)$ bằng sai phân. Với $f(x)=e^x$, $a=0$, $h=0{,}1$ (đạo hàm đúng bằng 1):&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;sai phân tiến $\dfrac{f(h)-f(0)}h\approx1{,}05171$, sai số khoảng $0{,}05$, cỡ $h$;&lt;/li&gt;
  &lt;li&gt;sai phân trung tâm $\dfrac{f(h)-f(-h)}{2h}\approx1{,}001668$, sai số khoảng $0{,}0017$, cỡ $h^2$.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Thư viện học sâu dùng sai phân trung tâm để kiểm tra lại gradient tính bằng lan truyền ngược (gradient checking).&lt;/p&gt;

&lt;h2 id=&quot;bài-tập&quot;&gt;Bài tập&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Mức cơ bản.&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;Dùng định nghĩa tính đạo hàm của $f(x)=3x^2-x$.&lt;/li&gt;
  &lt;li&gt;Viết phương trình tiếp tuyến của $y=x^3$ tại $x=1$ (dùng $(x^3)&apos;=3x^2$).&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Đáp án&lt;/summary&gt;

  &lt;ol&gt;
    &lt;li&gt;$\dfrac{3(x+h)^2-(x+h)-3x^2+x}{h}=6x+3h-1\to6x-1$.&lt;/li&gt;
    &lt;li&gt;$y=1+3(x-1)=3x-2$.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;p&gt;&lt;strong&gt;Mức vận dụng.&lt;/strong&gt;&lt;/p&gt;

&lt;ol start=&quot;3&quot;&gt;
  &lt;li&gt;Dùng định nghĩa tính đạo hàm của $f(x)=\dfrac1{x+2}$.&lt;/li&gt;
  &lt;li&gt;Hàm $f(x)=x\lvert x\rvert$ có khả vi tại 0 không?&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Đáp án&lt;/summary&gt;

  &lt;ol start=&quot;3&quot;&gt;
    &lt;li&gt;$-\dfrac1{(x+2)^2}$.&lt;/li&gt;
    &lt;li&gt;Có: $\dfrac{h\lvert h\rvert}{h}=\lvert h\rvert\to0$, nên $f&apos;(0)=0$.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;p&gt;&lt;strong&gt;Mức nâng cao.&lt;/strong&gt;&lt;/p&gt;

&lt;ol start=&quot;5&quot;&gt;
  &lt;li&gt;Cho $f(x)=x^2\sin\tfrac1x$ khi $x\ne0$, $f(0)=0$. Chứng minh $f&apos;(0)=0$, nhưng $f&apos;$ không liên tục tại 0.&lt;/li&gt;
  &lt;li&gt;Chứng minh: nếu $f$ khả vi tại $a$ thì $\lim_{h\to0}\dfrac{f(a+h)-f(a-h)}{2h}=f&apos;(a)$. Điều ngược lại có đúng không?&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Gợi ý&lt;/summary&gt;

  &lt;ol start=&quot;5&quot;&gt;
    &lt;li&gt;$\dfrac{f(h)}h=h\sin\tfrac1h\to0$ (kẹp). Với $x\ne0$: $f&apos;(x)=2x\sin\tfrac1x-\cos\tfrac1x$, số hạng $\cos\tfrac1x$ không có giới hạn.&lt;/li&gt;
    &lt;li&gt;Tách thành trung bình của $\dfrac{f(a+h)-f(a)}h$ và $\dfrac{f(a-h)-f(a)}{-h}$. Ngược lại sai: $\lvert x\rvert$ tại 0 cho giới hạn 0 nhưng không khả vi.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;h2 id=&quot;tóm-tắt&quot;&gt;Tóm tắt&lt;/h2&gt;

&lt;div class=&quot;content-box summary-box textbook-block&quot;&gt;
  &lt;ul&gt;
    &lt;li&gt;$f&apos;(a)=\lim_{h\to0}\dfrac{f(a+h)-f(a)}h$: hệ số góc tiếp tuyến, tốc độ biến thiên tức thời.&lt;/li&gt;
    &lt;li&gt;Tiếp tuyến: $y=f(a)+f&apos;(a)(x-a)$.&lt;/li&gt;
    &lt;li&gt;Đã có: $(x^2)&apos;=2x$, $\left(\tfrac1x\right)&apos;=-\tfrac1{x^2}$, $(\sqrt x)&apos;=\tfrac1{2\sqrt x}$.&lt;/li&gt;
    &lt;li&gt;Khả vi kéo theo liên tục; $\lvert x\rvert$ cho thấy chiều ngược lại sai.&lt;/li&gt;
  &lt;/ul&gt;
&lt;/div&gt;
</content>
 </entry>
 
 <entry>
   <title>Định lý giá trị trung gian và định lý Weierstrass</title>
   <link href="https://calculus-self-learning.pages.dev/contents/vi/chapter01/01_06_Dinh_ly_gia_tri_trung_gian_va_Weierstrass/"/>
   <updated>2026-12-01T00:00:00+00:00</updated>
   <id>https://calculus-self-learning.pages.dev/contents/vi/chapter01/01_06_Dinh_ly_gia_tri_trung_gian_va_Weierstrass</id>
   <content type="html">&lt;div class=&quot;textbook-objectives&quot;&gt;

  &lt;p&gt;&lt;strong&gt;Mục tiêu học tập.&lt;/strong&gt; Sau bài này, người học có thể:&lt;/p&gt;

  &lt;ul&gt;
    &lt;li&gt;phát biểu và chứng minh định lý giá trị trung gian bằng cận trên đúng;&lt;/li&gt;
    &lt;li&gt;dùng định lý để chứng minh một phương trình có nghiệm và khoanh vùng nghiệm bằng phương pháp chia đôi;&lt;/li&gt;
    &lt;li&gt;phát biểu định lý Weierstrass và chỉ ra vì sao cần giả thiết đoạn đóng, bị chặn;&lt;/li&gt;
    &lt;li&gt;phân biệt liên tục và liên tục đều qua ví dụ $x^2$ trên $[0,1]$ và $\tfrac1x$ trên $(0,1]$.&lt;/li&gt;
  &lt;/ul&gt;

&lt;/div&gt;

&lt;h2 id=&quot;vì-sao-cần-bài-này&quot;&gt;Vì sao cần bài này&lt;/h2&gt;

&lt;p&gt;Phương trình $x^3+x-1=0$ không có công thức nghiệm dễ nhớ. Nhưng $f(0)=-1&amp;lt;0$ và $f(1)=1&amp;gt;0$. Đồ thị của một hàm liên tục đi từ dưới trục hoành lên trên trục hoành thì phải cắt trục hoành ở đâu đó. Định lý giá trị trung gian biến ý trực giác này thành một khẳng định chắc chắn, và cho luôn một thuật toán tìm nghiệm với độ chính xác tuỳ ý.&lt;/p&gt;

&lt;h2 id=&quot;định-lý-giá-trị-trung-gian&quot;&gt;Định lý giá trị trung gian&lt;/h2&gt;

&lt;div class=&quot;textbook-theorem&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Định lý 1 (Giá trị trung gian).&lt;/strong&gt; Cho $f$ liên tục trên $[a,b]$ và $y$ là số nằm giữa $f(a)$ và $f(b)$. Khi đó tồn tại $c\in[a,b]$ sao cho $f(c)=y$.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-proof&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Chứng minh.&lt;/strong&gt; Xét trường hợp $f(a)&amp;lt;y&amp;lt;f(b)$ (các trường hợp khác tương tự hoặc hiển nhiên). Đặt $S=\lbrace x\in[a,b]\mid f(x)&amp;lt;y\rbrace $. Tập $S$ khác rỗng (chứa $a$) và bị chặn trên bởi $b$, nên theo tính đầy đủ của $\mathbb{R}$ có $c=\sup S\in[a,b]$.&lt;/p&gt;

  &lt;ul&gt;
    &lt;li&gt;Giả sử $f(c)&amp;lt;y$. Khi đó $c\ne b$. Do $f$ liên tục tại $c$, có $\delta&amp;gt;0$ để $f(x)&amp;lt;y$ với mọi $x\in[c,c+\delta)\cap[a,b]$. Những điểm này thuộc $S$ và lớn hơn $c$, trái với $c=\sup S$.&lt;/li&gt;
    &lt;li&gt;Giả sử $f(c)&amp;gt;y$. Khi đó $c\ne a$. Do liên tục, có $\delta&amp;gt;0$ để $f(x)&amp;gt;y$ với mọi $x\in(c-\delta,c]$. Vậy không điểm nào của $S$ nằm trong $(c-\delta,c]$, và mọi điểm của $S$ đều $\le c$, nên $c-\delta$ là một cận trên của $S$, nhỏ hơn $c$. Mâu thuẫn.&lt;/li&gt;
  &lt;/ul&gt;

  &lt;p&gt;Vậy $f(c)=y$.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-theorem&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Hệ quả 1 (Bolzano).&lt;/strong&gt; Nếu $f$ liên tục trên $[a,b]$ và $f(a)f(b)&amp;lt;0$ thì phương trình $f(x)=0$ có nghiệm trong $(a,b)$.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Ví dụ 1 (Phương pháp chia đôi).&lt;/strong&gt; Khoanh vùng nghiệm của $f(x)=x^3+x-1$ trên $[0,1]$.&lt;/p&gt;

  &lt;p&gt;Mỗi bước lấy trung điểm $c$, giữ nửa đoạn mà $f$ đổi dấu.&lt;/p&gt;

  &lt;table&gt;
    &lt;thead&gt;
      &lt;tr&gt;
        &lt;th&gt;bước&lt;/th&gt;
        &lt;th&gt;đoạn&lt;/th&gt;
        &lt;th&gt;$c$&lt;/th&gt;
        &lt;th&gt;$f(c)$&lt;/th&gt;
      &lt;/tr&gt;
    &lt;/thead&gt;
    &lt;tbody&gt;
      &lt;tr&gt;
        &lt;td&gt;1&lt;/td&gt;
        &lt;td&gt;$[0;\,1]$&lt;/td&gt;
        &lt;td&gt;0,5&lt;/td&gt;
        &lt;td&gt;$-0{,}375$&lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr&gt;
        &lt;td&gt;2&lt;/td&gt;
        &lt;td&gt;$[0{,}5;\,1]$&lt;/td&gt;
        &lt;td&gt;0,75&lt;/td&gt;
        &lt;td&gt;$0{,}171875$&lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr&gt;
        &lt;td&gt;3&lt;/td&gt;
        &lt;td&gt;$[0{,}5;\,0{,}75]$&lt;/td&gt;
        &lt;td&gt;0,625&lt;/td&gt;
        &lt;td&gt;$-0{,}130859$&lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr&gt;
        &lt;td&gt;4&lt;/td&gt;
        &lt;td&gt;$[0{,}625;\,0{,}75]$&lt;/td&gt;
        &lt;td&gt;0,6875&lt;/td&gt;
        &lt;td&gt;$0{,}012451$&lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr&gt;
        &lt;td&gt;5&lt;/td&gt;
        &lt;td&gt;$[0{,}625;\,0{,}6875]$&lt;/td&gt;
        &lt;td&gt;0,65625&lt;/td&gt;
        &lt;td&gt;$-0{,}061127$&lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr&gt;
        &lt;td&gt;6&lt;/td&gt;
        &lt;td&gt;$[0{,}65625;\,0{,}6875]$&lt;/td&gt;
        &lt;td&gt;0,671875&lt;/td&gt;
        &lt;td&gt;$-0{,}024830$&lt;/td&gt;
      &lt;/tr&gt;
    &lt;/tbody&gt;
  &lt;/table&gt;

  &lt;p&gt;Sau 6 bước, nghiệm nằm trong $[0{,}671875;\,0{,}6875]$, độ dài $2^{-6}\approx0{,}0156$. Sau $n$ bước sai số không quá $2^{-n}$; muốn sai số dưới $10^{-6}$ cần $n=20$ bước. Nghiệm đúng là $x\approx0{,}682328$. Vì $f$ tăng ngặt nên đây là nghiệm duy nhất.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Ví dụ 2.&lt;/strong&gt; Chứng minh phương trình $\cos x=x$ có nghiệm trong $(0,1)$.&lt;/p&gt;

  &lt;p&gt;Đặt $g(x)=\cos x-x$, liên tục. $g(0)=1&amp;gt;0$, $g(1)=\cos1-1\approx-0{,}4597&amp;lt;0$. Theo Hệ quả 1 có nghiệm.&lt;/p&gt;
&lt;/div&gt;

&lt;h2 id=&quot;định-lý-weierstrass&quot;&gt;Định lý Weierstrass&lt;/h2&gt;

&lt;div class=&quot;textbook-theorem&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Định lý 2 (Weierstrass).&lt;/strong&gt; Nếu $f$ liên tục trên đoạn $[a,b]$ thì $f$ bị chặn và đạt giá trị lớn nhất, giá trị nhỏ nhất trên đoạn đó: có $x_1,x_2\in[a,b]$ với $f(x_1)\le f(x)\le f(x_2)$ với mọi $x\in[a,b]$.&lt;/p&gt;
&lt;/div&gt;

&lt;p&gt;Chứng minh cần định lý Bolzano–Weierstrass về dãy con hội tụ, nên để đến chương 7. Ở đây quan trọng hơn là thấy mỗi giả thiết đều cần:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;em&gt;Khoảng mở:&lt;/em&gt; $f(x)=x$ trên $(0,1)$ liên tục nhưng không đạt max hay min.&lt;/li&gt;
  &lt;li&gt;&lt;em&gt;Không bị chặn:&lt;/em&gt; $f(x)=x$ trên $[0,\infty)$ không có max.&lt;/li&gt;
  &lt;li&gt;&lt;em&gt;Không liên tục:&lt;/em&gt; $f(x)=\tfrac1x$ khi $x\in(0,1]$, $f(0)=0$: xác định trên $[0,1]$ nhưng không bị chặn.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Kết hợp hai định lý: ảnh của đoạn $[a,b]$ qua hàm liên tục là đoạn $[m,M]$, với $m,M$ là min và max.&lt;/p&gt;

&lt;h2 id=&quot;liên-tục-đều&quot;&gt;Liên tục đều&lt;/h2&gt;

&lt;p&gt;Trong định nghĩa liên tục tại $a$, số $\delta$ được phép phụ thuộc cả $\varepsilon$ và $a$. Với $f(x)=\tfrac1x$ trên $(0,1]$, càng gần 0 đồ thị càng dốc, nên $\delta$ phải càng nhỏ. Liên tục đều đòi một $\delta$ dùng chung cho mọi điểm.&lt;/p&gt;

&lt;div class=&quot;textbook-definition&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Định nghĩa 1 (Liên tục đều).&lt;/strong&gt; $f$ &lt;em&gt;liên tục đều&lt;/em&gt; trên tập $I$ nếu&lt;/p&gt;

\[\forall\varepsilon&amp;gt;0\ \exists\delta&amp;gt;0\ \forall x,y\in I:\ \lvert x-y\rvert&amp;lt;\delta\Rightarrow\lvert f(x)-f(y)\rvert&amp;lt;\varepsilon .\]

&lt;/div&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Ví dụ 3.&lt;/strong&gt;&lt;/p&gt;

  &lt;ul&gt;
    &lt;li&gt;$f(x)=x^2$ trên $[0,1]$: $\lvert x^2-y^2\rvert=\lvert x+y\rvert\,\lvert x-y\rvert\le2\lvert x-y\rvert$. Chọn $\delta=\tfrac\varepsilon2$, không phụ thuộc điểm. Liên tục đều.&lt;/li&gt;
    &lt;li&gt;$f(x)=\tfrac1x$ trên $(0,1]$: lấy $x=\tfrac1n$, $y=\tfrac1{n+1}$. Khi đó $\lvert x-y\rvert=\tfrac1{n(n+1)}\to0$ nhưng $\lvert f(x)-f(y)\rvert=1$. Với $\varepsilon=1$, không $\delta$ nào dùng được cho mọi điểm. Liên tục nhưng không liên tục đều.&lt;/li&gt;
  &lt;/ul&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-theorem&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Định lý 3 (Cantor).&lt;/strong&gt; Hàm liên tục trên đoạn $[a,b]$ thì liên tục đều trên đoạn đó.&lt;/p&gt;
&lt;/div&gt;

&lt;p&gt;Định lý Cantor được chứng minh ở chương 7 và là lý do hàm liên tục trên đoạn thì khả tích (chương 4).&lt;/p&gt;

&lt;h2 id=&quot;minh-hoạ&quot;&gt;Minh hoạ&lt;/h2&gt;

&lt;div class=&quot;interactive-frame&quot;&gt;
  &lt;div class=&quot;interactive-frame-head&quot;&gt;
    &lt;div class=&quot;interactive-frame-title&quot;&gt;Liên tục và liên tục đều&lt;/div&gt;
    &lt;div class=&quot;interactive-frame-desc&quot;&gt;Chọn 1/x và xem δ lớn nhất sụt về 0 khi a tiến về 0 (đồ thị bên phải).&lt;/div&gt;
  &lt;/div&gt;
  &lt;iframe src=&quot;/interactives/chapter01/epsilon-delta.html&quot; title=&quot;Liên tục và liên tục đều&quot; loading=&quot;lazy&quot; style=&quot;height: 760px;&quot;&gt;&lt;/iframe&gt;
  &lt;div class=&quot;interactive-frame-foot&quot;&gt;
    &lt;a href=&quot;/interactives/chapter01/epsilon-delta.html&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;Mở minh hoạ ở cửa sổ riêng&lt;/a&gt;
  &lt;/div&gt;
&lt;/div&gt;

&lt;h2 id=&quot;ứng-dụng&quot;&gt;Ứng dụng&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Tính toán: chia đôi là thuật toán tìm nghiệm chắc chắn nhất.&lt;/strong&gt; Hàm &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;bisect&lt;/code&gt; trong các thư viện số (ví dụ &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;scipy.optimize.bisect&lt;/code&gt;) làm đúng như Ví dụ 1. Nó chậm hơn phương pháp Newton (chương 3) nhưng luôn hội tụ khi $f$ liên tục và đổi dấu, nên thường dùng để khoanh vùng trước.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Vật lý: hai điểm đối xứng có cùng nhiệt độ.&lt;/strong&gt; Trên một đường tròn quanh trái đất (ví dụ đường xích đạo), luôn có hai điểm đối xứng qua tâm có cùng nhiệt độ. Gọi $T(\theta)$ là nhiệt độ ở góc $\theta$, liên tục và tuần hoàn chu kỳ $2\pi$. Đặt $g(\theta)=T(\theta)-T(\theta+\pi)$. Khi đó $g(\pi)=T(\pi)-T(2\pi)=-g(0)$. Nếu $g(0)=0$ thì xong; nếu không, $g(0)$ và $g(\pi)$ trái dấu, theo Hệ quả 1 có $\theta$ với $g(\theta)=0$.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Kinh tế: tối ưu có nghiệm.&lt;/strong&gt; Một hàm lợi nhuận liên tục theo sản lượng $q\in[0,q_{\max}]$ chắc chắn có mức sản lượng cho lợi nhuận lớn nhất (Định lý 2). Điều này cần thiết trước khi đi tìm nghiệm bằng đạo hàm ở chương 3.&lt;/p&gt;

&lt;h2 id=&quot;bài-tập&quot;&gt;Bài tập&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Mức cơ bản.&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;Chứng minh $x^5-3x+1=0$ có nghiệm trong $(0,1)$.&lt;/li&gt;
  &lt;li&gt;Hàm $f(x)=\tfrac1{x^2}$ trên $[-1,1]\setminus\lbrace 0\rbrace $ có max không? Vì sao không mâu thuẫn với Định lý 2?&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Đáp án&lt;/summary&gt;

  &lt;ol&gt;
    &lt;li&gt;$f(0)=1&amp;gt;0$, $f(1)=-1&amp;lt;0$.&lt;/li&gt;
    &lt;li&gt;Không có max (không bị chặn). Miền không phải một đoạn và hàm không xác định tại 0.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;p&gt;&lt;strong&gt;Mức vận dụng.&lt;/strong&gt;&lt;/p&gt;

&lt;ol start=&quot;3&quot;&gt;
  &lt;li&gt;Thực hiện 4 bước chia đôi cho $\cos x=x$ trên $[0,1]$. Nghiệm nằm trong đoạn nào?&lt;/li&gt;
  &lt;li&gt;Chứng minh mọi đa thức bậc lẻ có ít nhất một nghiệm thực.&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Đáp án&lt;/summary&gt;

  &lt;ol start=&quot;3&quot;&gt;
    &lt;li&gt;Các trung điểm: 0,5 ($g&amp;gt;0$), 0,75 ($g&amp;lt;0$), 0,625 ($g&amp;gt;0$), 0,6875 ($g&amp;gt;0$). Nghiệm trong $[0{,}6875;\,0{,}75]$ (nghiệm đúng $\approx0{,}7391$).&lt;/li&gt;
    &lt;li&gt;Với $a_n&amp;gt;0$: $p(x)\to+\infty$ khi $x\to+\infty$ và $\to-\infty$ khi $x\to-\infty$. Chọn $b$ lớn với $p(b)&amp;gt;0$, $a$ nhỏ với $p(a)&amp;lt;0$, dùng Hệ quả 1.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;p&gt;&lt;strong&gt;Mức nâng cao.&lt;/strong&gt;&lt;/p&gt;

&lt;ol start=&quot;5&quot;&gt;
  &lt;li&gt;Cho $f:[0,1]\to[0,1]$ liên tục. Chứng minh có $c$ với $f(c)=c$ (điểm bất động).&lt;/li&gt;
  &lt;li&gt;Chứng minh $f(x)=\sqrt x$ liên tục đều trên $[0,\infty)$.&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Gợi ý&lt;/summary&gt;

  &lt;ol start=&quot;5&quot;&gt;
    &lt;li&gt;Xét $g(x)=f(x)-x$: $g(0)=f(0)\ge0$, $g(1)=f(1)-1\le0$.&lt;/li&gt;
    &lt;li&gt;Chứng minh $\lvert\sqrt x-\sqrt y\rvert\le\sqrt{\lvert x-y\rvert}$ (bình phương hai vế, giả sử $x\ge y$). Chọn $\delta=\varepsilon^2$.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;h2 id=&quot;tóm-tắt&quot;&gt;Tóm tắt&lt;/h2&gt;

&lt;div class=&quot;content-box summary-box textbook-block&quot;&gt;
  &lt;ul&gt;
    &lt;li&gt;Định lý giá trị trung gian: hàm liên tục trên đoạn nhận mọi giá trị nằm giữa $f(a)$ và $f(b)$. Chứng minh dựa trên sup.&lt;/li&gt;
    &lt;li&gt;Hệ quả: $f(a)f(b)&amp;lt;0$ thì có nghiệm trong $(a,b)$; chia đôi $n$ lần cho sai số $\le(b-a)2^{-n}$.&lt;/li&gt;
    &lt;li&gt;Weierstrass: hàm liên tục trên đoạn đóng, bị chặn thì đạt max và min. Thiếu một giả thiết là có phản ví dụ.&lt;/li&gt;
    &lt;li&gt;Liên tục đều: một $\delta$ chung cho mọi điểm. $\tfrac1x$ trên $(0,1]$ không liên tục đều; hàm liên tục trên đoạn thì liên tục đều (Cantor).&lt;/li&gt;
  &lt;/ul&gt;
&lt;/div&gt;
</content>
 </entry>
 
 <entry>
   <title>Hàm liên tục và các loại gián đoạn</title>
   <link href="https://calculus-self-learning.pages.dev/contents/vi/chapter01/01_05_Ham_lien_tuc_va_cac_loai_gian_doan/"/>
   <updated>2026-12-01T00:00:00+00:00</updated>
   <id>https://calculus-self-learning.pages.dev/contents/vi/chapter01/01_05_Ham_lien_tuc_va_cac_loai_gian_doan</id>
   <content type="html">&lt;div class=&quot;textbook-objectives&quot;&gt;

  &lt;p&gt;&lt;strong&gt;Mục tiêu học tập.&lt;/strong&gt; Sau bài này, người học có thể:&lt;/p&gt;

  &lt;ul&gt;
    &lt;li&gt;kiểm tra hàm có liên tục tại một điểm bằng ba điều kiện;&lt;/li&gt;
    &lt;li&gt;dùng tính liên tục của hàm sơ cấp và hàm hợp để tính giới hạn bằng cách thay số;&lt;/li&gt;
    &lt;li&gt;tìm tham số để hàm cho bởi nhiều công thức liên tục;&lt;/li&gt;
    &lt;li&gt;phân loại điểm gián đoạn: khử được, loại một (bước nhảy), loại hai.&lt;/li&gt;
  &lt;/ul&gt;

&lt;/div&gt;

&lt;h2 id=&quot;vì-sao-cần-bài-này&quot;&gt;Vì sao cần bài này&lt;/h2&gt;

&lt;p&gt;Giả sử giá điện tính bậc thang: 50 kWh đầu giá 2000 đ/kWh, phần vượt quá 50 kWh giá 2100 đ/kWh (số liệu minh hoạ). Tiền điện theo số kWh là&lt;/p&gt;

\[T(x)=\begin{cases}2000x, &amp;amp; 0\le x\le50,\\ 100\,000+2100(x-50), &amp;amp; x&amp;gt;50.\end{cases}\]

&lt;p&gt;Dùng 49,9 kWh hay 50,1 kWh thì tiền điện chỉ chênh vài trăm đồng: $T$ không có bước nhảy, $T$ &lt;em&gt;liên tục&lt;/em&gt;. Nhưng giá của kWh tiếp theo thì nhảy từ 2000 lên 2100 tại $x=50$. Phân biệt hai loại hành vi này là nội dung của bài.&lt;/p&gt;

&lt;h2 id=&quot;liên-tục-tại-một-điểm&quot;&gt;Liên tục tại một điểm&lt;/h2&gt;

&lt;div class=&quot;textbook-definition&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Định nghĩa 1 (Liên tục).&lt;/strong&gt; Hàm $f$ &lt;em&gt;liên tục tại&lt;/em&gt; $a$ nếu ba điều kiện cùng thoả:&lt;/p&gt;

  &lt;ol&gt;
    &lt;li&gt;$f(a)$ xác định;&lt;/li&gt;
    &lt;li&gt;$\lim_{x\to a}f(x)$ tồn tại;&lt;/li&gt;
    &lt;li&gt;$\lim_{x\to a}f(x)=f(a)$.&lt;/li&gt;
  &lt;/ol&gt;

  &lt;p&gt;Dạng ε–δ: $\forall\varepsilon&amp;gt;0\ \exists\delta&amp;gt;0:\ \lvert x-a\rvert&amp;lt;\delta\Rightarrow\lvert f(x)-f(a)\rvert&amp;lt;\varepsilon$. Hàm &lt;em&gt;liên tục phải&lt;/em&gt; tại $a$ nếu $\lim_{x\to a^+}f(x)=f(a)$, &lt;em&gt;liên tục trái&lt;/em&gt; nếu $\lim_{x\to a^-}f(x)=f(a)$. Hàm liên tục trên khoảng nếu liên tục tại mọi điểm của khoảng (tại đầu mút đoạn thì xét liên tục một phía).&lt;/p&gt;
&lt;/div&gt;

&lt;p&gt;So với định nghĩa giới hạn, chỉ khác ở chỗ $L$ được thay bằng $f(a)$ và không còn điều kiện $x\ne a$.&lt;/p&gt;

&lt;div class=&quot;textbook-theorem&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Định lý 1 (Phép toán với hàm liên tục).&lt;/strong&gt; Nếu $f,g$ liên tục tại $a$ thì $f\pm g$, $fg$ liên tục tại $a$, và $f/g$ liên tục tại $a$ nếu $g(a)\ne0$.&lt;/p&gt;
&lt;/div&gt;

&lt;p&gt;Định lý 1 suy ra ngay từ quy tắc tính giới hạn (bài 01_03).&lt;/p&gt;

&lt;div class=&quot;textbook-theorem&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Định lý 2 (Hàm hợp).&lt;/strong&gt; Nếu $g$ liên tục tại $a$ và $f$ liên tục tại $g(a)$ thì $f\circ g$ liên tục tại $a$.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-proof&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Chứng minh.&lt;/strong&gt; Cho $\varepsilon&amp;gt;0$. Vì $f$ liên tục tại $b=g(a)$, có $\eta&amp;gt;0$ để $\lvert y-b\rvert&amp;lt;\eta\Rightarrow\lvert f(y)-f(b)\rvert&amp;lt;\varepsilon$. Vì $g$ liên tục tại $a$, với chính $\eta$ đó có $\delta&amp;gt;0$ để $\lvert x-a\rvert&amp;lt;\delta\Rightarrow\lvert g(x)-b\rvert&amp;lt;\eta$. Ghép lại: $\lvert x-a\rvert&amp;lt;\delta\Rightarrow\lvert f(g(x))-f(g(a))\rvert&amp;lt;\varepsilon$.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-theorem&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Định lý 3.&lt;/strong&gt; Mọi hàm sơ cấp liên tục tại mọi điểm thuộc miền xác định của nó.&lt;/p&gt;
&lt;/div&gt;

&lt;p&gt;Ta chấp nhận Định lý 3 không chứng minh đầy đủ: với $\sin$, dùng $\lvert\sin x-\sin a\rvert=2\left\lvert\cos\tfrac{x+a}2\sin\tfrac{x-a}2\right\rvert\le\lvert x-a\rvert$; với $e^x$ và $\ln$, dùng tính đơn điệu; các hàm còn lại có được bằng Định lý 1, 2 và việc hàm ngược của hàm liên tục đơn điệu cũng liên tục.&lt;/p&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Ví dụ 1.&lt;/strong&gt; Tính $\lim_{x\to0}\sqrt{\dfrac{\sin x}{x}+3}$.&lt;/p&gt;

  &lt;p&gt;Hàm $u\mapsto\sqrt{u+3}$ liên tục tại $u=1$, và $\tfrac{\sin x}x\to1$. Theo lập luận của Định lý 2, giới hạn bằng $\sqrt{1+3}=2$. Đây là quy tắc “đưa giới hạn vào trong hàm liên tục” đã dùng ở bài 01_04 với $\ln$.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Ví dụ 2.&lt;/strong&gt; Tìm $a$ để hàm sau liên tục trên $\mathbb{R}$:&lt;/p&gt;

\[f(x)=\begin{cases}\dfrac{x^2-4}{x-2}, &amp;amp; x\ne2,\\ a, &amp;amp; x=2.\end{cases}\]

  &lt;p&gt;Với $x\ne2$, $f(x)=x+2$ liên tục. Tại $x=2$: $\lim_{x\to2}f(x)=4$. Cần $a=f(2)=4$.&lt;/p&gt;

  &lt;p&gt;Tương tự, tiền điện $T$ ở đầu bài liên tục tại $50$ vì $\lim_{x\to50^-}T=2000\cdot50=100\,000$ và $\lim_{x\to50^+}T=100\,000+0=100\,000=T(50)$.&lt;/p&gt;
&lt;/div&gt;

&lt;h2 id=&quot;phân-loại-điểm-gián-đoạn&quot;&gt;Phân loại điểm gián đoạn&lt;/h2&gt;

&lt;div class=&quot;textbook-definition&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Định nghĩa 2 (Các loại gián đoạn).&lt;/strong&gt; Giả sử $f$ không liên tục tại $a$ (nhưng xác định ở gần $a$).&lt;/p&gt;

  &lt;ul&gt;
    &lt;li&gt;$a$ là điểm gián đoạn &lt;em&gt;khử được&lt;/em&gt; nếu $\lim_{x\to a}f(x)$ tồn tại (hữu hạn) nhưng khác $f(a)$ hoặc $f(a)$ không xác định.&lt;/li&gt;
    &lt;li&gt;$a$ là điểm gián đoạn &lt;em&gt;loại một&lt;/em&gt; nếu hai giới hạn một phía tồn tại hữu hạn nhưng khác nhau. Hiệu $f(a^+)-f(a^-)$ là &lt;em&gt;bước nhảy&lt;/em&gt;.&lt;/li&gt;
    &lt;li&gt;Các trường hợp còn lại (ít nhất một giới hạn một phía không tồn tại hoặc vô hạn) là gián đoạn &lt;em&gt;loại hai&lt;/em&gt;.&lt;/li&gt;
  &lt;/ul&gt;
&lt;/div&gt;

&lt;p&gt;Một số sách gộp điểm khử được vào loại một, vì ở đó hai giới hạn một phía cũng tồn tại hữu hạn.&lt;/p&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Ví dụ 3.&lt;/strong&gt; Phân loại điểm gián đoạn tại $x=0$.&lt;/p&gt;

  &lt;ol&gt;
    &lt;li&gt;$f(x)=\dfrac{\sin x}x$: giới hạn bằng 1, $f(0)$ không xác định. Khử được: đặt $f(0)=1$ thì hàm liên tục.&lt;/li&gt;
    &lt;li&gt;$f(x)=\dfrac{\lvert x\rvert}x$: $f(0^+)=1$, $f(0^-)=-1$. Loại một, bước nhảy 2.&lt;/li&gt;
    &lt;li&gt;$f(x)=\dfrac1x$: $f(0^+)=+\infty$. Loại hai.&lt;/li&gt;
    &lt;li&gt;$f(x)=\sin\dfrac1x$: không có giới hạn một phía nào (dao động). Loại hai.&lt;/li&gt;
    &lt;li&gt;$f(x)=\lfloor x\rfloor$ (phần nguyên) tại mọi số nguyên $n$: $f(n^-)=n-1$, $f(n^+)=n=f(n)$. Loại một, liên tục phải.&lt;/li&gt;
  &lt;/ol&gt;
&lt;/div&gt;

&lt;h2 id=&quot;minh-hoạ&quot;&gt;Minh hoạ&lt;/h2&gt;

&lt;div class=&quot;interactive-frame&quot;&gt;
  &lt;div class=&quot;interactive-frame-head&quot;&gt;
    &lt;div class=&quot;interactive-frame-title&quot;&gt;Liên tục theo ε–δ&lt;/div&gt;
    &lt;div class=&quot;interactive-frame-desc&quot;&gt;Chọn hàm bậc thang để thấy tại điểm gián đoạn không có δ nào.&lt;/div&gt;
  &lt;/div&gt;
  &lt;iframe src=&quot;/interactives/chapter01/epsilon-delta.html&quot; title=&quot;Liên tục theo ε–δ&quot; loading=&quot;lazy&quot; style=&quot;height: 760px;&quot;&gt;&lt;/iframe&gt;
  &lt;div class=&quot;interactive-frame-foot&quot;&gt;
    &lt;a href=&quot;/interactives/chapter01/epsilon-delta.html&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;Mở minh hoạ ở cửa sổ riêng&lt;/a&gt;
  &lt;/div&gt;
&lt;/div&gt;

&lt;h2 id=&quot;ứng-dụng&quot;&gt;Ứng dụng&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Kinh tế: biểu giá bậc thang.&lt;/strong&gt; Tiền điện $T(x)$ liên tục, nhưng giá biên (giá của kWh tiếp theo) có gián đoạn loại một tại 50 kWh, bước nhảy 100 đ/kWh. Ngược lại, nếu biểu giá tính &lt;em&gt;toàn bộ&lt;/em&gt; lượng điện theo giá của bậc cao nhất đạt tới, thì $T$ nhảy từ $100\,000$ lên $50\cdot2100=105\,000$ ngay sau 50 kWh. Khi đó dùng thêm $0{,}1$ kWh làm tiền điện tăng gần 5000 đ. Tính liên tục của $T$ là thứ làm biểu giá bậc thang công bằng.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Học máy: vì sao bỏ hàm bậc thang.&lt;/strong&gt; Mạng nơ-ron đầu tiên (perceptron) dùng hàm kích hoạt bậc thang $H(x)=1$ khi $x\ge0$, $0$ khi $x&amp;lt;0$, có gián đoạn loại một tại 0. Thuật toán huấn luyện bằng gradient cần thay đổi nhỏ của trọng số gây thay đổi nhỏ của đầu ra, nên người ta thay $H$ bằng sigmoid liên tục (bài 00_03).&lt;/p&gt;

&lt;h2 id=&quot;bài-tập&quot;&gt;Bài tập&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Mức cơ bản.&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;Hàm $f(x)=\dfrac{x^2-x}{x}$ gián đoạn ở đâu, thuộc loại nào?&lt;/li&gt;
  &lt;li&gt;Tìm $a$ để $f(x)=\begin{cases}ax+1, &amp;amp; x&amp;lt;1\\ x^2+2, &amp;amp; x\ge1\end{cases}$ liên tục tại 1.&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Đáp án&lt;/summary&gt;

  &lt;ol&gt;
    &lt;li&gt;Tại $x=0$, khử được (giới hạn bằng $-1$).&lt;/li&gt;
    &lt;li&gt;$a+1=3$, $a=2$.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;p&gt;&lt;strong&gt;Mức vận dụng.&lt;/strong&gt;&lt;/p&gt;

&lt;ol start=&quot;3&quot;&gt;
  &lt;li&gt;Phân loại điểm gián đoạn của $f(x)=\dfrac{1}{1+e^{1/x}}$ tại $x=0$.&lt;/li&gt;
  &lt;li&gt;Tìm $a,b$ để $f(x)=\begin{cases}x+a, &amp;amp; x&amp;lt;0\\ \cos x, &amp;amp; 0\le x\le\pi\\ bx, &amp;amp; x&amp;gt;\pi\end{cases}$ liên tục trên $\mathbb{R}$.&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Đáp án&lt;/summary&gt;

  &lt;ol start=&quot;3&quot;&gt;
    &lt;li&gt;$x\to0^+$: $e^{1/x}\to\infty$, $f\to0$. $x\to0^-$: $e^{1/x}\to0$, $f\to1$. Loại một, bước nhảy $-1$.&lt;/li&gt;
    &lt;li&gt;Tại 0: $a=1$. Tại $\pi$: $b\pi=-1$, $b=-\tfrac1\pi$.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;p&gt;&lt;strong&gt;Mức nâng cao.&lt;/strong&gt;&lt;/p&gt;

&lt;ol start=&quot;5&quot;&gt;
  &lt;li&gt;Chứng minh hàm Dirichlet $D(x)=1$ khi $x$ hữu tỉ, $0$ khi $x$ vô tỉ, gián đoạn tại mọi điểm.&lt;/li&gt;
  &lt;li&gt;Chứng minh $g(x)=x\,D(x)$ chỉ liên tục tại đúng một điểm.&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Gợi ý&lt;/summary&gt;

  &lt;ol start=&quot;5&quot;&gt;
    &lt;li&gt;Mọi khoảng đều chứa cả số hữu tỉ và vô tỉ. Chọn $\varepsilon=\tfrac12$: mọi $\delta$ đều có $x$ trong $(a-\delta,a+\delta)$ với $\lvert D(x)-D(a)\rvert=1$.&lt;/li&gt;
    &lt;li&gt;Tại 0: $\lvert g(x)\rvert\le\lvert x\rvert$, chọn $\delta=\varepsilon$. Tại $a\ne0$: các điểm hữu tỉ gần $a$ cho giá trị gần $a$, các điểm vô tỉ cho 0, nên không có giới hạn.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;h2 id=&quot;tóm-tắt&quot;&gt;Tóm tắt&lt;/h2&gt;

&lt;div class=&quot;content-box summary-box textbook-block&quot;&gt;
  &lt;ul&gt;
    &lt;li&gt;$f$ liên tục tại $a$: $f(a)$ xác định và $\lim_{x\to a}f(x)=f(a)$.&lt;/li&gt;
    &lt;li&gt;Tổng, tích, thương (mẫu khác 0), hàm hợp của hàm liên tục là hàm liên tục. Hàm sơ cấp liên tục trên miền xác định, nên tính giới hạn bằng cách thay số.&lt;/li&gt;
    &lt;li&gt;Gián đoạn khử được: có giới hạn nhưng khác $f(a)$. Loại một: hai giới hạn một phía hữu hạn và khác nhau. Loại hai: các trường hợp còn lại.&lt;/li&gt;
  &lt;/ul&gt;
&lt;/div&gt;
</content>
 </entry>
 
 <entry>
   <title>Giới hạn cơ bản, vô cùng bé và vô cùng lớn</title>
   <link href="https://calculus-self-learning.pages.dev/contents/vi/chapter01/01_04_Gioi_han_co_ban_vo_cung_be/"/>
   <updated>2026-12-01T00:00:00+00:00</updated>
   <id>https://calculus-self-learning.pages.dev/contents/vi/chapter01/01_04_Gioi_han_co_ban_vo_cung_be</id>
   <content type="html">&lt;div class=&quot;textbook-objectives&quot;&gt;

  &lt;p&gt;&lt;strong&gt;Mục tiêu học tập.&lt;/strong&gt; Sau bài này, người học có thể:&lt;/p&gt;

  &lt;ul&gt;
    &lt;li&gt;chứng minh $\lim_{x\to0}\dfrac{\sin x}x=1$ bằng định lý kẹp;&lt;/li&gt;
    &lt;li&gt;dùng $\lim_{x\to\infty}\left(1+\tfrac1x\right)^x=e$ cho các dạng $1^\infty$;&lt;/li&gt;
    &lt;li&gt;so sánh hai vô cùng bé bằng ký hiệu $\sim$, $o$, $O$;&lt;/li&gt;
    &lt;li&gt;thay vô cùng bé tương đương trong tích và thương, và biết vì sao không được thay trong tổng.&lt;/li&gt;
  &lt;/ul&gt;

&lt;/div&gt;

&lt;h2 id=&quot;vì-sao-cần-bài-này&quot;&gt;Vì sao cần bài này&lt;/h2&gt;

&lt;p&gt;Phương trình con lắc đơn là $\theta&apos;&apos;=-\tfrac gL\sin\theta$. Sách vật lý phổ thông thay $\sin\theta$ bằng $\theta$ và được dao động điều hoà với chu kỳ $2\pi\sqrt{L/g}$. Phép thay đó đúng đến mức nào? Với $\theta=10^\circ\approx0{,}17453$ rad, $\sin\theta\approx0{,}17365$, sai lệch khoảng $0{,}5\%$. Lý do sâu xa là $\sin\theta/\theta\to1$ khi $\theta\to0$: hai đại lượng là &lt;em&gt;vô cùng bé tương đương&lt;/em&gt;. Bài này chứng minh giới hạn đó và xây dựng cách tính dựa trên nó.&lt;/p&gt;

&lt;h2 id=&quot;giới-hạn-sin-x--x&quot;&gt;Giới hạn sin x / x&lt;/h2&gt;

&lt;div class=&quot;textbook-theorem&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Định lý 1.&lt;/strong&gt; $\displaystyle\lim_{x\to0}\frac{\sin x}{x}=1$.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-proof&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Chứng minh.&lt;/strong&gt; Xét $0&amp;lt;x&amp;lt;\tfrac\pi2$ trên đường tròn đơn vị tâm $O$, $A=(1,0)$, $P=(\cos x,\sin x)$, và $T=(1,\tan x)$ là giao của tia $OP$ với tiếp tuyến tại $A$. So sánh ba diện tích: tam giác $OAP$ nằm trong hình quạt $OAP$, hình quạt nằm trong tam giác $OAT$. Do đó&lt;/p&gt;

\[\frac{\sin x}2&amp;lt;\frac x2&amp;lt;\frac{\tan x}2 .\]

  &lt;p&gt;Chia cho $\tfrac{\sin x}2&amp;gt;0$ rồi nghịch đảo: $\cos x&amp;lt;\dfrac{\sin x}x&amp;lt;1$. Khi $x\to0^+$, $\cos x\to1$, nên theo định lý kẹp $\tfrac{\sin x}x\to1$. Hàm $\tfrac{\sin x}x$ chẵn nên giới hạn trái cũng bằng 1.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Ví dụ 1.&lt;/strong&gt;&lt;/p&gt;

  &lt;ul&gt;
    &lt;li&gt;$\lim_{x\to0}\dfrac{\sin3x}{x}=\lim_{x\to0}3\cdot\dfrac{\sin 3x}{3x}=3$.&lt;/li&gt;
    &lt;li&gt;$\lim_{x\to0}\dfrac{1-\cos x}{x^2}=\lim_{x\to0}\dfrac{2\sin^2(x/2)}{x^2}=\lim_{x\to0}\dfrac12\left(\dfrac{\sin(x/2)}{x/2}\right)^2=\dfrac12$.&lt;/li&gt;
  &lt;/ul&gt;
&lt;/div&gt;

&lt;h2 id=&quot;số-e&quot;&gt;Số e&lt;/h2&gt;

&lt;div class=&quot;textbook-theorem&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Định lý 2.&lt;/strong&gt; $\displaystyle\lim_{x\to\infty}\left(1+\frac1x\right)^x=e\approx2{,}71828$, và tương đương $\displaystyle\lim_{t\to0}(1+t)^{1/t}=e$.&lt;/p&gt;
&lt;/div&gt;

&lt;p&gt;Chương 7 chứng minh dãy $\left(1+\tfrac1n\right)^n$ tăng và bị chặn trên (dùng bất đẳng thức Bernoulli), nên hội tụ; giới hạn đó được &lt;em&gt;định nghĩa&lt;/em&gt; là $e$. Ở đây ta dùng kết quả.&lt;/p&gt;

&lt;p&gt;Hệ quả (dùng tính liên tục của $\ln$ và $e^x$, bài 01_05):&lt;/p&gt;

\[\lim_{x\to0}\frac{\ln(1+x)}x=\lim_{x\to0}\ln(1+x)^{1/x}=\ln e=1,\qquad \lim_{x\to0}\frac{e^x-1}x=1 .\]

&lt;p&gt;Giới hạn thứ hai có được bằng cách đặt $t=e^x-1$, khi đó $x=\ln(1+t)$ và $\dfrac{e^x-1}x=\dfrac t{\ln(1+t)}\to1$.&lt;/p&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Ví dụ 2.&lt;/strong&gt; Tính $\lim_{x\to\infty}\left(1+\dfrac2x\right)^x$.&lt;/p&gt;

  &lt;p&gt;Đặt $u=x/2$: $\left(1+\tfrac2x\right)^x=\left[\left(1+\tfrac1u\right)^u\right]^2\to e^2\approx7{,}389$. Tổng quát: $\left(1+\tfrac ax\right)^x\to e^a$.&lt;/p&gt;
&lt;/div&gt;

&lt;h2 id=&quot;vô-cùng-bé-và-vô-cùng-lớn&quot;&gt;Vô cùng bé và vô cùng lớn&lt;/h2&gt;

&lt;div class=&quot;textbook-definition&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Định nghĩa 1.&lt;/strong&gt; Hàm $\alpha(x)$ là &lt;em&gt;vô cùng bé&lt;/em&gt; (VCB) khi $x\to a$ nếu $\lim_{x\to a}\alpha(x)=0$; là &lt;em&gt;vô cùng lớn&lt;/em&gt; nếu $\lvert\alpha(x)\rvert\to\infty$. Với hai VCB $\alpha,\beta$ khi $x\to a$:&lt;/p&gt;

  &lt;ul&gt;
    &lt;li&gt;$\alpha\sim\beta$ (&lt;em&gt;tương đương&lt;/em&gt;) nếu $\lim\dfrac\alpha\beta=1$;&lt;/li&gt;
    &lt;li&gt;$\alpha=o(\beta)$ ($\alpha$ là VCB &lt;em&gt;bậc cao hơn&lt;/em&gt; $\beta$) nếu $\lim\dfrac\alpha\beta=0$;&lt;/li&gt;
    &lt;li&gt;$\alpha=O(\beta)$ nếu $\left\lvert\dfrac\alpha\beta\right\rvert$ bị chặn gần $a$.&lt;/li&gt;
  &lt;/ul&gt;
&lt;/div&gt;

&lt;p&gt;Các tương đương khi $x\to0$ suy ra từ phần trên:&lt;/p&gt;

&lt;table&gt;
  &lt;thead&gt;
    &lt;tr&gt;
      &lt;th&gt;VCB&lt;/th&gt;
      &lt;th&gt;tương đương&lt;/th&gt;
    &lt;/tr&gt;
  &lt;/thead&gt;
  &lt;tbody&gt;
    &lt;tr&gt;
      &lt;td&gt;$\sin x$, $\tan x$, $\arcsin x$, $\arctan x$&lt;/td&gt;
      &lt;td&gt;$x$&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;$1-\cos x$&lt;/td&gt;
      &lt;td&gt;$\tfrac{x^2}2$&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;$\ln(1+x)$, $e^x-1$&lt;/td&gt;
      &lt;td&gt;$x$&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;$(1+x)^\alpha-1$&lt;/td&gt;
      &lt;td&gt;$\alpha x$&lt;/td&gt;
    &lt;/tr&gt;
  &lt;/tbody&gt;
&lt;/table&gt;

&lt;div class=&quot;textbook-theorem&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Định lý 3 (Thay tương đương).&lt;/strong&gt; Nếu $\alpha\sim\alpha_1$ và $\beta\sim\beta_1$ khi $x\to a$, thì $\lim\dfrac{\alpha}{\beta}=\lim\dfrac{\alpha_1}{\beta_1}$ (nếu vế phải tồn tại).&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-proof&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Chứng minh.&lt;/strong&gt; Viết $\dfrac\alpha\beta=\dfrac\alpha{\alpha_1}\cdot\dfrac{\alpha_1}{\beta_1}\cdot\dfrac{\beta_1}\beta$. Thừa số đầu và cuối tiến tới 1, nên theo quy tắc tích, giới hạn bằng $\lim\dfrac{\alpha_1}{\beta_1}$.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Ví dụ 3.&lt;/strong&gt;&lt;/p&gt;

  &lt;ul&gt;
    &lt;li&gt;$\lim_{x\to0}\dfrac{\sin3x}{\tan5x}=\lim_{x\to0}\dfrac{3x}{5x}=\dfrac35$.&lt;/li&gt;
    &lt;li&gt;$\lim_{x\to0}\dfrac{1-\cos4x}{x\sin x}=\lim_{x\to0}\dfrac{(4x)^2/2}{x\cdot x}=8$.&lt;/li&gt;
    &lt;li&gt;$\lim_{x\to0}\dfrac{\ln(1+2x)}{e^{3x}-1}=\dfrac{2x}{3x}=\dfrac23$.&lt;/li&gt;
  &lt;/ul&gt;
&lt;/div&gt;

&lt;div class=&quot;content-box warning-box textbook-block&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Lưu ý: không thay tương đương trong hiệu.&lt;/strong&gt; Với $\lim_{x\to0}\dfrac{\tan x-\sin x}{x^3}$, nếu thay $\tan x\sim x$ và $\sin x\sim x$ thì tử bằng 0, ra kết quả sai là 0. Cách đúng: $\tan x-\sin x=\tan x\,(1-\cos x)\sim x\cdot\dfrac{x^2}2$, nên giới hạn bằng $\dfrac12$. Máy tính với $x=0{,}01$ cho $0{,}500013$.&lt;/p&gt;
&lt;/div&gt;

&lt;h2 id=&quot;video-ngắn&quot;&gt;Video ngắn&lt;/h2&gt;

&lt;div class=&quot;reel-video&quot;&gt;
  &lt;video controls=&quot;&quot; playsinline=&quot;&quot; preload=&quot;metadata&quot; src=&quot;/public/videos/reels/squeeze-sinx-over-x.mp4&quot;&gt;&lt;/video&gt;
  &lt;p class=&quot;reel-caption&quot;&gt;Kẹp sin x / x: ba diện tích trên đường tròn đơn vị lồng nhau cho cos x &amp;lt; sin x / x &amp;lt; 1, cả hai đầu kẹp cùng về 1 khi x → 0 (video không lời, khoảng 2 phút).&lt;/p&gt;
&lt;/div&gt;

&lt;h2 id=&quot;ứng-dụng&quot;&gt;Ứng dụng&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Vật lý: xấp xỉ góc nhỏ.&lt;/strong&gt; $\sin\theta=\theta+o(\theta)$ khi $\theta\to0$. Với $\theta=0{,}1$ rad, $\theta-\sin\theta\approx0{,}000167$, sai số tương đối $0{,}17\%$. Bài 08 sẽ cho ước lượng chính xác hơn: $\theta-\sin\theta\approx\theta^3/6$.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Kinh tế: lãi kép liên tục.&lt;/strong&gt; Gửi 1 đồng với lãi suất năm $r$, ghép lãi $n$ lần mỗi năm, sau một năm được $\left(1+\tfrac rn\right)^n$. Khi $n\to\infty$, theo Ví dụ 2 số tiền tiến tới $e^r$. Với $r=10\%$:&lt;/p&gt;

&lt;table&gt;
  &lt;thead&gt;
    &lt;tr&gt;
      &lt;th&gt;ghép lãi&lt;/th&gt;
      &lt;th&gt;hằng năm&lt;/th&gt;
      &lt;th&gt;hằng tháng&lt;/th&gt;
      &lt;th&gt;hằng ngày&lt;/th&gt;
      &lt;th&gt;liên tục&lt;/th&gt;
    &lt;/tr&gt;
  &lt;/thead&gt;
  &lt;tbody&gt;
    &lt;tr&gt;
      &lt;td&gt;số tiền&lt;/td&gt;
      &lt;td&gt;1,1&lt;/td&gt;
      &lt;td&gt;1,104713&lt;/td&gt;
      &lt;td&gt;1,105156&lt;/td&gt;
      &lt;td&gt;$e^{0{,}1}\approx1{,}105171$&lt;/td&gt;
    &lt;/tr&gt;
  &lt;/tbody&gt;
&lt;/table&gt;

&lt;p&gt;Ghép lãi dày hơn có lợi hơn, nhưng lợi ích bị chặn bởi $e^r$.&lt;/p&gt;

&lt;h2 id=&quot;bài-tập&quot;&gt;Bài tập&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Mức cơ bản.&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;Tính $\lim_{x\to0}\dfrac{\tan 2x}{x}$.&lt;/li&gt;
  &lt;li&gt;Tính $\lim_{x\to\infty}\left(1-\dfrac3x\right)^x$.&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Đáp án&lt;/summary&gt;

  &lt;ol&gt;
    &lt;li&gt;$2$.&lt;/li&gt;
    &lt;li&gt;$e^{-3}$.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;p&gt;&lt;strong&gt;Mức vận dụng.&lt;/strong&gt;&lt;/p&gt;

&lt;ol start=&quot;3&quot;&gt;
  &lt;li&gt;Tính $\lim_{x\to0}\dfrac{\sqrt{1+x}-1}{\sin x}$.&lt;/li&gt;
  &lt;li&gt;Tính $\lim_{x\to0}(1+\sin x)^{1/x}$.&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Đáp án&lt;/summary&gt;

  &lt;ol start=&quot;3&quot;&gt;
    &lt;li&gt;$\sqrt{1+x}-1\sim\tfrac x2$, $\sin x\sim x$, nên giới hạn bằng $\tfrac12$.&lt;/li&gt;
    &lt;li&gt;$\ln$ của biểu thức là $\dfrac{\ln(1+\sin x)}x\sim\dfrac{\sin x}x\to1$, nên giới hạn bằng $e$.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;p&gt;&lt;strong&gt;Mức nâng cao.&lt;/strong&gt;&lt;/p&gt;

&lt;ol start=&quot;5&quot;&gt;
  &lt;li&gt;Tính $\lim_{x\to0}\dfrac{x-\sin x}{x^3}$ bằng cách dùng $\sin x=3\sin\tfrac x3-4\sin^3\tfrac x3$. (Đáp số sẽ được kiểm tra lại bằng Taylor ở chương 8.)&lt;/li&gt;
  &lt;li&gt;Chứng minh: nếu $\alpha\sim\beta$ khi $x\to a$ thì $\alpha-\beta=o(\beta)$.&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Gợi ý&lt;/summary&gt;

  &lt;ol start=&quot;5&quot;&gt;
    &lt;li&gt;Chấp nhận giới hạn $L$ tồn tại. Viết $x-\sin x=3\left(\tfrac x3-\sin\tfrac x3\right)+4\sin^3\tfrac x3$ rồi chia cho $x^3$: số hạng đầu tiến tới $\tfrac L9$, số hạng sau tiến tới $\tfrac4{27}$. Vậy $L=\tfrac L9+\tfrac4{27}$, tức $L=\tfrac16$.&lt;/li&gt;
    &lt;li&gt;$\dfrac{\alpha-\beta}\beta=\dfrac\alpha\beta-1\to0$.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;h2 id=&quot;tóm-tắt&quot;&gt;Tóm tắt&lt;/h2&gt;

&lt;div class=&quot;content-box summary-box textbook-block&quot;&gt;
  &lt;ul&gt;
    &lt;li&gt;$\dfrac{\sin x}x\to1$ (kẹp bằng diện tích), $\left(1+\tfrac1x\right)^x\to e$, $\dfrac{\ln(1+x)}x\to1$, $\dfrac{e^x-1}x\to1$.&lt;/li&gt;
    &lt;li&gt;VCB tương đương: $\sin x\sim\tan x\sim\ln(1+x)\sim e^x-1\sim x$, $1-\cos x\sim\tfrac{x^2}2$.&lt;/li&gt;
    &lt;li&gt;Được thay tương đương trong tích và thương; không thay trong tổng, hiệu.&lt;/li&gt;
    &lt;li&gt;Dạng $1^\infty$: đưa về $\left(1+\tfrac ax\right)^x\to e^a$, hoặc lấy $\ln$.&lt;/li&gt;
  &lt;/ul&gt;
&lt;/div&gt;
</content>
 </entry>
 
 <entry>
   <title>Quy tắc tính giới hạn, giới hạn một phía và ở vô cực</title>
   <link href="https://calculus-self-learning.pages.dev/contents/vi/chapter01/01_03_Quy_tac_tinh_gioi_han/"/>
   <updated>2026-12-01T00:00:00+00:00</updated>
   <id>https://calculus-self-learning.pages.dev/contents/vi/chapter01/01_03_Quy_tac_tinh_gioi_han</id>
   <content type="html">&lt;div class=&quot;textbook-objectives&quot;&gt;

  &lt;p&gt;&lt;strong&gt;Mục tiêu học tập.&lt;/strong&gt; Sau bài này, người học có thể:&lt;/p&gt;

  &lt;ul&gt;
    &lt;li&gt;tính giới hạn bằng các quy tắc tổng, tích, thương mà không cần quay lại ε–δ;&lt;/li&gt;
    &lt;li&gt;khử dạng $\tfrac00$ bằng phân tích nhân tử hoặc nhân liên hợp;&lt;/li&gt;
    &lt;li&gt;dùng định lý kẹp cho hàm bị chặn nhân với vô cùng bé;&lt;/li&gt;
    &lt;li&gt;tính giới hạn một phía, giới hạn ở vô cực và tìm tiệm cận đứng, tiệm cận ngang.&lt;/li&gt;
  &lt;/ul&gt;

&lt;/div&gt;

&lt;h2 id=&quot;vì-sao-cần-bài-này&quot;&gt;Vì sao cần bài này&lt;/h2&gt;

&lt;p&gt;Người nhảy dù rơi với vận tốc $v(t)=\dfrac{mg}{k}\left(1-e^{-kt/m}\right)$ khi có lực cản không khí tỉ lệ với vận tốc. Với $m=70$ kg, $g=9{,}8$ m/s², $k=14$ kg/s, vận tốc tiến tới bao nhiêu khi $t$ lớn? Ta cần $\lim_{t\to\infty}v(t)$. Viết chứng minh ε–δ cho mỗi giới hạn như vậy thì quá dài. Bài này cho các quy tắc để tính nhanh.&lt;/p&gt;

&lt;h2 id=&quot;các-quy-tắc-cơ-bản&quot;&gt;Các quy tắc cơ bản&lt;/h2&gt;

&lt;div class=&quot;textbook-theorem&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Định lý 1 (Quy tắc tính giới hạn).&lt;/strong&gt; Giả sử $\lim_{x\to a}f(x)=L$ và $\lim_{x\to a}g(x)=M$. Khi đó&lt;/p&gt;

  &lt;ol&gt;
    &lt;li&gt;$\lim_{x\to a}\big(f(x)\pm g(x)\big)=L\pm M$;&lt;/li&gt;
    &lt;li&gt;$\lim_{x\to a}c\,f(x)=cL$;&lt;/li&gt;
    &lt;li&gt;$\lim_{x\to a}f(x)g(x)=LM$;&lt;/li&gt;
    &lt;li&gt;$\lim_{x\to a}\dfrac{f(x)}{g(x)}=\dfrac LM$ nếu $M\ne0$.&lt;/li&gt;
  &lt;/ol&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-proof&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Chứng minh (quy tắc tổng).&lt;/strong&gt; Cho $\varepsilon&amp;gt;0$. Có $\delta_1$ để $0&amp;lt;\lvert x-a\rvert&amp;lt;\delta_1\Rightarrow\lvert f(x)-L\rvert&amp;lt;\tfrac\varepsilon2$ và $\delta_2$ để $0&amp;lt;\lvert x-a\rvert&amp;lt;\delta_2\Rightarrow\lvert g(x)-M\rvert&amp;lt;\tfrac\varepsilon2$. Với $\delta=\min(\delta_1,\delta_2)$ và $0&amp;lt;\lvert x-a\rvert&amp;lt;\delta$:&lt;/p&gt;

\[\lvert(f+g)(x)-(L+M)\rvert\le\lvert f(x)-L\rvert+\lvert g(x)-M\rvert&amp;lt;\varepsilon .\]

  &lt;p&gt;Quy tắc tích và thương chứng minh tương tự, dùng thêm $fg-LM=f(g-M)+M(f-L)$ và việc $f$ bị chặn gần $a$.&lt;/p&gt;
&lt;/div&gt;

&lt;p&gt;Hệ quả: với đa thức $p$, $\lim_{x\to a}p(x)=p(a)$; với hàm hữu tỉ $\tfrac pq$ và $q(a)\ne0$, giới hạn bằng $\tfrac{p(a)}{q(a)}$. Tức là có thể thay số trực tiếp. Chỉ khi thay số ra dạng $\tfrac00$ mới cần biến đổi.&lt;/p&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Ví dụ 1.&lt;/strong&gt; Tính $\lim_{x\to2}\dfrac{x^3-8}{x^2-4}$.&lt;/p&gt;

  &lt;p&gt;Thay $x=2$ được $\tfrac00$. Phân tích: $x^3-8=(x-2)(x^2+2x+4)$, $x^2-4=(x-2)(x+2)$. Với $x\ne2$:&lt;/p&gt;

\[\frac{x^3-8}{x^2-4}=\frac{x^2+2x+4}{x+2}\ \xrightarrow{x\to2}\ \frac{12}{4}=3 .\]

&lt;/div&gt;

&lt;h2 id=&quot;định-lý-kẹp&quot;&gt;Định lý kẹp&lt;/h2&gt;

&lt;div class=&quot;textbook-theorem&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Định lý 2 (Định lý kẹp).&lt;/strong&gt; Giả sử $g(x)\le f(x)\le h(x)$ với mọi $x\ne a$ gần $a$, và $\lim_{x\to a}g(x)=\lim_{x\to a}h(x)=L$. Khi đó $\lim_{x\to a}f(x)=L$.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-proof&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Chứng minh.&lt;/strong&gt; Cho $\varepsilon&amp;gt;0$. Chọn $\delta&amp;gt;0$ đủ nhỏ để với $0&amp;lt;\lvert x-a\rvert&amp;lt;\delta$ đồng thời có bất đẳng thức kẹp, $L-\varepsilon&amp;lt;g(x)$ và $h(x)&amp;lt;L+\varepsilon$. Khi đó $L-\varepsilon&amp;lt;g(x)\le f(x)\le h(x)&amp;lt;L+\varepsilon$, tức $\lvert f(x)-L\rvert&amp;lt;\varepsilon$.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Ví dụ 2.&lt;/strong&gt; Tính $\lim_{x\to0}x^2\sin\dfrac1x$.&lt;/p&gt;

  &lt;p&gt;Không dùng được quy tắc tích, vì $\sin\tfrac1x$ không có giới hạn. Nhưng $-1\le\sin\tfrac1x\le1$, nên $-x^2\le x^2\sin\tfrac1x\le x^2$. Hai hàm chặn đều tiến tới 0, nên giới hạn bằng 0. Quy luật chung: hàm bị chặn nhân với hàm tiến tới 0 thì tiến tới 0.&lt;/p&gt;
&lt;/div&gt;

&lt;h2 id=&quot;giới-hạn-một-phía&quot;&gt;Giới hạn một phía&lt;/h2&gt;

&lt;div class=&quot;textbook-definition&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Định nghĩa 1 (Giới hạn phải, giới hạn trái).&lt;/strong&gt; $\lim_{x\to a^+}f(x)=L$ nếu với mọi $\varepsilon&amp;gt;0$ có $\delta&amp;gt;0$ để $a&amp;lt;x&amp;lt;a+\delta\Rightarrow\lvert f(x)-L\rvert&amp;lt;\varepsilon$. Giới hạn trái $\lim_{x\to a^-}$ định nghĩa tương tự với $a-\delta&amp;lt;x&amp;lt;a$.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-theorem&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Định lý 3.&lt;/strong&gt; $\lim_{x\to a}f(x)=L$ khi và chỉ khi cả hai giới hạn một phía tồn tại và cùng bằng $L$.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Ví dụ 3.&lt;/strong&gt; Cho $f(x)=x^2$ khi $x&amp;lt;1$ và $f(x)=3-2x$ khi $x\ge1$. Ta có $\lim_{x\to1^-}f(x)=1$ và $\lim_{x\to1^+}f(x)=1$, nên $\lim_{x\to1}f(x)=1$. Nếu đổi nhánh phải thành $3-x$ thì giới hạn phải bằng 2, khác giới hạn trái, nên không có giới hạn tại 1.&lt;/p&gt;
&lt;/div&gt;

&lt;h2 id=&quot;giới-hạn-ở-vô-cực-và-tiệm-cận&quot;&gt;Giới hạn ở vô cực và tiệm cận&lt;/h2&gt;

&lt;p&gt;$\lim_{x\to\infty}f(x)=L$ nghĩa là: với mọi $\varepsilon&amp;gt;0$ có $N$ để $x&amp;gt;N\Rightarrow\lvert f(x)-L\rvert&amp;lt;\varepsilon$. Khi đó đường $y=L$ là &lt;em&gt;tiệm cận ngang&lt;/em&gt;. Nếu $f(x)\to\pm\infty$ khi $x\to a^+$ hoặc $x\to a^-$ thì đường $x=a$ là &lt;em&gt;tiệm cận đứng&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;Kỹ thuật với hàm hữu tỉ: chia tử và mẫu cho lũy thừa cao nhất của mẫu, dùng $\tfrac1{x^k}\to0$.&lt;/p&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Ví dụ 4.&lt;/strong&gt;&lt;/p&gt;

  &lt;ul&gt;
    &lt;li&gt;$\lim_{x\to\infty}\dfrac{3x^2-x}{2x^2+5}=\lim_{x\to\infty}\dfrac{3-1/x}{2+5/x^2}=\dfrac32$.&lt;/li&gt;
    &lt;li&gt;$f(x)=\dfrac{2x+1}{x-1}$ có tiệm cận ngang $y=2$ (vì $\tfrac{2+1/x}{1-1/x}\to2$) và tiệm cận đứng $x=1$: khi $x\to1^+$ tử $\to3$, mẫu $\to0^+$, nên $f\to+\infty$; khi $x\to1^-$, $f\to-\infty$.&lt;/li&gt;
    &lt;li&gt;$\lim_{x\to\infty}\left(\sqrt{x^2+x}-x\right)$ có dạng $\infty-\infty$. Nhân liên hợp:&lt;/li&gt;
  &lt;/ul&gt;

\[\sqrt{x^2+x}-x=\frac{x}{\sqrt{x^2+x}+x}=\frac{1}{\sqrt{1+1/x}+1}\to\frac12 .\]

&lt;/div&gt;

&lt;h2 id=&quot;ứng-dụng&quot;&gt;Ứng dụng&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Vật lý: vận tốc giới hạn.&lt;/strong&gt; Vì $e^{-kt/m}\to0$ khi $t\to\infty$, ta có $\lim_{t\to\infty}v(t)=\dfrac{mg}{k}=\dfrac{70\cdot9{,}8}{14}=49$ m/s (khoảng 176 km/h). Đường $v=49$ là tiệm cận ngang của đồ thị vận tốc.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Kinh tế: chi phí trung bình dài hạn.&lt;/strong&gt; Một xưởng có chi phí cố định 5000 (nghìn đồng) và chi phí biến đổi 20 mỗi sản phẩm. Chi phí trung bình $\bar C(q)=\dfrac{5000+20q}{q}=20+\dfrac{5000}q$. Khi $q\to\infty$, $\bar C\to20$: sản xuất càng nhiều, chi phí cố định chia cho mỗi sản phẩm càng nhỏ, nhưng không bao giờ thấp hơn chi phí biến đổi.&lt;/p&gt;

&lt;h2 id=&quot;bài-tập&quot;&gt;Bài tập&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Mức cơ bản.&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;Tính $\lim_{x\to-1}\dfrac{x^2+3x+2}{x+1}$.&lt;/li&gt;
  &lt;li&gt;Tính $\lim_{x\to\infty}\dfrac{5x^3-2}{x^3+4x}$.&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Đáp án&lt;/summary&gt;

  &lt;ol&gt;
    &lt;li&gt;$\dfrac{(x+1)(x+2)}{x+1}=x+2\to1$.&lt;/li&gt;
    &lt;li&gt;$5$.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;p&gt;&lt;strong&gt;Mức vận dụng.&lt;/strong&gt;&lt;/p&gt;

&lt;ol start=&quot;3&quot;&gt;
  &lt;li&gt;Tính $\lim_{x\to0}\dfrac{\sqrt{1+x}-\sqrt{1-x}}{x}$.&lt;/li&gt;
  &lt;li&gt;Tìm các tiệm cận của $f(x)=\dfrac{x^2}{x^2-4}$.&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Đáp án&lt;/summary&gt;

  &lt;ol start=&quot;3&quot;&gt;
    &lt;li&gt;Nhân liên hợp: $\dfrac{2x}{x(\sqrt{1+x}+\sqrt{1-x})}\to\dfrac22=1$.&lt;/li&gt;
    &lt;li&gt;Tiệm cận ngang $y=1$; tiệm cận đứng $x=2$ và $x=-2$.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;p&gt;&lt;strong&gt;Mức nâng cao.&lt;/strong&gt;&lt;/p&gt;

&lt;ol start=&quot;5&quot;&gt;
  &lt;li&gt;Tính $\lim_{x\to\infty}\dfrac{\sin x}{x}$ và giải thích vì sao không mâu thuẫn với $\lim_{x\to0}\dfrac{\sin x}x=1$.&lt;/li&gt;
  &lt;li&gt;Chứng minh quy tắc tích trong Định lý 1. Gợi ý: chứng minh trước rằng $f$ bị chặn gần $a$.&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Gợi ý&lt;/summary&gt;

  &lt;ol start=&quot;5&quot;&gt;
    &lt;li&gt;$\left\lvert\tfrac{\sin x}x\right\rvert\le\tfrac1x\to0$, nên giới hạn bằng 0. Hai giới hạn ở hai nơi khác nhau ($x\to\infty$ và $x\to0$).&lt;/li&gt;
    &lt;li&gt;Với $\varepsilon=1$, gần $a$ có $\lvert f(x)\rvert&amp;lt;\lvert L\rvert+1$. Rồi $\lvert fg-LM\rvert\le\lvert f\rvert\,\lvert g-M\rvert+\lvert M\rvert\,\lvert f-L\rvert$.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;h2 id=&quot;tóm-tắt&quot;&gt;Tóm tắt&lt;/h2&gt;

&lt;div class=&quot;content-box summary-box textbook-block&quot;&gt;
  &lt;ul&gt;
    &lt;li&gt;Giới hạn của tổng, tích, thương bằng tổng, tích, thương các giới hạn (mẫu khác 0). Với đa thức và hàm hữu tỉ, thay số trực tiếp nếu không ra $\tfrac00$.&lt;/li&gt;
    &lt;li&gt;Dạng $\tfrac00$: phân tích nhân tử hoặc nhân liên hợp. Dạng $\infty-\infty$ với căn: nhân liên hợp.&lt;/li&gt;
    &lt;li&gt;Định lý kẹp: hàm bị chặn nhân với hàm tiến tới 0 thì tiến tới 0.&lt;/li&gt;
    &lt;li&gt;Giới hạn tồn tại khi và chỉ khi hai giới hạn một phía bằng nhau. Tiệm cận ngang: giới hạn ở vô cực; tiệm cận đứng: hàm tiến ra $\pm\infty$.&lt;/li&gt;
  &lt;/ul&gt;
&lt;/div&gt;
</content>
 </entry>
 
 <entry>
   <title>Định nghĩa ε–δ của giới hạn</title>
   <link href="https://calculus-self-learning.pages.dev/contents/vi/chapter01/01_02_Dinh_nghia_epsilon_delta/"/>
   <updated>2026-12-01T00:00:00+00:00</updated>
   <id>https://calculus-self-learning.pages.dev/contents/vi/chapter01/01_02_Dinh_nghia_epsilon_delta</id>
   <content type="html">&lt;div class=&quot;textbook-objectives&quot;&gt;

  &lt;p&gt;&lt;strong&gt;Mục tiêu học tập.&lt;/strong&gt; Sau bài này, người học có thể:&lt;/p&gt;

  &lt;ul&gt;
    &lt;li&gt;phát biểu định nghĩa ε–δ của $\lim_{x\to a}f(x)=L$ và giải thích nó bằng hình ảnh dải ngang, dải dọc;&lt;/li&gt;
    &lt;li&gt;chứng minh giới hạn của hàm bậc nhất, bậc hai và hàm hữu tỉ đơn giản bằng cách chọn δ theo ε;&lt;/li&gt;
    &lt;li&gt;chứng minh giới hạn (nếu có) là duy nhất;&lt;/li&gt;
    &lt;li&gt;chứng minh một giới hạn không tồn tại bằng phủ định định nghĩa.&lt;/li&gt;
  &lt;/ul&gt;

&lt;/div&gt;

&lt;h2 id=&quot;vì-sao-cần-bài-này&quot;&gt;Vì sao cần bài này&lt;/h2&gt;

&lt;p&gt;Cảm biến nhiệt PT100 có điện trở $R(T)=100(1+0{,}00385\,T)$ ôm khi nhiệt độ là $T$ (°C). Một mạch đo cần $R$ lệch khỏi $R(25)$ không quá $0{,}1\,\Omega$. Hỏi phải giữ nhiệt độ trong khoảng nào quanh 25°C?&lt;/p&gt;

\[\lvert R(T)-R(25)\rvert=0{,}385\,\lvert T-25\rvert&amp;lt;0{,}1\iff\lvert T-25\rvert&amp;lt;\frac{0{,}1}{0{,}385}\approx0{,}26 .\]

&lt;p&gt;Sai số đầu ra cho phép là $\varepsilon=0{,}1$, dung sai đầu vào tìm được là $\delta\approx0{,}26$. Định nghĩa giới hạn đòi hỏi làm được việc này với &lt;em&gt;mọi&lt;/em&gt; $\varepsilon&amp;gt;0$, dù nhỏ đến đâu.&lt;/p&gt;

&lt;h2 id=&quot;định-nghĩa&quot;&gt;Định nghĩa&lt;/h2&gt;

&lt;div class=&quot;textbook-definition&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Định nghĩa 1 (Giới hạn).&lt;/strong&gt; Cho $f$ xác định trên một khoảng mở chứa $a$, có thể trừ điểm $a$. Ta nói $f$ có giới hạn $L$ khi $x$ tiến tới $a$, viết $\lim_{x\to a}f(x)=L$, nếu&lt;/p&gt;

\[\forall\varepsilon&amp;gt;0\ \ \exists\delta&amp;gt;0\ \ \forall x:\quad 0&amp;lt;\lvert x-a\rvert&amp;lt;\delta\ \Rightarrow\ \lvert f(x)-L\rvert&amp;lt;\varepsilon .\]

&lt;/div&gt;

&lt;p&gt;Hình ảnh: vẽ dải ngang $(L-\varepsilon,L+\varepsilon)$ quanh $L$. Phải tìm được một dải dọc $(a-\delta,a+\delta)$ quanh $a$ sao cho phần đồ thị nằm trong dải dọc (bỏ điểm $x=a$) nằm gọn trong dải ngang. Đối thủ chọn $\varepsilon$, ta đáp lại bằng $\delta$. Điều kiện $0&amp;lt;\lvert x-a\rvert$ loại điểm $x=a$, đúng với ý “không quan tâm $f(a)$”.&lt;/p&gt;

&lt;h2 id=&quot;chọn-δ-theo-ε&quot;&gt;Chọn δ theo ε&lt;/h2&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Ví dụ 1.&lt;/strong&gt; Chứng minh $\lim_{x\to3}(2x+1)=7$.&lt;/p&gt;

  &lt;p&gt;&lt;em&gt;Nháp.&lt;/em&gt; $\lvert(2x+1)-7\rvert=2\lvert x-3\rvert$. Muốn nó nhỏ hơn $\varepsilon$ thì cần $\lvert x-3\rvert&amp;lt;\varepsilon/2$.&lt;/p&gt;

  &lt;p&gt;&lt;em&gt;Chứng minh.&lt;/em&gt; Cho $\varepsilon&amp;gt;0$, chọn $\delta=\varepsilon/2$. Nếu $0&amp;lt;\lvert x-3\rvert&amp;lt;\delta$ thì $\lvert(2x+1)-7\rvert=2\lvert x-3\rvert&amp;lt;2\delta=\varepsilon$.&lt;/p&gt;

  &lt;p&gt;Với $\varepsilon=0{,}01$: $\delta=0{,}005$. Hàm bậc nhất $mx+b$ ($m\ne0$) luôn cho $\delta=\varepsilon/\lvert m\rvert$: hệ số góc càng lớn thì dải dọc càng phải hẹp.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Ví dụ 2.&lt;/strong&gt; Chứng minh $\lim_{x\to3}x^2=9$.&lt;/p&gt;

  &lt;p&gt;&lt;em&gt;Nháp.&lt;/em&gt; $\lvert x^2-9\rvert=\lvert x-3\rvert\,\lvert x+3\rvert$. Thừa số $\lvert x+3\rvert$ thay đổi theo $x$, nên ta chặn nó trước. Nếu $\lvert x-3\rvert&amp;lt;1$ thì $2&amp;lt;x&amp;lt;4$, nên $\lvert x+3\rvert&amp;lt;7$. Khi đó $\lvert x^2-9\rvert&amp;lt;7\lvert x-3\rvert$, chỉ cần $\lvert x-3\rvert&amp;lt;\varepsilon/7$.&lt;/p&gt;

  &lt;p&gt;&lt;em&gt;Chứng minh.&lt;/em&gt; Cho $\varepsilon&amp;gt;0$, chọn $\delta=\min\left(1,\tfrac\varepsilon7\right)$. Nếu $0&amp;lt;\lvert x-3\rvert&amp;lt;\delta$ thì $\lvert x-3\rvert&amp;lt;1$ nên $\lvert x+3\rvert&amp;lt;7$, và&lt;/p&gt;

\[\lvert x^2-9\rvert=\lvert x-3\rvert\,\lvert x+3\rvert&amp;lt;\frac{\varepsilon}7\cdot7=\varepsilon .\]

  &lt;p&gt;Với $\varepsilon=0{,}01$: $\delta\approx0{,}00143$. Kiểm tra $x=3{,}0014$: $x^2=9{,}00840196$, sai lệch $0{,}0084&amp;lt;0{,}01$.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Ví dụ 3.&lt;/strong&gt; Chứng minh $\lim_{x\to1}\dfrac{x^2-1}{x-1}=2$.&lt;/p&gt;

  &lt;p&gt;Với $x\ne1$, $\dfrac{x^2-1}{x-1}-2=(x+1)-2=x-1$. Cho $\varepsilon&amp;gt;0$, chọn $\delta=\varepsilon$. Nếu $0&amp;lt;\lvert x-1\rvert&amp;lt;\delta$ thì sai lệch bằng $\lvert x-1\rvert&amp;lt;\varepsilon$. Điều kiện $x\ne1$ (từ $0&amp;lt;\lvert x-1\rvert$) là thứ cho phép rút gọn. Đây cũng chính là chứng minh của Định lý 1 bài 01_01 trong trường hợp này.&lt;/p&gt;
&lt;/div&gt;

&lt;h2 id=&quot;tính-duy-nhất&quot;&gt;Tính duy nhất&lt;/h2&gt;

&lt;div class=&quot;textbook-theorem&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Định lý 1 (Giới hạn là duy nhất).&lt;/strong&gt; Nếu $\lim_{x\to a}f(x)=L$ và $\lim_{x\to a}f(x)=M$ thì $L=M$.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-proof&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Chứng minh.&lt;/strong&gt; Giả sử $L\ne M$. Đặt $\varepsilon=\tfrac{\lvert L-M\rvert}2&amp;gt;0$. Có $\delta_1$ sao cho $0&amp;lt;\lvert x-a\rvert&amp;lt;\delta_1\Rightarrow\lvert f(x)-L\rvert&amp;lt;\varepsilon$, và $\delta_2$ sao cho $0&amp;lt;\lvert x-a\rvert&amp;lt;\delta_2\Rightarrow\lvert f(x)-M\rvert&amp;lt;\varepsilon$. Lấy $x$ với $0&amp;lt;\lvert x-a\rvert&amp;lt;\min(\delta_1,\delta_2)$. Theo bất đẳng thức tam giác,&lt;/p&gt;

\[\lvert L-M\rvert\le\lvert L-f(x)\rvert+\lvert f(x)-M\rvert&amp;lt;2\varepsilon=\lvert L-M\rvert,\]

  &lt;p&gt;mâu thuẫn.&lt;/p&gt;
&lt;/div&gt;

&lt;h2 id=&quot;chứng-minh-giới-hạn-không-tồn-tại&quot;&gt;Chứng minh giới hạn không tồn tại&lt;/h2&gt;

&lt;p&gt;Phủ định Định nghĩa 1 (bài 00_04): $\lim_{x\to a}f(x)\ne L$ khi&lt;/p&gt;

\[\exists\varepsilon&amp;gt;0\ \ \forall\delta&amp;gt;0\ \ \exists x:\ 0&amp;lt;\lvert x-a\rvert&amp;lt;\delta\ \text{và}\ \lvert f(x)-L\rvert\ge\varepsilon .\]

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Ví dụ 4.&lt;/strong&gt; Hàm dấu $\operatorname{sgn}x$ ($1$ khi $x&amp;gt;0$, $-1$ khi $x&amp;lt;0$, $0$ khi $x=0$) không có giới hạn tại 0.&lt;/p&gt;

  &lt;p&gt;Giả sử giới hạn là $L$. Chọn $\varepsilon=1$. Với mọi $\delta&amp;gt;0$, hai điểm $x=\pm\tfrac\delta2$ đều thoả $0&amp;lt;\lvert x\rvert&amp;lt;\delta$, với giá trị $1$ và $-1$. Nếu cả hai cách $L$ dưới 1 thì $2=\lvert1-(-1)\rvert\le\lvert1-L\rvert+\lvert L+1\rvert&amp;lt;2$, vô lý. Vậy ít nhất một điểm có $\lvert f(x)-L\rvert\ge1$.&lt;/p&gt;
&lt;/div&gt;

&lt;h2 id=&quot;minh-hoạ&quot;&gt;Minh hoạ&lt;/h2&gt;

&lt;div class=&quot;interactive-frame&quot;&gt;
  &lt;div class=&quot;interactive-frame-head&quot;&gt;
    &lt;div class=&quot;interactive-frame-title&quot;&gt;Tìm δ cho một ε&lt;/div&gt;
    &lt;div class=&quot;interactive-frame-desc&quot;&gt;Thu nhỏ ε và xem δ lớn nhất có thể chọn.&lt;/div&gt;
  &lt;/div&gt;
  &lt;iframe src=&quot;/interactives/chapter01/epsilon-delta.html&quot; title=&quot;Tìm δ cho một ε&quot; loading=&quot;lazy&quot; style=&quot;height: 760px;&quot;&gt;&lt;/iframe&gt;
  &lt;div class=&quot;interactive-frame-foot&quot;&gt;
    &lt;a href=&quot;/interactives/chapter01/epsilon-delta.html&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;Mở minh hoạ ở cửa sổ riêng&lt;/a&gt;
  &lt;/div&gt;
&lt;/div&gt;

&lt;h2 id=&quot;video-ngắn&quot;&gt;Video ngắn&lt;/h2&gt;

&lt;div class=&quot;reel-video&quot;&gt;
  &lt;video controls=&quot;&quot; playsinline=&quot;&quot; preload=&quot;metadata&quot; src=&quot;/public/videos/reels/epsilon-delta-game.mp4&quot;&gt;&lt;/video&gt;
  &lt;p class=&quot;reel-caption&quot;&gt;Trò chơi ε–δ với x² tại 2: mỗi vòng ε nhỏ hơn, δ co theo; hàm nhảy thì không δ nào thắng (video không lời, khoảng 2 phút).&lt;/p&gt;
&lt;/div&gt;

&lt;h2 id=&quot;ứng-dụng&quot;&gt;Ứng dụng&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Kỹ thuật đo lường.&lt;/strong&gt; Bài toán PT100 ở đầu bài chính là một bước của chứng minh $\lim_{T\to25}R(T)=R(25)$ với $\varepsilon=0{,}1$. Vì $R$ là hàm bậc nhất với hệ số góc $0{,}385$, ta luôn chọn được $\delta=\varepsilon/0{,}385$.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Học máy: độ nhạy của mô hình.&lt;/strong&gt; Một mô hình $f$ có tính chất $\lvert f(x)-f(y)\rvert\le K\lvert x-y\rvert$ (hằng số Lipschitz $K$) thì với mọi $\varepsilon$ có thể chọn $\delta=\varepsilon/K$. Nghiên cứu về độ bền của mạng nơ-ron với nhiễu đầu vào dùng đúng ý này: nếu $K$ nhỏ, nhiễu nhỏ ở ảnh đầu vào không làm đầu ra thay đổi nhiều.&lt;/p&gt;

&lt;h2 id=&quot;bài-tập&quot;&gt;Bài tập&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Mức cơ bản.&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;Chứng minh $\lim_{x\to2}(5x-2)=8$. Với $\varepsilon=0{,}1$, $\delta$ bằng bao nhiêu?&lt;/li&gt;
  &lt;li&gt;Chứng minh $\lim_{x\to a}c=c$ với hằng số $c$.&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Đáp án&lt;/summary&gt;

  &lt;ol&gt;
    &lt;li&gt;$\lvert(5x-2)-8\rvert=5\lvert x-2\rvert$; chọn $\delta=\varepsilon/5$. Với $\varepsilon=0{,}1$: $\delta=0{,}02$.&lt;/li&gt;
    &lt;li&gt;$\lvert c-c\rvert=0&amp;lt;\varepsilon$ với mọi $x$; chọn $\delta$ tuỳ ý, ví dụ $\delta=1$.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;p&gt;&lt;strong&gt;Mức vận dụng.&lt;/strong&gt;&lt;/p&gt;

&lt;ol start=&quot;3&quot;&gt;
  &lt;li&gt;Chứng minh $\lim_{x\to2}\dfrac1x=\dfrac12$.&lt;/li&gt;
  &lt;li&gt;Chứng minh $\lim_{x\to-1}(x^2+x)=0$.&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Đáp án&lt;/summary&gt;

  &lt;ol start=&quot;3&quot;&gt;
    &lt;li&gt;$\left\lvert\tfrac1x-\tfrac12\right\rvert=\dfrac{\lvert x-2\rvert}{2\lvert x\rvert}$. Nếu $\lvert x-2\rvert&amp;lt;1$ thì $x&amp;gt;1$, nên biểu thức $&amp;lt;\tfrac12\lvert x-2\rvert$. Chọn $\delta=\min(1,2\varepsilon)$.&lt;/li&gt;
    &lt;li&gt;$\lvert x^2+x\rvert=\lvert x+1\rvert\,\lvert x\rvert$. Nếu $\lvert x+1\rvert&amp;lt;1$ thì $\lvert x\rvert&amp;lt;2$. Chọn $\delta=\min(1,\varepsilon/2)$.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;p&gt;&lt;strong&gt;Mức nâng cao.&lt;/strong&gt;&lt;/p&gt;

&lt;ol start=&quot;5&quot;&gt;
  &lt;li&gt;Chứng minh $\lim_{x\to4}\sqrt x=2$.&lt;/li&gt;
  &lt;li&gt;Chứng minh: nếu $\lim_{x\to a}f(x)=L&amp;gt;0$ thì có $\delta&amp;gt;0$ sao cho $f(x)&amp;gt;\tfrac L2$ với mọi $0&amp;lt;\lvert x-a\rvert&amp;lt;\delta$ (giữ dấu).&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Gợi ý&lt;/summary&gt;

  &lt;ol start=&quot;5&quot;&gt;
    &lt;li&gt;$\lvert\sqrt x-2\rvert=\dfrac{\lvert x-4\rvert}{\sqrt x+2}\le\dfrac{\lvert x-4\rvert}2$. Chọn $\delta=\min(4,2\varepsilon)$ để $x&amp;gt;0$.&lt;/li&gt;
    &lt;li&gt;Dùng định nghĩa với $\varepsilon=\tfrac L2$: $f(x)&amp;gt;L-\tfrac L2$.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;h2 id=&quot;tóm-tắt&quot;&gt;Tóm tắt&lt;/h2&gt;

&lt;div class=&quot;content-box summary-box textbook-block&quot;&gt;
  &lt;ul&gt;
    &lt;li&gt;$\lim_{x\to a}f(x)=L$: với mọi $\varepsilon&amp;gt;0$ có $\delta&amp;gt;0$ để $0&amp;lt;\lvert x-a\rvert&amp;lt;\delta\Rightarrow\lvert f(x)-L\rvert&amp;lt;\varepsilon$.&lt;/li&gt;
    &lt;li&gt;Cách tìm δ: tách $\lvert f(x)-L\rvert=\lvert x-a\rvert\cdot(\text{thừa số})$, chặn thừa số bằng cách giả sử trước $\lvert x-a\rvert&amp;lt;1$, rồi lấy $\delta=\min(1,\dots)$.&lt;/li&gt;
    &lt;li&gt;Giới hạn là duy nhất. Muốn chứng minh không tồn tại, dùng phủ định: một $\varepsilon$ mà mọi $\delta$ đều thất bại.&lt;/li&gt;
  &lt;/ul&gt;
&lt;/div&gt;
</content>
 </entry>
 
 <entry>
   <title>Giới hạn của hàm số: trực giác</title>
   <link href="https://calculus-self-learning.pages.dev/contents/vi/chapter01/01_01_Gioi_han_cua_ham_so_truc_giac/"/>
   <updated>2026-12-01T00:00:00+00:00</updated>
   <id>https://calculus-self-learning.pages.dev/contents/vi/chapter01/01_01_Gioi_han_cua_ham_so_truc_giac</id>
   <content type="html">&lt;div class=&quot;textbook-objectives&quot;&gt;

  &lt;p&gt;&lt;strong&gt;Mục tiêu học tập.&lt;/strong&gt; Sau bài này, người học có thể:&lt;/p&gt;

  &lt;ul&gt;
    &lt;li&gt;ước lượng $\lim_{x\to a}f(x)$ bằng bảng giá trị lấy từ hai phía của $a$;&lt;/li&gt;
    &lt;li&gt;giải thích vì sao giới hạn tại $a$ không phụ thuộc giá trị $f(a)$, thậm chí khi $f(a)$ không xác định;&lt;/li&gt;
    &lt;li&gt;nhận ra ba tình huống giới hạn không tồn tại: hai phía khác nhau, tiến ra vô cực, dao động;&lt;/li&gt;
    &lt;li&gt;biết khi nào bảng số đánh lừa người tính.&lt;/li&gt;
  &lt;/ul&gt;

&lt;/div&gt;

&lt;h2 id=&quot;vì-sao-cần-bài-này&quot;&gt;Vì sao cần bài này&lt;/h2&gt;

&lt;p&gt;Một viên bi rơi tự do đi được quãng đường $s(t)=4{,}9t^2$ mét sau $t$ giây. Vận tốc trung bình từ $t=2$ đến $t=2+h$ là&lt;/p&gt;

\[\frac{s(2+h)-s(2)}{h}=\frac{4{,}9(4+4h+h^2)-19{,}6}{h}=19{,}6+4{,}9h .\]

&lt;table&gt;
  &lt;thead&gt;
    &lt;tr&gt;
      &lt;th&gt;$h$&lt;/th&gt;
      &lt;th&gt;0,1&lt;/th&gt;
      &lt;th&gt;0,01&lt;/th&gt;
      &lt;th&gt;0,001&lt;/th&gt;
    &lt;/tr&gt;
  &lt;/thead&gt;
  &lt;tbody&gt;
    &lt;tr&gt;
      &lt;td&gt;vận tốc trung bình (m/s)&lt;/td&gt;
      &lt;td&gt;20,09&lt;/td&gt;
      &lt;td&gt;19,649&lt;/td&gt;
      &lt;td&gt;19,6049&lt;/td&gt;
    &lt;/tr&gt;
  &lt;/tbody&gt;
&lt;/table&gt;

&lt;p&gt;Không thể đặt $h=0$ vì phép chia cho 0 vô nghĩa. Nhưng khi $h$ càng nhỏ, kết quả càng gần 19,6. Ta nói vận tốc &lt;em&gt;tức thời&lt;/em&gt; tại $t=2$ là $19{,}6$ m/s, và viết $\lim_{h\to0}(19{,}6+4{,}9h)=19{,}6$. Toàn bộ đạo hàm ở chương 2 dựa trên ý này.&lt;/p&gt;

&lt;h2 id=&quot;giới-hạn-ý-tưởng&quot;&gt;Giới hạn: ý tưởng&lt;/h2&gt;

&lt;div class=&quot;textbook-definition&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Định nghĩa 1 (Giới hạn, dạng trực giác).&lt;/strong&gt; Cho $f$ xác định ở gần $a$ (có thể trừ chính điểm $a$). Ta viết&lt;/p&gt;

\[\lim_{x\to a}f(x)=L\]

  &lt;p&gt;nếu $f(x)$ gần $L$ tuỳ ý khi $x$ đủ gần $a$ và $x\ne a$.&lt;/p&gt;
&lt;/div&gt;

&lt;p&gt;“Gần tuỳ ý” và “đủ gần” sẽ được làm chính xác bằng ε và δ ở bài sau. Hai điểm cần nhớ ngay:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;chỉ xét $x\ne a$, nên giá trị $f(a)$ (nếu có) không ảnh hưởng đến giới hạn;&lt;/li&gt;
  &lt;li&gt;$x$ được tiến tới $a$ từ cả hai phía.&lt;/li&gt;
&lt;/ul&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Ví dụ 1.&lt;/strong&gt; Ước lượng $\lim_{x\to1}\dfrac{x^2-1}{x-1}$.&lt;/p&gt;

  &lt;p&gt;Hàm không xác định tại $x=1$. Bảng số:&lt;/p&gt;

  &lt;table&gt;
    &lt;thead&gt;
      &lt;tr&gt;
        &lt;th&gt;$x$&lt;/th&gt;
        &lt;th&gt;0,9&lt;/th&gt;
        &lt;th&gt;0,99&lt;/th&gt;
        &lt;th&gt;0,999&lt;/th&gt;
        &lt;th&gt;1,001&lt;/th&gt;
        &lt;th&gt;1,01&lt;/th&gt;
        &lt;th&gt;1,1&lt;/th&gt;
      &lt;/tr&gt;
    &lt;/thead&gt;
    &lt;tbody&gt;
      &lt;tr&gt;
        &lt;td&gt;$f(x)$&lt;/td&gt;
        &lt;td&gt;1,9&lt;/td&gt;
        &lt;td&gt;1,99&lt;/td&gt;
        &lt;td&gt;1,999&lt;/td&gt;
        &lt;td&gt;2,001&lt;/td&gt;
        &lt;td&gt;2,01&lt;/td&gt;
        &lt;td&gt;2,1&lt;/td&gt;
      &lt;/tr&gt;
    &lt;/tbody&gt;
  &lt;/table&gt;

  &lt;p&gt;Giới hạn bằng 2. Lý do: với $x\ne1$, $\dfrac{x^2-1}{x-1}=\dfrac{(x-1)(x+1)}{x-1}=x+1$. Đồ thị là đường thẳng $y=x+1$ bị khoét một lỗ tại $(1,2)$.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-theorem&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Định lý 1 (Giới hạn chỉ phụ thuộc giá trị ở gần a).&lt;/strong&gt; Nếu $f(x)=g(x)$ với mọi $x\ne a$ trong một khoảng chứa $a$, và $\lim_{x\to a}g(x)=L$, thì $\lim_{x\to a}f(x)=L$.&lt;/p&gt;
&lt;/div&gt;

&lt;p&gt;Định lý này hiển nhiên theo Định nghĩa 1, vì định nghĩa chỉ nhìn các $x\ne a$. Bài 01_02 sẽ chứng minh nó bằng ε–δ. Đây là cơ sở của bước “rút gọn rồi thay số” ở Ví dụ 1.&lt;/p&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Ví dụ 2.&lt;/strong&gt; Ước lượng $\lim_{x\to0}\dfrac{\sin x}{x}$ ($x$ tính bằng radian).&lt;/p&gt;

  &lt;table&gt;
    &lt;thead&gt;
      &lt;tr&gt;
        &lt;th&gt;$x$&lt;/th&gt;
        &lt;th&gt;0,1&lt;/th&gt;
        &lt;th&gt;0,01&lt;/th&gt;
        &lt;th&gt;0,001&lt;/th&gt;
      &lt;/tr&gt;
    &lt;/thead&gt;
    &lt;tbody&gt;
      &lt;tr&gt;
        &lt;td&gt;$\dfrac{\sin x}{x}$&lt;/td&gt;
        &lt;td&gt;0,998334&lt;/td&gt;
        &lt;td&gt;0,999983&lt;/td&gt;
        &lt;td&gt;0,9999998&lt;/td&gt;
      &lt;/tr&gt;
    &lt;/tbody&gt;
  &lt;/table&gt;

  &lt;p&gt;Hàm chẵn nên phía âm cho cùng giá trị. Giới hạn có vẻ là 1. Bảng số không phải chứng minh; bài 01_04 chứng minh điều này bằng định lý kẹp.&lt;/p&gt;
&lt;/div&gt;

&lt;h2 id=&quot;khi-nào-giới-hạn-không-tồn-tại&quot;&gt;Khi nào giới hạn không tồn tại&lt;/h2&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Ví dụ 3.&lt;/strong&gt; Ba hàm sau không có giới hạn tại $0$.&lt;/p&gt;

  &lt;ol&gt;
    &lt;li&gt;$f(x)=\dfrac{\lvert x\rvert}{x}$: bằng $1$ khi $x&amp;gt;0$, bằng $-1$ khi $x&amp;lt;0$. Hai phía tiến tới hai số khác nhau.&lt;/li&gt;
    &lt;li&gt;$f(x)=\dfrac1{x^2}$: khi $x\to0$, $f(x)$ lớn vô hạn ($x=0{,}01$ cho $10\,000$). Ta viết $\lim_{x\to0}\tfrac1{x^2}=+\infty$, nhưng đó là cách nói “tăng không bị chặn”, không phải một giới hạn hữu hạn.&lt;/li&gt;
    &lt;li&gt;$f(x)=\sin\dfrac{\pi}{x}$: tại $x=\tfrac1n$ hàm bằng $\sin(n\pi)=0$; tại $x=\tfrac2{4n+1}$ hàm bằng $\sin\left(\tfrac{(4n+1)\pi}2\right)=1$. Cả hai dãy điểm đều tiến tới 0, nhưng giá trị hàm cứ dao động giữa 0 và 1.&lt;/li&gt;
  &lt;/ol&gt;
&lt;/div&gt;

&lt;div class=&quot;content-box warning-box textbook-block&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Lưu ý: bảng số có thể đánh lừa.&lt;/strong&gt; Với $f(x)=\sin\tfrac\pi x$, nếu chỉ thử $x=0{,}1;\ 0{,}01;\ 0{,}001$ thì mọi giá trị đều bằng $0$, và ta sẽ đoán sai rằng giới hạn bằng 0. Bảng số chỉ là gợi ý. Kết luận phải dựa vào biến đổi đại số hoặc định nghĩa.&lt;/p&gt;
&lt;/div&gt;

&lt;h2 id=&quot;minh-hoạ&quot;&gt;Minh hoạ&lt;/h2&gt;

&lt;div class=&quot;interactive-frame&quot;&gt;
  &lt;div class=&quot;interactive-frame-head&quot;&gt;
    &lt;div class=&quot;interactive-frame-title&quot;&gt;Bảng giá trị tiến tới a&lt;/div&gt;
    &lt;div class=&quot;interactive-frame-desc&quot;&gt;Chọn hàm, xem giá trị f(x) khi x tiến tới a từ hai phía.&lt;/div&gt;
  &lt;/div&gt;
  &lt;iframe src=&quot;/interactives/chapter01/limit-table.html&quot; title=&quot;Bảng giá trị tiến tới a&quot; loading=&quot;lazy&quot; style=&quot;height: 640px;&quot;&gt;&lt;/iframe&gt;
  &lt;div class=&quot;interactive-frame-foot&quot;&gt;
    &lt;a href=&quot;/interactives/chapter01/limit-table.html&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;Mở minh hoạ ở cửa sổ riêng&lt;/a&gt;
  &lt;/div&gt;
&lt;/div&gt;

&lt;h2 id=&quot;ứng-dụng&quot;&gt;Ứng dụng&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Vật lý: vận tốc tức thời.&lt;/strong&gt; Đã làm ở đầu bài: vận tốc tức thời là giới hạn của vận tốc trung bình khi khoảng thời gian co về 0.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Tính toán khoa học: lỗi triệt tiêu khi trừ hai số gần nhau.&lt;/strong&gt; Ta biết (bài 01_04) $\lim_{x\to0}\dfrac{1-\cos x}{x^2}=\tfrac12$. Nhưng với số thực dấu phẩy động 64 bit, tính trực tiếp tại $x=10^{-8}$ cho kết quả $0$: máy làm tròn $\cos(10^{-8})$ thành đúng $1$, nên tử số bằng 0. Viết lại $1-\cos x=2\sin^2\tfrac x2$ thì máy cho $0{,}5$. Bảng số trên máy tính chỉ đáng tin khi công thức không trừ hai số gần bằng nhau.&lt;/p&gt;

&lt;h2 id=&quot;bài-tập&quot;&gt;Bài tập&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Mức cơ bản.&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;Lập bảng với $x=\pm0{,}1;\ \pm0{,}01;\ \pm0{,}001$ để ước lượng $\lim_{x\to0}\dfrac{\sqrt{x+9}-3}{x}$.&lt;/li&gt;
  &lt;li&gt;Tính $\lim_{x\to3}\dfrac{x^2-9}{x-3}$ bằng cách rút gọn.&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Đáp án&lt;/summary&gt;

  &lt;ol&gt;
    &lt;li&gt;Với $x=0{,}001$ được $0{,}166662$. Giới hạn là $\tfrac16\approx0{,}1667$. Nhân liên hợp: $\dfrac{\sqrt{x+9}-3}{x}=\dfrac{1}{\sqrt{x+9}+3}\to\dfrac16$.&lt;/li&gt;
    &lt;li&gt;$x+3\to6$.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;p&gt;&lt;strong&gt;Mức vận dụng.&lt;/strong&gt;&lt;/p&gt;

&lt;ol start=&quot;3&quot;&gt;
  &lt;li&gt;Ước lượng $\lim_{x\to0}\dfrac{2^x-1}{x}$ bằng bảng số, và so sánh với $\ln2$.&lt;/li&gt;
  &lt;li&gt;Cho $f(x)=x^2$ khi $x\ne2$ và $f(2)=10$. Tính $\lim_{x\to2}f(x)$ và $f(2)$.&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Đáp án&lt;/summary&gt;

  &lt;ol start=&quot;3&quot;&gt;
    &lt;li&gt;$x=0{,}001$ cho $0{,}69339$; giới hạn là $\ln2\approx0{,}69315$.&lt;/li&gt;
    &lt;li&gt;Giới hạn bằng 4, còn $f(2)=10$. Giới hạn không quan tâm giá trị tại điểm.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;p&gt;&lt;strong&gt;Mức nâng cao.&lt;/strong&gt;&lt;/p&gt;

&lt;ol start=&quot;5&quot;&gt;
  &lt;li&gt;Chứng tỏ $\lim_{x\to0}\cos\dfrac1x$ không tồn tại bằng cách chọn hai dãy $x_n\to0$ cho hai giá trị khác nhau.&lt;/li&gt;
  &lt;li&gt;Bảng số với $x=10^{-1},\dots,10^{-6}$ cho $\dfrac{1-\cos x}{x^2}$ gần $0{,}5$. Vì sao với $x=10^{-9}$ máy tính lại cho $0$? Đề xuất cách tính ổn định.&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Gợi ý&lt;/summary&gt;

  &lt;ol start=&quot;5&quot;&gt;
    &lt;li&gt;$x_n=\tfrac1{2n\pi}$ cho $\cos=1$; $x_n=\tfrac1{(2n+1)\pi}$ cho $\cos=-1$.&lt;/li&gt;
    &lt;li&gt;$\cos(10^{-9})=1-5\cdot10^{-19}$, nhỏ hơn độ chính xác khoảng $10^{-16}$ của số 64 bit, nên bị làm tròn thành 1. Dùng $\dfrac{2\sin^2(x/2)}{x^2}$.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;h2 id=&quot;tóm-tắt&quot;&gt;Tóm tắt&lt;/h2&gt;

&lt;div class=&quot;content-box summary-box textbook-block&quot;&gt;
  &lt;ul&gt;
    &lt;li&gt;$\lim_{x\to a}f(x)=L$: $f(x)$ gần $L$ khi $x$ gần $a$, $x\ne a$. Giá trị $f(a)$ không quan trọng.&lt;/li&gt;
    &lt;li&gt;Rút gọn đại số rồi thay số là cách tính giới hạn hợp lệ (Định lý 1).&lt;/li&gt;
    &lt;li&gt;Giới hạn không tồn tại khi hai phía khác nhau, khi hàm tăng không bị chặn, hoặc khi hàm dao động.&lt;/li&gt;
    &lt;li&gt;Bảng số chỉ là gợi ý và có thể sai vì dao động hoặc lỗi làm tròn.&lt;/li&gt;
  &lt;/ul&gt;
&lt;/div&gt;
</content>
 </entry>
 
 <entry>
   <title>Ngôn ngữ chứng minh trong giải tích</title>
   <link href="https://calculus-self-learning.pages.dev/contents/vi/chapter00/00_04_Ngon_ngu_chung_minh_trong_giai_tich/"/>
   <updated>2026-12-01T00:00:00+00:00</updated>
   <id>https://calculus-self-learning.pages.dev/contents/vi/chapter00/00_04_Ngon_ngu_chung_minh_trong_giai_tich</id>
   <content type="html">&lt;div class=&quot;textbook-objectives&quot;&gt;

  &lt;p&gt;&lt;strong&gt;Mục tiêu học tập.&lt;/strong&gt; Sau bài này, người học có thể:&lt;/p&gt;

  &lt;ul&gt;
    &lt;li&gt;đọc và viết câu có lượng từ $\forall$ (với mọi), $\exists$ (tồn tại), và hiểu thứ tự lượng từ thay đổi ý nghĩa;&lt;/li&gt;
    &lt;li&gt;phủ định một câu có nhiều lượng từ một cách máy móc, không sai;&lt;/li&gt;
    &lt;li&gt;chứng minh bằng phản đảo, phản chứng và quy nạp;&lt;/li&gt;
    &lt;li&gt;viết một chứng minh ngắn dạng “cho $\varepsilon&amp;gt;0$, chọn $\delta=\dots$”.&lt;/li&gt;
  &lt;/ul&gt;

&lt;/div&gt;

&lt;h2 id=&quot;vì-sao-cần-bài-này&quot;&gt;Vì sao cần bài này&lt;/h2&gt;

&lt;p&gt;Câu sau là định nghĩa “dãy $a_n$ hội tụ về $L$” ở chương 7:&lt;/p&gt;

\[\forall\varepsilon&amp;gt;0\ \ \exists N\ \ \forall n\ge N:\quad \lvert a_n-L\rvert&amp;lt;\varepsilon .\]

&lt;p&gt;Nó có ba lượng từ liên tiếp. Muốn chứng minh một dãy &lt;em&gt;không&lt;/em&gt; hội tụ, ta phải phủ định đúng câu này. Sinh viên mất điểm ở chương 1 và chương 7 chủ yếu vì đọc sai hoặc phủ định sai những câu như vậy, không phải vì tính toán.&lt;/p&gt;

&lt;h2 id=&quot;lượng-từ-và-thứ-tự-lượng-từ&quot;&gt;Lượng từ và thứ tự lượng từ&lt;/h2&gt;

&lt;div class=&quot;textbook-definition&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Định nghĩa 1 (Lượng từ).&lt;/strong&gt; Cho $P(x)$ là một mệnh đề phụ thuộc biến $x$ thuộc tập $X$.&lt;/p&gt;

  &lt;ul&gt;
    &lt;li&gt;$\forall x\in X:\ P(x)$ nghĩa là $P(x)$ đúng với mọi $x$ trong $X$.&lt;/li&gt;
    &lt;li&gt;$\exists x\in X:\ P(x)$ nghĩa là có ít nhất một $x$ trong $X$ làm $P(x)$ đúng.&lt;/li&gt;
  &lt;/ul&gt;
&lt;/div&gt;

&lt;p&gt;Thứ tự lượng từ quan trọng. So sánh hai câu với $x,y\in\mathbb{R}$:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;$\forall x\ \exists y:\ y&amp;gt;x$. Đúng: cho $x$, chọn $y=x+1$. Ở đây $y$ được phép phụ thuộc $x$.&lt;/li&gt;
  &lt;li&gt;$\exists y\ \forall x:\ y&amp;gt;x$. Sai: không có số thực nào lớn hơn mọi số thực.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Trong định nghĩa ε–δ, câu “$\forall\varepsilon\ \exists\delta$” cho phép $\delta$ phụ thuộc $\varepsilon$. Đó là lý do ta thường viết $\delta=\varepsilon/3$ hay $\delta=\min(1,\varepsilon/5)$.&lt;/p&gt;

&lt;h2 id=&quot;phủ-định&quot;&gt;Phủ định&lt;/h2&gt;

&lt;div class=&quot;textbook-theorem&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Định lý 1 (Quy tắc phủ định).&lt;/strong&gt;&lt;/p&gt;

\[\neg\big(\forall x:\ P(x)\big)\iff \exists x:\ \neg P(x),\qquad \neg\big(\exists x:\ P(x)\big)\iff \forall x:\ \neg P(x).\]

  &lt;p&gt;Ngoài ra $\neg(P\wedge Q)\iff\neg P\vee\neg Q$, $\neg(P\vee Q)\iff\neg P\wedge\neg Q$, và $\neg(P\Rightarrow Q)\iff P\wedge\neg Q$.&lt;/p&gt;
&lt;/div&gt;

&lt;p&gt;Quy tắc thực hành: đi từ trái sang phải, đổi mỗi $\forall$ thành $\exists$, mỗi $\exists$ thành $\forall$, rồi phủ định phần cuối. Phủ định của $&amp;lt;$ là $\ge$.&lt;/p&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Ví dụ 1.&lt;/strong&gt; Phủ định câu “dãy $a_n$ hội tụ về $L$”:&lt;/p&gt;

\[\exists\varepsilon&amp;gt;0\ \ \forall N\ \ \exists n\ge N:\quad \lvert a_n-L\rvert\ge\varepsilon .\]

  &lt;p&gt;Đọc thành lời: có một sai số $\varepsilon$ sao cho dù đi xa đến đâu, vẫn còn một số hạng lệch khỏi $L$ ít nhất $\varepsilon$.&lt;/p&gt;

  &lt;p&gt;Áp dụng: dãy $a_n=(-1)^n$ không hội tụ về 1. Chọn $\varepsilon=1$. Cho $N$ bất kỳ, lấy $n$ lẻ, $n\ge N$. Khi đó $\lvert a_n-1\rvert=\lvert-1-1\rvert=2\ge1$.&lt;/p&gt;
&lt;/div&gt;

&lt;h2 id=&quot;phản-đảo-và-phản-chứng&quot;&gt;Phản đảo và phản chứng&lt;/h2&gt;

&lt;div class=&quot;textbook-lemma&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Bổ đề 1 (Phản đảo).&lt;/strong&gt; $P\Rightarrow Q$ tương đương với $\neg Q\Rightarrow\neg P$.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-proof&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Chứng minh.&lt;/strong&gt; $P\Rightarrow Q$ chỉ sai khi $P$ đúng và $Q$ sai. $\neg Q\Rightarrow\neg P$ chỉ sai khi $\neg Q$ đúng và $\neg P$ sai, tức cũng khi $Q$ sai và $P$ đúng. Hai mệnh đề sai trong đúng cùng một trường hợp, nên tương đương.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Ví dụ 2 (Phản đảo).&lt;/strong&gt; Chứng minh: với số nguyên $n$, nếu $n^2$ chẵn thì $n$ chẵn.&lt;/p&gt;

  &lt;p&gt;Chứng minh phản đảo: nếu $n$ lẻ thì $n^2$ lẻ. Viết $n=2k+1$, ta có $n^2=4k^2+4k+1=2(2k^2+2k)+1$, là số lẻ.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-theorem&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Định lý 2.&lt;/strong&gt; $\sqrt2$ là số vô tỉ.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-proof&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Chứng minh.&lt;/strong&gt; Phản chứng. Giả sử $\sqrt2=\tfrac pq$ với $p,q$ nguyên dương, phân số tối giản. Bình phương: $p^2=2q^2$, nên $p^2$ chẵn, theo Ví dụ 2 thì $p$ chẵn, $p=2m$. Thay vào: $4m^2=2q^2$, tức $q^2=2m^2$, nên $q$ cũng chẵn. Cả $p$ và $q$ chẵn, trái với giả thiết tối giản.&lt;/p&gt;
&lt;/div&gt;

&lt;h2 id=&quot;quy-nạp-toán-học&quot;&gt;Quy nạp toán học&lt;/h2&gt;

&lt;p&gt;Để chứng minh $P(n)$ đúng với mọi $n\ge n_0$: kiểm tra $P(n_0)$ (bước cơ sở), rồi chứng minh $P(n)\Rightarrow P(n+1)$ với mọi $n\ge n_0$ (bước quy nạp).&lt;/p&gt;

&lt;div class=&quot;textbook-theorem&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Định lý 3 (Bất đẳng thức Bernoulli).&lt;/strong&gt; Với $x\ge-1$ và mọi số nguyên $n\ge1$,&lt;/p&gt;

\[(1+x)^n\ge1+nx .\]

&lt;/div&gt;

&lt;div class=&quot;textbook-proof&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Chứng minh.&lt;/strong&gt; Với $n=1$ hai vế bằng nhau. Giả sử $(1+x)^n\ge1+nx$. Vì $1+x\ge0$, nhân hai vế với $1+x$ không đổi chiều:&lt;/p&gt;

\[(1+x)^{n+1}\ge(1+nx)(1+x)=1+(n+1)x+nx^2\ge1+(n+1)x .\]

  &lt;p&gt;Vậy bất đẳng thức đúng với $n+1$.&lt;/p&gt;
&lt;/div&gt;

&lt;p&gt;Bất đẳng thức Bernoulli sẽ dùng ở chương 7 để chứng minh $q^n\to0$ khi $0&amp;lt;q&amp;lt;1$ và dãy $(1+1/n)^n$ tăng.&lt;/p&gt;

&lt;h2 id=&quot;chứng-minh-dạng-εδ-đầu-tiên&quot;&gt;Chứng minh dạng ε–δ đầu tiên&lt;/h2&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Ví dụ 3.&lt;/strong&gt; Chứng minh: $\forall\varepsilon&amp;gt;0\ \exists\delta&amp;gt;0:\ \lvert x-2\rvert&amp;lt;\delta\Rightarrow\lvert 3x-6\rvert&amp;lt;\varepsilon$.&lt;/p&gt;

  &lt;p&gt;&lt;em&gt;Nháp.&lt;/em&gt; Ta cần $\lvert3x-6\rvert=3\lvert x-2\rvert&amp;lt;\varepsilon$, tức $\lvert x-2\rvert&amp;lt;\varepsilon/3$. Vậy chọn $\delta=\varepsilon/3$.&lt;/p&gt;

  &lt;p&gt;&lt;em&gt;Bài viết.&lt;/em&gt; Cho $\varepsilon&amp;gt;0$. Đặt $\delta=\varepsilon/3&amp;gt;0$. Nếu $\lvert x-2\rvert&amp;lt;\delta$ thì $\lvert3x-6\rvert=3\lvert x-2\rvert&amp;lt;3\delta=\varepsilon$.&lt;/p&gt;

  &lt;p&gt;Với số cụ thể: $\varepsilon=0{,}03$ cho $\delta=0{,}01$. Lấy $x=2{,}009$: $\lvert3x-6\rvert=0{,}027&amp;lt;0{,}03$.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;content-box insight-box textbook-block&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Nhận xét.&lt;/strong&gt; Một chứng minh ε–δ luôn có hai phần: nháp (đi ngược từ điều cần chứng minh để tìm $\delta$) và bài viết (đi xuôi từ $\delta$ đã chọn). Người đọc chỉ cần thấy bài viết, nhưng người viết phải làm nháp trước.&lt;/p&gt;
&lt;/div&gt;

&lt;h2 id=&quot;ứng-dụng&quot;&gt;Ứng dụng&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Học máy: một phản ví dụ đủ bác bỏ câu “với mọi”.&lt;/strong&gt; Câu “gradient descent làm hàm mất mát giảm với mọi tốc độ học $\eta&amp;gt;0$” có dạng $\forall\eta$. Muốn bác bỏ chỉ cần một $\eta$.&lt;/p&gt;

&lt;p&gt;Lấy $f(x)=x^2$. Bước lặp $x_{k+1}=x_k-\eta f&apos;(x_k)=x_k-2\eta x_k=(1-2\eta)x_k$. Với $\eta=1{,}5$, hệ số là $-2$: từ $x_0=1$ ta được $-2,\ 4,\ -8,\dots$ và $f(x_k)=4^k$ tăng mãi. Câu đúng phải có điều kiện: với $0&amp;lt;\eta&amp;lt;1$ thì $\lvert1-2\eta\rvert&amp;lt;1$ và $x_k\to0$.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Kỹ thuật: đặc tả dung sai.&lt;/strong&gt; “Với mọi sai số đầu ra cho phép $\varepsilon$, tồn tại dung sai đầu vào $\delta$” là cách một kỹ sư nói rằng hệ thống ổn định. Nếu đầu ra là $y=3x$ thì dung sai đầu vào phải nhỏ gấp 3 lần dung sai đầu ra, đúng như Ví dụ 3.&lt;/p&gt;

&lt;h2 id=&quot;bài-tập&quot;&gt;Bài tập&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Mức cơ bản.&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;Phủ định câu: “Mọi sinh viên trong lớp đều có ít nhất một bài đạt điểm 10.”&lt;/li&gt;
  &lt;li&gt;Câu $\forall x\in\mathbb{R}\ \exists y\in\mathbb{R}:\ x+y=0$ đúng hay sai? Còn $\exists y\ \forall x:\ x+y=0$?&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Đáp án&lt;/summary&gt;

  &lt;ol&gt;
    &lt;li&gt;Có một sinh viên trong lớp không có bài nào đạt điểm 10.&lt;/li&gt;
    &lt;li&gt;Câu thứ nhất đúng (chọn $y=-x$). Câu thứ hai sai.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;p&gt;&lt;strong&gt;Mức vận dụng.&lt;/strong&gt;&lt;/p&gt;

&lt;ol start=&quot;3&quot;&gt;
  &lt;li&gt;Viết phủ định của: $\forall\varepsilon&amp;gt;0\ \exists\delta&amp;gt;0\ \forall x:\ \lvert x-a\rvert&amp;lt;\delta\Rightarrow\lvert f(x)-L\rvert&amp;lt;\varepsilon$.&lt;/li&gt;
  &lt;li&gt;Chứng minh bằng quy nạp: $1+2+\dots+n=\dfrac{n(n+1)}2$.&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Đáp án&lt;/summary&gt;

  &lt;ol start=&quot;3&quot;&gt;
    &lt;li&gt;$\exists\varepsilon&amp;gt;0\ \forall\delta&amp;gt;0\ \exists x:\ \lvert x-a\rvert&amp;lt;\delta$ và $\lvert f(x)-L\rvert\ge\varepsilon$.&lt;/li&gt;
    &lt;li&gt;Cơ sở $n=1$ đúng. Bước quy nạp: $\dfrac{n(n+1)}2+(n+1)=\dfrac{(n+1)(n+2)}2$.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;p&gt;&lt;strong&gt;Mức nâng cao.&lt;/strong&gt;&lt;/p&gt;

&lt;ol start=&quot;5&quot;&gt;
  &lt;li&gt;Chứng minh $\sqrt3$ là số vô tỉ.&lt;/li&gt;
  &lt;li&gt;Chứng minh: $\forall\varepsilon&amp;gt;0\ \exists\delta&amp;gt;0:\ \lvert x-1\rvert&amp;lt;\delta\Rightarrow\lvert x^2-1\rvert&amp;lt;\varepsilon$.&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Gợi ý&lt;/summary&gt;

  &lt;ol start=&quot;5&quot;&gt;
    &lt;li&gt;Làm như Định lý 2, dùng: nếu $3\mid p^2$ thì $3\mid p$ (xét $p=3k+1$, $p=3k+2$).&lt;/li&gt;
    &lt;li&gt;$\lvert x^2-1\rvert=\lvert x-1\rvert\,\lvert x+1\rvert$. Nếu $\lvert x-1\rvert&amp;lt;1$ thì $0&amp;lt;x&amp;lt;2$ nên $\lvert x+1\rvert&amp;lt;3$. Chọn $\delta=\min(1,\varepsilon/3)$.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;h2 id=&quot;tóm-tắt&quot;&gt;Tóm tắt&lt;/h2&gt;

&lt;div class=&quot;content-box summary-box textbook-block&quot;&gt;
  &lt;ul&gt;
    &lt;li&gt;$\forall x\ \exists y$ cho phép $y$ phụ thuộc $x$; đổi thứ tự lượng từ có thể đổi nghĩa.&lt;/li&gt;
    &lt;li&gt;Phủ định: đổi $\forall\leftrightarrow\exists$ từ trái sang phải, phủ định phần cuối; $\neg(P\Rightarrow Q)$ là $P\wedge\neg Q$.&lt;/li&gt;
    &lt;li&gt;Phản đảo: chứng minh $\neg Q\Rightarrow\neg P$. Phản chứng: giả sử điều ngược lại rồi dẫn đến mâu thuẫn.&lt;/li&gt;
    &lt;li&gt;Quy nạp: bước cơ sở và bước $P(n)\Rightarrow P(n+1)$. Bất đẳng thức Bernoulli $(1+x)^n\ge1+nx$.&lt;/li&gt;
    &lt;li&gt;Chứng minh ε–δ: làm nháp để tìm $\delta$, rồi viết xuôi.&lt;/li&gt;
  &lt;/ul&gt;
&lt;/div&gt;
</content>
 </entry>
 
 <entry>
   <title>Các hàm sơ cấp</title>
   <link href="https://calculus-self-learning.pages.dev/contents/vi/chapter00/00_03_Cac_ham_so_cap/"/>
   <updated>2026-12-01T00:00:00+00:00</updated>
   <id>https://calculus-self-learning.pages.dev/contents/vi/chapter00/00_03_Cac_ham_so_cap</id>
   <content type="html">&lt;div class=&quot;textbook-objectives&quot;&gt;

  &lt;p&gt;&lt;strong&gt;Mục tiêu học tập.&lt;/strong&gt; Sau bài này, người học có thể:&lt;/p&gt;

  &lt;ul&gt;
    &lt;li&gt;nêu miền xác định, miền giá trị, dáng đồ thị của các hàm sơ cấp cơ bản;&lt;/li&gt;
    &lt;li&gt;dùng tính chất của mũ và logarit để giải phương trình mũ;&lt;/li&gt;
    &lt;li&gt;tính các giá trị lượng giác ngược và rút gọn biểu thức như $\cos(\arcsin x)$;&lt;/li&gt;
    &lt;li&gt;nhận ra hàm sigmoid và tanh trong học máy là hàm mũ ghép lại.&lt;/li&gt;
  &lt;/ul&gt;

&lt;/div&gt;

&lt;h2 id=&quot;vì-sao-cần-bài-này&quot;&gt;Vì sao cần bài này&lt;/h2&gt;

&lt;p&gt;Một mẫu thuốc trong máu giảm một nửa sau mỗi 6 giờ. Sau $t$ giờ còn $C(t)=C_0\cdot 2^{-t/6}$. Hỏi sau bao lâu còn 10% liều ban đầu? Phải giải $2^{-t/6}=0{,}1$, tức là phải dùng logarit: $t=6\log_2 10\approx 19{,}9$ giờ.&lt;/p&gt;

&lt;p&gt;Hầu hết hàm gặp trong khoá học được ghép từ một danh sách ngắn các hàm cơ bản bằng cộng, nhân, chia và hợp. Bài này ôn lại danh sách đó.&lt;/p&gt;

&lt;div class=&quot;textbook-definition&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Định nghĩa 1 (Hàm sơ cấp).&lt;/strong&gt; Các &lt;em&gt;hàm sơ cấp cơ bản&lt;/em&gt; là: hằng số, $x^\alpha$, $a^x$, $\log_a x$, $\sin x$, $\cos x$, $\tan x$, $\cot x$ và các hàm ngược $\arcsin x$, $\arccos x$, $\arctan x$. &lt;em&gt;Hàm sơ cấp&lt;/em&gt; là hàm nhận được từ các hàm sơ cấp cơ bản bằng hữu hạn phép cộng, trừ, nhân, chia và hợp.&lt;/p&gt;
&lt;/div&gt;

&lt;p&gt;Ví dụ $f(x)=\dfrac{e^{-x^2}\sin 3x}{1+\ln(1+x^2)}$ là hàm sơ cấp. Hàm $\lvert x\rvert=\sqrt{x^2}$ cũng là hàm sơ cấp.&lt;/p&gt;

&lt;h2 id=&quot;đa-thức-và-hàm-hữu-tỉ&quot;&gt;Đa thức và hàm hữu tỉ&lt;/h2&gt;

&lt;p&gt;Đa thức bậc $n$: $p(x)=a_nx^n+\dots+a_1x+a_0$ với $a_n\ne0$, xác định trên $\mathbb{R}$, có tối đa $n$ nghiệm thực. Khi $\lvert x\rvert$ lớn, $p(x)$ hành xử như số hạng bậc cao nhất $a_nx^n$.&lt;/p&gt;

&lt;p&gt;Hàm hữu tỉ $\dfrac{p(x)}{q(x)}$ xác định tại các $x$ có $q(x)\ne0$. Ví dụ $\dfrac{x^2-1}{x-1}$ bằng $x+1$ khi $x\ne1$ nhưng không xác định tại $x=1$. Chương 1 sẽ nói giới hạn của nó tại 1 bằng 2.&lt;/p&gt;

&lt;h2 id=&quot;hàm-mũ-và-logarit&quot;&gt;Hàm mũ và logarit&lt;/h2&gt;

&lt;p&gt;Với $a&amp;gt;0$, $a\ne1$: hàm $a^x$ xác định trên $\mathbb{R}$, luôn dương, tăng nếu $a&amp;gt;1$ và giảm nếu $0&amp;lt;a&amp;lt;1$. Cơ số quan trọng nhất là $e\approx2{,}71828$ (chương 1 định nghĩa $e$ bằng giới hạn $(1+1/n)^n$).&lt;/p&gt;

&lt;div class=&quot;textbook-definition&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Định nghĩa 2 (Logarit).&lt;/strong&gt; Với $a&amp;gt;0$, $a\ne1$, hàm $\log_a:(0,\infty)\to\mathbb{R}$ là hàm ngược của $x\mapsto a^x$:&lt;/p&gt;

\[\log_a y=x\iff a^x=y .\]

  &lt;p&gt;Ký hiệu $\ln x=\log_e x$ (logarit tự nhiên).&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-theorem&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Định lý 1 (Tính chất logarit).&lt;/strong&gt; Với $u,v&amp;gt;0$ và $r\in\mathbb{R}$:&lt;/p&gt;

\[\ln(uv)=\ln u+\ln v,\qquad \ln\frac uv=\ln u-\ln v,\qquad \ln u^r=r\ln u,\qquad \log_a u=\frac{\ln u}{\ln a}.\]

&lt;/div&gt;

&lt;div class=&quot;textbook-proof&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Chứng minh.&lt;/strong&gt; Đặt $p=\ln u$, $q=\ln v$, tức $u=e^p$, $v=e^q$. Khi đó $uv=e^pe^q=e^{p+q}$, nên $\ln(uv)=p+q$. Công thức thương làm tương tự với $e^p/e^q=e^{p-q}$. Với lũy thừa: $u^r=(e^p)^r=e^{rp}$, nên $\ln u^r=rp$. Cuối cùng, nếu $\log_a u=x$ thì $a^x=u$; lấy $\ln$ hai vế: $x\ln a=\ln u$, nên $x=\ln u/\ln a$.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Ví dụ 1.&lt;/strong&gt; Giải $2^{x+1}=5\cdot3^x$.&lt;/p&gt;

  &lt;p&gt;Lấy $\ln$ hai vế: $(x+1)\ln2=\ln5+x\ln3$. Chuyển vế: $x(\ln2-\ln3)=\ln5-\ln2$. Vậy&lt;/p&gt;

\[x=\frac{\ln(5/2)}{\ln(2/3)}\approx\frac{0{,}9163}{-0{,}4055}\approx-2{,}260 .\]

  &lt;p&gt;Kiểm tra: $2^{-1{,}260}\approx0{,}418$ và $5\cdot3^{-2{,}260}\approx5\cdot0{,}0835\approx0{,}418$.&lt;/p&gt;
&lt;/div&gt;

&lt;h2 id=&quot;hàm-lượng-giác-và-lượng-giác-ngược&quot;&gt;Hàm lượng giác và lượng giác ngược&lt;/h2&gt;

&lt;p&gt;Trên đường tròn đơn vị, điểm ứng với góc $t$ (radian) là $(\cos t,\sin t)$. Từ đó $\sin^2t+\cos^2t=1$, cả hai hàm có chu kỳ $2\pi$, còn $\tan t=\sin t/\cos t$ có chu kỳ $\pi$ và không xác định tại $t=\tfrac\pi2+k\pi$.&lt;/p&gt;

&lt;p&gt;Trong giải tích, góc luôn đo bằng radian. Chỉ với radian mới có $(\sin x)&apos;=\cos x$ (chương 2).&lt;/p&gt;

&lt;p&gt;Hàm $\sin$ không đơn ánh trên $\mathbb{R}$, nên phải giới hạn miền trước khi lấy hàm ngược.&lt;/p&gt;

&lt;div class=&quot;textbook-definition&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Định nghĩa 3 (Lượng giác ngược).&lt;/strong&gt;&lt;/p&gt;

  &lt;ul&gt;
    &lt;li&gt;$\arcsin:[-1,1]\to[-\tfrac\pi2,\tfrac\pi2]$ là hàm ngược của $\sin$ trên $[-\tfrac\pi2,\tfrac\pi2]$.&lt;/li&gt;
    &lt;li&gt;$\arccos:[-1,1]\to[0,\pi]$ là hàm ngược của $\cos$ trên $[0,\pi]$.&lt;/li&gt;
    &lt;li&gt;$\arctan:\mathbb{R}\to(-\tfrac\pi2,\tfrac\pi2)$ là hàm ngược của $\tan$ trên $(-\tfrac\pi2,\tfrac\pi2)$.&lt;/li&gt;
  &lt;/ul&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Ví dụ 2.&lt;/strong&gt;&lt;/p&gt;

  &lt;ul&gt;
    &lt;li&gt;$\arcsin\left(\sin\tfrac{5\pi}6\right)=\arcsin\tfrac12=\tfrac\pi6$, không phải $\tfrac{5\pi}6$, vì $\tfrac{5\pi}6$ nằm ngoài $[-\tfrac\pi2,\tfrac\pi2]$.&lt;/li&gt;
    &lt;li&gt;Rút gọn $\cos(\arcsin x)$ với $x\in[-1,1]$. Đặt $\theta=\arcsin x\in[-\tfrac\pi2,\tfrac\pi2]$, nên $\cos\theta\ge0$ và $\cos\theta=\sqrt{1-\sin^2\theta}=\sqrt{1-x^2}$.&lt;/li&gt;
    &lt;li&gt;$\arctan1=\tfrac\pi4$, $\arctan(-\sqrt3)=-\tfrac\pi3$.&lt;/li&gt;
  &lt;/ul&gt;
&lt;/div&gt;

&lt;h2 id=&quot;hàm-hyperbolic&quot;&gt;Hàm hyperbolic&lt;/h2&gt;

&lt;div class=&quot;textbook-definition&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Định nghĩa 4 (Hàm hyperbolic).&lt;/strong&gt;&lt;/p&gt;

\[\sinh x=\frac{e^x-e^{-x}}2,\qquad \cosh x=\frac{e^x+e^{-x}}2,\qquad \tanh x=\frac{\sinh x}{\cosh x}.\]

&lt;/div&gt;

&lt;div class=&quot;textbook-theorem&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Định lý 2.&lt;/strong&gt; $\cosh^2x-\sinh^2x=1$ với mọi $x$.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-proof&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Chứng minh.&lt;/strong&gt; $\cosh^2x-\sinh^2x=(\cosh x-\sinh x)(\cosh x+\sinh x)=e^{-x}\cdot e^{x}=1$.&lt;/p&gt;
&lt;/div&gt;

&lt;p&gt;Điểm $(\cosh t,\sinh t)$ chạy trên nhánh hyperbol $x^2-y^2=1$, giống như $(\cos t,\sin t)$ chạy trên đường tròn. Dây cáp điện treo giữa hai cột có dạng $y=a\cosh(x/a)$ (đường dây xích).&lt;/p&gt;

&lt;h2 id=&quot;video-ngắn&quot;&gt;Video ngắn&lt;/h2&gt;

&lt;div class=&quot;reel-video&quot;&gt;
  &lt;video controls=&quot;&quot; playsinline=&quot;&quot; preload=&quot;metadata&quot; src=&quot;/public/videos/reels/unit-circle-trig.mp4&quot;&gt;&lt;/video&gt;
  &lt;p class=&quot;reel-caption&quot;&gt;Một điểm chạy đều trên đường tròn đơn vị vẽ ra đồ thị sin và cos (video không lời, khoảng 2 phút).&lt;/p&gt;
&lt;/div&gt;

&lt;h2 id=&quot;ứng-dụng&quot;&gt;Ứng dụng&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Dược học: chu kỳ bán rã.&lt;/strong&gt; Với $C(t)=C_0\,2^{-t/6}$, điều kiện $C(t)=0{,}1\,C_0$ cho $-\tfrac t6\ln2=\ln0{,}1$, nên $t=\dfrac{6\ln10}{\ln2}\approx\dfrac{6\cdot2{,}3026}{0{,}6931}\approx19{,}9$ giờ.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Học máy: sigmoid, tanh và ReLU.&lt;/strong&gt; Ba hàm kích hoạt phổ biến đều là hàm sơ cấp:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;sigmoid $\sigma(x)=\dfrac1{1+e^{-x}}$, giá trị trong $(0,1)$, dùng làm xác suất;&lt;/li&gt;
  &lt;li&gt;$\tanh x$, giá trị trong $(-1,1)$. Hai hàm này liên hệ bởi $\sigma(x)=\tfrac12\left(1+\tanh\tfrac x2\right)$;&lt;/li&gt;
  &lt;li&gt;ReLU $(x)=\max(0,x)=\tfrac12(x+\lvert x\rvert)$.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Kiểm tra công thức liên hệ: $\tanh\tfrac x2=\dfrac{e^{x/2}-e^{-x/2}}{e^{x/2}+e^{-x/2}}=\dfrac{1-e^{-x}}{1+e^{-x}}$, nên $\tfrac12\left(1+\tanh\tfrac x2\right)=\tfrac12\cdot\dfrac{2}{1+e^{-x}}=\sigma(x)$.&lt;/p&gt;

&lt;p&gt;Hàm ngược của sigmoid là logit: $\sigma^{-1}(p)=\ln\dfrac{p}{1-p}$, $0&amp;lt;p&amp;lt;1$. Với $p=0{,}9$: $\ln9\approx2{,}197$.&lt;/p&gt;

&lt;h2 id=&quot;bài-tập&quot;&gt;Bài tập&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Mức cơ bản.&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;Tính $\log_2 48-\log_2 3$ và $e^{2\ln3}$.&lt;/li&gt;
  &lt;li&gt;Tính $\arccos(-\tfrac12)$ và $\arctan\tfrac1{\sqrt3}$.&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Đáp án&lt;/summary&gt;

  &lt;ol&gt;
    &lt;li&gt;$\log_2 16=4$; $e^{\ln 9}=9$.&lt;/li&gt;
    &lt;li&gt;$\tfrac{2\pi}3$; $\tfrac\pi6$.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;p&gt;&lt;strong&gt;Mức vận dụng.&lt;/strong&gt;&lt;/p&gt;

&lt;ol start=&quot;3&quot;&gt;
  &lt;li&gt;Giải $e^{2x}-3e^x+2=0$.&lt;/li&gt;
  &lt;li&gt;Rút gọn $\tan(\arccos x)$ với $0&amp;lt;x\le1$.&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Đáp án&lt;/summary&gt;

  &lt;ol start=&quot;3&quot;&gt;
    &lt;li&gt;Đặt $u=e^x&amp;gt;0$: $u^2-3u+2=0$, $u=1$ hoặc $u=2$. Vậy $x=0$ hoặc $x=\ln2$.&lt;/li&gt;
    &lt;li&gt;Với $\theta=\arccos x\in[0,\tfrac\pi2)$: $\sin\theta=\sqrt{1-x^2}$, nên $\tan\theta=\dfrac{\sqrt{1-x^2}}{x}$.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;p&gt;&lt;strong&gt;Mức nâng cao.&lt;/strong&gt;&lt;/p&gt;

&lt;ol start=&quot;5&quot;&gt;
  &lt;li&gt;Chứng minh $\sinh$ là đơn ánh và tìm hàm ngược: $\operatorname{arsinh}x=\ln\left(x+\sqrt{x^2+1}\right)$.&lt;/li&gt;
  &lt;li&gt;Chứng minh $\arctan x+\arctan\tfrac1x=\tfrac\pi2$ với $x&amp;gt;0$.&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Gợi ý&lt;/summary&gt;

  &lt;ol start=&quot;5&quot;&gt;
    &lt;li&gt;$\sinh$ là tổng của hai hàm tăng ngặt $\tfrac12e^x$ và $-\tfrac12e^{-x}$. Giải $y=\tfrac{e^x-e^{-x}}2$: đặt $u=e^x$, được $u^2-2yu-1=0$, lấy nghiệm dương $u=y+\sqrt{y^2+1}$.&lt;/li&gt;
    &lt;li&gt;Đặt $\theta=\arctan x\in(0,\tfrac\pi2)$. Khi đó $\tan(\tfrac\pi2-\theta)=\cot\theta=\tfrac1x$, và $\tfrac\pi2-\theta\in(0,\tfrac\pi2)$, nên $\arctan\tfrac1x=\tfrac\pi2-\theta$.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;h2 id=&quot;tóm-tắt&quot;&gt;Tóm tắt&lt;/h2&gt;

&lt;div class=&quot;content-box summary-box textbook-block&quot;&gt;
  &lt;ul&gt;
    &lt;li&gt;Hàm sơ cấp: ghép từ đa thức, mũ, logarit, lượng giác, lượng giác ngược bằng các phép toán và phép hợp.&lt;/li&gt;
    &lt;li&gt;$\ln$ là hàm ngược của $e^x$: $\ln(uv)=\ln u+\ln v$, $\ln u^r=r\ln u$, $\log_a u=\ln u/\ln a$.&lt;/li&gt;
    &lt;li&gt;Lượng giác ngược chỉ là hàm ngược trên một miền giới hạn: $\arcsin$ cho giá trị trong $[-\tfrac\pi2,\tfrac\pi2]$, $\arccos$ trong $[0,\pi]$.&lt;/li&gt;
    &lt;li&gt;$\cosh^2x-\sinh^2x=1$; sigmoid, tanh, ReLU đều là hàm sơ cấp.&lt;/li&gt;
  &lt;/ul&gt;
&lt;/div&gt;
</content>
 </entry>
 
 <entry>
   <title>Hàm số và đồ thị</title>
   <link href="https://calculus-self-learning.pages.dev/contents/vi/chapter00/00_02_Ham_so_va_do_thi/"/>
   <updated>2026-12-01T00:00:00+00:00</updated>
   <id>https://calculus-self-learning.pages.dev/contents/vi/chapter00/00_02_Ham_so_va_do_thi</id>
   <content type="html">&lt;div class=&quot;textbook-objectives&quot;&gt;

  &lt;p&gt;&lt;strong&gt;Mục tiêu học tập.&lt;/strong&gt; Sau bài này, người học có thể:&lt;/p&gt;

  &lt;ul&gt;
    &lt;li&gt;tìm miền xác định và miền giá trị của hàm cho bởi công thức;&lt;/li&gt;
    &lt;li&gt;lập hàm hợp $f\circ g$ và thấy rằng nói chung $f\circ g\ne g\circ f$;&lt;/li&gt;
    &lt;li&gt;kiểm tra hàm có hàm ngược không và tìm công thức hàm ngược;&lt;/li&gt;
    &lt;li&gt;vẽ nhanh đồ thị $y=a\,f(bx+c)+d$ từ đồ thị $y=f(x)$.&lt;/li&gt;
  &lt;/ul&gt;

&lt;/div&gt;

&lt;h2 id=&quot;vì-sao-cần-bài-này&quot;&gt;Vì sao cần bài này&lt;/h2&gt;

&lt;p&gt;Nhiệt độ ngoài trời ở TP.HCM trong một ngày nắng dao động từ khoảng 22°C lúc 4 giờ sáng đến 34°C lúc 4 giờ chiều. Đồ thị trông như một đường sin bị dịch lên, kéo giãn và dời sang phải. Muốn viết được công thức, ta cần biết mỗi tham số trong $a\sin(bx+c)+d$ làm gì với đồ thị. Phần cuối bài giải đúng bài toán này.&lt;/p&gt;

&lt;h2 id=&quot;hàm-số-miền-xác-định-miền-giá-trị&quot;&gt;Hàm số, miền xác định, miền giá trị&lt;/h2&gt;

&lt;div class=&quot;textbook-definition&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Định nghĩa 1 (Hàm số).&lt;/strong&gt; Một &lt;em&gt;hàm số&lt;/em&gt; $f$ từ tập $D\subset\mathbb{R}$ vào $\mathbb{R}$ là một quy tắc gán cho mỗi $x\in D$ đúng một số $f(x)$. Tập $D$ là &lt;em&gt;miền xác định&lt;/em&gt;. Tập $f(D)=\lbrace f(x)\mid x\in D\rbrace $ là &lt;em&gt;miền giá trị&lt;/em&gt;. &lt;em&gt;Đồ thị&lt;/em&gt; của $f$ là tập điểm $\lbrace (x,f(x))\mid x\in D\rbrace $ trong mặt phẳng.&lt;/p&gt;
&lt;/div&gt;

&lt;p&gt;Khi hàm chỉ cho bằng công thức, miền xác định là tập các $x$ làm công thức có nghĩa: mẫu khác 0, biểu thức dưới căn bậc chẵn không âm, đối số của logarit dương.&lt;/p&gt;

&lt;p&gt;Kiểm tra bằng đường thẳng đứng: một đường cong là đồ thị của một hàm số khi mỗi đường thẳng đứng cắt nó tối đa một lần. Đường tròn $x^2+y^2=1$ không phải đồ thị của hàm $y=f(x)$, vì đường $x=0$ cắt nó tại hai điểm.&lt;/p&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Ví dụ 1.&lt;/strong&gt; Tìm miền xác định của $f(x)=\dfrac{\sqrt{4-x^2}}{x-1}$.&lt;/p&gt;

  &lt;ul&gt;
    &lt;li&gt;Căn: $4-x^2\ge0\iff -2\le x\le 2$.&lt;/li&gt;
    &lt;li&gt;Mẫu: $x\ne1$.&lt;/li&gt;
  &lt;/ul&gt;

  &lt;p&gt;Miền xác định $D=[-2,1)\cup(1,2]$.&lt;/p&gt;

  &lt;p&gt;Miền giá trị của $g(x)=\sqrt{4-x^2}$ trên $[-2,2]$ là $[0,2]$: giá trị lớn nhất 2 tại $x=0$, nhỏ nhất 0 tại $x=\pm2$, và đồ thị là nửa trên đường tròn bán kính 2.&lt;/p&gt;
&lt;/div&gt;

&lt;h2 id=&quot;hàm-hợp&quot;&gt;Hàm hợp&lt;/h2&gt;

&lt;div class=&quot;textbook-definition&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Định nghĩa 2 (Hàm hợp).&lt;/strong&gt; Cho $g:D\to\mathbb{R}$ và $f$ xác định trên một tập chứa $g(D)$. &lt;em&gt;Hàm hợp&lt;/em&gt; $f\circ g$ là hàm $(f\circ g)(x)=f(g(x))$, $x\in D$.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Ví dụ 2.&lt;/strong&gt; Với $f(x)=x^2$, $g(x)=x+3$:&lt;/p&gt;

\[(f\circ g)(x)=(x+3)^2,\qquad (g\circ f)(x)=x^2+3 .\]

  &lt;p&gt;Tại $x=1$: $(f\circ g)(1)=16$, $(g\circ f)(1)=4$. Thứ tự hợp quan trọng.&lt;/p&gt;

  &lt;p&gt;Ngược lại, $h(x)=\sqrt{1+\sin x}$ là hợp của ba hàm: $x\mapsto\sin x$, rồi $u\mapsto1+u$, rồi $v\mapsto\sqrt v$. Tách một hàm thành chuỗi các hàm đơn giản như vậy là bước đầu của quy tắc đạo hàm hàm hợp ở chương 2.&lt;/p&gt;
&lt;/div&gt;

&lt;h2 id=&quot;hàm-ngược&quot;&gt;Hàm ngược&lt;/h2&gt;

&lt;div class=&quot;textbook-definition&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Định nghĩa 3 (Đơn ánh, hàm ngược).&lt;/strong&gt; Hàm $f:D\to\mathbb{R}$ là &lt;em&gt;đơn ánh&lt;/em&gt; nếu $x_1\ne x_2$ kéo theo $f(x_1)\ne f(x_2)$. Khi đó, với mỗi $y$ thuộc miền giá trị $f(D)$ có đúng một $x\in D$ với $f(x)=y$; đặt $f^{-1}(y)=x$. Hàm $f^{-1}:f(D)\to D$ là &lt;em&gt;hàm ngược&lt;/em&gt; của $f$, và&lt;/p&gt;

\[f^{-1}(f(x))=x\ \ (x\in D),\qquad f(f^{-1}(y))=y\ \ (y\in f(D)).\]

&lt;/div&gt;

&lt;div class=&quot;textbook-lemma&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Bổ đề 1.&lt;/strong&gt; Hàm tăng ngặt (hoặc giảm ngặt) trên $D$ là đơn ánh, nên có hàm ngược.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-proof&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Chứng minh.&lt;/strong&gt; Giả sử $f$ tăng ngặt và $x_1\ne x_2$, chẳng hạn $x_1&amp;lt;x_2$. Khi đó $f(x_1)&amp;lt;f(x_2)$, nên $f(x_1)\ne f(x_2)$. Trường hợp giảm ngặt tương tự.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-theorem&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Định lý 1 (Đồ thị hàm ngược).&lt;/strong&gt; Đồ thị của $f^{-1}$ là ảnh đối xứng của đồ thị $f$ qua đường thẳng $y=x$.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-proof&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Chứng minh.&lt;/strong&gt; Điểm $(a,b)$ nằm trên đồ thị $f$ khi và chỉ khi $b=f(a)$, khi và chỉ khi $a=f^{-1}(b)$, tức điểm $(b,a)$ nằm trên đồ thị $f^{-1}$. Phép đổi chỗ $(a,b)\mapsto(b,a)$ chính là phép đối xứng qua đường $y=x$.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Ví dụ 3.&lt;/strong&gt; Tìm hàm ngược của $f(x)=\dfrac{2x+1}{x-3}$, $x\ne3$.&lt;/p&gt;

  &lt;p&gt;Đặt $y=\dfrac{2x+1}{x-3}$ và giải theo $x$: $y(x-3)=2x+1\iff x(y-2)=3y+1$. Với $y\ne2$: $x=\dfrac{3y+1}{y-2}$. Giá trị $y=2$ không đạt được (sẽ cho $0=7$), nên miền giá trị của $f$ là $\mathbb{R}\setminus\lbrace 2\rbrace $ và&lt;/p&gt;

\[f^{-1}(x)=\frac{3x+1}{x-2},\qquad x\ne2 .\]

  &lt;p&gt;Kiểm tra: $f(4)=9$, và $f^{-1}(9)=\dfrac{28}{7}=4$.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;content-box warning-box textbook-block&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Lưu ý.&lt;/strong&gt; $f^{-1}(x)$ là giá trị của hàm ngược, không phải $\dfrac{1}{f(x)}$. Với $f(x)=x^3$, $f^{-1}(8)=2$ còn $\dfrac1{f(8)}=\dfrac1{512}$.&lt;/p&gt;
&lt;/div&gt;

&lt;h2 id=&quot;biến-đổi-đồ-thị&quot;&gt;Biến đổi đồ thị&lt;/h2&gt;

&lt;p&gt;Từ đồ thị $y=f(x)$, đồ thị $y=a\,f(bx+c)+d$ có được bằng các bước đơn giản. Viết $bx+c=b\left(x+\tfrac cb\right)$ với $b&amp;gt;0$:&lt;/p&gt;

&lt;table&gt;
  &lt;thead&gt;
    &lt;tr&gt;
      &lt;th&gt;Thay đổi&lt;/th&gt;
      &lt;th&gt;Tác dụng lên đồ thị&lt;/th&gt;
    &lt;/tr&gt;
  &lt;/thead&gt;
  &lt;tbody&gt;
    &lt;tr&gt;
      &lt;td&gt;$f(x)+d$&lt;/td&gt;
      &lt;td&gt;dịch lên $d$ đơn vị (xuống nếu $d&amp;lt;0$)&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;$f(x-h)$&lt;/td&gt;
      &lt;td&gt;dịch sang phải $h$ đơn vị (sang trái nếu $h&amp;lt;0$)&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;$a\,f(x)$, $a&amp;gt;0$&lt;/td&gt;
      &lt;td&gt;giãn theo chiều dọc hệ số $a$&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;$-f(x)$&lt;/td&gt;
      &lt;td&gt;lật qua trục hoành&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;$f(bx)$, $b&amp;gt;0$&lt;/td&gt;
      &lt;td&gt;co theo chiều ngang hệ số $b$ (chu kỳ chia cho $b$)&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;$f(-x)$&lt;/td&gt;
      &lt;td&gt;lật qua trục tung&lt;/td&gt;
    &lt;/tr&gt;
  &lt;/tbody&gt;
&lt;/table&gt;

&lt;p&gt;Lý do của dòng “$f(x-h)$ dịch phải”: giá trị mà $f$ có tại $x_0$ thì hàm mới có tại $x_0+h$, vì $(x_0+h)-h=x_0$.&lt;/p&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Ví dụ 4.&lt;/strong&gt; Mô tả đồ thị $y=2\sin(3x-\pi)+1$.&lt;/p&gt;

  &lt;p&gt;Viết $3x-\pi=3\left(x-\tfrac\pi3\right)$. Từ $y=\sin x$:&lt;/p&gt;

  &lt;ol&gt;
    &lt;li&gt;co ngang hệ số 3: chu kỳ $2\pi/3$;&lt;/li&gt;
    &lt;li&gt;dịch phải $\pi/3$;&lt;/li&gt;
    &lt;li&gt;giãn dọc hệ số 2: biên độ 2;&lt;/li&gt;
    &lt;li&gt;dịch lên 1.&lt;/li&gt;
  &lt;/ol&gt;

  &lt;p&gt;Miền giá trị $[-1,3]$. Giá trị lớn nhất 3 khi $3x-\pi=\tfrac\pi2+2k\pi$, tức $x=\tfrac\pi2+\tfrac{2k\pi}3$. Kiểm tra tại $x=\tfrac\pi2$: $2\sin\left(\tfrac{\pi}{2}\right)+1=3$.&lt;/p&gt;
&lt;/div&gt;

&lt;h2 id=&quot;minh-hoạ&quot;&gt;Minh hoạ&lt;/h2&gt;

&lt;div class=&quot;interactive-frame&quot;&gt;
  &lt;div class=&quot;interactive-frame-head&quot;&gt;
    &lt;div class=&quot;interactive-frame-title&quot;&gt;Biến đổi đồ thị&lt;/div&gt;
    &lt;div class=&quot;interactive-frame-desc&quot;&gt;Kéo a, b, c, d trong y = a·f(bx + c) + d và so với đồ thị gốc.&lt;/div&gt;
  &lt;/div&gt;
  &lt;iframe src=&quot;/interactives/chapter00/graph-transform.html&quot; title=&quot;Biến đổi đồ thị&quot; loading=&quot;lazy&quot; style=&quot;height: 700px;&quot;&gt;&lt;/iframe&gt;
  &lt;div class=&quot;interactive-frame-foot&quot;&gt;
    &lt;a href=&quot;/interactives/chapter00/graph-transform.html&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;Mở minh hoạ ở cửa sổ riêng&lt;/a&gt;
  &lt;/div&gt;
&lt;/div&gt;

&lt;h2 id=&quot;video-ngắn&quot;&gt;Video ngắn&lt;/h2&gt;

&lt;div class=&quot;reel-video&quot;&gt;
  &lt;video controls=&quot;&quot; playsinline=&quot;&quot; preload=&quot;metadata&quot; src=&quot;/public/videos/reels/graph-transform.mp4&quot;&gt;&lt;/video&gt;
  &lt;p class=&quot;reel-caption&quot;&gt;Biến đổi đồ thị y = a·f(b(x − c)) + d: các núm a, b, c, d dịch, co giãn đồ thị sin, rồi hợp hàm qua hai máy nối tiếp (video không lời, khoảng 2 phút 20 giây).&lt;/p&gt;
&lt;/div&gt;

&lt;h2 id=&quot;ứng-dụng&quot;&gt;Ứng dụng&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Nhiệt độ trong ngày.&lt;/strong&gt; Mô hình $T(t)=A\sin(\omega t+\varphi)+B$ với $t$ tính bằng giờ, thấp nhất 22°C lúc 4 giờ, cao nhất 34°C lúc 16 giờ.&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;$B=\tfrac{34+22}{2}=28$, $A=\tfrac{34-22}2=6$.&lt;/li&gt;
  &lt;li&gt;Chu kỳ 24 giờ: $\omega=\tfrac{2\pi}{24}=\tfrac{\pi}{12}$.&lt;/li&gt;
  &lt;li&gt;Cực đại lúc $t=16$: $\tfrac{\pi}{12}\cdot16+\varphi=\tfrac\pi2$, nên $\varphi=\tfrac\pi2-\tfrac{4\pi}3=-\tfrac{5\pi}6$.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Kiểm tra cực tiểu: $\tfrac{\pi}{12}\cdot 4-\tfrac{5\pi}6=-\tfrac\pi2$, $\sin(-\tfrac\pi2)=-1$, $T(4)=22$. Đúng.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Kinh tế: hàm cầu và hàm cầu ngược.&lt;/strong&gt; Lượng cầu theo giá $Q(p)=1000-20p$ (nghìn đồng). Nhà bán hàng thường cần điều ngược lại: muốn bán $Q$ sản phẩm thì đặt giá bao nhiêu. Đó là hàm ngược $p(Q)=50-\tfrac{Q}{20}$. Muốn bán 600 sản phẩm thì đặt giá $p=20$.&lt;/p&gt;

&lt;h2 id=&quot;bài-tập&quot;&gt;Bài tập&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Mức cơ bản.&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;Tìm miền xác định của $f(x)=\ln(x^2-9)$.&lt;/li&gt;
  &lt;li&gt;Với $f(x)=\sqrt x$, $g(x)=x^2-1$, tính $(f\circ g)(3)$ và $(g\circ f)(3)$.&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Đáp án&lt;/summary&gt;

  &lt;ol&gt;
    &lt;li&gt;$x^2-9&amp;gt;0\iff x&amp;lt;-3$ hoặc $x&amp;gt;3$.&lt;/li&gt;
    &lt;li&gt;$(f\circ g)(3)=\sqrt8=2\sqrt2$; $(g\circ f)(3)=3-1=2$.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;p&gt;&lt;strong&gt;Mức vận dụng.&lt;/strong&gt;&lt;/p&gt;

&lt;ol start=&quot;3&quot;&gt;
  &lt;li&gt;Tìm hàm ngược của $f(x)=e^{2x}+1$ và miền xác định của nó.&lt;/li&gt;
  &lt;li&gt;Đồ thị $y=-\lvert x+2\rvert+3$ có được từ $y=\lvert x\rvert$ bằng những phép biến đổi nào? Đỉnh ở đâu?&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Đáp án&lt;/summary&gt;

  &lt;ol start=&quot;3&quot;&gt;
    &lt;li&gt;$y-1=e^{2x}$, $x=\tfrac12\ln(y-1)$. Vậy $f^{-1}(x)=\tfrac12\ln(x-1)$ với $x&amp;gt;1$.&lt;/li&gt;
    &lt;li&gt;Dịch trái 2, lật qua trục hoành, dịch lên 3. Đỉnh $(-2,3)$, là điểm cao nhất.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;p&gt;&lt;strong&gt;Mức nâng cao.&lt;/strong&gt;&lt;/p&gt;

&lt;ol start=&quot;5&quot;&gt;
  &lt;li&gt;Chứng minh: nếu $f$ và $g$ đều tăng ngặt thì $f\circ g$ tăng ngặt. Nếu $f$ tăng ngặt, $g$ giảm ngặt thì sao?&lt;/li&gt;
  &lt;li&gt;Chứng minh mọi hàm $f$ xác định trên $\mathbb{R}$ viết được thành tổng một hàm chẵn và một hàm lẻ.&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Gợi ý&lt;/summary&gt;

  &lt;ol start=&quot;5&quot;&gt;
    &lt;li&gt;$x_1&amp;lt;x_2\Rightarrow g(x_1)&amp;lt;g(x_2)\Rightarrow f(g(x_1))&amp;lt;f(g(x_2))$. Nếu $g$ giảm ngặt thì $f\circ g$ giảm ngặt.&lt;/li&gt;
    &lt;li&gt;$f(x)=\dfrac{f(x)+f(-x)}2+\dfrac{f(x)-f(-x)}2$. Số hạng đầu là hàm chẵn, số hạng sau là hàm lẻ.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;h2 id=&quot;tóm-tắt&quot;&gt;Tóm tắt&lt;/h2&gt;

&lt;div class=&quot;content-box summary-box textbook-block&quot;&gt;
  &lt;ul&gt;
    &lt;li&gt;Miền xác định: các $x$ làm công thức có nghĩa. Miền giá trị: tập các giá trị $f(x)$.&lt;/li&gt;
    &lt;li&gt;$(f\circ g)(x)=f(g(x))$; nói chung $f\circ g\ne g\circ f$.&lt;/li&gt;
    &lt;li&gt;Hàm đơn ánh (ví dụ hàm đơn điệu ngặt) có hàm ngược; đồ thị $f^{-1}$ đối xứng với đồ thị $f$ qua $y=x$.&lt;/li&gt;
    &lt;li&gt;$y=a\,f(b(x-h))+d$: co ngang $b$, dịch phải $h$, giãn dọc $a$, dịch lên $d$.&lt;/li&gt;
  &lt;/ul&gt;
&lt;/div&gt;
</content>
 </entry>
 
 <entry>
   <title>Số thực, bất đẳng thức, giá trị tuyệt đối</title>
   <link href="https://calculus-self-learning.pages.dev/contents/vi/chapter00/00_01_So_thuc_bat_dang_thuc_gia_tri_tuyet_doi/"/>
   <updated>2026-12-01T00:00:00+00:00</updated>
   <id>https://calculus-self-learning.pages.dev/contents/vi/chapter00/00_01_So_thuc_bat_dang_thuc_gia_tri_tuyet_doi</id>
   <content type="html">&lt;div class=&quot;textbook-objectives&quot;&gt;

  &lt;p&gt;&lt;strong&gt;Mục tiêu học tập.&lt;/strong&gt; Sau bài này, người học có thể:&lt;/p&gt;

  &lt;ul&gt;
    &lt;li&gt;đọc $\lvert x-a\rvert&amp;lt;r$ là “khoảng cách từ $x$ đến $a$ nhỏ hơn $r$” và đổi qua lại với dạng khoảng $(a-r,\,a+r)$;&lt;/li&gt;
    &lt;li&gt;giải bất phương trình và phương trình có trị tuyệt đối bằng cách chia trường hợp;&lt;/li&gt;
    &lt;li&gt;phát biểu và chứng minh bất đẳng thức tam giác;&lt;/li&gt;
    &lt;li&gt;tìm cận trên đúng (sup), cận dưới đúng (inf) của một tập số và kiểm tra bằng tiêu chuẩn ε.&lt;/li&gt;
  &lt;/ul&gt;

&lt;/div&gt;

&lt;h2 id=&quot;vì-sao-cần-bài-này&quot;&gt;Vì sao cần bài này&lt;/h2&gt;

&lt;p&gt;Một nhà máy tiện trục có đường kính danh nghĩa 20 mm. Trục đạt chuẩn nếu đường kính $d$ lệch không quá 0,05 mm. Viết gọn: $\lvert d-20\rvert\le 0{,}05$, tức $19{,}95\le d\le 20{,}05$.&lt;/p&gt;

&lt;p&gt;Cả khoá học dùng đúng kiểu câu này. Định nghĩa giới hạn ở chương 1 là “$\lvert f(x)-L\rvert&amp;lt;\varepsilon$ mỗi khi $\lvert x-a\rvert&amp;lt;\delta$”. Nếu đọc nhanh được trị tuyệt đối như khoảng cách thì chương 1 dễ hơn nhiều.&lt;/p&gt;

&lt;h2 id=&quot;số-thực-và-giá-trị-tuyệt-đối&quot;&gt;Số thực và giá trị tuyệt đối&lt;/h2&gt;

&lt;p&gt;Tập số thực $\mathbb{R}$ gồm các số hữu tỉ ($\tfrac{1}{2}$, $-3$, $0{,}75$) và vô tỉ ($\sqrt{2}$, $\pi$, $e$). Trên $\mathbb{R}$ có phép cộng, nhân và thứ tự $&amp;lt;$ như ở phổ thông. Hai quy tắc hay dùng:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;nếu $a&amp;lt;b$ thì $a+c&amp;lt;b+c$ với mọi $c$;&lt;/li&gt;
  &lt;li&gt;nếu $a&amp;lt;b$ và $c&amp;gt;0$ thì $ac&amp;lt;bc$; nếu $c&amp;lt;0$ thì $ac&amp;gt;bc$ (đổi chiều).&lt;/li&gt;
&lt;/ul&gt;

&lt;div class=&quot;textbook-definition&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Định nghĩa 1 (Giá trị tuyệt đối).&lt;/strong&gt; Với $x\in\mathbb{R}$,&lt;/p&gt;

\[\lvert x\rvert=\begin{cases}x, &amp;amp; x\ge 0,\\ -x, &amp;amp; x&amp;lt;0.\end{cases}\]

  &lt;p&gt;Số $\lvert x-a\rvert$ là &lt;em&gt;khoảng cách&lt;/em&gt; giữa $x$ và $a$ trên trục số.&lt;/p&gt;
&lt;/div&gt;

&lt;p&gt;Một số tính chất suy ra ngay từ định nghĩa: $\lvert x\rvert\ge0$; $\lvert x\rvert=0\iff x=0$; $\lvert xy\rvert=\lvert x\rvert\,\lvert y\rvert$; $\sqrt{x^2}=\lvert x\rvert$; $-\lvert x\rvert\le x\le\lvert x\rvert$.&lt;/p&gt;

&lt;div class=&quot;textbook-theorem&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Định lý 1 (Trị tuyệt đối và khoảng).&lt;/strong&gt; Cho $r&amp;gt;0$. Khi đó&lt;/p&gt;

\[\lvert x-a\rvert&amp;lt;r \iff a-r&amp;lt;x&amp;lt;a+r,\]

  &lt;p&gt;và $\lvert x-a\rvert&amp;gt;r \iff x&amp;lt;a-r$ hoặc $x&amp;gt;a+r$.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-proof&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Chứng minh.&lt;/strong&gt; Nếu $x\ge a$ thì $\lvert x-a\rvert=x-a$, nên $\lvert x-a\rvert&amp;lt;r\iff x&amp;lt;a+r$; kết hợp với $x\ge a&amp;gt;a-r$ ta được $a-r&amp;lt;x&amp;lt;a+r$. Nếu $x&amp;lt;a$ thì $\lvert x-a\rvert=a-x$, nên $\lvert x-a\rvert&amp;lt;r\iff x&amp;gt;a-r$; kết hợp với $x&amp;lt;a&amp;lt;a+r$ ta lại được $a-r&amp;lt;x&amp;lt;a+r$. Phần thứ hai chứng minh giống hệt: với $x\ge a$ điều kiện thành $x&amp;gt;a+r$, với $x&amp;lt;a$ điều kiện thành $x&amp;lt;a-r$.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-theorem&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Định lý 2 (Bất đẳng thức tam giác).&lt;/strong&gt; Với mọi $a,b\in\mathbb{R}$,&lt;/p&gt;

\[\lvert a+b\rvert\le\lvert a\rvert+\lvert b\rvert .\]

&lt;/div&gt;

&lt;div class=&quot;textbook-proof&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Chứng minh.&lt;/strong&gt; Ta có $-\lvert a\rvert\le a\le\lvert a\rvert$ và $-\lvert b\rvert\le b\le\lvert b\rvert$. Cộng hai bất đẳng thức:&lt;/p&gt;

\[-(\lvert a\rvert+\lvert b\rvert)\le a+b\le\lvert a\rvert+\lvert b\rvert .\]

  &lt;p&gt;Theo Định lý 1 (dạng $\le$), điều này nghĩa là $\lvert a+b\rvert\le\lvert a\rvert+\lvert b\rvert$.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;content-box insight-box textbook-block&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Nhận xét.&lt;/strong&gt; Dạng hay dùng trong giải tích là $\lvert x-z\rvert\le\lvert x-y\rvert+\lvert y-z\rvert$: đi từ $x$ đến $z$ qua $y$ không thể ngắn hơn đi thẳng. Đặt $a=x-y$, $b=y-z$ vào Định lý 2 là ra.&lt;/p&gt;
&lt;/div&gt;

&lt;h2 id=&quot;giải-bất-phương-trình-có-trị-tuyệt-đối&quot;&gt;Giải bất phương trình có trị tuyệt đối&lt;/h2&gt;

&lt;p&gt;Cách làm chung: tìm các điểm làm biểu thức trong trị tuyệt đối bằng 0, chia trục số thành các khoảng, bỏ dấu trị tuyệt đối trên từng khoảng.&lt;/p&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Ví dụ 1.&lt;/strong&gt; Giải $\lvert 2x-3\rvert\le5$.&lt;/p&gt;

  &lt;p&gt;Theo Định lý 1: $-5\le 2x-3\le 5$. Cộng 3: $-2\le 2x\le 8$. Chia 2: $-1\le x\le 4$. Tập nghiệm $[-1,4]$.&lt;/p&gt;

  &lt;p&gt;Kiểm tra: $x=4$ cho $\lvert 5\rvert=5$ (đạt dấu bằng), $x=5$ cho $\lvert 7\rvert=7&amp;gt;5$ (loại).&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Ví dụ 2.&lt;/strong&gt; Giải $\lvert x-1\rvert+\lvert x+2\rvert=5$.&lt;/p&gt;

  &lt;p&gt;Điểm chia: $x=1$ và $x=-2$.&lt;/p&gt;

  &lt;ul&gt;
    &lt;li&gt;$x\ge1$: phương trình thành $(x-1)+(x+2)=5$, tức $2x+1=5$, $x=2$. Thoả $x\ge1$.&lt;/li&gt;
    &lt;li&gt;$-2\le x&amp;lt;1$: thành $(1-x)+(x+2)=5$, tức $3=5$. Vô nghiệm.&lt;/li&gt;
    &lt;li&gt;$x&amp;lt;-2$: thành $(1-x)+(-x-2)=5$, tức $-2x-1=5$, $x=-3$. Thoả $x&amp;lt;-2$.&lt;/li&gt;
  &lt;/ul&gt;

  &lt;p&gt;Nghiệm: $x=-3$ hoặc $x=2$. Ý nghĩa hình học: tổng khoảng cách từ $x$ đến $1$ và đến $-2$ bằng 5, mà hai điểm này cách nhau 3, nên $x$ phải nằm ngoài đoạn $[-2,1]$ và cách mỗi đầu thêm 1.&lt;/p&gt;
&lt;/div&gt;

&lt;h2 id=&quot;cận-trên-đúng-và-cận-dưới-đúng&quot;&gt;Cận trên đúng và cận dưới đúng&lt;/h2&gt;

&lt;p&gt;Tập $A=\lbrace 1-\tfrac1n \mid n=1,2,3,\dots\rbrace =\lbrace 0,\ \tfrac12,\ \tfrac23,\ \tfrac34,\dots\rbrace $ không có phần tử lớn nhất: phần tử nào cũng còn phần tử lớn hơn. Nhưng mọi phần tử đều nhỏ hơn 1, và 1 là “chặn trên sát nhất”. Khái niệm sup mô tả đúng điều đó.&lt;/p&gt;

&lt;div class=&quot;textbook-definition&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Định nghĩa 2 (Cận trên, cận trên đúng).&lt;/strong&gt; Cho $A\subset\mathbb{R}$ khác rỗng.&lt;/p&gt;

  &lt;ul&gt;
    &lt;li&gt;Số $M$ là &lt;em&gt;cận trên&lt;/em&gt; của $A$ nếu $x\le M$ với mọi $x\in A$. Khi có cận trên, ta nói $A$ &lt;em&gt;bị chặn trên&lt;/em&gt;.&lt;/li&gt;
    &lt;li&gt;Số $s$ là &lt;em&gt;cận trên đúng&lt;/em&gt; của $A$, ký hiệu $s=\sup A$, nếu $s$ là một cận trên và mọi cận trên $M$ đều thoả $s\le M$.&lt;/li&gt;
  &lt;/ul&gt;

  &lt;p&gt;Cận dưới và cận dưới đúng $\inf A$ định nghĩa tương tự, đổi chiều bất đẳng thức.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-theorem&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Tiên đề về cận trên đúng (tính đầy đủ của $\mathbb{R}$).&lt;/strong&gt; Mọi tập con khác rỗng, bị chặn trên của $\mathbb{R}$ đều có cận trên đúng trong $\mathbb{R}$.&lt;/p&gt;
&lt;/div&gt;

&lt;p&gt;Tập số hữu tỉ $\mathbb{Q}$ không có tính chất này: tập $\lbrace q\in\mathbb{Q}\mid q^2&amp;lt;2\rbrace $ bị chặn trên nhưng “cận trên đúng” của nó là $\sqrt2\notin\mathbb{Q}$. Mọi định lý lớn của Giải tích 1 (giá trị trung gian, Weierstrass, hội tụ dãy đơn điệu) đều dựa vào tiên đề này.&lt;/p&gt;

&lt;div class=&quot;textbook-lemma&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Bổ đề 1 (Tiêu chuẩn ε cho sup).&lt;/strong&gt; Cho $s$ là một cận trên của $A$. Khi đó $s=\sup A$ khi và chỉ khi với mọi $\varepsilon&amp;gt;0$ tồn tại $x\in A$ sao cho $x&amp;gt;s-\varepsilon$.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-proof&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Chứng minh.&lt;/strong&gt; ($\Rightarrow$) Cho $\varepsilon&amp;gt;0$. Số $s-\varepsilon&amp;lt;s$ nên không phải cận trên (vì $s$ là cận trên nhỏ nhất). Vậy có $x\in A$ với $x&amp;gt;s-\varepsilon$.&lt;/p&gt;

  &lt;p&gt;($\Leftarrow$) Giả sử có cận trên $M&amp;lt;s$. Lấy $\varepsilon=s-M&amp;gt;0$, sẽ có $x\in A$ với $x&amp;gt;s-\varepsilon=M$, mâu thuẫn với việc $M$ là cận trên. Vậy mọi cận trên đều $\ge s$, tức $s=\sup A$.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Ví dụ 3.&lt;/strong&gt; Với $A=\lbrace 1-\tfrac1n\mid n\ge1\rbrace $, chứng minh $\sup A=1$ và $\inf A=0$.&lt;/p&gt;

  &lt;ul&gt;
    &lt;li&gt;$1$ là cận trên vì $1-\tfrac1n&amp;lt;1$.&lt;/li&gt;
    &lt;li&gt;Cho $\varepsilon&amp;gt;0$. Chọn số nguyên $n&amp;gt;\tfrac1\varepsilon$, khi đó $\tfrac1n&amp;lt;\varepsilon$ nên $1-\tfrac1n&amp;gt;1-\varepsilon$. Theo Bổ đề 1, $\sup A=1$. Số 1 không thuộc $A$: sup không nhất thiết đạt được.&lt;/li&gt;
    &lt;li&gt;$0=1-\tfrac11\in A$ và mọi phần tử đều $\ge0$, nên $\inf A=0$, và lần này inf đạt được (là phần tử nhỏ nhất).&lt;/li&gt;
  &lt;/ul&gt;

  &lt;p&gt;Ví dụ số: với $\varepsilon=0{,}001$, chọn $n=1001$ thì $1-\tfrac1{1001}\approx0{,}999001&amp;gt;0{,}999$.&lt;/p&gt;
&lt;/div&gt;

&lt;h2 id=&quot;ứng-dụng&quot;&gt;Ứng dụng&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Dung sai trong kỹ thuật.&lt;/strong&gt; Một điện trở ghi $100\,\Omega\pm5\%$ có giá trị thật $R$ thoả $\lvert R-100\rvert\le5$. Hai điện trở như vậy mắc nối tiếp cho $R_1+R_2$. Theo bất đẳng thức tam giác,&lt;/p&gt;

\[\lvert (R_1+R_2)-200\rvert\le\lvert R_1-100\rvert+\lvert R_2-100\rvert\le 10 .\]

&lt;p&gt;Sai số tuyệt đối cộng dồn, sai số tương đối vẫn là $10/200=5\%$.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Học máy: cắt gradient (gradient clipping).&lt;/strong&gt; Khi huấn luyện mạng nơ-ron, người ta thường thay gradient $g$ bằng $\operatorname{clip}(g)=\max(-c,\min(g,c))$ để luôn có $\lvert\operatorname{clip}(g)\rvert\le c$. Với $c=1$: $g=3{,}2$ thành $1$; $g=-0{,}4$ giữ nguyên.&lt;/p&gt;

&lt;h2 id=&quot;bài-tập&quot;&gt;Bài tập&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Mức cơ bản.&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;Giải $\lvert x+4\rvert&amp;lt;3$.&lt;/li&gt;
  &lt;li&gt;Viết tập $\lbrace x\mid \lvert x-7\rvert\le 0{,}5\rbrace $ dưới dạng đoạn.&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Đáp án&lt;/summary&gt;

  &lt;ol&gt;
    &lt;li&gt;$-3&amp;lt;x+4&amp;lt;3$, tức $-7&amp;lt;x&amp;lt;-1$.&lt;/li&gt;
    &lt;li&gt;$[6{,}5;\ 7{,}5]$.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;p&gt;&lt;strong&gt;Mức vận dụng.&lt;/strong&gt;&lt;/p&gt;

&lt;ol start=&quot;3&quot;&gt;
  &lt;li&gt;Giải $\lvert x-2\rvert&amp;gt;\lvert x+1\rvert$.&lt;/li&gt;
  &lt;li&gt;Tìm $\sup$ và $\inf$ của $B=\lbrace \tfrac{n}{n+1}\mid n\ge1\rbrace $. Chúng có thuộc $B$ không?&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Đáp án&lt;/summary&gt;

  &lt;ol start=&quot;3&quot;&gt;
    &lt;li&gt;Hai vế không âm nên bình phương được: $x^2-4x+4&amp;gt;x^2+2x+1$, tức $-6x&amp;gt;-3$, $x&amp;lt;\tfrac12$. (Hình học: $x$ gần $-1$ hơn gần $2$, tức nằm bên trái trung điểm $\tfrac12$.)&lt;/li&gt;
    &lt;li&gt;$\inf B=\tfrac12\in B$ (khi $n=1$), $\sup B=1\notin B$. Với $\varepsilon&amp;gt;0$ chọn $n&amp;gt;\tfrac1\varepsilon$, vì $1-\tfrac{n}{n+1}=\tfrac1{n+1}&amp;lt;\varepsilon$.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;p&gt;&lt;strong&gt;Mức nâng cao.&lt;/strong&gt;&lt;/p&gt;

&lt;ol start=&quot;5&quot;&gt;
  &lt;li&gt;Chứng minh $\big\lvert\lvert a\rvert-\lvert b\rvert\big\rvert\le\lvert a-b\rvert$.&lt;/li&gt;
  &lt;li&gt;Cho $A,B$ khác rỗng, bị chặn trên, và $A+B=\lbrace a+b\mid a\in A,\ b\in B\rbrace $. Chứng minh $\sup(A+B)=\sup A+\sup B$.&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Gợi ý&lt;/summary&gt;

  &lt;ol start=&quot;5&quot;&gt;
    &lt;li&gt;Viết $a=(a-b)+b$, dùng Định lý 2: $\lvert a\rvert-\lvert b\rvert\le\lvert a-b\rvert$. Đổi vai $a,b$ được $\lvert b\rvert-\lvert a\rvert\le\lvert a-b\rvert$.&lt;/li&gt;
    &lt;li&gt;$\sup A+\sup B$ là cận trên của $A+B$. Cho $\varepsilon&amp;gt;0$, lấy $a&amp;gt;\sup A-\varepsilon/2$, $b&amp;gt;\sup B-\varepsilon/2$ thì $a+b&amp;gt;\sup A+\sup B-\varepsilon$; dùng Bổ đề 1.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;h2 id=&quot;tóm-tắt&quot;&gt;Tóm tắt&lt;/h2&gt;

&lt;div class=&quot;content-box summary-box textbook-block&quot;&gt;
  &lt;ul&gt;
    &lt;li&gt;$\lvert x-a\rvert$ là khoảng cách; $\lvert x-a\rvert&amp;lt;r\iff a-r&amp;lt;x&amp;lt;a+r$.&lt;/li&gt;
    &lt;li&gt;Bất đẳng thức tam giác $\lvert a+b\rvert\le\lvert a\rvert+\lvert b\rvert$ là công cụ ước lượng chính của cả khoá.&lt;/li&gt;
    &lt;li&gt;Giải phương trình, bất phương trình có trị tuyệt đối: chia khoảng tại các điểm làm biểu thức bằng 0.&lt;/li&gt;
    &lt;li&gt;$\sup A$ là cận trên nhỏ nhất; kiểm tra bằng tiêu chuẩn ε. Tính đầy đủ của $\mathbb{R}$ bảo đảm sup tồn tại cho mọi tập khác rỗng bị chặn trên.&lt;/li&gt;
  &lt;/ul&gt;
&lt;/div&gt;
</content>
 </entry>
 
 <entry>
   <title>Summary: one formula for all the theorems</title>
   <link href="https://calculus-self-learning.pages.dev/contents/en/chapter15/15_06_Summary_one_formula_for_all_theorems/"/>
   <updated>2026-12-01T00:00:00+00:00</updated>
   <id>https://calculus-self-learning.pages.dev/contents/en/chapter15/15_06_Summary_one_formula_for_all_theorems</id>
   <content type="html">&lt;div class=&quot;textbook-objectives&quot;&gt;

  &lt;p&gt;&lt;strong&gt;Learning objectives.&lt;/strong&gt; After this lesson you can:&lt;/p&gt;

  &lt;ul&gt;
    &lt;li&gt;fit the five big theorems of calculus into one pattern, “the integral of a derivative over a region equals an integral over its boundary”;&lt;/li&gt;
    &lt;li&gt;read the general form $\int_{\partial\Omega}\omega=\int_\Omega d\omega$ at an introductory level;&lt;/li&gt;
    &lt;li&gt;relate $\operatorname{curl}\nabla=0$ and $\operatorname{div}\operatorname{curl}=0$ to $d^2=0$;&lt;/li&gt;
    &lt;li&gt;write Maxwell’s four equations in integral and differential form.&lt;/li&gt;
  &lt;/ul&gt;

&lt;/div&gt;

&lt;h2 id=&quot;why-this-lesson&quot;&gt;Why this lesson&lt;/h2&gt;

&lt;p&gt;From chapter 4 until now we have met five theorems that look very different. In fact they are one: each says that adding up a “derivative” inside a region equals adding up a function on its boundary, because the contributions inside cancel. Seeing this helps you remember them, check signs, and opens the way to differential geometry.&lt;/p&gt;

&lt;h2 id=&quot;summary-table&quot;&gt;Summary table&lt;/h2&gt;

&lt;table&gt;
  &lt;thead&gt;
    &lt;tr&gt;
      &lt;th&gt;Theorem&lt;/th&gt;
      &lt;th&gt;Region $\Omega$&lt;/th&gt;
      &lt;th&gt;Boundary $\partial\Omega$&lt;/th&gt;
      &lt;th&gt;Formula&lt;/th&gt;
    &lt;/tr&gt;
  &lt;/thead&gt;
  &lt;tbody&gt;
    &lt;tr&gt;
      &lt;td&gt;Newton–Leibniz (lesson 04_03)&lt;/td&gt;
      &lt;td&gt;interval $[a,b]$&lt;/td&gt;
      &lt;td&gt;two points $a$, $b$&lt;/td&gt;
      &lt;td&gt;$\int_a^bf&apos;\,dx=f(b)-f(a)$&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Line integral of a gradient (lesson 14_04)&lt;/td&gt;
      &lt;td&gt;curve $C$&lt;/td&gt;
      &lt;td&gt;two endpoints $A$, $B$&lt;/td&gt;
      &lt;td&gt;$\int_C\nabla f\cdot dr=f(B)-f(A)$&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Green (lesson 14_05)&lt;/td&gt;
      &lt;td&gt;plane region $D$&lt;/td&gt;
      &lt;td&gt;closed curve&lt;/td&gt;
      &lt;td&gt;$\oint P\,dx+Q\,dy=\iint(Q_x-P_y)\,dA$&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Stokes (lesson 15_04)&lt;/td&gt;
      &lt;td&gt;surface $S$&lt;/td&gt;
      &lt;td&gt;closed curve&lt;/td&gt;
      &lt;td&gt;$\oint F\cdot dr=\iint\operatorname{curl}F\cdot n\,dS$&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Gauss (lesson 15_05)&lt;/td&gt;
      &lt;td&gt;solid $E$&lt;/td&gt;
      &lt;td&gt;closed surface&lt;/td&gt;
      &lt;td&gt;$\iint F\cdot n\,dS=\iiint\operatorname{div}F\,dV$&lt;/td&gt;
    &lt;/tr&gt;
  &lt;/tbody&gt;
&lt;/table&gt;

&lt;p&gt;In each row, the left side is an integral over the (oriented) boundary and the right side is an integral of a “derivative” ($f&apos;$, $\nabla$, curl, div) over the region. Every proof has the same idea: cut the region into small cells, apply the fundamental theorem of calculus on each cell, and the shared faces cancel.&lt;/p&gt;

&lt;h2 id=&quot;differential-forms-and-the-general-formula&quot;&gt;Differential forms and the general formula&lt;/h2&gt;

&lt;p&gt;Without going into technical detail, the unifying language can be described as follows.&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;A &lt;strong&gt;0-form&lt;/strong&gt; is a function $f$. A &lt;strong&gt;1-form&lt;/strong&gt; is an expression $P\,dx+Q\,dy+R\,dz$, the thing we integrate over curves. A &lt;strong&gt;2-form&lt;/strong&gt; is $A\,dy\wedge dz+B\,dz\wedge dx+C\,dx\wedge dy$, the thing we integrate over surfaces (it corresponds to the flux of $(A,B,C)$). A &lt;strong&gt;3-form&lt;/strong&gt; is $g\,dx\wedge dy\wedge dz$, the thing we integrate over solids.&lt;/li&gt;
  &lt;li&gt;The &lt;strong&gt;exterior derivative&lt;/strong&gt; $d$ turns a $k$-form into a $(k+1)$-form: $df=f_xdx+f_ydy+f_zdz$ (the gradient); $d$ of a 1-form gives the 2-form corresponding to curl; $d$ of a 2-form gives the 3-form corresponding to div. Computation rules: $dx\wedge dx=0$ and $dy\wedge dx=-dx\wedge dy$.&lt;/li&gt;
&lt;/ul&gt;

&lt;div class=&quot;textbook-theorem&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Theorem 1 (General Stokes, stated without proof).&lt;/strong&gt; If $\Omega$ is a bounded oriented $k$-dimensional “manifold” whose boundary $\partial\Omega$ has the compatible orientation, and $\omega$ is a smooth $(k-1)$-form, then&lt;/p&gt;

\[\int_{\partial\Omega}\omega=\int_\Omega d\omega.\]

&lt;/div&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Example 1 (Green is the case $k=2$).&lt;/strong&gt; $\omega=P\,dx+Q\,dy$. Then $d\omega=dP\wedge dx+dQ\wedge dy=(P_y\,dy)\wedge dx+(Q_x\,dx)\wedge dy=(Q_x-P_y)\,dx\wedge dy$ (the terms $dx\wedge dx$, $dy\wedge dy$ vanish). The general formula gives exactly Green’s theorem.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Example 2 ($d^2=0$).&lt;/strong&gt; For a function $f$ of two variables: $d(df)=d(f_x\,dx+f_y\,dy)=(f_{xy}-f_{yx})\,dx\wedge dy=0$ by Schwarz. In three dimensions, $d^2=0$ is exactly the two identities $\operatorname{curl}\nabla f=0$ and $\operatorname{div}\operatorname{curl}F=0$ of lesson 14_01. The geometric dual: &lt;strong&gt;the boundary of a boundary is empty&lt;/strong&gt; ($\partial\partial\Omega=\varnothing$); for example, the boundary of a ball is a sphere, and a sphere has no boundary. Combined with theorem 1: $\int_\Omega d(d\omega)=\int_{\partial\Omega}d\omega=\int_{\partial\partial\Omega}\omega=0$.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Example 3 (One computation, two ways).&lt;/strong&gt; The flux of $\operatorname{curl}F$ out of a sphere: by Gauss it is $\iiint\operatorname{div}\operatorname{curl}F=0$; by Stokes, the sphere has no boundary, so it is 0. The two ways are two faces of $d^2=0$ and $\partial^2=\varnothing$.&lt;/p&gt;
&lt;/div&gt;

&lt;h2 id=&quot;application-maxwells-four-equations&quot;&gt;Application: Maxwell’s four equations&lt;/h2&gt;

&lt;table&gt;
  &lt;thead&gt;
    &lt;tr&gt;
      &lt;th&gt;Law&lt;/th&gt;
      &lt;th&gt;Integral form&lt;/th&gt;
      &lt;th&gt;Differential form (via Gauss or Stokes)&lt;/th&gt;
    &lt;/tr&gt;
  &lt;/thead&gt;
  &lt;tbody&gt;
    &lt;tr&gt;
      &lt;td&gt;Gauss for electricity&lt;/td&gt;
      &lt;td&gt;$\iint_SE\cdot n\,dS=Q/\varepsilon_0$&lt;/td&gt;
      &lt;td&gt;$\operatorname{div}E=\rho/\varepsilon_0$&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;No magnetic monopoles&lt;/td&gt;
      &lt;td&gt;$\iint_SB\cdot n\,dS=0$&lt;/td&gt;
      &lt;td&gt;$\operatorname{div}B=0$&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Faraday&lt;/td&gt;
      &lt;td&gt;$\oint_CE\cdot dr=-\tfrac{d}{dt}\iint_SB\cdot n\,dS$&lt;/td&gt;
      &lt;td&gt;$\operatorname{curl}E=-\partial_tB$&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Ampère–Maxwell&lt;/td&gt;
      &lt;td&gt;$\oint_CB\cdot dr=\mu_0I+\mu_0\varepsilon_0\tfrac{d}{dt}\iint_SE\cdot n\,dS$&lt;/td&gt;
      &lt;td&gt;$\operatorname{curl}B=\mu_0J+\mu_0\varepsilon_0\partial_tE$&lt;/td&gt;
    &lt;/tr&gt;
  &lt;/tbody&gt;
&lt;/table&gt;

&lt;p&gt;From the differential form, taking the curl of Faraday’s equation and using $\operatorname{curl}\operatorname{curl}=\nabla\operatorname{div}-\Delta$ (lesson 14_01, exercise 5) in a vacuum gives the wave equation $\partial_t^2E=\tfrac1{\mu_0\varepsilon_0}\Delta E$ with speed $1/\sqrt{\mu_0\varepsilon_0}\approx3\times10^8$ m/s: light is an electromagnetic wave.&lt;/p&gt;

&lt;h2 id=&quot;exercises&quot;&gt;Exercises&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Basic.&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;Which theorem suits each integral? (a) $\oint_C$ over a circle in the plane; (b) the flux out of the surface of a cube; (c) the circulation along the rim of an umbrella.&lt;/li&gt;
  &lt;li&gt;Compute $d\omega$ for $\omega=x\,dy-y\,dx$ and deduce the area formula of lesson 14_05.&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Answers&lt;/summary&gt;

  &lt;ol&gt;
    &lt;li&gt;(a) Green; (b) Gauss; (c) Stokes (the rim is the boundary of the umbrella’s surface).&lt;/li&gt;
    &lt;li&gt;$d\omega=dx\wedge dy-dy\wedge dx=2\,dx\wedge dy$, so $\oint\omega=2\cdot$ area.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;p&gt;&lt;strong&gt;Intermediate.&lt;/strong&gt;&lt;/p&gt;

&lt;ol start=&quot;3&quot;&gt;
  &lt;li&gt;For $\omega=P\,dx+Q\,dy+R\,dz$, compute $d\omega$ and recognise its coefficients as the three components of $\operatorname{curl}F$.&lt;/li&gt;
  &lt;li&gt;Use Ampère’s law to find the magnetic field inside a cylindrical wire of radius $a$ carrying a uniformly distributed current $I$, at distance $r&amp;lt;a$ from the axis.&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Answers&lt;/summary&gt;

  &lt;ol start=&quot;3&quot;&gt;
    &lt;li&gt;$d\omega=(R_y-Q_z)\,dy\wedge dz+(P_z-R_x)\,dz\wedge dx+(Q_x-P_y)\,dx\wedge dy$.&lt;/li&gt;
    &lt;li&gt;The current through the disc of radius $r$ is $I\,r^2/a^2$, so $B\cdot2\pi r=\mu_0Ir^2/a^2$, $B=\dfrac{\mu_0Ir}{2\pi a^2}$.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;p&gt;&lt;strong&gt;Advanced.&lt;/strong&gt;&lt;/p&gt;

&lt;ol start=&quot;5&quot;&gt;
  &lt;li&gt;Check $\partial\partial=\varnothing$ for the oriented triangle $[A,B,C]$: its boundary is $[B,C]-[A,C]+[A,B]$; compute the boundary of the boundary using $\partial[P,Q]=Q-P$.&lt;/li&gt;
  &lt;li&gt;Take the divergence of the Ampère–Maxwell equation and use Gauss’s law to deduce $\partial_t\rho+\operatorname{div}J=0$. What does it mean physically?&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Hints&lt;/summary&gt;

  &lt;ol start=&quot;5&quot;&gt;
    &lt;li&gt;$(C-B)-(C-A)+(B-A)=0$.&lt;/li&gt;
    &lt;li&gt;$\operatorname{div}\operatorname{curl}B=0$ gives $0=\mu_0\operatorname{div}J+\mu_0\varepsilon_0\partial_t\operatorname{div}E=\mu_0(\operatorname{div}J+\partial_t\rho)$: conservation of charge, the same form as the continuity equation of lesson 15_05. Maxwell’s term is needed for this to hold.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;h2 id=&quot;summary&quot;&gt;Summary&lt;/h2&gt;

&lt;div class=&quot;content-box summary-box textbook-block&quot;&gt;
  &lt;ul&gt;
    &lt;li&gt;The five theorems (Newton–Leibniz, gradient, Green, Stokes, Gauss) all say: the integral of a derivative over a region equals an integral over its boundary.&lt;/li&gt;
    &lt;li&gt;The common language: $\int_{\partial\Omega}\omega=\int_\Omega d\omega$.&lt;/li&gt;
    &lt;li&gt;$d^2=0$ corresponds to $\operatorname{curl}\nabla=0$ and $\operatorname{div}\operatorname{curl}=0$; the boundary of a boundary is empty.&lt;/li&gt;
    &lt;li&gt;Maxwell’s equations pass between integral and differential form via Gauss and Stokes.&lt;/li&gt;
  &lt;/ul&gt;
&lt;/div&gt;
</content>
 </entry>
 
 <entry>
   <title>The divergence theorem (Gauss)</title>
   <link href="https://calculus-self-learning.pages.dev/contents/en/chapter15/15_05_The_divergence_theorem/"/>
   <updated>2026-12-01T00:00:00+00:00</updated>
   <id>https://calculus-self-learning.pages.dev/contents/en/chapter15/15_05_The_divergence_theorem</id>
   <content type="html">&lt;div class=&quot;textbook-objectives&quot;&gt;

  &lt;p&gt;&lt;strong&gt;Learning objectives.&lt;/strong&gt; After this lesson you can:&lt;/p&gt;

  &lt;ul&gt;
    &lt;li&gt;state and prove the divergence theorem for simple solids;&lt;/li&gt;
    &lt;li&gt;compute the flux through a closed surface by a triple integral, and vice versa;&lt;/li&gt;
    &lt;li&gt;prove Gauss’s law for a point charge and any closed surface;&lt;/li&gt;
    &lt;li&gt;derive the continuity equation and the heat equation.&lt;/li&gt;
  &lt;/ul&gt;

&lt;/div&gt;

&lt;h2 id=&quot;why-this-lesson&quot;&gt;Why this lesson&lt;/h2&gt;

&lt;p&gt;Lesson 14_01 said that div is the outward flux per unit volume of a small box. Add up all the small boxes in a solid: the fluxes through shared faces cancel, leaving only the flux through the outer surface. That is the divergence theorem, the main tool for deriving the equations of physics from conservation laws.&lt;/p&gt;

&lt;h2 id=&quot;the-theorem&quot;&gt;The theorem&lt;/h2&gt;

&lt;div class=&quot;textbook-theorem&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Theorem 1 (Gauss).&lt;/strong&gt; Let $E$ be a bounded solid whose boundary $S$ is piecewise smooth and oriented by the outward normal, and let $F$ have continuous partial derivatives on an open set containing $E$. Then&lt;/p&gt;

\[\iint_SF\cdot n\,dS=\iiint_E\operatorname{div}F\,dV.\]

&lt;/div&gt;

&lt;div class=&quot;textbook-proof&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Proof (for a solid that is “simple” along all three axes).&lt;/strong&gt; By linearity we prove it separately for $F=(0,0,R)$: $\iint_SRn_z\,dS=\iiint_ER_z\,dV$; the other two components are similar.&lt;/p&gt;

  &lt;p&gt;Write $E=\lbrace(x,y)\in D,\ u_1(x,y)\le z\le u_2(x,y)\rbrace$. By theorem 1 of lesson 13_04 and the fundamental theorem of calculus,&lt;/p&gt;

\[\iiint_ER_z\,dV=\iint_D\big[R(x,y,u_2)-R(x,y,u_1)\big]\,dA.\]

  &lt;p&gt;The boundary consists of the top $z=u_2$, with $n\,dS=(-u_{2x},-u_{2y},1)\,dA$ (upward is outward), giving $\iint_DR(x,y,u_2)\,dA$; the bottom $z=u_1$ with the outward normal pointing down, $n\,dS=(u_{1x},u_{1y},-1)\,dA$, giving $-\iint_DR(x,y,u_1)\,dA$; and the side (if any), which is vertical, so $n_z=0$. Adding these gives the claim.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;reel-video&quot;&gt;
  &lt;video controls=&quot;&quot; playsinline=&quot;&quot; preload=&quot;metadata&quot; src=&quot;/public/videos/reels/gauss-source-flux.mp4&quot;&gt;&lt;/video&gt;
  &lt;p class=&quot;reel-caption&quot;&gt;Gauss&apos;s theorem with point sources: the outward flux through a closed surface equals the total source inside, independent of the radius or the shape of the surface; an outside source gives 0, sinks and dipoles, a planet&apos;s gravity g(r), F = (x, y, z) with div = 3, and the continuity equation (silent video, about 3 minutes 8 seconds).&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Example 1.&lt;/strong&gt; $F=(x,y,z)$ out of the ball of radius $R$: $\operatorname{div}F=3$, so the flux is $3\cdot\tfrac43\pi R^3=4\pi R^3$, matching example 1 of lesson 15_03.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Example 2 (Hard surface, easy solid).&lt;/strong&gt; $F=\big(xy,\ y^2+e^{xz^2},\ \sin(xy)\big)$ out of the solid $E$ bounded by the parabolic cylinder $z=1-x^2$ and the planes $z=0$, $y=0$, $y+z=2$. Computing on the four faces is very hard, but $\operatorname{div}F=y+2y=3y$:&lt;/p&gt;

\[\int_{-1}^1\int_0^{1-x^2}\int_0^{2-z}3y\,dy\,dz\,dx=\frac{184}{35}\approx5.257.\]

&lt;/div&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Example 3 (Gauss’s law).&lt;/strong&gt; $E=\dfrac{q}{4\pi\varepsilon_0}\dfrac{r}{\lVert r\rVert^3}$ has zero divergence away from the origin (lesson 14_01). Let $S$ be any closed surface enclosing the origin, and $S_\varepsilon$ a small sphere around the origin inside $S$. Apply the theorem to the solid between them (its boundary is $S$ oriented outward and $S_\varepsilon$ oriented toward the centre): the flux through $S$ minus the outward flux through $S_\varepsilon$ is 0. So the flux through $S$ is $q/\varepsilon_0$ (lesson 15_03), whatever the shape of $S$. If $S$ does not enclose the origin, the flux is 0.&lt;/p&gt;
&lt;/div&gt;

&lt;h2 id=&quot;application-the-continuity-equation-and-the-heat-equation&quot;&gt;Application: the continuity equation and the heat equation&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;The continuity equation.&lt;/strong&gt; A fluid has density $\rho(x,t)$ and velocity $v$. The mass in a fixed region $E$ changes only through fluid crossing the boundary:&lt;/p&gt;

\[\frac{d}{dt}\iiint_E\rho\,dV=-\iint_S\rho v\cdot n\,dS=-\iiint_E\operatorname{div}(\rho v)\,dV.\]

&lt;p&gt;Moving the derivative inside: $\iiint_E\big(\rho_t+\operatorname{div}(\rho v)\big)dV=0$ for &lt;strong&gt;every&lt;/strong&gt; $E$. A continuous function whose integral over every small ball is 0 is itself 0 (average over a ball shrinking to a point), so $\rho_t+\operatorname{div}(\rho v)=0$.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The heat equation.&lt;/strong&gt; Heat energy is $c\rho T$ and the heat flow is $q=-k\nabla T$ (Fourier). The same argument gives $c\rho\,T_t=\operatorname{div}(k\nabla T)$, that is $T_t=\alpha\,\Delta T$ with $\alpha=k/(c\rho)$, the equation of lesson 10_05.&lt;/p&gt;

&lt;h2 id=&quot;exercises&quot;&gt;Exercises&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Basic.&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;The flux of $F=(x^3,y^3,z^3)$ out of the unit sphere.&lt;/li&gt;
  &lt;li&gt;The flux of $F=(x,y,z)$ out of the surface of the cube $[0,1]^3$.&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Answers&lt;/summary&gt;

  &lt;ol&gt;
    &lt;li&gt;$\operatorname{div}F=3\rho^2$: $\int_0^13\rho^2\cdot\rho^2\,d\rho\cdot4\pi=\tfrac{12\pi}5$.&lt;/li&gt;
    &lt;li&gt;$\operatorname{div}F=3$ and the volume is 1: the flux is $3$.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;p&gt;&lt;strong&gt;Intermediate.&lt;/strong&gt;&lt;/p&gt;

&lt;ol start=&quot;3&quot;&gt;
  &lt;li&gt;The flux of $F=(z,y,x)$ out of the unit sphere.&lt;/li&gt;
  &lt;li&gt;Show that the volume is $V(E)=\tfrac13\iint_Sr\cdot n\,dS$ and check it for the ball.&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Answers&lt;/summary&gt;

  &lt;ol start=&quot;3&quot;&gt;
    &lt;li&gt;$\operatorname{div}F=1$: $\tfrac{4\pi}3$.&lt;/li&gt;
    &lt;li&gt;$\operatorname{div}r=3$. For the ball: $r\cdot n=R$, so $\tfrac13R\cdot4\pi R^2=\tfrac43\pi R^3$.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;p&gt;&lt;strong&gt;Advanced.&lt;/strong&gt;&lt;/p&gt;

&lt;ol start=&quot;5&quot;&gt;
  &lt;li&gt;(Green’s identity.) Prove $\iiint_E\big(u\,\Delta v+\nabla u\cdot\nabla v\big)dV=\iint_Su\,\nabla v\cdot n\,dS$.&lt;/li&gt;
  &lt;li&gt;Use exercise 5 to show: if $\Delta w=0$ in $E$ and $w=0$ on $S$, then $w=0$ in $E$. Deduce that the Dirichlet problem $\Delta u=f$ in $E$, $u=g$ on $S$ has at most one solution.&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Hints&lt;/summary&gt;

  &lt;ol start=&quot;5&quot;&gt;
    &lt;li&gt;Apply the theorem to $F=u\nabla v$, using $\operatorname{div}(u\nabla v)=u\Delta v+\nabla u\cdot\nabla v$ (lesson 14_01, exercise 3).&lt;/li&gt;
    &lt;li&gt;With $u=v=w$: $\iiint\lVert\nabla w\rVert^2=0$, so $\nabla w=0$ and $w$ is constant, but $w=0$ on the boundary. The difference of two solutions solves the homogeneous problem.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;h2 id=&quot;summary&quot;&gt;Summary&lt;/h2&gt;

&lt;div class=&quot;content-box summary-box textbook-block&quot;&gt;
  &lt;ul&gt;
    &lt;li&gt;Gauss: $\iint_SF\cdot n\,dS=\iiint_E\operatorname{div}F\,dV$, with the outward normal.&lt;/li&gt;
    &lt;li&gt;Proof: the fundamental theorem of calculus along each axis; the sides contribute nothing.&lt;/li&gt;
    &lt;li&gt;Gauss’s law: the electric flux through every closed surface enclosing a charge is $q/\varepsilon_0$.&lt;/li&gt;
    &lt;li&gt;Conservation plus the divergence theorem gives the continuity and heat equations.&lt;/li&gt;
  &lt;/ul&gt;
&lt;/div&gt;
</content>
 </entry>
 
 <entry>
   <title>Stokes' theorem</title>
   <link href="https://calculus-self-learning.pages.dev/contents/en/chapter15/15_04_Stokes_theorem/"/>
   <updated>2026-12-01T00:00:00+00:00</updated>
   <id>https://calculus-self-learning.pages.dev/contents/en/chapter15/15_04_Stokes_theorem</id>
   <content type="html">&lt;div class=&quot;textbook-objectives&quot;&gt;

  &lt;p&gt;&lt;strong&gt;Learning objectives.&lt;/strong&gt; After this lesson you can:&lt;/p&gt;

  &lt;ul&gt;
    &lt;li&gt;state Stokes’ theorem with the right-hand rule for orientation;&lt;/li&gt;
    &lt;li&gt;prove the theorem for graphs by reducing it to Green’s theorem;&lt;/li&gt;
    &lt;li&gt;use the theorem both ways: compute a line integral by a surface integral and vice versa;&lt;/li&gt;
    &lt;li&gt;explain why the flux of a curl depends only on the boundary.&lt;/li&gt;
  &lt;/ul&gt;

&lt;/div&gt;

&lt;h2 id=&quot;why-this-lesson&quot;&gt;Why this lesson&lt;/h2&gt;

&lt;p&gt;Green’s theorem (lesson 14_05) says the circulation around the boundary of a plane region equals the total curl inside. Stokes is the same idea for a curved surface in space: a soap film spanning a wire loop, where all the small eddies on the film cancel and only the circulation along the wire remains.&lt;/p&gt;

&lt;h2 id=&quot;the-theorem&quot;&gt;The theorem&lt;/h2&gt;

&lt;p&gt;An oriented surface $S$ with boundary $C$ is &lt;strong&gt;compatibly oriented&lt;/strong&gt; if, walking along $C$ with your head in the direction of $n$, the surface $S$ is on your left (right-hand rule: fingers along $C$, thumb along $n$).&lt;/p&gt;

&lt;div class=&quot;textbook-theorem&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Theorem 1 (Stokes).&lt;/strong&gt; Let $S$ be a piecewise smooth oriented surface whose boundary $C$ is a piecewise smooth closed curve with the compatible orientation, and let $F$ have continuous partial derivatives on an open set containing $S$. Then&lt;/p&gt;

\[\oint_CF\cdot dr=\iint_S(\operatorname{curl}F)\cdot n\,dS.\]

&lt;/div&gt;

&lt;div class=&quot;textbook-proof&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Proof (for a graph $z=g(x,y)$ over a region $D$ where Green’s theorem holds, oriented upward).&lt;/strong&gt; By linearity it suffices to treat $F=(P,0,0)$; the other two components are similar.&lt;/p&gt;

  &lt;p&gt;&lt;em&gt;Right-hand side.&lt;/em&gt; $\operatorname{curl}(P,0,0)=(0,P_z,-P_y)$ and $n\,dS=(-g_x,-g_y,1)\,dA$, so the right-hand side is $\iint_D\big(-P_zg_y-P_y\big)\,dA$, with $P$ evaluated at $(x,y,g(x,y))$.&lt;/p&gt;

  &lt;p&gt;&lt;em&gt;Left-hand side.&lt;/em&gt; If $(x(t),y(t))$ traverses $\partial D$ positively, then $C$ is $(x(t),y(t),g(x(t),y(t)))$, and $\oint_CP\,dx=\oint_{\partial D}p(x,y)\,dx$ with $p(x,y)=P(x,y,g(x,y))$. By Green this equals $-\iint_Dp_y\,dA$. Chain rule: $p_y=P_y+P_zg_y$. So the left-hand side is $\iint_D(-P_y-P_zg_y)\,dA$, equal to the right-hand side.&lt;/p&gt;

  &lt;p&gt;A general surface is glued from such pieces; the integrals along the seams are traversed twice in opposite directions and cancel.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;reel-video&quot;&gt;
  &lt;video controls=&quot;&quot; playsinline=&quot;&quot; preload=&quot;metadata&quot; src=&quot;/public/videos/reels/stokes-soap-film.mp4&quot;&gt;&lt;/video&gt;
  &lt;p class=&quot;reel-caption&quot;&gt;Stokes&apos; theorem: every soap film spanning the same wire loop carries the same curl flux, equal to the circulation around the boundary (silent video, about 2 minutes).&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;interactive-frame&quot;&gt;
  &lt;div class=&quot;interactive-frame-head&quot;&gt;
    &lt;div class=&quot;interactive-frame-title&quot;&gt;Both sides of Stokes&apos; theorem&lt;/div&gt;
    &lt;div class=&quot;interactive-frame-desc&quot;&gt;Change the surface with h and k; the circulation and the curl flux stay equal.&lt;/div&gt;
  &lt;/div&gt;
  &lt;iframe src=&quot;/interactives/chapter15/stokes-vs-line-en.html&quot; title=&quot;Both sides of Stokes&amp;#39; theorem&quot; loading=&quot;lazy&quot; style=&quot;height: 700px;&quot;&gt;&lt;/iframe&gt;
  &lt;div class=&quot;interactive-frame-foot&quot;&gt;
    &lt;a href=&quot;/interactives/chapter15/stokes-vs-line-en.html&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;Open the interactive in a new window&lt;/a&gt;
  &lt;/div&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Example 1 (A check).&lt;/strong&gt; $F=(-y,x,0)$, $S$ the upper hemisphere of radius 1, $C$ the unit circle counterclockwise. Left-hand side $=2\pi$ (lesson 14_03). $\operatorname{curl}F=(0,0,2)$, and the outward flux through the hemisphere is $2\cdot\pi$ (example 2 of lesson 15_03). Both sides agree. The flux through the flat disc $x^2+y^2\le1$ is also $2\pi$: same boundary, same result.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Example 2 (A surface instead of a curve).&lt;/strong&gt; $\oint_CF\cdot dr$ with $F=(-y^2,x,z^2)$, where $C$ is the intersection of the plane $y+z=2$ with the cylinder $x^2+y^2=1$, counterclockwise seen from above. $\operatorname{curl}F=(0,0,1+2y)$. Take $S$ to be the part of the plane $z=2-y$ inside the cylinder, oriented upward; $n\,dS=(0,1,1)\,dA$:&lt;/p&gt;

\[\iint_D(1+2y)\,dA=\pi+0=\pi.\]

  &lt;p&gt;(A numerical check with a parametrisation of $C$ gives $3.14159\ldots$.)&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Example 3 (A curve instead of a surface).&lt;/strong&gt; $\iint_S\operatorname{curl}F\cdot n\,dS$ with $F=(xz,yz,xy)$, where $S$ is the part of the sphere $x^2+y^2+z^2=4$ inside the cylinder $x^2+y^2=1$ and above the $xy$-plane, oriented outward. Its boundary is the circle $x^2+y^2=1$ at $z=\sqrt3$: $r=(\cos t,\sin t,\sqrt3)$. $F\cdot r&apos;=-\sqrt3\cos t\sin t+\sqrt3\sin t\cos t=0$, so the answer is 0.&lt;/p&gt;
&lt;/div&gt;

&lt;p&gt;&lt;strong&gt;Consequences.&lt;/strong&gt; If $S_1$, $S_2$ have the same boundary $C$ (with the same orientation), then $\iint_{S_1}\operatorname{curl}F\cdot n=\iint_{S_2}\operatorname{curl}F\cdot n$. On a closed surface (no boundary), the flux of a curl is 0. And if $\operatorname{curl}F=0$ on all of $\mathbb R^3$, then $\oint_CF\cdot dr=0$ for every closed curve (span a surface over $C$), so $F$ is conservative (lesson 14_04).&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What curl means.&lt;/strong&gt; For a small disc $S_\varepsilon$ centred at $a$ with normal $n$: $\oint_{\partial S_\varepsilon}F\cdot dr\approx(\operatorname{curl}F(a)\cdot n)\,\pi\varepsilon^2$. So $\operatorname{curl}F\cdot n$ is the circulation per unit area in the plane perpendicular to $n$, and $\operatorname{curl}F$ points along the axis of strongest rotation.&lt;/p&gt;

&lt;h2 id=&quot;application-electromagnetism&quot;&gt;Application: electromagnetism&lt;/h2&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;strong&gt;Faraday.&lt;/strong&gt; $\oint_CE\cdot dr=-\dfrac{d}{dt}\iint_SB\cdot n\,dS$: a changing magnetic flux through a wire loop produces an electromotive force (the principle of the generator). By Stokes the left-hand side is $\iint\operatorname{curl}E\cdot n$, and since this holds for every surface: $\operatorname{curl}E=-\partial B/\partial t$.&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Ampère.&lt;/strong&gt; $\oint_CB\cdot dr=\mu_0I$ (the current through the surface). For a long straight wire, symmetry makes $B$ constant in size on a circle of radius $r$, so $B\cdot2\pi r=\mu_0I$, $B=\dfrac{\mu_0I}{2\pi r}$.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2 id=&quot;exercises&quot;&gt;Exercises&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Basic.&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;Check Stokes’ theorem for $F=(y,-x,0)$ on the unit disc in the plane $z=0$, oriented upward.&lt;/li&gt;
  &lt;li&gt;Use Stokes to compute $\oint_CF\cdot dr$ with $F=(z,x,y)$, where $C$ is the unit circle in the plane $z=0$, counterclockwise.&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Answers&lt;/summary&gt;

  &lt;ol&gt;
    &lt;li&gt;Left-hand side $-2\pi$ (lesson 14_03, exercise 3). $\operatorname{curl}F=(0,0,-2)$, flux $-2\pi$.&lt;/li&gt;
    &lt;li&gt;$\operatorname{curl}F=(1,1,1)$; through the disc with $n=(0,0,1)$: $\pi$.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;p&gt;&lt;strong&gt;Intermediate.&lt;/strong&gt;&lt;/p&gt;

&lt;ol start=&quot;3&quot;&gt;
  &lt;li&gt;Compute $\iint_S\operatorname{curl}F\cdot n\,dS$ with $F=(y,z,x)$, where $S$ is the upper hemisphere of radius 1 oriented outward, by replacing $S$ with the disc.&lt;/li&gt;
  &lt;li&gt;Show that $\iint_S\operatorname{curl}F\cdot n\,dS=0$ for every sphere $S$, in two ways (Stokes, and $\operatorname{div}\operatorname{curl}=0$ with the divergence theorem of the next lesson).&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Answers&lt;/summary&gt;

  &lt;ol start=&quot;3&quot;&gt;
    &lt;li&gt;$\operatorname{curl}F=(-1,-1,-1)$; through the disc oriented upward: $-\pi$.&lt;/li&gt;
    &lt;li&gt;Cut the sphere along the equator: the two halves have the same boundary with opposite orientations, so the two line integrals cancel. Or $\iiint\operatorname{div}\operatorname{curl}F\,dV=0$.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;p&gt;&lt;strong&gt;Advanced.&lt;/strong&gt;&lt;/p&gt;

&lt;ol start=&quot;5&quot;&gt;
  &lt;li&gt;Complete the proof of theorem 1 for the component $F=(0,0,R)$.&lt;/li&gt;
  &lt;li&gt;Show that if $\operatorname{curl}F=0$ on $\mathbb R^3$ minus the $z$-axis, $F$ need not be conservative. Hint: extend example 2 of lesson 14_04.&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Hints&lt;/summary&gt;

  &lt;ol start=&quot;5&quot;&gt;
    &lt;li&gt;Right-hand side: $\operatorname{curl}(0,0,R)=(R_y,-R_x,0)$, $n\,dS=(-g_x,-g_y,1)dA$, giving $\iint(-R_yg_x+R_xg_y)\,dA$. Left-hand side: $\oint R\,dz=\oint r(x,y)(g_x\,dx+g_y\,dy)$ with $r=R(x,y,g)$; apply Green and the chain rule, and the $g_{xy}$ terms cancel by Schwarz.&lt;/li&gt;
    &lt;li&gt;$F=\big(\tfrac{-y}{x^2+y^2},\tfrac{x}{x^2+y^2},0\big)$: its curl is 0 but its circulation around the $z$-axis is $2\pi$. No surface spanning that loop avoids the axis.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;h2 id=&quot;summary&quot;&gt;Summary&lt;/h2&gt;

&lt;div class=&quot;content-box summary-box textbook-block&quot;&gt;
  &lt;ul&gt;
    &lt;li&gt;Stokes: $\oint_CF\cdot dr=\iint_S\operatorname{curl}F\cdot n\,dS$, oriented by the right-hand rule.&lt;/li&gt;
    &lt;li&gt;Proof: for a graph, reduce to Green with the chain rule.&lt;/li&gt;
    &lt;li&gt;The flux of a curl depends only on the boundary; on a closed surface it is 0.&lt;/li&gt;
    &lt;li&gt;Applications: Faraday’s and Ampère’s laws; $B=\mu_0I/(2\pi r)$ around a straight wire.&lt;/li&gt;
  &lt;/ul&gt;
&lt;/div&gt;
</content>
 </entry>
 
 <entry>
   <title>Surface integrals of vector fields and flux</title>
   <link href="https://calculus-self-learning.pages.dev/contents/en/chapter15/15_03_Surface_integrals_of_vector_fields_and_flux/"/>
   <updated>2026-12-01T00:00:00+00:00</updated>
   <id>https://calculus-self-learning.pages.dev/contents/en/chapter15/15_03_Surface_integrals_of_vector_fields_and_flux</id>
   <content type="html">&lt;div class=&quot;textbook-objectives&quot;&gt;

  &lt;p&gt;&lt;strong&gt;Learning objectives.&lt;/strong&gt; After this lesson you can:&lt;/p&gt;

  &lt;ul&gt;
    &lt;li&gt;orient a surface and explain why the Möbius strip cannot be oriented;&lt;/li&gt;
    &lt;li&gt;compute the flux $\iint_SF\cdot n\,dS$ through parametric surfaces, graphs and spheres;&lt;/li&gt;
    &lt;li&gt;interpret flux as the amount of fluid crossing a surface per unit time.&lt;/li&gt;
  &lt;/ul&gt;

&lt;/div&gt;

&lt;h2 id=&quot;why-this-lesson&quot;&gt;Why this lesson&lt;/h2&gt;

&lt;p&gt;Put a net into a stream: how much water passes through it each second? Only the component of velocity perpendicular to the net carries water through, and we must say which way counts as “through”. That quantity is flux, central to Gauss’s law in electricity and to the theorems of Stokes and Gauss in the next two lessons.&lt;/p&gt;

&lt;h2 id=&quot;oriented-surfaces&quot;&gt;Oriented surfaces&lt;/h2&gt;

&lt;div class=&quot;textbook-definition&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Definition.&lt;/strong&gt; A surface $S$ is &lt;strong&gt;orientable&lt;/strong&gt; if one can choose a unit normal $n$ that varies continuously over the whole surface. Such a choice is an &lt;strong&gt;orientation&lt;/strong&gt; of $S$. A closed surface (the boundary of a solid) is usually oriented by the &lt;strong&gt;outward normal&lt;/strong&gt;.&lt;/p&gt;
&lt;/div&gt;

&lt;p&gt;The Möbius strip (a strip of paper given a half twist and glued end to end) is not orientable: going once around the strip, the normal comes back pointing the opposite way. One cannot speak of flux “through” a Möbius strip.&lt;/p&gt;

&lt;h2 id=&quot;flux&quot;&gt;Flux&lt;/h2&gt;

&lt;div class=&quot;textbook-definition&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Definition.&lt;/strong&gt; The &lt;strong&gt;flux&lt;/strong&gt; of a continuous field $F$ through an oriented surface $S$ is&lt;/p&gt;

\[\iint_SF\cdot dS=\iint_SF\cdot n\,dS.\]

  &lt;p&gt;If $r:D\to\mathbb R^3$ is a parametrisation with $r_u\times r_v$ pointing the same way as $n$, then $n\,dS=(r_u\times r_v)\,du\,dv$, so&lt;/p&gt;

\[\iint_SF\cdot dS=\iint_DF(r(u,v))\cdot(r_u\times r_v)\,du\,dv.\]

&lt;/div&gt;

&lt;p&gt;Reversing the orientation changes the sign of the flux. For a graph $z=g(x,y)$ oriented upward ($r_x\times r_y=(-g_x,-g_y,1)$):&lt;/p&gt;

\[\iint_SF\cdot dS=\iint_D\big(-Pg_x-Qg_y+R\big)\,dA.\]

&lt;p&gt;When $F$ is a fluid velocity, $F\cdot n\,\Delta S$ approximates the volume crossing the patch $\Delta S$ per unit time (the volume of a slanted box with base $\Delta S$ and edge $F$).&lt;/p&gt;

&lt;div class=&quot;interactive-frame&quot;&gt;
  &lt;div class=&quot;interactive-frame-head&quot;&gt;
    &lt;div class=&quot;interactive-frame-title&quot;&gt;Flux through a surface&lt;/div&gt;
    &lt;div class=&quot;interactive-frame-desc&quot;&gt;Cells coloured by the sign of F · n; their sum is the flux.&lt;/div&gt;
  &lt;/div&gt;
  &lt;iframe src=&quot;/interactives/chapter15/surface-flux-en.html&quot; title=&quot;Flux through a surface&quot; loading=&quot;lazy&quot; style=&quot;height: 720px;&quot;&gt;&lt;/iframe&gt;
  &lt;div class=&quot;interactive-frame-foot&quot;&gt;
    &lt;a href=&quot;/interactives/chapter15/surface-flux-en.html&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;Open the interactive in a new window&lt;/a&gt;
  &lt;/div&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Example 1.&lt;/strong&gt; $F=(x,y,z)$ through the sphere of radius $R$, oriented outward. On the sphere $n=r/R$, so $F\cdot n=R$ and the flux is $R\cdot4\pi R^2=4\pi R^3$.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Example 2 (Rain).&lt;/strong&gt; Rain falls straight down uniformly, $F=(0,0,-1)$. The (downward) flux through the upper hemisphere of radius $R$: with $n$ pointing inward, $F\cdot n=\cos\varphi$, so the flux is $\int_0^{2\pi}\int_0^{\pi/2}\cos\varphi\,R^2\sin\varphi\,d\varphi\,d\theta=\pi R^2$. The dome catches exactly as much rain as the disc of its shadow.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Example 3 (A graph).&lt;/strong&gt; $F=(y,x,z)$ through the paraboloid $z=1-x^2-y^2$, $z\ge0$, oriented upward. $g_x=-2x$, $g_y=-2y$:&lt;/p&gt;

\[\iint_D\big(2xy+2xy+1-x^2-y^2\big)\,dA=0+\int_0^{2\pi}\int_0^1(1-r^2)\,r\,dr\,d\theta=\frac\pi2.\]

  &lt;p&gt;(The term $4xy$ integrates to 0 over the disc by symmetry.)&lt;/p&gt;
&lt;/div&gt;

&lt;h2 id=&quot;application-a-point-charge&quot;&gt;Application: a point charge&lt;/h2&gt;

&lt;p&gt;A charge $q$ at the origin produces the electric field $E=\dfrac{q}{4\pi\varepsilon_0}\dfrac{r}{\lVert r\rVert^3}$. On the sphere of radius $R$, $E\cdot n=\dfrac q{4\pi\varepsilon_0R^2}$, so the outward flux is $\dfrac q{4\pi\varepsilon_0R^2}\cdot4\pi R^2=\dfrac q{\varepsilon_0}$, &lt;strong&gt;independent of $R$&lt;/strong&gt;: the number of “field lines” leaving is fixed. Lesson 15_05 proves this for every closed surface enclosing the charge (Gauss’s law).&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Heat.&lt;/strong&gt; By Fourier’s law, the heat flow is $q=-k\nabla T$. The flux of $q$ through the wall of a pot is the power escaping as heat (W).&lt;/p&gt;

&lt;h2 id=&quot;exercises&quot;&gt;Exercises&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Basic.&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;The flux of $F=(0,0,z)$ out of the unit sphere.&lt;/li&gt;
  &lt;li&gt;The flux of $F=(x,y,0)$ out of the side of the cylinder $x^2+y^2=1$, $0\le z\le2$.&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Answers&lt;/summary&gt;

  &lt;ol&gt;
    &lt;li&gt;$F\cdot n=z^2$: $\iint z^2\,dS=\tfrac{4\pi}3$ (lesson 15_02).&lt;/li&gt;
    &lt;li&gt;$F\cdot n=x^2+y^2=1$: equal to the area $4\pi$.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;p&gt;&lt;strong&gt;Intermediate.&lt;/strong&gt;&lt;/p&gt;

&lt;ol start=&quot;3&quot;&gt;
  &lt;li&gt;The flux of $F=(1,1,1)$ through the triangle $x+y+z=1$, $x,y,z\ge0$, oriented upward.&lt;/li&gt;
  &lt;li&gt;The flux of $F=(0,0,1)$ out of the unit sphere (the whole closed surface). Explain the result.&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Answers&lt;/summary&gt;

  &lt;ol start=&quot;3&quot;&gt;
    &lt;li&gt;$g=1-x-y$: $-P(-1)-Q(-1)+R=3$, times the area $\tfrac12$ of $D$: $\tfrac32$.&lt;/li&gt;
    &lt;li&gt;The upper half gives $\pi$, the lower half $-\pi$: total 0. A uniform field leaves exactly as much as it enters.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;p&gt;&lt;strong&gt;Advanced.&lt;/strong&gt;&lt;/p&gt;

&lt;ol start=&quot;5&quot;&gt;
  &lt;li&gt;Show that the flux of $F=\dfrac{r}{\lVert r\rVert^3}$ through a patch of a sphere centred at the origin equals its solid angle (the area of the patch projected onto the unit sphere).&lt;/li&gt;
  &lt;li&gt;Write the Möbius strip as $r(u,v)=\big((1+\tfrac v2\cos\tfrac u2)\cos u,\,(1+\tfrac v2\cos\tfrac u2)\sin u,\,\tfrac v2\sin\tfrac u2\big)$ and check that at $v=0$, $r_u\times r_v$ at $u=0$ and at $u=2\pi$ point in opposite directions.&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Hints&lt;/summary&gt;

  &lt;ol start=&quot;5&quot;&gt;
    &lt;li&gt;On the sphere of radius $R$, $F\cdot n=1/R^2$ and $dS=R^2\,d\Omega$, so the flux is $\iint d\Omega$.&lt;/li&gt;
    &lt;li&gt;At $v=0$: $r_u=(-\sin u,\cos u,0)$, $r_v=\tfrac12(\cos\tfrac u2\cos u,\cos\tfrac u2\sin u,\sin\tfrac u2)$. At $u=0$: $r_v=(\tfrac12,0,0)$; at $u=2\pi$: $r_v=(-\tfrac12,0,0)$, while $r_u=(0,1,0)$ in both, so the cross product changes sign.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;h2 id=&quot;summary&quot;&gt;Summary&lt;/h2&gt;

&lt;div class=&quot;content-box summary-box textbook-block&quot;&gt;
  &lt;ul&gt;
    &lt;li&gt;An oriented surface has a continuous unit normal; the Möbius strip has none.&lt;/li&gt;
    &lt;li&gt;Flux $\iint F\cdot n\,dS=\iint F(r)\cdot(r_u\times r_v)\,du\,dv$; reversing the orientation changes the sign.&lt;/li&gt;
    &lt;li&gt;Upward graph: $\iint(-Pg_x-Qg_y+R)\,dA$.&lt;/li&gt;
    &lt;li&gt;A point charge: the flux through a sphere is $q/\varepsilon_0$, independent of the radius.&lt;/li&gt;
  &lt;/ul&gt;
&lt;/div&gt;
</content>
 </entry>
 
 <entry>
   <title>Surface integrals of scalar functions</title>
   <link href="https://calculus-self-learning.pages.dev/contents/en/chapter15/15_02_Surface_integrals_of_scalar_functions/"/>
   <updated>2026-12-01T00:00:00+00:00</updated>
   <id>https://calculus-self-learning.pages.dev/contents/en/chapter15/15_02_Surface_integrals_of_scalar_functions</id>
   <content type="html">&lt;div class=&quot;textbook-objectives&quot;&gt;

  &lt;p&gt;&lt;strong&gt;Learning objectives.&lt;/strong&gt; After this lesson you can:&lt;/p&gt;

  &lt;ul&gt;
    &lt;li&gt;compute $\iint_Sf\,dS$ with a parametrisation of the surface;&lt;/li&gt;
    &lt;li&gt;use symmetry to simplify integrals over spheres;&lt;/li&gt;
    &lt;li&gt;compute the mass, centre of mass and moment of inertia of thin shells.&lt;/li&gt;
  &lt;/ul&gt;

&lt;/div&gt;

&lt;h2 id=&quot;why-this-lesson&quot;&gt;Why this lesson&lt;/h2&gt;

&lt;p&gt;The arc-length line integral (lesson 14_02) adds up a quantity along a wire. The scalar surface integral does the same on a thin shell: the mass of an eggshell of varying thickness, the charge on the surface of a conductor, the average temperature over the Earth’s surface.&lt;/p&gt;

&lt;h2 id=&quot;definition&quot;&gt;Definition&lt;/h2&gt;

&lt;div class=&quot;textbook-definition&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Definition.&lt;/strong&gt; Let $S$ be a smooth surface parametrised by $r:D\to\mathbb R^3$ and $f$ continuous on $S$:&lt;/p&gt;

\[\iint_Sf\,dS=\iint_Df(r(u,v))\,\lVert r_u\times r_v\rVert\,du\,dv.\]

&lt;/div&gt;

&lt;p&gt;With $f=1$ we get the area (lesson 15_01). As with arc-length integrals, the value does not depend on the parametrisation: under a change of parameters $(u,v)=\Phi(s,t)$, $r_s\times r_t=(r_u\times r_v)\det J_\Phi$, and the change-of-variables formula (lesson 13_03) absorbs $\lvert\det J_\Phi\rvert$.&lt;/p&gt;

&lt;p&gt;Two common cases: on a sphere, $dS=R^2\sin\varphi\,d\varphi\,d\theta$; on a graph $z=g(x,y)$, $dS=\sqrt{1+g_x^2+g_y^2}\,dA$.&lt;/p&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Example 1 (Symmetry).&lt;/strong&gt; $\iint_Sz^2\,dS$ over the unit sphere. By symmetry $\iint x^2=\iint y^2=\iint z^2$, and their sum is $\iint1\,dS=4\pi$ (since $x^2+y^2+z^2=1$ on $S$). So $\iint_Sz^2\,dS=\tfrac{4\pi}3$, with no integration.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Example 2.&lt;/strong&gt; $\iint_Sz\,dS$ over the upper hemisphere $z\ge0$ of radius $R$:&lt;/p&gt;

\[\int_0^{2\pi}\int_0^{\pi/2}R\cos\varphi\cdot R^2\sin\varphi\,d\varphi\,d\theta=2\pi R^3\cdot\frac12=\pi R^3.\]

  &lt;p&gt;Dividing by the area $2\pi R^2$: the centre of mass of a hemispherical shell is at height $\bar z=R/2$, exactly halfway (a consequence of Archimedes’ theorem, lesson 15_01). For the solid hemisphere, $\bar z=\tfrac38R$.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Example 3 (A graph).&lt;/strong&gt; $\iint_Sy\,dS$, where $S$ is $z=x+y^2$, $0\le x\le1$, $0\le y\le2$. $dS=\sqrt{1+1+4y^2}\,dA$:&lt;/p&gt;

\[\int_0^1\int_0^2y\sqrt{2+4y^2}\,dy\,dx=\Big[\frac{(2+4y^2)^{3/2}}{12}\Big]_0^2=\frac{18^{3/2}-2^{3/2}}{12}=\frac{13\sqrt2}3\approx6.13.\]

&lt;/div&gt;

&lt;h2 id=&quot;applications&quot;&gt;Applications&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;The moment of inertia of a spherical shell.&lt;/strong&gt; A thin uniform shell of radius $R$ and mass $M$: by example 1 (scaled by $R$), $\iint(x^2+y^2)\,dS=\tfrac23\iint(x^2+y^2+z^2)\,dS=\tfrac23R^2\cdot4\pi R^2$. Multiplying by the density $\tfrac M{4\pi R^2}$: $I_z=\tfrac23MR^2$, matching lesson 13_05 (exercise 6). A hollow ball is harder to spin than a solid ball of the same mass ($\tfrac25MR^2$).&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Average temperature.&lt;/strong&gt; The average of $f$ over $S$ is $\tfrac1{A(S)}\iint_Sf\,dS$. A simple model of a planet’s surface temperature is $T=T_0-T_1\cos^2\varphi$ with $T_1&amp;gt;0$ ($T_0$ at the equator $\varphi=\pi/2$, colder by $T_1$ at the poles); by example 1 the average is $T_0-\tfrac13T_1$, closer to the equatorial temperature than to the polar one. The average is by area, not by latitude; the region near the equator has more area.&lt;/p&gt;

&lt;h2 id=&quot;exercises&quot;&gt;Exercises&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Basic.&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;$\iint_S(x^2+y^2)\,dS$ over the unit sphere.&lt;/li&gt;
  &lt;li&gt;$\iint_Sz\,dS$ over the cylinder $x^2+y^2=1$, $0\le z\le2$.&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Answers&lt;/summary&gt;

  &lt;ol&gt;
    &lt;li&gt;$\tfrac23\cdot4\pi=\tfrac{8\pi}3$.&lt;/li&gt;
    &lt;li&gt;$dS=d\theta\,dz$: $2\pi\int_0^2z\,dz=4\pi$.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;p&gt;&lt;strong&gt;Intermediate.&lt;/strong&gt;&lt;/p&gt;

&lt;ol start=&quot;3&quot;&gt;
  &lt;li&gt;$\iint_Sz^2\,dS$ over the upper hemisphere of radius $R$.&lt;/li&gt;
  &lt;li&gt;$\iint_Sxyz\,dS$ over the unit sphere. Explain without computing.&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Answers&lt;/summary&gt;

  &lt;ol start=&quot;3&quot;&gt;
    &lt;li&gt;$\int_0^{2\pi}\int_0^{\pi/2}R^2\cos^2\varphi\,R^2\sin\varphi\,d\varphi\,d\theta=\tfrac{2\pi R^4}3$.&lt;/li&gt;
    &lt;li&gt;It is 0: $x\to-x$ maps the sphere to itself but changes the sign of the integrand.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;p&gt;&lt;strong&gt;Advanced.&lt;/strong&gt;&lt;/p&gt;

&lt;ol start=&quot;5&quot;&gt;
  &lt;li&gt;Compute $\iint_S\dfrac{dS}{\lVert X-P\rVert}$, where $S$ is the unit sphere and $P=(0,0,d)$ with $d&amp;gt;1$. (This is the gravitational potential of a shell at an outside point.)&lt;/li&gt;
  &lt;li&gt;Show that the centre of mass of a hemispherical shell is at $R/2$ using the zone theorem (lesson 15_01), without integrating $z$.&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Hints&lt;/summary&gt;

  &lt;ol start=&quot;5&quot;&gt;
    &lt;li&gt;$\lVert X-P\rVert^2=1+d^2-2d\cos\varphi$. With $w=\cos\varphi$: $2\pi\int_{-1}^1\tfrac{dw}{\sqrt{1+d^2-2dw}}=\tfrac{2\pi}{d}\big[(d+1)-(d-1)\big]=\tfrac{4\pi}d$: as if the whole mass $4\pi$ were concentrated at the centre (Newton).&lt;/li&gt;
    &lt;li&gt;Area is spread uniformly in $z$ over $[0,R]$ (each slice of thickness $dz$ has area $2\pi R\,dz$), so the average of $z$ is $R/2$.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;h2 id=&quot;summary&quot;&gt;Summary&lt;/h2&gt;

&lt;div class=&quot;content-box summary-box textbook-block&quot;&gt;
  &lt;ul&gt;
    &lt;li&gt;$\iint_Sf\,dS=\iint_Df(r)\lVert r_u\times r_v\rVert\,du\,dv$, independent of the parametrisation.&lt;/li&gt;
    &lt;li&gt;Sphere: $dS=R^2\sin\varphi\,d\varphi\,d\theta$; graph: $dS=\sqrt{1+g_x^2+g_y^2}\,dA$.&lt;/li&gt;
    &lt;li&gt;Symmetry helps: $\iint x^2=\iint y^2=\iint z^2$ over a sphere.&lt;/li&gt;
    &lt;li&gt;A hemispherical shell has $\bar z=R/2$; a spherical shell has $I=\tfrac23MR^2$.&lt;/li&gt;
  &lt;/ul&gt;
&lt;/div&gt;
</content>
 </entry>
 
 <entry>
   <title>Parametric surfaces and surface area</title>
   <link href="https://calculus-self-learning.pages.dev/contents/en/chapter15/15_01_Parametric_surfaces_and_surface_area/"/>
   <updated>2026-12-01T00:00:00+00:00</updated>
   <id>https://calculus-self-learning.pages.dev/contents/en/chapter15/15_01_Parametric_surfaces_and_surface_area</id>
   <content type="html">&lt;div class=&quot;textbook-objectives&quot;&gt;

  &lt;p&gt;&lt;strong&gt;Learning objectives.&lt;/strong&gt; After this lesson you can:&lt;/p&gt;

  &lt;ul&gt;
    &lt;li&gt;parametrise spheres, cylinders, cones, graphs $z=g(x,y)$ and tori;&lt;/li&gt;
    &lt;li&gt;compute the normal vector $r_u\times r_v$ and the tangent plane;&lt;/li&gt;
    &lt;li&gt;compute surface area with $\iint\lVert r_u\times r_v\rVert\,du\,dv$.&lt;/li&gt;
  &lt;/ul&gt;

&lt;/div&gt;

&lt;h2 id=&quot;why-this-lesson&quot;&gt;Why this lesson&lt;/h2&gt;

&lt;p&gt;Chapter 14 integrated along curves (one parameter). To compute the flux of fluid through a net, the charge on a spherical shell or the heat escaping through the wall of a pot, we need integrals over &lt;strong&gt;surfaces&lt;/strong&gt; (two parameters). The first step is to describe a surface and measure its area.&lt;/p&gt;

&lt;h2 id=&quot;parametric-surfaces&quot;&gt;Parametric surfaces&lt;/h2&gt;

&lt;div class=&quot;textbook-definition&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Definition.&lt;/strong&gt; A &lt;strong&gt;parametric surface&lt;/strong&gt; is the image of a function $r(u,v)=(x(u,v),y(u,v),z(u,v))$ for $(u,v)$ in a region $D\subset\mathbb R^2$. The vectors $r_u=\partial r/\partial u$ and $r_v=\partial r/\partial v$ are tangent to the surface; if $r_u\times r_v\ne0$, the surface is &lt;strong&gt;smooth&lt;/strong&gt; there and $r_u\times r_v$ is a &lt;strong&gt;normal vector&lt;/strong&gt;.&lt;/p&gt;
&lt;/div&gt;

&lt;ul&gt;
  &lt;li&gt;The sphere of radius $R$: $r(\varphi,\theta)=(R\sin\varphi\cos\theta,\,R\sin\varphi\sin\theta,\,R\cos\varphi)$, $0\le\varphi\le\pi$, $0\le\theta\le2\pi$.&lt;/li&gt;
  &lt;li&gt;The cylinder: $r(\theta,z)=(R\cos\theta,R\sin\theta,z)$.&lt;/li&gt;
  &lt;li&gt;The graph $z=g(x,y)$: $r(x,y)=(x,y,g(x,y))$.&lt;/li&gt;
  &lt;li&gt;The torus: $r(u,v)=\big((a+b\cos v)\cos u,\,(a+b\cos v)\sin u,\,b\sin v\big)$, $0&amp;lt;b&amp;lt;a$.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2 id=&quot;surface-area&quot;&gt;Surface area&lt;/h2&gt;

&lt;div class=&quot;textbook-theorem&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Theorem 1.&lt;/strong&gt; The area of a smooth surface $S$ parametrised one-to-one by $r:D\to\mathbb R^3$ is&lt;/p&gt;

\[A(S)=\iint_D\lVert r_u\times r_v\rVert\,du\,dv.\]

  &lt;p&gt;For a graph $z=g(x,y)$: $A(S)=\iint_D\sqrt{1+g_x^2+g_y^2}\,dA$.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-proof&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Reason.&lt;/strong&gt; As in lesson 13_03, a small cell $[u,u+\Delta u]\times[v,v+\Delta v]$ has an image close to the parallelogram with sides $r_u\Delta u$ and $r_v\Delta v$, of area $\lVert r_u\times r_v\rVert\Delta u\Delta v$. Adding up and refining the grid gives the integral (this is the definition of surface area; one proves it does not depend on the parametrisation, using the change-of-variables formula). For a graph, $r_x=(1,0,g_x)$, $r_y=(0,1,g_y)$, so $r_x\times r_y=(-g_x,-g_y,1)$ has length $\sqrt{1+g_x^2+g_y^2}$.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Example 1 (The sphere).&lt;/strong&gt; $r_\varphi=(R\cos\varphi\cos\theta,R\cos\varphi\sin\theta,-R\sin\varphi)$, $r_\theta=(-R\sin\varphi\sin\theta,R\sin\varphi\cos\theta,0)$. A computation gives $r_\varphi\times r_\theta=R\sin\varphi\cdot r$, of length $R^2\sin\varphi$. So&lt;/p&gt;

\[A=\int_0^{2\pi}\int_0^\pi R^2\sin\varphi\,d\varphi\,d\theta=4\pi R^2.\]

  &lt;p&gt;The normal is parallel to $r$: it points away from the centre, as geometry predicts.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Example 2 (A paraboloid).&lt;/strong&gt; The part of $z=x^2+y^2$ with $z\le1$: $\sqrt{1+4x^2+4y^2}$ over the unit disc, in polar coordinates&lt;/p&gt;

\[A=\int_0^{2\pi}\int_0^1\sqrt{1+4r^2}\,r\,dr\,d\theta=\frac\pi6\big(5\sqrt5-1\big)\approx5.33.\]

&lt;/div&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Example 3 (The torus).&lt;/strong&gt; One finds $\lVert r_u\times r_v\rVert=b(a+b\cos v)$, so $A=\int_0^{2\pi}\int_0^{2\pi}b(a+b\cos v)\,du\,dv=4\pi^2ab$: the circumference $2\pi b$ of the small circle times the distance $2\pi a$ travelled by its centre (Pappus’s theorem).&lt;/p&gt;
&lt;/div&gt;

&lt;h2 id=&quot;application-archimedes-theorem-and-maps&quot;&gt;Application: Archimedes’ theorem and maps&lt;/h2&gt;

&lt;p&gt;The part of a sphere of radius $R$ between two parallel planes a distance $h$ apart (a &lt;strong&gt;spherical zone&lt;/strong&gt;, corresponding to $\varphi_1\le\varphi\le\varphi_2$) has area&lt;/p&gt;

\[\int_0^{2\pi}\int_{\varphi_1}^{\varphi_2}R^2\sin\varphi\,d\varphi\,d\theta=2\pi R^2(\cos\varphi_1-\cos\varphi_2)=2\pi Rh,\]

&lt;p&gt;depending only on $h$, not on where the zone is. This is also the area of the enclosing cylinder of the same height. Archimedes was proudest of this result. Consequence: projecting the sphere horizontally onto the tangent cylinder (Lambert’s cylindrical equal-area projection) preserves area, although it distorts shapes near the poles.&lt;/p&gt;

&lt;h2 id=&quot;exercises&quot;&gt;Exercises&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Basic.&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;The area of the part of the plane $z=2x+y$ above the square $[0,1]^2$.&lt;/li&gt;
  &lt;li&gt;The area of a cylinder of radius $R$ and height $h$ (without its ends).&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Answers&lt;/summary&gt;

  &lt;ol&gt;
    &lt;li&gt;$\sqrt{1+4+1}=\sqrt6$.&lt;/li&gt;
    &lt;li&gt;$\lVert r_\theta\times r_z\rVert=R$: $2\pi Rh$.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;p&gt;&lt;strong&gt;Intermediate.&lt;/strong&gt;&lt;/p&gt;

&lt;ol start=&quot;3&quot;&gt;
  &lt;li&gt;The area of the part of the sphere of radius 2 above the plane $z=1$.&lt;/li&gt;
  &lt;li&gt;The area of the cone $z=\sqrt{x^2+y^2}$, $0\le z\le1$.&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Answers&lt;/summary&gt;

  &lt;ol start=&quot;3&quot;&gt;
    &lt;li&gt;A zone with $h=1$: $2\pi\cdot2\cdot1=4\pi$.&lt;/li&gt;
    &lt;li&gt;$\sqrt{1+g_x^2+g_y^2}=\sqrt2$ over the unit disc: $\sqrt2\pi$.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;p&gt;&lt;strong&gt;Advanced.&lt;/strong&gt;&lt;/p&gt;

&lt;ol start=&quot;5&quot;&gt;
  &lt;li&gt;With $E=r_u\cdot r_u$, $F=r_u\cdot r_v$, $G=r_v\cdot r_v$, show that $\lVert r_u\times r_v\rVert^2=EG-F^2$.&lt;/li&gt;
  &lt;li&gt;Show that the tangent plane of a parametric surface at $r(u_0,v_0)$ is $(X-r(u_0,v_0))\cdot(r_u\times r_v)=0$, and check it for example 1.&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Hints&lt;/summary&gt;

  &lt;ol start=&quot;5&quot;&gt;
    &lt;li&gt;Lagrange’s identity: $\lVert a\times b\rVert^2=\lVert a\rVert^2\lVert b\rVert^2-(a\cdot b)^2$ (lesson 09_01: $\lVert a\times b\rVert=\lVert a\rVert\lVert b\rVert\sin\theta$).&lt;/li&gt;
    &lt;li&gt;The curves $u\mapsto r(u,v_0)$ and $v\mapsto r(u_0,v)$ have tangents $r_u$, $r_v$ lying in the tangent plane, so the normal is their cross product. For the sphere, the tangent plane is perpendicular to the radius.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;h2 id=&quot;summary&quot;&gt;Summary&lt;/h2&gt;

&lt;div class=&quot;content-box summary-box textbook-block&quot;&gt;
  &lt;ul&gt;
    &lt;li&gt;A parametric surface $r(u,v)$; $r_u$, $r_v$ are tangent and $r_u\times r_v$ is normal.&lt;/li&gt;
    &lt;li&gt;Area $\iint\lVert r_u\times r_v\rVert\,du\,dv$; for a graph $\iint\sqrt{1+g_x^2+g_y^2}\,dA$.&lt;/li&gt;
    &lt;li&gt;The sphere: $dS=R^2\sin\varphi\,d\varphi\,d\theta$, area $4\pi R^2$.&lt;/li&gt;
    &lt;li&gt;A spherical zone of height $h$ has area $2\pi Rh$ (Archimedes).&lt;/li&gt;
  &lt;/ul&gt;
&lt;/div&gt;
</content>
 </entry>
 
 <entry>
   <title>Green's theorem</title>
   <link href="https://calculus-self-learning.pages.dev/contents/en/chapter14/14_05_Greens_theorem/"/>
   <updated>2026-12-01T00:00:00+00:00</updated>
   <id>https://calculus-self-learning.pages.dev/contents/en/chapter14/14_05_Greens_theorem</id>
   <content type="html">&lt;div class=&quot;textbook-objectives&quot;&gt;

  &lt;p&gt;&lt;strong&gt;Learning objectives.&lt;/strong&gt; After this lesson you can:&lt;/p&gt;

  &lt;ul&gt;
    &lt;li&gt;state and prove Green’s theorem for regions that are both type I and type II;&lt;/li&gt;
    &lt;li&gt;turn a line integral around a closed curve into a double integral, and back;&lt;/li&gt;
    &lt;li&gt;compute areas with $\tfrac12\oint x\,dy-y\,dx$ and the shoelace formula;&lt;/li&gt;
    &lt;li&gt;apply the theorem to regions with holes.&lt;/li&gt;
  &lt;/ul&gt;

&lt;/div&gt;

&lt;h2 id=&quot;why-this-lesson&quot;&gt;Why this lesson&lt;/h2&gt;

&lt;p&gt;Lesson 14_01 showed that the curl is the circulation per unit area of a small cell. Add up all the small cells in a region: the circulation along shared edges cancels (each edge is traversed twice in opposite directions), leaving only the outer boundary. That is Green’s theorem, the two-dimensional version of the fundamental theorem of calculus.&lt;/p&gt;

&lt;h2 id=&quot;the-theorem&quot;&gt;The theorem&lt;/h2&gt;

&lt;p&gt;A closed curve $C$ bounding a region $D$ is &lt;strong&gt;positively oriented&lt;/strong&gt; if $D$ lies on the left as we walk along $C$ (for a disc: counter-clockwise).&lt;/p&gt;

&lt;div class=&quot;textbook-theorem&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Theorem 1 (Green).&lt;/strong&gt; Let $D$ be a bounded region whose boundary $C$ is piecewise smooth and positively oriented, and let $P$, $Q$ have continuous partial derivatives on an open set containing $D$. Then&lt;/p&gt;

\[\oint_CP\,dx+Q\,dy=\iint_D(Q_x-P_y)\,dA.\]

&lt;/div&gt;

&lt;div class=&quot;textbook-proof&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Proof (regions both type I and type II).&lt;/strong&gt; We prove separately $\oint_CP\,dx=-\iint_DP_y\,dA$ and $\oint_CQ\,dy=\iint_DQ_x\,dA$.&lt;/p&gt;

  &lt;p&gt;Write $D=\lbrace a\le x\le b,\ g_1(x)\le y\le g_2(x)\rbrace$. By Fubini and the fundamental theorem of calculus,&lt;/p&gt;

\[\iint_DP_y\,dA=\int_a^b\big[P(x,g_2(x))-P(x,g_1(x))\big]dx.\]

  &lt;p&gt;The boundary consists of: the bottom $y=g_1(x)$ from $a$ to $b$, giving $\int_a^bP(x,g_1(x))\,dx$; the top traversed backwards from $b$ to $a$, giving $-\int_a^bP(x,g_2(x))\,dx$; and the vertical sides (if any), where $dx=0$. Adding up, $\oint_CP\,dx=-\iint_DP_y\,dA$.&lt;/p&gt;

  &lt;p&gt;Writing $D$ as type II and arguing the same way (now the right boundary goes up and the left one goes down) gives $\oint_CQ\,dy=\iint_DQ_x\,dA$. Add the two identities. More general regions are cut into such pieces; the integrals along the cuts are traversed twice in opposite directions and cancel.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;reel-video&quot;&gt;
  &lt;video controls=&quot;&quot; playsinline=&quot;&quot; preload=&quot;metadata&quot; src=&quot;/public/videos/reels/green-theorem-cancellation.mp4&quot;&gt;&lt;/video&gt;
  &lt;p class=&quot;reel-caption&quot;&gt;Green&apos;s theorem: cancellation of inner edges. A grid of small loops, where the shared edge of two neighbouring cells is traversed in opposite directions and cancels, leaving only the outer loop; a staircase grid approximates a disk; walking a circle with a curl paddle wheel, the ellipse area formula, a gradient field giving 0, a field with a hole, and the flux form (silent video, about 3 minutes 2 seconds).&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Example 1.&lt;/strong&gt; $\oint_Cx^4\,dx+xy\,dy$, where $C$ is the triangle $(0,0)\to(1,0)\to(0,1)\to(0,0)$. $Q_x-P_y=y$, so the integral is $\int_0^1\int_0^{1-x}y\,dy\,dx=\int_0^1\tfrac{(1-x)^2}2\,dx=\tfrac16$, shorter than computing three edges.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Example 2.&lt;/strong&gt; $\oint_C(3y-e^{\sin x})\,dx+(7x+\sqrt{y^4+1})\,dy$ on the circle $x^2+y^2=9$. A direct computation is hopeless, but $Q_x-P_y=7-3=4$, so the integral is $4\cdot9\pi=36\pi$.&lt;/p&gt;
&lt;/div&gt;

&lt;h2 id=&quot;area-as-a-line-integral&quot;&gt;Area as a line integral&lt;/h2&gt;

&lt;p&gt;Choose $P$, $Q$ with $Q_x-P_y=1$, for example $P=-\tfrac y2$, $Q=\tfrac x2$:&lt;/p&gt;

\[\text{Area of }D=\frac12\oint_Cx\,dy-y\,dx.\]

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Example 3.&lt;/strong&gt; The ellipse $x=a\cos t$, $y=b\sin t$: $x\,y&apos;-y\,x&apos;=ab\cos^2t+ab\sin^2t=ab$, so the area is $\tfrac12\int_0^{2\pi}ab\,dt=\pi ab$, matching lesson 13_03.&lt;/p&gt;
&lt;/div&gt;

&lt;p&gt;&lt;strong&gt;The shoelace formula.&lt;/strong&gt; For a polygon with vertices $(x_1,y_1),\dots,(x_n,y_n)$ in positive order, applying the formula above edge by edge gives&lt;/p&gt;

\[\text{Area}=\frac12\sum_{i=1}^n(x_iy_{i+1}-x_{i+1}y_i),\qquad(x_{n+1},y_{n+1})=(x_1,y_1).\]

&lt;p&gt;The rectangle $(0,0)$, $(4,0)$, $(4,3)$, $(0,3)$: $\tfrac12(0+12+12+0)=12$. This formula is used in computer graphics and geographic information systems (GIS) to compute the area of a land parcel from its vertex coordinates.&lt;/p&gt;

&lt;h2 id=&quot;regions-with-holes&quot;&gt;Regions with holes&lt;/h2&gt;

&lt;p&gt;If $D$ has a hole, its boundary consists of an outer curve (counter-clockwise) and an inner curve (clockwise), so that $D$ is always on the left; the theorem still holds (cut $D$ into regions without holes).&lt;/p&gt;

&lt;p&gt;For the field $F=\big(\tfrac{-y}{x^2+y^2},\tfrac{x}{x^2+y^2}\big)$ of lesson 14_04, $Q_x-P_y=0$ away from the origin. Let $C$ be any closed curve around the origin and $C_\varepsilon$ a small circle of radius $\varepsilon$. Applying Green on the region between them: $\oint_CF\cdot dr-\oint_{C_\varepsilon}F\cdot dr=0$, so $\oint_CF\cdot dr=2\pi$ for &lt;strong&gt;every&lt;/strong&gt; such curve. This is the basis of the “winding number” and of the residue theorem in complex analysis.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Consequence.&lt;/strong&gt; On a simply connected region (no holes), if $P_y=Q_x$, then every simple closed curve $C$ bounds a region $D$ inside that region, so $\oint_CF\cdot dr=\iint_D0\,dA=0$, and $F$ is conservative (lesson 14_04, theorem 2). (Self-intersecting closed curves are split into simple loops.)&lt;/p&gt;

&lt;h2 id=&quot;application-the-planimeter&quot;&gt;Application: the planimeter&lt;/h2&gt;

&lt;p&gt;A mechanical planimeter has a small wheel that rolls as the user traces the boundary of a shape on a map with a stylus. The mechanism is designed so that the number of turns of the wheel is proportional to $\oint x\,dy-y\,dx$ (or an equivalent integral), so by Green it gives the area directly, however complicated the boundary.&lt;/p&gt;

&lt;h2 id=&quot;exercises&quot;&gt;Exercises&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Basic.&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;$\oint_Cy^2\,dx+3xy\,dy$, where $C$ is the positively oriented boundary of the square $[0,1]^2$.&lt;/li&gt;
  &lt;li&gt;Use $\tfrac12\oint x\,dy-y\,dx$ to find the area of a disc of radius $r$.&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Answers&lt;/summary&gt;

  &lt;ol&gt;
    &lt;li&gt;$Q_x-P_y=3y-2y=y$: $\iint y\,dA=\tfrac12$.&lt;/li&gt;
    &lt;li&gt;$\tfrac12\int_0^{2\pi}r^2\,dt=\pi r^2$.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;p&gt;&lt;strong&gt;Intermediate.&lt;/strong&gt;&lt;/p&gt;

&lt;ol start=&quot;3&quot;&gt;
  &lt;li&gt;$\oint_C\dfrac{-y\,dx+x\,dy}{x^2+y^2}$ on the positively oriented ellipse $\tfrac{x^2}4+y^2=1$.&lt;/li&gt;
  &lt;li&gt;The area of the triangle $(0,0)$, $(3,0)$, $(1,2)$ by the shoelace formula.&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Answers&lt;/summary&gt;

  &lt;ol start=&quot;3&quot;&gt;
    &lt;li&gt;The ellipse goes around the origin, so the answer is $2\pi$.&lt;/li&gt;
    &lt;li&gt;$\tfrac12\big[(0\cdot0-3\cdot0)+(3\cdot2-1\cdot0)+(1\cdot0-0\cdot2)\big]=3$, matching base $3$ and height $2$.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;p&gt;&lt;strong&gt;Advanced.&lt;/strong&gt;&lt;/p&gt;

&lt;ol start=&quot;5&quot;&gt;
  &lt;li&gt;(Flux form.) With the outward normal $n$ of $C$, prove $\oint_CF\cdot n\,ds=\iint_D\operatorname{div}F\,dA$.&lt;/li&gt;
  &lt;li&gt;Derive the shoelace formula from $\tfrac12\oint x\,dy-y\,dx$ by computing it on a straight edge from $(x_i,y_i)$ to $(x_{i+1},y_{i+1})$.&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Hints&lt;/summary&gt;

  &lt;ol start=&quot;5&quot;&gt;
    &lt;li&gt;With $T=(x&apos;,y&apos;)/\lVert r&apos;\rVert$, the outward normal is $n=(y&apos;,-x&apos;)/\lVert r&apos;\rVert$. Then $F\cdot n\,ds=P\,dy-Q\,dx$; apply Green to the pair $(-Q,P)$: $\iint(P_x+Q_y)\,dA$.&lt;/li&gt;
    &lt;li&gt;On the edge $r=(x_i,y_i)+t(\Delta x,\Delta y)$: $x\,y&apos;-y\,x&apos;=x_i\Delta y-y_i\Delta x=x_iy_{i+1}-x_{i+1}y_i$, constant in $t$.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;h2 id=&quot;summary&quot;&gt;Summary&lt;/h2&gt;

&lt;div class=&quot;content-box summary-box textbook-block&quot;&gt;
  &lt;ul&gt;
    &lt;li&gt;Green: $\oint_CP\,dx+Q\,dy=\iint_D(Q_x-P_y)\,dA$ with a positively oriented boundary.&lt;/li&gt;
    &lt;li&gt;Meaning: a sum of small circulations; the inner edges cancel.&lt;/li&gt;
    &lt;li&gt;Area $=\tfrac12\oint x\,dy-y\,dx$; the shoelace formula for polygons.&lt;/li&gt;
    &lt;li&gt;Regions with holes: add the inner boundary; the swirling field gives $2\pi$ for every loop around the origin.&lt;/li&gt;
    &lt;li&gt;On simply connected regions, $P_y=Q_x$ implies conservative.&lt;/li&gt;
  &lt;/ul&gt;
&lt;/div&gt;
</content>
 </entry>
 
 <entry>
   <title>Conservative fields and potential functions</title>
   <link href="https://calculus-self-learning.pages.dev/contents/en/chapter14/14_04_Conservative_fields_and_potential_functions/"/>
   <updated>2026-12-01T00:00:00+00:00</updated>
   <id>https://calculus-self-learning.pages.dev/contents/en/chapter14/14_04_Conservative_fields_and_potential_functions</id>
   <content type="html">&lt;div class=&quot;textbook-objectives&quot;&gt;

  &lt;p&gt;&lt;strong&gt;Learning objectives.&lt;/strong&gt; After this lesson you can:&lt;/p&gt;

  &lt;ul&gt;
    &lt;li&gt;use the fundamental theorem $\int_C\nabla f\cdot dr=f(B)-f(A)$;&lt;/li&gt;
    &lt;li&gt;prove that a path-independent field has a potential;&lt;/li&gt;
    &lt;li&gt;check $P_y=Q_x$ and find a potential by integrating one variable at a time;&lt;/li&gt;
    &lt;li&gt;recognise the role of the domain (the counterexample of a field swirling around the origin).&lt;/li&gt;
  &lt;/ul&gt;

&lt;/div&gt;

&lt;h2 id=&quot;why-this-lesson&quot;&gt;Why this lesson&lt;/h2&gt;

&lt;p&gt;Example 3 of lesson 14_03 showed that the work of gravity depends only on the start and end points. Such fields are called conservative, and they have a “potential energy”. Recognising a conservative field reduces a line integral to a subtraction, and underlies the law of conservation of energy.&lt;/p&gt;

&lt;h2 id=&quot;the-fundamental-theorem&quot;&gt;The fundamental theorem&lt;/h2&gt;

&lt;div class=&quot;textbook-theorem&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Theorem 1.&lt;/strong&gt; If $f$ has continuous partial derivatives and $C$ is a piecewise smooth curve from $A$ to $B$, then&lt;/p&gt;

\[\int_C\nabla f\cdot dr=f(B)-f(A).\]

&lt;/div&gt;

&lt;div class=&quot;textbook-proof&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Proof.&lt;/strong&gt; By the chain rule, $\tfrac{d}{dt}f(r(t))=\nabla f(r(t))\cdot r&apos;(t)$. So $\int_a^b\nabla f(r(t))\cdot r&apos;(t)\,dt=f(r(b))-f(r(a))$ by the fundamental theorem of calculus. For a piecewise smooth path, add the pieces; the intermediate values cancel.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-definition&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Definition.&lt;/strong&gt; A field $F$ on an open connected region $D$ is &lt;strong&gt;conservative&lt;/strong&gt; if $F=\nabla f$ for some function $f$, called a &lt;strong&gt;potential function&lt;/strong&gt; (in physics the potential energy is usually $-f$).&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-theorem&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Theorem 2.&lt;/strong&gt; For $F$ continuous on an open connected region $D$, the following are equivalent:&lt;/p&gt;

  &lt;ol&gt;
    &lt;li&gt;$F$ is conservative;&lt;/li&gt;
    &lt;li&gt;$\int_CF\cdot dr$ depends only on the endpoints of $C$;&lt;/li&gt;
    &lt;li&gt;$\oint_CF\cdot dr=0$ for every closed curve $C$ in $D$.&lt;/li&gt;
  &lt;/ol&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-proof&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Proof.&lt;/strong&gt; (1)⇒(2) is theorem 1. (2)⇔(3): a closed curve consists of a path $C_1$ from $A$ to $B$ and a path $-C_2$ back; $\oint=\int_{C_1}-\int_{C_2}$, which is 0 exactly when the two integrals agree.&lt;/p&gt;

  &lt;p&gt;(2)⇒(1): fix $A\in D$ and let $f(X)=\int_A^XF\cdot dr$ along any path in $D$ (well defined by (2)). For $X=(x,y)$ and small $h$, go to $X$ and then along the horizontal segment to $(x+h,y)$ (inside $D$ because $D$ is open):&lt;/p&gt;

\[\frac{f(x+h,y)-f(x,y)}h=\frac1h\int_0^hP(x+s,y)\,ds\to P(x,y),\]

  &lt;p&gt;by the fundamental theorem of calculus and continuity of $P$. So $f_x=P$; with a vertical segment, $f_y=Q$.&lt;/p&gt;
&lt;/div&gt;

&lt;h2 id=&quot;the-curl-test&quot;&gt;The curl test&lt;/h2&gt;

&lt;p&gt;If $F=(P,Q)=\nabla f$ with $f$ having continuous second partial derivatives, then by Schwarz’s theorem $P_y=f_{xy}=f_{yx}=Q_x$. In space the condition is $\operatorname{curl}F=0$ (lesson 14_01). The condition is &lt;strong&gt;necessary&lt;/strong&gt;, but it is &lt;strong&gt;sufficient only on regions without holes&lt;/strong&gt; (simply connected); lesson 14_05 proves this with Green’s theorem.&lt;/p&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Example 1.&lt;/strong&gt; $F=(2xy+1,\ x^2+3y^2)$. $P_y=2x=Q_x$. Integrating $P$ in $x$: $f=x^2y+x+g(y)$; comparing $f_y=x^2+g&apos;(y)$ with $Q$: $g&apos;=3y^2$, $g=y^3$. So $f=x^2y+x+y^3$, and every integral from $(0,0)$ to $(1,2)$ equals $f(1,2)-f(0,0)=2+1+8=11$.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Example 2 (A counterexample).&lt;/strong&gt; $F=\Big(\dfrac{-y}{x^2+y^2},\dfrac{x}{x^2+y^2}\Big)$ on the plane without the origin. A direct computation gives $Q_x=P_y=\dfrac{y^2-x^2}{(x^2+y^2)^2}$. But on the unit circle $F=(-\sin t,\cos t)$ and $F\cdot r&apos;=1$, so $\oint F\cdot dr=2\pi\ne0$: $F$ is not conservative. Locally $F=\nabla\theta$ (the polar angle), but $\theta$ grows by $2\pi$ on each turn around the origin, so it is not single-valued on the whole region. The hole at the origin is to blame.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Example 3 (Escape velocity).&lt;/strong&gt; Gravity $F=-GMm\,\dfrac{r}{\lVert r\rVert^3}=\nabla\Big(\dfrac{GMm}{\lVert r\rVert}\Big)$. The work from the surface ($\lVert r\rVert=R$) to infinity is $0-\dfrac{GMm}R$. To escape, the initial kinetic energy must pay for it: $\tfrac12mv^2=\dfrac{GMm}R$, $v=\sqrt{2GM/R}$. With $GM=3.986\times10^{14}\,\text{m}^3/\text{s}^2$ and $R=6.371\times10^6$ m: $v\approx11.2$ km/s.&lt;/p&gt;
&lt;/div&gt;

&lt;h2 id=&quot;application-conservation-of-energy&quot;&gt;Application: conservation of energy&lt;/h2&gt;

&lt;p&gt;If $F=-\nabla V$ and $m\ddot r=F$, then $\tfrac{d}{dt}\big(\tfrac12m\lVert\dot r\rVert^2+V(r)\big)=m\dot r\cdot\ddot r+\nabla V\cdot\dot r=\dot r\cdot(F-F)=0$: kinetic plus potential energy is constant. In machine learning, the field $-\nabla L$ of continuous gradient descent (gradient flow) is conservative; $L$ strictly decreases along trajectories ($\tfrac{d}{dt}L=-\lVert\nabla L\rVert^2$), so trajectories cannot loop.&lt;/p&gt;

&lt;h2 id=&quot;exercises&quot;&gt;Exercises&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Basic.&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;Is $F=(3x^2y,\ x^3+2y)$ conservative? If so, find a potential.&lt;/li&gt;
  &lt;li&gt;Compute $\int_C e^x\cos y\,dx-e^x\sin y\,dy$ from $(0,0)$ to $(1,\pi)$.&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Answers&lt;/summary&gt;

  &lt;ol&gt;
    &lt;li&gt;$P_y=3x^2=Q_x$; $f=x^3y+y^2$.&lt;/li&gt;
    &lt;li&gt;$f=e^x\cos y$: $e\cdot(-1)-1=-e-1$.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;p&gt;&lt;strong&gt;Intermediate.&lt;/strong&gt;&lt;/p&gt;

&lt;ol start=&quot;3&quot;&gt;
  &lt;li&gt;$F=(yz,\ xz,\ xy+2z)$. Find a potential and the work from $(0,0,0)$ to $(1,1,2)$.&lt;/li&gt;
  &lt;li&gt;Is $F=(y,-x)$ conservative? Check in two ways.&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Answers&lt;/summary&gt;

  &lt;ol start=&quot;3&quot;&gt;
    &lt;li&gt;$f=xyz+z^2$; work $=2+4=6$.&lt;/li&gt;
    &lt;li&gt;No: $P_y=1\ne Q_x=-1$; and $\oint$ over the unit circle is $-2\pi$ (lesson 14_03, exercise 3).&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;p&gt;&lt;strong&gt;Advanced.&lt;/strong&gt;&lt;/p&gt;

&lt;ol start=&quot;5&quot;&gt;
  &lt;li&gt;On the half-plane $x&amp;gt;0$, show that the field of example 2 is conservative and find a potential.&lt;/li&gt;
  &lt;li&gt;Prove directly (without Green): if $P_y=Q_x$ on the whole plane, then $f(x,y)=\int_0^xP(s,0)\,ds+\int_0^yQ(x,t)\,dt$ is a potential.&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Hints&lt;/summary&gt;

  &lt;ol start=&quot;5&quot;&gt;
    &lt;li&gt;$f=\arctan(y/x)$: $f_x=\tfrac{-y}{x^2+y^2}$, $f_y=\tfrac{x}{x^2+y^2}$.&lt;/li&gt;
    &lt;li&gt;$f_y=Q$ immediately. $f_x=P(x,0)+\int_0^yQ_x(x,t)\,dt=P(x,0)+\int_0^yP_y(x,t)\,dt=P(x,y)$ (differentiating under the integral sign needs $Q_x$ continuous).&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;h2 id=&quot;summary&quot;&gt;Summary&lt;/h2&gt;

&lt;div class=&quot;content-box summary-box textbook-block&quot;&gt;
  &lt;ul&gt;
    &lt;li&gt;$\int_C\nabla f\cdot dr=f(B)-f(A)$.&lt;/li&gt;
    &lt;li&gt;Conservative ⇔ path independent ⇔ zero integral around every closed loop.&lt;/li&gt;
    &lt;li&gt;The necessary condition $P_y=Q_x$ ($\operatorname{curl}F=0$) is sufficient on regions without holes.&lt;/li&gt;
    &lt;li&gt;To find a potential: integrate $P$ in $x$, then adjust the function of $y$.&lt;/li&gt;
  &lt;/ul&gt;
&lt;/div&gt;
</content>
 </entry>
 
 <entry>
   <title>Line integrals of vector fields</title>
   <link href="https://calculus-self-learning.pages.dev/contents/en/chapter14/14_03_Line_integrals_of_vector_fields/"/>
   <updated>2026-12-01T00:00:00+00:00</updated>
   <id>https://calculus-self-learning.pages.dev/contents/en/chapter14/14_03_Line_integrals_of_vector_fields</id>
   <content type="html">&lt;div class=&quot;textbook-objectives&quot;&gt;

  &lt;p&gt;&lt;strong&gt;Learning objectives.&lt;/strong&gt; After this lesson you can:&lt;/p&gt;

  &lt;ul&gt;
    &lt;li&gt;compute the work $\int_CF\cdot dr$ of a force field along an oriented curve;&lt;/li&gt;
    &lt;li&gt;write the integral as $\int_CP\,dx+Q\,dy$ and relate it to the arc-length integral;&lt;/li&gt;
    &lt;li&gt;prove that reversing the path changes the sign;&lt;/li&gt;
    &lt;li&gt;recognise when the integral depends on the path.&lt;/li&gt;
  &lt;/ul&gt;

&lt;/div&gt;

&lt;h2 id=&quot;why-this-lesson&quot;&gt;Why this lesson&lt;/h2&gt;

&lt;p&gt;In school physics, work is force times distance. When the force varies with position and the path is curved, we add up the small pieces of work $F\cdot\Delta r$. Unlike the arc-length integral, &lt;strong&gt;direction&lt;/strong&gt; now matters: going with the wind and against it gives work of opposite signs.&lt;/p&gt;

&lt;h2 id=&quot;definition&quot;&gt;Definition&lt;/h2&gt;

&lt;div class=&quot;textbook-definition&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Definition.&lt;/strong&gt; Let $C$ be an oriented curve with parametrisation $r:[a,b]\to\mathbb R^n$ (from $r(a)$ to $r(b)$) and $F$ a continuous field. The &lt;strong&gt;line integral of $F$ along $C$&lt;/strong&gt; is&lt;/p&gt;

\[\int_CF\cdot dr=\int_a^bF(r(t))\cdot r&apos;(t)\,dt.\]

  &lt;p&gt;In the plane, with $F=(P,Q)$ and $r=(x(t),y(t))$, we write $\int_CP\,dx+Q\,dy=\int_a^b\big(P\,x&apos;(t)+Q\,y&apos;(t)\big)dt$.&lt;/p&gt;
&lt;/div&gt;

&lt;p&gt;With the unit tangent $T=r&apos;/\lVert r&apos;\rVert$, $F\cdot r&apos;\,dt=(F\cdot T)\lVert r&apos;\rVert\,dt$, so $\int_CF\cdot dr=\int_C(F\cdot T)\,ds$: the arc-length integral of the tangential component of the force.&lt;/p&gt;

&lt;div class=&quot;textbook-theorem&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Theorem 1.&lt;/strong&gt; Let $-C$ be $C$ traversed in the opposite direction. Then $\int_{-C}F\cdot dr=-\int_CF\cdot dr$. A reparametrisation preserving the direction does not change the value.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-proof&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Proof.&lt;/strong&gt; Parametrise $-C$ by $\tilde r(u)=r(a+b-u)$, $u\in[a,b]$, so $\tilde r&apos;(u)=-r&apos;(a+b-u)$. Substituting $t=a+b-u$:&lt;/p&gt;

\[\int_a^bF(\tilde r(u))\cdot\tilde r&apos;(u)\,du=-\int_a^bF(r(a+b-u))\cdot r&apos;(a+b-u)\,du=-\int_a^bF(r(t))\cdot r&apos;(t)\,dt.\]

  &lt;p&gt;For a reparametrisation $t=\varphi(u)$ with $\varphi&apos;&amp;gt;0$, the substitution of lesson 14_02 without the absolute value gives the same value.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;interactive-frame&quot;&gt;
  &lt;div class=&quot;interactive-frame-head&quot;&gt;
    &lt;div class=&quot;interactive-frame-title&quot;&gt;Work along a path&lt;/div&gt;
    &lt;div class=&quot;interactive-frame-desc&quot;&gt;Bend the path from A to B; compare conservative and non-conservative fields.&lt;/div&gt;
  &lt;/div&gt;
  &lt;iframe src=&quot;/interactives/chapter14/line-integral-work-en.html&quot; title=&quot;Work along a path&quot; loading=&quot;lazy&quot; style=&quot;height: 720px;&quot;&gt;&lt;/iframe&gt;
  &lt;div class=&quot;interactive-frame-foot&quot;&gt;
    &lt;a href=&quot;/interactives/chapter14/line-integral-work-en.html&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;Open the interactive in a new window&lt;/a&gt;
  &lt;/div&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Example 1 (Circulation).&lt;/strong&gt; $F=(-y,x)$ along the unit circle counter-clockwise, $r=(\cos t,\sin t)$: $F\cdot r&apos;=\sin^2t+\cos^2t=1$, so $\oint_CF\cdot dr=2\pi$. The force always points along the motion, so the work around the closed loop is positive.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Example 2 (Path dependence).&lt;/strong&gt; $F=(x^2,xy)$ from $(0,0)$ to $(1,1)$.&lt;/p&gt;

  &lt;ul&gt;
    &lt;li&gt;The segment $r=(t,t)$: $\int_0^1(t^2+t^2)\,dt=\tfrac23$.&lt;/li&gt;
    &lt;li&gt;The parabola $r=(t,t^2)$, $r&apos;=(1,2t)$: $\int_0^1(t^2+t\cdot t^2\cdot2t)\,dt=\tfrac13+\tfrac25=\tfrac{11}{15}$.&lt;/li&gt;
  &lt;/ul&gt;

  &lt;p&gt;Two paths with the same endpoints give different work. Lesson 14_04 tells us when this cannot happen.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Example 3 (Gravity).&lt;/strong&gt; $F=(0,0,-mg)$. For any path $r(t)$ from height $h_1$ to $h_2$: $F\cdot r&apos;=-mg\,z&apos;(t)$, so the work is $-mg(h_2-h_1)$, depending only on the end heights. Descending along a helix or falling straight down gives the same work.&lt;/p&gt;
&lt;/div&gt;

&lt;h2 id=&quot;applications&quot;&gt;Applications&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Non-conservative forces.&lt;/strong&gt; Friction always opposes the velocity with magnitude $\mu N$: $F\cdot T=-\mu N$, so the work is $-\mu N\cdot(\text{path length})$. A longer path costs more work, and the work around a closed loop is nonzero.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Circulation of a flow.&lt;/strong&gt; For a velocity field $v$, $\oint_Cv\cdot dr$ is the circulation around $C$. Nonzero circulation around an aircraft wing is the source of lift (the Kutta–Joukowski theorem).&lt;/p&gt;

&lt;h2 id=&quot;exercises&quot;&gt;Exercises&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Basic.&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;$\int_Cy\,dx+x\,dy$, where $C$ is the segment from $(0,0)$ to $(1,2)$.&lt;/li&gt;
  &lt;li&gt;$\oint_CF\cdot dr$ for $F=(x,y)$ on the unit circle.&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Answers&lt;/summary&gt;

  &lt;ol&gt;
    &lt;li&gt;$r=(t,2t)$: $\int_0^1(2t+2t)\,dt=2$.&lt;/li&gt;
    &lt;li&gt;$F\cdot r&apos;=-\cos t\sin t+\sin t\cos t=0$, so the integral is 0. A radial force is perpendicular to the motion.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;p&gt;&lt;strong&gt;Intermediate.&lt;/strong&gt;&lt;/p&gt;

&lt;ol start=&quot;3&quot;&gt;
  &lt;li&gt;$\oint_C(y\,dx-x\,dy)$ on the unit circle counter-clockwise.&lt;/li&gt;
  &lt;li&gt;$\int_Cy^2\,dx+x\,dy$ along $y=x^2$ from $(0,0)$ to $(1,1)$.&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Answers&lt;/summary&gt;

  &lt;ol start=&quot;3&quot;&gt;
    &lt;li&gt;$-\sin^2t-\cos^2t=-1$: total $-2\pi$.&lt;/li&gt;
    &lt;li&gt;$r=(t,t^2)$: $\int_0^1(t^4+2t^2)\,dt=\tfrac15+\tfrac23=\tfrac{13}{15}$.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;p&gt;&lt;strong&gt;Advanced.&lt;/strong&gt;&lt;/p&gt;

&lt;ol start=&quot;5&quot;&gt;
  &lt;li&gt;The spring force is $F=-k\,r$. Show that its work from $A$ to $B$ along any path is $-\tfrac k2\big(\lVert B\rVert^2-\lVert A\rVert^2\big)$.&lt;/li&gt;
  &lt;li&gt;Prove that $\big\lvert\int_CF\cdot dr\big\rvert\le M\cdot L$, where $M=\max_C\lVert F\rVert$ and $L$ is the length of $C$.&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Hints&lt;/summary&gt;

  &lt;ol start=&quot;5&quot;&gt;
    &lt;li&gt;$F\cdot r&apos;=-k\,r\cdot r&apos;=-\tfrac k2\tfrac{d}{dt}\lVert r\rVert^2$; integrate.&lt;/li&gt;
    &lt;li&gt;$\lvert F\cdot T\rvert\le\lVert F\rVert\le M$, so $\lvert\int(F\cdot T)\,ds\rvert\le\int M\,ds=ML$.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;h2 id=&quot;summary&quot;&gt;Summary&lt;/h2&gt;

&lt;div class=&quot;content-box summary-box textbook-block&quot;&gt;
  &lt;ul&gt;
    &lt;li&gt;$\int_CF\cdot dr=\int_a^bF(r(t))\cdot r&apos;(t)\,dt=\int_CP\,dx+Q\,dy=\int_C(F\cdot T)\,ds$.&lt;/li&gt;
    &lt;li&gt;Reversing the direction changes the sign; a direction-preserving reparametrisation does not.&lt;/li&gt;
    &lt;li&gt;In general the integral depends on the path; gravity and spring forces are exceptions.&lt;/li&gt;
    &lt;li&gt;The circulation $\oint v\cdot dr$ measures how a flow swirls along a loop.&lt;/li&gt;
  &lt;/ul&gt;
&lt;/div&gt;
</content>
 </entry>
 
 <entry>
   <title>Line integrals with respect to arc length</title>
   <link href="https://calculus-self-learning.pages.dev/contents/en/chapter14/14_02_Line_integrals_with_respect_to_arc_length/"/>
   <updated>2026-12-01T00:00:00+00:00</updated>
   <id>https://calculus-self-learning.pages.dev/contents/en/chapter14/14_02_Line_integrals_with_respect_to_arc_length</id>
   <content type="html">&lt;div class=&quot;textbook-objectives&quot;&gt;

  &lt;p&gt;&lt;strong&gt;Learning objectives.&lt;/strong&gt; After this lesson you can:&lt;/p&gt;

  &lt;ul&gt;
    &lt;li&gt;compute $\int_Cf\,ds$ using a parametrisation $r(t)$ of the curve;&lt;/li&gt;
    &lt;li&gt;prove that the result does not depend on the parametrisation;&lt;/li&gt;
    &lt;li&gt;compute the mass and centre of mass of a wire.&lt;/li&gt;
  &lt;/ul&gt;

&lt;/div&gt;

&lt;h2 id=&quot;why-this-lesson&quot;&gt;Why this lesson&lt;/h2&gt;

&lt;p&gt;A curved wire has varying density: what is its mass? We need to add up the density along the curve, with the “length element” $ds$ in place of $dx$. The line integral with respect to arc length is the along-a-curve version of the ordinary integral.&lt;/p&gt;

&lt;h2 id=&quot;definition&quot;&gt;Definition&lt;/h2&gt;

&lt;div class=&quot;textbook-definition&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Definition.&lt;/strong&gt; Let $C$ be a smooth curve with parametrisation $r:[a,b]\to\mathbb R^n$, $r&apos;(t)\ne0$, and $f$ continuous on $C$. The &lt;strong&gt;line integral with respect to arc length&lt;/strong&gt; is&lt;/p&gt;

\[\int_Cf\,ds=\int_a^bf(r(t))\,\lVert r&apos;(t)\rVert\,dt.\]

&lt;/div&gt;

&lt;p&gt;It is the limit of sums $\sum f(r(t_i^*))\,\Delta s_i$, where $\Delta s_i\approx\lVert r&apos;(t_i)\rVert\Delta t$ is the length of a small arc (lessons 06_02 and 09_03). With $f=1$ we get the length of $C$.&lt;/p&gt;

&lt;div class=&quot;textbook-theorem&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Theorem 1.&lt;/strong&gt; $\int_Cf\,ds$ does not depend on the parametrisation: if $t=\varphi(u)$ with $\varphi:[\alpha,\beta]\to[a,b]$ continuously differentiable, one-to-one and onto, $\varphi&apos;\ne0$, and $\tilde r(u)=r(\varphi(u))$, then both formulas give the same value (even if $\varphi$ reverses direction).&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-proof&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Proof.&lt;/strong&gt; $\tilde r&apos;(u)=r&apos;(\varphi(u))\varphi&apos;(u)$, so $\lVert\tilde r&apos;(u)\rVert=\lVert r&apos;(\varphi(u))\rVert\,\lvert\varphi&apos;(u)\rvert$. If $\varphi&apos;&amp;gt;0$, substitute $t=\varphi(u)$:&lt;/p&gt;

\[\int_\alpha^\beta f(\tilde r(u))\lVert\tilde r&apos;(u)\rVert\,du=\int_\alpha^\beta f(r(\varphi(u)))\lVert r&apos;(\varphi(u))\rVert\varphi&apos;(u)\,du=\int_a^bf(r(t))\lVert r&apos;(t)\rVert\,dt.\]

  &lt;p&gt;If $\varphi&apos;&amp;lt;0$, then $\varphi(\alpha)=b$ and $\varphi(\beta)=a$; the minus sign in $\lvert\varphi&apos;\rvert=-\varphi&apos;$ compensates for swapping the limits, and the result is the same.&lt;/p&gt;
&lt;/div&gt;

&lt;p&gt;So the arc-length integral &lt;strong&gt;does not depend on direction&lt;/strong&gt;: the mass of a wire is the same whichever end we start from.&lt;/p&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Example 1.&lt;/strong&gt; $\int_C(x^2+y^2)\,ds$ over the circle $C$ of radius 2. On $C$, $f=4$ and the length is $4\pi$, so the integral is $16\pi$. (With $r=(2\cos t,2\sin t)$, $\lVert r&apos;\rVert=2$: $\int_0^{2\pi}4\cdot2\,dt=16\pi$.)&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Example 2.&lt;/strong&gt; $\int_Cx\,ds$ over the parabola $y=x^2$, $0\le x\le1$. With $r=(t,t^2)$, $\lVert r&apos;\rVert=\sqrt{1+4t^2}$:&lt;/p&gt;

\[\int_0^1t\sqrt{1+4t^2}\,dt=\frac1{12}\big(5^{3/2}-1\big)\approx0.848.\]

&lt;/div&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Example 3 (A helix).&lt;/strong&gt; $r=(\cos t,\sin t,t)$, $0\le t\le2\pi$: $\lVert r&apos;\rVert=\sqrt2$. The length is $2\sqrt2\pi$, and $\int_Cz\,ds=\sqrt2\int_0^{2\pi}t\,dt=2\sqrt2\pi^2\approx27.9$.&lt;/p&gt;
&lt;/div&gt;

&lt;h2 id=&quot;application-wires&quot;&gt;Application: wires&lt;/h2&gt;

&lt;p&gt;A wire with density (mass per length) $\rho$ has mass $m=\int_C\rho\,ds$ and centre of mass $\bar x=\tfrac1m\int_Cx\rho\,ds$ (similarly $\bar y$, $\bar z$).&lt;/p&gt;

&lt;p&gt;A uniform semicircular wire of radius $R$, $r=(R\cos\theta,R\sin\theta)$, $0\le\theta\le\pi$: $m=\pi R\rho$, and&lt;/p&gt;

\[\bar y=\frac{1}{\pi R}\int_0^\pi R\sin\theta\cdot R\,d\theta=\frac{2R}\pi.\]

&lt;p&gt;Compared with the solid half-disc (lesson 13_06, $\bar y=\tfrac{4R}{3\pi}\approx0.42R$), the wire’s centre of mass is higher ($\approx0.64R$) because all its mass is at the rim.&lt;/p&gt;

&lt;h2 id=&quot;exercises&quot;&gt;Exercises&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Basic.&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;$\int_C(x+y)\,ds$, where $C$ is the segment from $(0,0)$ to $(1,1)$.&lt;/li&gt;
  &lt;li&gt;$\int_Cxy\,ds$, where $C$ is the segment from $(0,0)$ to $(2,1)$.&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Answers&lt;/summary&gt;

  &lt;ol&gt;
    &lt;li&gt;$r=(t,t)$, $\lVert r&apos;\rVert=\sqrt2$: $\int_0^12t\sqrt2\,dt=\sqrt2$.&lt;/li&gt;
    &lt;li&gt;$r=(2t,t)$, $\lVert r&apos;\rVert=\sqrt5$: $\int_0^12t^2\sqrt5\,dt=\tfrac{2\sqrt5}3$.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;p&gt;&lt;strong&gt;Intermediate.&lt;/strong&gt;&lt;/p&gt;

&lt;ol start=&quot;3&quot;&gt;
  &lt;li&gt;The mass of a wire along the quarter unit circle in the first quadrant with density $\rho=xy$.&lt;/li&gt;
  &lt;li&gt;Find the length of the curve $r=(t^2,\tfrac23t^3)$, $0\le t\le1$.&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Answers&lt;/summary&gt;

  &lt;ol start=&quot;3&quot;&gt;
    &lt;li&gt;$\int_0^{\pi/2}\cos\theta\sin\theta\,d\theta=\tfrac12$.&lt;/li&gt;
    &lt;li&gt;$\lVert r&apos;\rVert=\sqrt{4t^2+4t^4}=2t\sqrt{1+t^2}$; $\int_0^12t\sqrt{1+t^2}\,dt=\tfrac23(2\sqrt2-1)\approx1.219$.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;p&gt;&lt;strong&gt;Advanced.&lt;/strong&gt;&lt;/p&gt;

&lt;ol start=&quot;5&quot;&gt;
  &lt;li&gt;Show that if $C$ is parametrised by arc length ($\lVert r&apos;(s)\rVert=1$), then $\int_Cf\,ds=\int_0^Lf(r(s))\,ds$. Why is this the “natural” parametrisation?&lt;/li&gt;
  &lt;li&gt;Find the centre of mass of the uniform helical wire of example 3.&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Hints&lt;/summary&gt;

  &lt;ol start=&quot;5&quot;&gt;
    &lt;li&gt;Substitute $\lVert r&apos;\rVert=1$ into the definition. The parameter is the distance travelled itself, independent of the speed.&lt;/li&gt;
    &lt;li&gt;$m\propto2\sqrt2\pi$; $\int\cos t\,dt=\int\sin t\,dt=0$ over $[0,2\pi]$, so $\bar x=\bar y=0$; $\bar z=\tfrac{2\sqrt2\pi^2}{2\sqrt2\pi}=\pi$.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;h2 id=&quot;summary&quot;&gt;Summary&lt;/h2&gt;

&lt;div class=&quot;content-box summary-box textbook-block&quot;&gt;
  &lt;ul&gt;
    &lt;li&gt;$\int_Cf\,ds=\int_a^bf(r(t))\lVert r&apos;(t)\rVert\,dt$.&lt;/li&gt;
    &lt;li&gt;It does not depend on the parametrisation or the direction.&lt;/li&gt;
    &lt;li&gt;$f=1$ gives length; $f=\rho$ gives mass; $x\rho$ gives the centre of mass.&lt;/li&gt;
    &lt;li&gt;A semicircular wire has $\bar y=\tfrac{2R}\pi$.&lt;/li&gt;
  &lt;/ul&gt;
&lt;/div&gt;
</content>
 </entry>
 
 <entry>
   <title>Vector fields, divergence and curl</title>
   <link href="https://calculus-self-learning.pages.dev/contents/en/chapter14/14_01_Vector_fields_divergence_and_curl/"/>
   <updated>2026-12-01T00:00:00+00:00</updated>
   <id>https://calculus-self-learning.pages.dev/contents/en/chapter14/14_01_Vector_fields_divergence_and_curl</id>
   <content type="html">&lt;div class=&quot;textbook-objectives&quot;&gt;

  &lt;p&gt;&lt;strong&gt;Learning objectives.&lt;/strong&gt; After this lesson you can:&lt;/p&gt;

  &lt;ul&gt;
    &lt;li&gt;read a picture of a vector field and sketch a few of its arrows;&lt;/li&gt;
    &lt;li&gt;compute $\operatorname{div}F$ and $\operatorname{curl}F$;&lt;/li&gt;
    &lt;li&gt;explain div as a “source” and curl as a “swirl” through the flux and circulation of a small cell;&lt;/li&gt;
    &lt;li&gt;prove $\operatorname{curl}\nabla f=0$ and $\operatorname{div}\operatorname{curl}F=0$.&lt;/li&gt;
  &lt;/ul&gt;

&lt;/div&gt;

&lt;h2 id=&quot;why-this-lesson&quot;&gt;Why this lesson&lt;/h2&gt;

&lt;p&gt;Wind, water currents, gravity, electric fields: each point of space carries a vector. To know whether fluid is gushing out of or draining into a point, or whether a small paddle wheel placed in the flow would spin, we need two operations: divergence and curl. They are the basis of the theorems of Green, Stokes and Gauss (chapter 15).&lt;/p&gt;

&lt;h2 id=&quot;definitions&quot;&gt;Definitions&lt;/h2&gt;

&lt;div class=&quot;textbook-definition&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Definition.&lt;/strong&gt; A &lt;strong&gt;vector field&lt;/strong&gt; on a region $D\subset\mathbb R^3$ is a function $F=(P,Q,R):D\to\mathbb R^3$. When the partial derivatives exist,&lt;/p&gt;

\[\operatorname{div}F=\nabla\cdot F=P_x+Q_y+R_z,\qquad\operatorname{curl}F=\nabla\times F=(R_y-Q_z,\ P_z-R_x,\ Q_x-P_y).\]

  &lt;p&gt;In the plane, $F=(P,Q)$ has $\operatorname{div}F=P_x+Q_y$ and &lt;strong&gt;scalar curl&lt;/strong&gt; $Q_x-P_y$ (the $z$ component of the curl).&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;reel-video&quot;&gt;
  &lt;video controls=&quot;&quot; playsinline=&quot;&quot; preload=&quot;metadata&quot; src=&quot;/public/videos/reels/field-flow-div-curl.mp4&quot;&gt;&lt;/video&gt;
  &lt;p class=&quot;reel-caption&quot;&gt;Particles drift in three vector fields (rotation, source, shear); a small paddle wheel measures curl and a fluid loop measures div (silent video, about 2 minutes).&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;interactive-frame&quot;&gt;
  &lt;div class=&quot;interactive-frame-head&quot;&gt;
    &lt;div class=&quot;interactive-frame-title&quot;&gt;Vector fields, divergence and curl&lt;/div&gt;
    &lt;div class=&quot;interactive-frame-desc&quot;&gt;Release particles to see streamlines; drag the small circle to measure div and curl.&lt;/div&gt;
  &lt;/div&gt;
  &lt;iframe src=&quot;/interactives/chapter14/vector-field-en.html&quot; title=&quot;Vector fields, divergence and curl&quot; loading=&quot;lazy&quot; style=&quot;height: 720px;&quot;&gt;&lt;/iframe&gt;
  &lt;div class=&quot;interactive-frame-foot&quot;&gt;
    &lt;a href=&quot;/interactives/chapter14/vector-field-en.html&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;Open the interactive in a new window&lt;/a&gt;
  &lt;/div&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Example 1.&lt;/strong&gt; $F=(x,y)$: arrows point away from the origin and grow longer. $\operatorname{div}F=2$, curl $=0$: a uniform source with no swirl.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Example 2.&lt;/strong&gt; $F=(-y,x)$: arrows circle the origin counter-clockwise. $\operatorname{div}F=0$, curl $=1-(-1)=2$. This is the velocity of a rigid body rotating with angular speed $\omega=1$, and the curl equals $2\omega$.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Example 3.&lt;/strong&gt; $F=(xy,yz,zx)$: $\operatorname{div}F=y+z+x$ and $\operatorname{curl}F=(0-y,\ 0-z,\ 0-x)=(-y,-z,-x)$.&lt;/p&gt;
&lt;/div&gt;

&lt;h2 id=&quot;meaning-flux-and-circulation-through-a-small-cell&quot;&gt;Meaning: flux and circulation through a small cell&lt;/h2&gt;

&lt;p&gt;Take a small square of side $h$ centred at $(a,b)$ in the plane. The &lt;strong&gt;outward flux&lt;/strong&gt; through the right edge is about $P(a+\tfrac h2,b)\,h$, through the left edge $-P(a-\tfrac h2,b)\,h$; together about $P_x\,h^2$. The top and bottom edges give $Q_y\,h^2$. So&lt;/p&gt;

\[\frac{\text{outward flux}}{\text{area}}\to P_x+Q_y=\operatorname{div}F\quad(h\to0).\]

&lt;p&gt;Similarly the &lt;strong&gt;circulation&lt;/strong&gt; (the total tangential component along the boundary, counter-clockwise) is $\big[Q(a+\tfrac h2,b)-Q(a-\tfrac h2,b)\big]h-\big[P(a,b+\tfrac h2)-P(a,b-\tfrac h2)\big]h\approx(Q_x-P_y)h^2$. Positive div: a source; negative div: a sink; nonzero curl: a swirl. Lesson 14_05 turns these approximations into an identity (Green’s theorem).&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Illustration: curl as circulation on a small square&lt;/strong&gt;&lt;/p&gt;

&lt;div class=&quot;reel-video&quot;&gt;
  &lt;video controls=&quot;&quot; playsinline=&quot;&quot; preload=&quot;metadata&quot; src=&quot;/public/videos/reels/curl-circulation-square-en.mp4&quot;&gt;&lt;/video&gt;
  &lt;p class=&quot;reel-caption&quot;&gt;A glowing dot goes once around a small square, adding up the part of F along the path on each edge; as the square shrinks, the ratio circulation / area approaches $\operatorname{curl}F=\partial Q/\partial x-\partial P/\partial y$ (silent video, about 2 minutes 19 seconds).&lt;/p&gt;
&lt;/div&gt;

&lt;h2 id=&quot;two-identities&quot;&gt;Two identities&lt;/h2&gt;

&lt;div class=&quot;textbook-theorem&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Theorem 1.&lt;/strong&gt; If $f$ and the components of $F$ have continuous second partial derivatives, then&lt;/p&gt;

\[\operatorname{curl}(\nabla f)=0,\qquad\operatorname{div}(\operatorname{curl}F)=0.\]

&lt;/div&gt;

&lt;div class=&quot;textbook-proof&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Proof.&lt;/strong&gt; With $\nabla f=(f_x,f_y,f_z)$, the first component of the curl is $f_{zy}-f_{yz}=0$ by Schwarz’s theorem (lesson 10_05); the other two are similar. With $F=(P,Q,R)$:&lt;/p&gt;

\[\operatorname{div}\operatorname{curl}F=(R_y-Q_z)_x+(P_z-R_x)_y+(Q_x-P_y)_z=(R_{yx}-R_{xy})+(P_{zy}-P_{yz})+(Q_{xz}-Q_{zx})=0.\]

&lt;/div&gt;

&lt;p&gt;Consequence: a field with nonzero curl cannot be the gradient of any function. This is a quick test for conservative fields in lesson 14_04.&lt;/p&gt;

&lt;h2 id=&quot;applications&quot;&gt;Applications&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Physics: the gravitational field.&lt;/strong&gt; A mass $M$ at the origin creates the field $F=-GM\,\dfrac{r}{\lVert r\rVert^3}$. With $r=(x,y,z)$ and $\rho=\lVert r\rVert$: $\partial_x(x/\rho^3)=1/\rho^3-3x^2/\rho^5$; adding the three components gives $3/\rho^3-3\rho^2/\rho^5=0$. So $\operatorname{div}F=0$ everywhere except the origin: there is no “source” other than the mass. Chapter 15 shows that the flux through every closed surface around the origin equals $-4\pi GM$.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Fluids.&lt;/strong&gt; An incompressible fluid has a velocity field with $\operatorname{div}v=0$. The curl of the velocity is called the vorticity; for a rigid rotation $v=\omega\times r$, $\operatorname{curl}v=2\omega$.&lt;/p&gt;

&lt;h2 id=&quot;exercises&quot;&gt;Exercises&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Basic.&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;Find the divergence and scalar curl of $F=(x^2y,\,xy^2)$.&lt;/li&gt;
  &lt;li&gt;Find the divergence and curl of $F=(yz,xz,xy)$.&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Answers&lt;/summary&gt;

  &lt;ol&gt;
    &lt;li&gt;$\operatorname{div}F=2xy+2xy=4xy$; curl $=y^2-x^2$.&lt;/li&gt;
    &lt;li&gt;$\operatorname{div}F=0$, $\operatorname{curl}F=(x-x,\,y-y,\,z-z)=0$; in fact $F=\nabla(xyz)$.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;p&gt;&lt;strong&gt;Intermediate.&lt;/strong&gt;&lt;/p&gt;

&lt;ol start=&quot;3&quot;&gt;
  &lt;li&gt;Show that $\operatorname{div}(fF)=f\operatorname{div}F+\nabla f\cdot F$.&lt;/li&gt;
  &lt;li&gt;Find $a$ so that $F=(ax+y,\,x-3y)$ has zero divergence. Does the field then swirl?&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Answers&lt;/summary&gt;

  &lt;ol start=&quot;3&quot;&gt;
    &lt;li&gt;Apply the product rule to each term: $(fP)_x=f_xP+fP_x$, then add.&lt;/li&gt;
    &lt;li&gt;$a-3=0$, $a=3$. The curl is $1-1=0$: no swirl.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;p&gt;&lt;strong&gt;Advanced.&lt;/strong&gt;&lt;/p&gt;

&lt;ol start=&quot;5&quot;&gt;
  &lt;li&gt;Show that the $x$ component of $\operatorname{curl}(\operatorname{curl}F)$ equals $\partial_x(\operatorname{div}F)-\Delta P$, where $\Delta P=P_{xx}+P_{yy}+P_{zz}$.&lt;/li&gt;
  &lt;li&gt;With $\omega=(0,0,\omega)$ and $v=\omega\times r$, show that $\operatorname{curl}v=2\omega$ and $\operatorname{div}v=0$.&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Hints&lt;/summary&gt;

  &lt;ol start=&quot;5&quot;&gt;
    &lt;li&gt;The $x$ component is $(Q_x-P_y)_y-(P_z-R_x)_z=Q_{xy}+R_{xz}-P_{yy}-P_{zz}$; add and subtract $P_{xx}$.&lt;/li&gt;
    &lt;li&gt;$v=(-\omega y,\omega x,0)$; curl $=(0,0,\omega+\omega)$, div $=0$.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;h2 id=&quot;summary&quot;&gt;Summary&lt;/h2&gt;

&lt;div class=&quot;content-box summary-box textbook-block&quot;&gt;
  &lt;ul&gt;
    &lt;li&gt;$\operatorname{div}F=P_x+Q_y+R_z$ is the outward flux per unit area (volume): a source or a sink.&lt;/li&gt;
    &lt;li&gt;$\operatorname{curl}F=\nabla\times F$ is the circulation per unit area: the swirl.&lt;/li&gt;
    &lt;li&gt;$\operatorname{curl}\nabla f=0$, $\operatorname{div}\operatorname{curl}F=0$ (Schwarz’s theorem).&lt;/li&gt;
    &lt;li&gt;The gravitational field has zero div away from the mass; a rigid rotation has curl $2\omega$.&lt;/li&gt;
  &lt;/ul&gt;
&lt;/div&gt;
</content>
 </entry>
 
 <entry>
   <title>Applications of multiple integrals</title>
   <link href="https://calculus-self-learning.pages.dev/contents/en/chapter13/13_06_Applications_of_multiple_integrals/"/>
   <updated>2026-12-01T00:00:00+00:00</updated>
   <id>https://calculus-self-learning.pages.dev/contents/en/chapter13/13_06_Applications_of_multiple_integrals</id>
   <content type="html">&lt;div class=&quot;textbook-objectives&quot;&gt;

  &lt;p&gt;&lt;strong&gt;Learning objectives.&lt;/strong&gt; After this lesson you can:&lt;/p&gt;

  &lt;ul&gt;
    &lt;li&gt;compute the mass, centre of mass and moment of inertia of a lamina with varying density;&lt;/li&gt;
    &lt;li&gt;compute probabilities and expectations from a joint density;&lt;/li&gt;
    &lt;li&gt;prove $\int_0^\infty e^{-x^2}dx=\tfrac{\sqrt\pi}2$ and normalise the two-dimensional normal distribution.&lt;/li&gt;
  &lt;/ul&gt;

&lt;/div&gt;

&lt;h2 id=&quot;why-this-lesson&quot;&gt;Why this lesson&lt;/h2&gt;

&lt;p&gt;Multiple integrals are the common language of mechanics (mass, centre of mass, inertia) and probability (densities, expectations). This lesson also contains one of the most beautiful computations in calculus: the Gaussian integral, which has no elementary antiderivative but becomes easy in two dimensions.&lt;/p&gt;

&lt;h2 id=&quot;mass-and-centre-of-mass&quot;&gt;Mass and centre of mass&lt;/h2&gt;

&lt;p&gt;A lamina occupying $D$ with density $\rho(x,y)$ has&lt;/p&gt;

\[m=\iint_D\rho\,dA,\qquad\bar x=\frac1m\iint_Dx\rho\,dA,\qquad\bar y=\frac1m\iint_Dy\rho\,dA,\qquad I_0=\iint_D(x^2+y^2)\rho\,dA.\]

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Example 1.&lt;/strong&gt; The triangular lamina with vertices $(0,0)$, $(1,0)$, $(0,2)$ and density $\rho=1+3x+y$. The region is $0\le x\le1$, $0\le y\le2-2x$:&lt;/p&gt;

\[m=\int_0^1\int_0^{2-2x}(1+3x+y)\,dy\,dx=\frac83,\qquad\bar x=\frac38,\qquad\bar y=\frac{11}{16}.\]

  &lt;p&gt;(A Riemann-sum check on a $2000\times2000$ grid gives $2.6676$, $0.3750$, $0.6877$.) The geometric centroid of the triangle is $(\tfrac13,\tfrac23)$; the higher density at larger $x$, $y$ pulls the centre of mass that way.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Example 2.&lt;/strong&gt; A uniform half-disc $x^2+y^2\le R^2$, $y\ge0$: by symmetry $\bar x=0$, and&lt;/p&gt;

\[\bar y=\frac{1}{\pi R^2/2}\int_0^\pi\int_0^Rr\sin\theta\cdot r\,dr\,d\theta=\frac{2}{\pi R^2}\cdot\frac{R^3}3\cdot2=\frac{4R}{3\pi}.\]

&lt;/div&gt;

&lt;h2 id=&quot;probability-and-expectation&quot;&gt;Probability and expectation&lt;/h2&gt;

&lt;p&gt;If $(X,Y)$ has joint density $p\ge0$ with $\iint p\,dA=1$, then $P((X,Y)\in D)=\iint_Dp\,dA$ and $E[g(X,Y)]=\iint g\,p\,dA$.&lt;/p&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Example 3.&lt;/strong&gt; $p=4xy$ on $[0,1]^2$. Check: $\iint4xy\,dA=4\cdot\tfrac12\cdot\tfrac12=1$. $E[X]=\iint x\cdot4xy\,dA=4\cdot\tfrac13\cdot\tfrac12=\tfrac23$. $P(X+Y\le1)=\int_0^1\int_0^{1-x}4xy\,dy\,dx=\int_0^12x(1-x)^2\,dx=\tfrac16$.&lt;/p&gt;
&lt;/div&gt;

&lt;h2 id=&quot;the-gaussian-integral&quot;&gt;The Gaussian integral&lt;/h2&gt;

&lt;div class=&quot;textbook-theorem&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Theorem 1.&lt;/strong&gt; $\displaystyle\int_0^\infty e^{-x^2}dx=\frac{\sqrt\pi}2$, and hence $\displaystyle\int_{-\infty}^\infty e^{-x^2/2}dx=\sqrt{2\pi}$.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-proof&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Proof.&lt;/strong&gt; Let $I(R)=\int_0^Re^{-x^2}dx$; the improper integral converges (lesson 05_05), with limit $I$. By lesson 13_01 (separable functions), $I(R)^2=\iint_{S_R}e^{-(x^2+y^2)}dA$ with $S_R=[0,R]^2$. Let $Q_R$ be the quarter disc of radius $R$ in the first quadrant. Since $Q_R\subset S_R\subset Q_{R\sqrt2}$ and the integrand is positive,&lt;/p&gt;

\[\iint_{Q_R}e^{-(x^2+y^2)}dA\le I(R)^2\le\iint_{Q_{R\sqrt2}}e^{-(x^2+y^2)}dA.\]

  &lt;p&gt;In polar coordinates, $\iint_{Q_\rho}e^{-(x^2+y^2)}dA=\int_0^{\pi/2}\int_0^\rho e^{-r^2}r\,dr\,d\theta=\tfrac\pi4(1-e^{-\rho^2})$. Both outer sides tend to $\tfrac\pi4$ as $R\to\infty$, so $I^2=\tfrac\pi4$ and $I=\tfrac{\sqrt\pi}2$. The second formula follows by symmetry and the substitution $x=\sqrt2\,u$.&lt;/p&gt;
&lt;/div&gt;

&lt;p&gt;Consequences: $\Gamma(\tfrac12)=\sqrt\pi$ (lesson 05_06), and the two-dimensional standard normal density $p=\tfrac1{2\pi}e^{-(x^2+y^2)/2}$ has total probability $\tfrac1{2\pi}\int_0^{2\pi}\int_0^\infty e^{-r^2/2}r\,dr\,d\theta=1$.&lt;/p&gt;

&lt;h2 id=&quot;exercises&quot;&gt;Exercises&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Basic.&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;The lamina $[0,1]^2$ with density $x+y$. Find its mass and $\bar x$.&lt;/li&gt;
  &lt;li&gt;The centre of mass of a uniform quarter disc of radius $R$ in the first quadrant.&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Answers&lt;/summary&gt;

  &lt;ol&gt;
    &lt;li&gt;$m=1$, $\bar x=\tfrac13+\tfrac14=\tfrac7{12}$.&lt;/li&gt;
    &lt;li&gt;$\big(\tfrac{4R}{3\pi},\tfrac{4R}{3\pi}\big)$.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;p&gt;&lt;strong&gt;Intermediate.&lt;/strong&gt;&lt;/p&gt;

&lt;ol start=&quot;3&quot;&gt;
  &lt;li&gt;$p=ce^{-x-2y}$ for $x,y\ge0$. Find $c$ and $P(X&amp;gt;Y)$.&lt;/li&gt;
  &lt;li&gt;The moment of inertia about the centre of a uniform disc of radius $R$ and mass $M$.&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Answers&lt;/summary&gt;

  &lt;ol start=&quot;3&quot;&gt;
    &lt;li&gt;$\int e^{-x}\int e^{-2y}=\tfrac12$, so $c=2$. $P(X&amp;gt;Y)=\int_0^\infty e^{-x}(1-e^{-2x})\,dx=1-\tfrac13=\tfrac23$.&lt;/li&gt;
    &lt;li&gt;$\tfrac M{\pi R^2}\cdot2\pi\int_0^Rr^3dr=\tfrac12MR^2$.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;p&gt;&lt;strong&gt;Advanced.&lt;/strong&gt;&lt;/p&gt;

&lt;ol start=&quot;5&quot;&gt;
  &lt;li&gt;For $(X,Y)$ with the two-dimensional standard normal density, find $E[X^2+Y^2]$ and $P(X^2+Y^2\le r^2)$.&lt;/li&gt;
  &lt;li&gt;Use theorem 1 to compute $\int_{-\infty}^\infty x^2e^{-x^2}dx$.&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Hints&lt;/summary&gt;

  &lt;ol start=&quot;5&quot;&gt;
    &lt;li&gt;$E=\int_0^\infty r^2e^{-r^2/2}r\,dr=2$; $P=1-e^{-r^2/2}$.&lt;/li&gt;
    &lt;li&gt;By parts with $u=x$, $dv=xe^{-x^2}dx$: $\tfrac12\int e^{-x^2}dx=\tfrac{\sqrt\pi}2$.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;h2 id=&quot;summary&quot;&gt;Summary&lt;/h2&gt;

&lt;div class=&quot;content-box summary-box textbook-block&quot;&gt;
  &lt;ul&gt;
    &lt;li&gt;Mass $\iint\rho$, centre of mass $\tfrac1m\iint x\rho$, moment of inertia $\iint r^2\rho$.&lt;/li&gt;
    &lt;li&gt;Probabilities and expectations are integrals of the joint density.&lt;/li&gt;
    &lt;li&gt;The Gaussian integral: square it and use polar coordinates, $\int_0^\infty e^{-x^2}=\tfrac{\sqrt\pi}2$.&lt;/li&gt;
    &lt;li&gt;The two-dimensional normal distribution is normalised by the same computation.&lt;/li&gt;
  &lt;/ul&gt;
&lt;/div&gt;
</content>
 </entry>
 
 <entry>
   <title>Cylindrical and spherical coordinates</title>
   <link href="https://calculus-self-learning.pages.dev/contents/en/chapter13/13_05_Cylindrical_and_spherical_coordinates/"/>
   <updated>2026-12-01T00:00:00+00:00</updated>
   <id>https://calculus-self-learning.pages.dev/contents/en/chapter13/13_05_Cylindrical_and_spherical_coordinates</id>
   <content type="html">&lt;div class=&quot;textbook-objectives&quot;&gt;

  &lt;p&gt;&lt;strong&gt;Learning objectives.&lt;/strong&gt; After this lesson you can:&lt;/p&gt;

  &lt;ul&gt;
    &lt;li&gt;write $dV=r\,dr\,d\theta\,dz$ (cylindrical) and $dV=\rho^2\sin\varphi\,d\rho\,d\varphi\,d\theta$ (spherical), and prove the second;&lt;/li&gt;
    &lt;li&gt;choose coordinates that match the symmetry of a solid;&lt;/li&gt;
    &lt;li&gt;compute moments of inertia of symmetric bodies.&lt;/li&gt;
  &lt;/ul&gt;

&lt;/div&gt;

&lt;h2 id=&quot;why-this-lesson&quot;&gt;Why this lesson&lt;/h2&gt;

&lt;p&gt;Pipes, wheels, balls, cones: in $x,y,z$ their limits are messy, but in cylindrical or spherical coordinates (lesson 09_04) the limits are constants. The integrals become short, provided we remember the Jacobian factor.&lt;/p&gt;

&lt;h2 id=&quot;cylindrical-coordinates&quot;&gt;Cylindrical coordinates&lt;/h2&gt;

&lt;p&gt;$x=r\cos\theta$, $y=r\sin\theta$, $z=z$. The Jacobian is $r$ (polar coordinates, with $z$ unchanged), so&lt;/p&gt;

\[dV=r\,dr\,d\theta\,dz.\]

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Example 1.&lt;/strong&gt; $\iiint_E(x^2+y^2)\,dV$, where $E$ is the cylinder $r\le1$, $0\le z\le2$: $\int_0^2\int_0^{2\pi}\int_0^1r^2\cdot r\,dr\,d\theta\,dz=2\cdot2\pi\cdot\tfrac14=\pi$.&lt;/p&gt;
&lt;/div&gt;

&lt;h2 id=&quot;spherical-coordinates&quot;&gt;Spherical coordinates&lt;/h2&gt;

&lt;p&gt;$x=\rho\sin\varphi\cos\theta$, $y=\rho\sin\varphi\sin\theta$, $z=\rho\cos\varphi$, with $\rho\ge0$, $0\le\varphi\le\pi$, $0\le\theta&amp;lt;2\pi$.&lt;/p&gt;

&lt;div class=&quot;textbook-theorem&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Theorem 1.&lt;/strong&gt; $\dfrac{\partial(x,y,z)}{\partial(\rho,\varphi,\theta)}=\rho^2\sin\varphi$, so $dV=\rho^2\sin\varphi\,d\rho\,d\varphi\,d\theta$.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-proof&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Proof.&lt;/strong&gt; The Jacobian matrix is&lt;/p&gt;

\[\begin{pmatrix}\sin\varphi\cos\theta&amp;amp;\rho\cos\varphi\cos\theta&amp;amp;-\rho\sin\varphi\sin\theta\\\sin\varphi\sin\theta&amp;amp;\rho\cos\varphi\sin\theta&amp;amp;\rho\sin\varphi\cos\theta\\\cos\varphi&amp;amp;-\rho\sin\varphi&amp;amp;0\end{pmatrix}.\]

  &lt;p&gt;Expanding along the last row:&lt;/p&gt;

\[\cos\varphi\cdot\big(\rho^2\sin\varphi\cos\varphi\cos^2\theta+\rho^2\sin\varphi\cos\varphi\sin^2\theta\big)+\rho\sin\varphi\cdot\big(\rho\sin^2\varphi\cos^2\theta+\rho\sin^2\varphi\sin^2\theta\big)\]

\[=\rho^2\sin\varphi\cos^2\varphi+\rho^2\sin^3\varphi=\rho^2\sin\varphi.\]

  &lt;p&gt;Since $\sin\varphi\ge0$ on $[0,\pi]$, $\lvert J\rvert=\rho^2\sin\varphi$. Geometrically, a small cell has three mutually perpendicular edges $d\rho$, $\rho\,d\varphi$ and $\rho\sin\varphi\,d\theta$ (the radius of a circle of latitude is $\rho\sin\varphi$).&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Example 2.&lt;/strong&gt; The volume of a ball: $\int_0^{2\pi}\int_0^\pi\int_0^R\rho^2\sin\varphi\,d\rho\,d\varphi\,d\theta=2\pi\cdot2\cdot\tfrac{R^3}3=\tfrac43\pi R^3$, much shorter than in lesson 13_03.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Example 3 (An ice-cream cone).&lt;/strong&gt; The solid above the cone $z=\sqrt{x^2+y^2}$ (that is, $\varphi\le\pi/4$) and inside the sphere $\rho\le1$:&lt;/p&gt;

\[V=\int_0^{2\pi}\int_0^{\pi/4}\int_0^1\rho^2\sin\varphi\,d\rho\,d\varphi\,d\theta=2\pi\Big(1-\frac{\sqrt2}2\Big)\frac13=\frac{\pi(2-\sqrt2)}3\approx0.613.\]

&lt;/div&gt;

&lt;h2 id=&quot;application-moments-of-inertia-physics&quot;&gt;Application: moments of inertia (physics)&lt;/h2&gt;

&lt;p&gt;The moment of inertia about the $z$-axis is $I_z=\iiint_E(x^2+y^2)\,\rho_m\,dV$; it measures how hard the body is to spin.&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;strong&gt;A wheel&lt;/strong&gt; (solid cylinder of radius $R$, height $h$, mass $M$, uniform density $\tfrac M{\pi R^2h}$): $I_z=\tfrac M{\pi R^2h}\cdot2\pi h\int_0^Rr^3\,dr=\tfrac12MR^2$.&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;A solid ball&lt;/strong&gt; of radius $R$ and mass $M$: $x^2+y^2=\rho^2\sin^2\varphi$, so $\iiint(x^2+y^2)\,dV=\int_0^R\rho^4d\rho\int_0^\pi\sin^3\varphi\,d\varphi\int_0^{2\pi}d\theta=\tfrac{R^5}5\cdot\tfrac43\cdot2\pi$. Multiplying by the density $\tfrac{3M}{4\pi R^3}$: $I_z=\tfrac25MR^2$.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The ball has a smaller $I$ than a wheel of the same mass and radius, so it rolls down a slope faster.&lt;/p&gt;

&lt;h2 id=&quot;exercises&quot;&gt;Exercises&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Basic.&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;The volume of the cylinder $r\le2$, $0\le z\le3$ in cylindrical coordinates.&lt;/li&gt;
  &lt;li&gt;$\iiint_{\rho\le1}(x^2+y^2+z^2)\,dV$.&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Answers&lt;/summary&gt;

  &lt;ol&gt;
    &lt;li&gt;$3\cdot2\pi\cdot2=12\pi$.&lt;/li&gt;
    &lt;li&gt;$\int\rho^4\sin\varphi=\tfrac15\cdot2\cdot2\pi=\tfrac{4\pi}5$.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;p&gt;&lt;strong&gt;Intermediate.&lt;/strong&gt;&lt;/p&gt;

&lt;ol start=&quot;3&quot;&gt;
  &lt;li&gt;The mass of a ball of radius 1 whose density equals the distance to the centre.&lt;/li&gt;
  &lt;li&gt;The volume of the part of the ball $x^2+y^2+z^2\le4$ outside the cylinder $x^2+y^2\le1$.&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Answers&lt;/summary&gt;

  &lt;ol start=&quot;3&quot;&gt;
    &lt;li&gt;$\int_0^1\rho^3d\rho\cdot2\cdot2\pi=\pi$.&lt;/li&gt;
    &lt;li&gt;The part inside the cylinder: $2\pi\int_0^12\sqrt{4-r^2}\,r\,dr=\tfrac{4\pi(8-3\sqrt3)}3$. Subtract from $\tfrac{32\pi}3$: $4\sqrt3\pi\approx21.77$.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;p&gt;&lt;strong&gt;Advanced.&lt;/strong&gt;&lt;/p&gt;

&lt;ol start=&quot;5&quot;&gt;
  &lt;li&gt;Compute $\iiint_{\rho\le R}\dfrac{dV}{\sqrt{x^2+y^2+z^2}}$. Why does it converge even though the integrand is unbounded at the centre?&lt;/li&gt;
  &lt;li&gt;Show that the moment of inertia of a thin spherical shell of radius $R$ and mass $M$ is $\tfrac23MR^2$ (differentiate $\iiint_{\rho\le R}(x^2+y^2)\,dV$ with respect to $R$).&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Hints&lt;/summary&gt;

  &lt;ol start=&quot;5&quot;&gt;
    &lt;li&gt;$\int_0^R\rho\,d\rho\cdot4\pi=2\pi R^2$. The factor $\rho^2$ in $dV$ cancels the singularity $1/\rho$.&lt;/li&gt;
    &lt;li&gt;$\tfrac{d}{dR}\tfrac{8\pi R^5}{15}=\tfrac{8\pi R^4}3$ is the integral over a shell of thickness $dR$; the shell’s mass is $4\pi R^2\,dR$ times the density. Dividing: $I=\tfrac{8\pi R^4/3}{4\pi R^2}M=\tfrac23MR^2$.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;h2 id=&quot;summary&quot;&gt;Summary&lt;/h2&gt;

&lt;div class=&quot;content-box summary-box textbook-block&quot;&gt;
  &lt;ul&gt;
    &lt;li&gt;Cylindrical coordinates: $dV=r\,dr\,d\theta\,dz$, for cylinders, pipes and solids of revolution.&lt;/li&gt;
    &lt;li&gt;Spherical coordinates: $dV=\rho^2\sin\varphi\,d\rho\,d\varphi\,d\theta$, for balls and cones.&lt;/li&gt;
    &lt;li&gt;Choose coordinates that make the limits constant.&lt;/li&gt;
    &lt;li&gt;Moments of inertia: a wheel $\tfrac12MR^2$, a solid ball $\tfrac25MR^2$.&lt;/li&gt;
  &lt;/ul&gt;
&lt;/div&gt;
</content>
 </entry>
 
 <entry>
   <title>Triple integrals</title>
   <link href="https://calculus-self-learning.pages.dev/contents/en/chapter13/13_04_Triple_integrals/"/>
   <updated>2026-12-01T00:00:00+00:00</updated>
   <id>https://calculus-self-learning.pages.dev/contents/en/chapter13/13_04_Triple_integrals</id>
   <content type="html">&lt;div class=&quot;textbook-objectives&quot;&gt;

  &lt;p&gt;&lt;strong&gt;Learning objectives.&lt;/strong&gt; After this lesson you can:&lt;/p&gt;

  &lt;ul&gt;
    &lt;li&gt;compute a triple integral over a box as three iterated integrals;&lt;/li&gt;
    &lt;li&gt;describe a solid $E=\lbrace(x,y)\in D,\ u_1(x,y)\le z\le u_2(x,y)\rbrace$ and read the limits from a sketch;&lt;/li&gt;
    &lt;li&gt;rewrite an iterated integral in a different order.&lt;/li&gt;
  &lt;/ul&gt;

&lt;/div&gt;

&lt;h2 id=&quot;why-this-lesson&quot;&gt;Why this lesson&lt;/h2&gt;

&lt;p&gt;The mass of an object with varying density, the charge in a region of space, the probability of three random variables: all are integrals over three-dimensional solids. The idea is exactly that of double integrals; the main difficulty is setting the limits.&lt;/p&gt;

&lt;h2 id=&quot;definition-and-fubinis-theorem&quot;&gt;Definition and Fubini’s theorem&lt;/h2&gt;

&lt;p&gt;The triple integral $\iiint_Ef\,dV$ is defined with Riemann sums over small boxes, as for double integrals. For $f$ continuous on a box $B=[a,b]\times[c,d]\times[r,s]$, Fubini’s theorem (proved exactly as in lesson 13_01) gives&lt;/p&gt;

\[\iiint_Bf\,dV=\int_r^s\int_c^d\int_a^bf(x,y,z)\,dx\,dy\,dz,\]

&lt;p&gt;and any of the six orders may be used.&lt;/p&gt;

&lt;div class=&quot;textbook-theorem&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Theorem 1.&lt;/strong&gt; If $E=\lbrace(x,y)\in D,\ u_1(x,y)\le z\le u_2(x,y)\rbrace$ with continuous $u_1$, $u_2$ and $f$ is continuous on $E$, then&lt;/p&gt;

\[\iiint_Ef\,dV=\iint_D\Big(\int_{u_1(x,y)}^{u_2(x,y)}f(x,y,z)\,dz\Big)dA.\]

&lt;/div&gt;

&lt;p&gt;The proof is like theorem 1 of lesson 13_02: extend $f$ by 0 to a box containing $E$ and apply Fubini. With $f=1$: $\iiint_E1\,dV=\iint_D(u_2-u_1)\,dA$ is the volume, as in lesson 13_02.&lt;/p&gt;

&lt;div class=&quot;interactive-frame&quot;&gt;
  &lt;div class=&quot;interactive-frame-head&quot;&gt;
    &lt;div class=&quot;interactive-frame-title&quot;&gt;Limits in z and the shadow D&lt;/div&gt;
    &lt;div class=&quot;interactive-frame-desc&quot;&gt;Drag a point in D; the vertical line gives the inner limits in z.&lt;/div&gt;
  &lt;/div&gt;
  &lt;iframe src=&quot;/interactives/chapter13/triple-integral-regions-en.html&quot; title=&quot;Limits in z and the shadow D&quot; loading=&quot;lazy&quot; style=&quot;height: 740px;&quot;&gt;&lt;/iframe&gt;
  &lt;div class=&quot;interactive-frame-foot&quot;&gt;
    &lt;a href=&quot;/interactives/chapter13/triple-integral-regions-en.html&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;Open the interactive in a new window&lt;/a&gt;
  &lt;/div&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Example 1.&lt;/strong&gt; $\iiint_{[0,1]\times[0,2]\times[0,3]}xyz\,dV=\tfrac12\cdot2\cdot\tfrac92=\tfrac92.$&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Example 2 (A tetrahedron).&lt;/strong&gt; $E$: $x,y,z\ge0$, $x+y+z\le1$. In $z$ first: $0\le z\le1-x-y$ over the triangle $D$: $0\le y\le1-x$, $0\le x\le1$. The volume is $\tfrac16$ (lesson 13_02, exercise 5). To compute $\iiint_Ez\,dV$, slice in $z$: the slice at height $z$ is a triangle of area $\tfrac{(1-z)^2}2$, so&lt;/p&gt;

\[\iiint_Ez\,dV=\int_0^1z\,\frac{(1-z)^2}2\,dz=\frac12\Big(\frac12-\frac23+\frac14\Big)=\frac1{24}.\]

&lt;/div&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Example 3.&lt;/strong&gt; The solid between the paraboloid $z=x^2+y^2$ and the plane $z=4$. Its projection $D$ is the disc $r\le2$, and $x^2+y^2\le z\le4$:&lt;/p&gt;

\[V=\iint_D(4-x^2-y^2)\,dA=\int_0^{2\pi}\int_0^2(4-r^2)\,r\,dr\,d\theta=2\pi(8-4)=8\pi.\]

&lt;/div&gt;

&lt;h2 id=&quot;application-mass-and-centre-of-mass&quot;&gt;Application: mass and centre of mass&lt;/h2&gt;

&lt;p&gt;An object occupying $E$ with density $\rho(x,y,z)$ has mass $m=\iiint_E\rho\,dV$ and centre of mass $\bar x=\tfrac1m\iiint_Ex\rho\,dV$ (similarly for $\bar y$, $\bar z$).&lt;/p&gt;

&lt;p&gt;The cube $[0,1]^3$ with density $\rho=x+y+z$ (heavier towards one corner): $m=\tfrac32$; $\iiint x(x+y+z)\,dV=\tfrac13+\tfrac14+\tfrac14=\tfrac56$, so $\bar x=\tfrac{5/6}{3/2}=\tfrac59$, and the same for $\bar y$, $\bar z$ by symmetry. The centre of mass moves away from the centre $(\tfrac12,\tfrac12,\tfrac12)$ towards the heavy corner.&lt;/p&gt;

&lt;h2 id=&quot;exercises&quot;&gt;Exercises&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Basic.&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;$\iiint_{[0,1]^3}(x+y+z)\,dV$.&lt;/li&gt;
  &lt;li&gt;$\iiint_{[0,1]\times[0,1]\times[0,2]}xy^2z\,dV$.&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Answers&lt;/summary&gt;

  &lt;ol&gt;
    &lt;li&gt;$3\cdot\tfrac12=\tfrac32$.&lt;/li&gt;
    &lt;li&gt;$\tfrac12\cdot\tfrac13\cdot2=\tfrac13$.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;p&gt;&lt;strong&gt;Intermediate.&lt;/strong&gt;&lt;/p&gt;

&lt;ol start=&quot;3&quot;&gt;
  &lt;li&gt;Find the volume of the solid in the first octant below the plane $2x+3y+z=6$.&lt;/li&gt;
  &lt;li&gt;Compute $\iiint_Ex\,dV$ for the tetrahedron of example 2.&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Answers&lt;/summary&gt;

  &lt;ol start=&quot;3&quot;&gt;
    &lt;li&gt;A tetrahedron with intercepts $3$, $2$, $6$: volume $\tfrac{3\cdot2\cdot6}6=6$.&lt;/li&gt;
    &lt;li&gt;$\tfrac1{24}$, by the symmetry between $x$ and $z$.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;p&gt;&lt;strong&gt;Advanced.&lt;/strong&gt;&lt;/p&gt;

&lt;ol start=&quot;5&quot;&gt;
  &lt;li&gt;Rewrite $\int_0^1\int_0^x\int_0^yf\,dz\,dy\,dx$ in the order $dx\,dy\,dz$.&lt;/li&gt;
  &lt;li&gt;Show that the volume of the “simplex” $x_1,\dots,x_n\ge0$, $x_1+\dots+x_n\le1$ is $\tfrac1{n!}$.&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Hints&lt;/summary&gt;

  &lt;ol start=&quot;5&quot;&gt;
    &lt;li&gt;The region is $0\le z\le y\le x\le1$: $\int_0^1\int_z^1\int_y^1f\,dx\,dy\,dz$.&lt;/li&gt;
    &lt;li&gt;Induction: the slice at $x_n=t$ is an $(n-1)$-dimensional simplex scaled by $1-t$, with volume $\tfrac{(1-t)^{n-1}}{(n-1)!}$; integrating in $t$ gives $\tfrac1{n!}$.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;h2 id=&quot;summary&quot;&gt;Summary&lt;/h2&gt;

&lt;div class=&quot;content-box summary-box textbook-block&quot;&gt;
  &lt;ul&gt;
    &lt;li&gt;A triple integral over a box: three iterated integrals, in any order.&lt;/li&gt;
    &lt;li&gt;General solids: $z$ between two surfaces over the projection $D$, then a double integral over $D$.&lt;/li&gt;
    &lt;li&gt;Slicing (in $z$) helps when slice areas are easy.&lt;/li&gt;
    &lt;li&gt;Mass $\iiint\rho\,dV$, centre of mass $\tfrac1m\iiint x\rho\,dV$.&lt;/li&gt;
  &lt;/ul&gt;
&lt;/div&gt;
</content>
 </entry>
 
 <entry>
   <title>Change of variables and the Jacobian</title>
   <link href="https://calculus-self-learning.pages.dev/contents/en/chapter13/13_03_Change_of_variables_and_the_Jacobian/"/>
   <updated>2026-12-01T00:00:00+00:00</updated>
   <id>https://calculus-self-learning.pages.dev/contents/en/chapter13/13_03_Change_of_variables_and_the_Jacobian</id>
   <content type="html">&lt;div class=&quot;textbook-objectives&quot;&gt;

  &lt;p&gt;&lt;strong&gt;Learning objectives.&lt;/strong&gt; After this lesson you can:&lt;/p&gt;

  &lt;ul&gt;
    &lt;li&gt;state the change-of-variables formula and explain why $\lvert J\rvert$ appears;&lt;/li&gt;
    &lt;li&gt;integrate over discs and annuli with polar coordinates;&lt;/li&gt;
    &lt;li&gt;choose a linear change of variables that turns a slanted region into a rectangle.&lt;/li&gt;
  &lt;/ul&gt;

&lt;/div&gt;

&lt;h2 id=&quot;why-this-lesson&quot;&gt;Why this lesson&lt;/h2&gt;

&lt;p&gt;In one variable, the substitution $x=g(u)$ gives $dx=g&apos;(u)\,du$. In two variables, a small cell $du\,dv$ is stretched by the change of variables into a parallelogram, and the area scaling factor is $\lvert\det J\rvert$. For round regions, polar coordinates turn hard problems into easy ones; for slanted regions, linear changes of variables do the same.&lt;/p&gt;

&lt;h2 id=&quot;the-change-of-variables-formula&quot;&gt;The change-of-variables formula&lt;/h2&gt;

&lt;div class=&quot;textbook-theorem&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Theorem 1.&lt;/strong&gt; Let $T(u,v)=(x(u,v),y(u,v))$ have continuous partial derivatives and map a region $S$ one-to-one onto $D$, with Jacobian $J=\dfrac{\partial(x,y)}{\partial(u,v)}=\det\begin{pmatrix}x_u&amp;amp;x_v\\y_u&amp;amp;y_v\end{pmatrix}\ne0$ (except on a set of zero area). For $f$ continuous on $D$:&lt;/p&gt;

\[\iint_Df(x,y)\,dx\,dy=\iint_Sf(T(u,v))\,\lvert J(u,v)\rvert\,du\,dv.\]

&lt;/div&gt;

&lt;div class=&quot;textbook-proof&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Idea of the proof.&lt;/strong&gt; A small rectangle $[u,u+\Delta u]\times[v,v+\Delta v]$ is mapped by $T$ to a region close to the parallelogram with sides $T_u\Delta u$ and $T_v\Delta v$ (the linear approximation $T(a+h)\approx T(a)+J_T(a)h$, lesson 11_01). The area of that parallelogram is $\lvert\det(T_u,T_v)\rvert\Delta u\Delta v=\lvert J\rvert\Delta u\Delta v$. So the Riemann sum $\sum f(T(u_i,v_j))\lvert J\rvert\Delta u\Delta v$ over $S$ approximates a Riemann sum of $f$ over $D$; a uniform error estimate (using the continuous partial derivatives) shows the two limits agree.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;reel-video&quot;&gt;
  &lt;video controls=&quot;&quot; playsinline=&quot;&quot; preload=&quot;metadata&quot; src=&quot;/public/videos/reels/jacobian-area-scaling.mp4&quot;&gt;&lt;/video&gt;
  &lt;p class=&quot;reel-caption&quot;&gt;The Jacobian determinant is the local area-scaling factor: from linear maps to curved maps to the Gaussian integral via polar coordinates; the polar grid with dA = r dr dθ, the examples ∬(x² + y²) dA and the hemisphere, a negative determinant that flips orientation, and the substitution u = x + y, v = y − x (silent video, about 3 minutes 1 second).&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;interactive-frame&quot;&gt;
  &lt;div class=&quot;interactive-frame-head&quot;&gt;
    &lt;div class=&quot;interactive-frame-title&quot;&gt;Change-of-variables grids and |J|&lt;/div&gt;
    &lt;div class=&quot;interactive-frame-desc&quot;&gt;Polar, linear and (u² − v², 2uv) maps: compare the image cell area with |J|·ΔuΔv.&lt;/div&gt;
  &lt;/div&gt;
  &lt;iframe src=&quot;/interactives/chapter13/change-of-variables-en.html&quot; title=&quot;Change-of-variables grids and |J|&quot; loading=&quot;lazy&quot; style=&quot;height: 720px;&quot;&gt;&lt;/iframe&gt;
  &lt;div class=&quot;interactive-frame-foot&quot;&gt;
    &lt;a href=&quot;/interactives/chapter13/change-of-variables-en.html&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;Open the interactive in a new window&lt;/a&gt;
  &lt;/div&gt;
&lt;/div&gt;

&lt;h2 id=&quot;polar-coordinates&quot;&gt;Polar coordinates&lt;/h2&gt;

&lt;p&gt;With $x=r\cos\theta$, $y=r\sin\theta$, $J=r$ (lesson 11_01), so&lt;/p&gt;

\[dA=r\,dr\,d\theta.\]

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Example 1.&lt;/strong&gt; $\iint_{x^2+y^2\le4}(x^2+y^2)\,dA=\int_0^{2\pi}\int_0^2r^2\cdot r\,dr\,d\theta=2\pi\cdot4=8\pi.$&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Example 2 (The volume of a ball).&lt;/strong&gt; A ball of radius $R$ consists of two halves, each under $z=\sqrt{R^2-x^2-y^2}$ over the disc of radius $R$:&lt;/p&gt;

\[V=2\int_0^{2\pi}\int_0^R\sqrt{R^2-r^2}\,r\,dr\,d\theta=4\pi\Big[-\tfrac13(R^2-r^2)^{3/2}\Big]_0^R=\frac43\pi R^3.\]

&lt;/div&gt;

&lt;h2 id=&quot;linear-changes-of-variables&quot;&gt;Linear changes of variables&lt;/h2&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Example 3.&lt;/strong&gt; $\iint_D(x+y)^2\,dA$, where $D$ is the rotated square $\lvert x+y\rvert\le1$, $\lvert x-y\rvert\le1$. Let $u=x+y$, $v=x-y$, so $x=\tfrac{u+v}2$, $y=\tfrac{u-v}2$:&lt;/p&gt;

\[J=\det\begin{pmatrix}\tfrac12&amp;amp;\tfrac12\\\tfrac12&amp;amp;-\tfrac12\end{pmatrix}=-\tfrac12,\qquad\iint_D(x+y)^2\,dA=\int_{-1}^1\int_{-1}^1u^2\cdot\tfrac12\,du\,dv=\tfrac23.\]

&lt;/div&gt;

&lt;h2 id=&quot;applications&quot;&gt;Applications&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;The area of an ellipse.&lt;/strong&gt; With $x=au$, $y=bv$, the ellipse $\tfrac{x^2}{a^2}+\tfrac{y^2}{b^2}\le1$ is the image of the unit disc and $J=ab$, so its area is $\pi ab$. This is the simplest instance of the fact that a linear map $A$ multiplies every area by $\lvert\det A\rvert$ (Linear Algebra).&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Physics.&lt;/strong&gt; A disc of radius $R$ with density $\sigma=k\sqrt{x^2+y^2}$ (denser at the rim) has mass $\int_0^{2\pi}\int_0^Rkr\cdot r\,dr\,d\theta=\tfrac23\pi kR^3$.&lt;/p&gt;

&lt;h2 id=&quot;exercises&quot;&gt;Exercises&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Basic.&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;$\iint_{x^2+y^2\le1}e^{-(x^2+y^2)}\,dA$.&lt;/li&gt;
  &lt;li&gt;$\iint_{1\le x^2+y^2\le4}\dfrac{dA}{x^2+y^2}$.&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Answers&lt;/summary&gt;

  &lt;ol&gt;
    &lt;li&gt;$2\pi\int_0^1e^{-r^2}r\,dr=\pi(1-e^{-1})$.&lt;/li&gt;
    &lt;li&gt;$2\pi\int_1^2\tfrac{dr}r=2\pi\ln2$.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;p&gt;&lt;strong&gt;Intermediate.&lt;/strong&gt;&lt;/p&gt;

&lt;ol start=&quot;3&quot;&gt;
  &lt;li&gt;$\iint_Dxy\,dA$, where $D$ is the quarter of the unit disc in the first quadrant.&lt;/li&gt;
  &lt;li&gt;Show that $\dfrac{\partial(x,y)}{\partial(u,v)}\cdot\dfrac{\partial(u,v)}{\partial(x,y)}=1$ and use it to find the Jacobian in example 3 another way.&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Answers&lt;/summary&gt;

  &lt;ol start=&quot;3&quot;&gt;
    &lt;li&gt;$\int_0^{\pi/2}\cos\theta\sin\theta\,d\theta\int_0^1r^3dr=\tfrac12\cdot\tfrac14=\tfrac18$.&lt;/li&gt;
    &lt;li&gt;By the chain rule the product of the two Jacobian matrices is the identity; take determinants. $\tfrac{\partial(u,v)}{\partial(x,y)}=\det\begin{pmatrix}1&amp;amp;1\\1&amp;amp;-1\end{pmatrix}=-2$, so $J=-\tfrac12$.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;p&gt;&lt;strong&gt;Advanced.&lt;/strong&gt;&lt;/p&gt;

&lt;ol start=&quot;5&quot;&gt;
  &lt;li&gt;Compute $\iint_De^{(x-y)/(x+y)}\,dA$, where $D$ is the triangle $x,y\ge0$, $x+y\le1$.&lt;/li&gt;
  &lt;li&gt;Why does the formula have $\lvert J\rvert$ rather than $J$, while in one variable we write $dx=g&apos;(u)\,du$ with a sign?&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Hints&lt;/summary&gt;

  &lt;ol start=&quot;5&quot;&gt;
    &lt;li&gt;$u=x-y$, $v=x+y$, $\lvert J\rvert=\tfrac12$, region $0\le v\le1$, $-v\le u\le v$: $\tfrac12\int_0^1v(e-e^{-1})\,dv=\tfrac{e-e^{-1}}4\approx0.588$.&lt;/li&gt;
    &lt;li&gt;In one variable the sign is compensated by swapping the limits ($\int_a^b=-\int_b^a$). A double integral over a region has no orientation, so we use area, which is always positive.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;h2 id=&quot;summary&quot;&gt;Summary&lt;/h2&gt;

&lt;div class=&quot;content-box summary-box textbook-block&quot;&gt;
  &lt;ul&gt;
    &lt;li&gt;$dx\,dy=\lvert J\rvert\,du\,dv$; $\lvert J\rvert$ is the area scaling factor.&lt;/li&gt;
    &lt;li&gt;Polar coordinates: $dA=r\,dr\,d\theta$, suited to discs and functions of $x^2+y^2$.&lt;/li&gt;
    &lt;li&gt;Linear changes of variables turn parallelograms into rectangles.&lt;/li&gt;
    &lt;li&gt;A linear map $A$ multiplies areas by $\lvert\det A\rvert$.&lt;/li&gt;
  &lt;/ul&gt;
&lt;/div&gt;
</content>
 </entry>
 
 <entry>
   <title>Double integrals over general regions</title>
   <link href="https://calculus-self-learning.pages.dev/contents/en/chapter13/13_02_Double_integrals_over_general_regions/"/>
   <updated>2026-12-01T00:00:00+00:00</updated>
   <id>https://calculus-self-learning.pages.dev/contents/en/chapter13/13_02_Double_integrals_over_general_regions</id>
   <content type="html">&lt;div class=&quot;textbook-objectives&quot;&gt;

  &lt;p&gt;&lt;strong&gt;Learning objectives.&lt;/strong&gt; After this lesson you can:&lt;/p&gt;

  &lt;ul&gt;
    &lt;li&gt;describe a planar region as type I ($y$ between two graphs) or type II ($x$ between two graphs);&lt;/li&gt;
    &lt;li&gt;read the limits from a sketch and compute the iterated integral;&lt;/li&gt;
    &lt;li&gt;reverse the order of integration;&lt;/li&gt;
    &lt;li&gt;compute probabilities for a pair of random variables.&lt;/li&gt;
  &lt;/ul&gt;

&lt;/div&gt;

&lt;h2 id=&quot;why-this-lesson&quot;&gt;Why this lesson&lt;/h2&gt;

&lt;p&gt;Real regions are rarely rectangles: a triangular plate, the region between two curves, the event $X&amp;lt;Y$. We need a way to set the limits, and sometimes changing the order of integration turns an impossible integral into an easy one.&lt;/p&gt;

&lt;h2 id=&quot;type-i-and-type-ii-regions&quot;&gt;Type I and type II regions&lt;/h2&gt;

&lt;div class=&quot;textbook-definition&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Definition.&lt;/strong&gt; A &lt;strong&gt;type I&lt;/strong&gt; region is $D=\lbrace a\le x\le b,\ g_1(x)\le y\le g_2(x)\rbrace$. A &lt;strong&gt;type II&lt;/strong&gt; region is $D=\lbrace c\le y\le d,\ h_1(y)\le x\le h_2(y)\rbrace$. For $f$ defined on $D$, set $\iint_Df\,dA=\iint_R\tilde f\,dA$, where $R\supset D$ is a rectangle and $\tilde f$ equals $f$ on $D$ and 0 outside $D$.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-theorem&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Theorem 1.&lt;/strong&gt; If $f$ is continuous on a type I region with continuous $g_1$, $g_2$, then&lt;/p&gt;

\[\iint_Df\,dA=\int_a^b\int_{g_1(x)}^{g_2(x)}f(x,y)\,dy\,dx,\]

  &lt;p&gt;and similarly for type II regions.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-proof&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Proof (sketch).&lt;/strong&gt; Apply Fubini to $\tilde f$ on $R=[a,b]\times[c,d]$: for fixed $x$, $\tilde f(x,\cdot)$ equals $f(x,\cdot)$ on $[g_1(x),g_2(x)]$ and 0 elsewhere, so the inner integral is $\int_{g_1(x)}^{g_2(x)}f\,dy$. The function $\tilde f$ is discontinuous only on the two graphs $y=g_k(x)$, which have zero area; Fubini’s theorem still holds in this case (proved in real analysis courses).&lt;/p&gt;
&lt;/div&gt;

&lt;p&gt;&lt;strong&gt;Setting the limits (type I).&lt;/strong&gt; Sketch the region. Fix an $x$ and draw a vertical line through the region: it enters at $y=g_1(x)$ and leaves at $y=g_2(x)$. Then let $x$ run from its smallest to its largest value on the region.&lt;/p&gt;

&lt;div class=&quot;interactive-frame&quot;&gt;
  &lt;div class=&quot;interactive-frame-head&quot;&gt;
    &lt;div class=&quot;interactive-frame-title&quot;&gt;Limits of a double integral and changing the order&lt;/div&gt;
    &lt;div class=&quot;interactive-frame-desc&quot;&gt;Move a vertical or horizontal cut to read the inner limits; both orders agree.&lt;/div&gt;
  &lt;/div&gt;
  &lt;iframe src=&quot;/interactives/chapter13/double-integral-en.html&quot; title=&quot;Limits of a double integral and changing the order&quot; loading=&quot;lazy&quot; style=&quot;height: 700px;&quot;&gt;&lt;/iframe&gt;
  &lt;div class=&quot;interactive-frame-foot&quot;&gt;
    &lt;a href=&quot;/interactives/chapter13/double-integral-en.html&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;Open the interactive in a new window&lt;/a&gt;
  &lt;/div&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Example 1.&lt;/strong&gt; $\iint_D(x+2y)\,dA$, where $D$ is the region between $y=2x^2$ and $y=1+x^2$. The curves meet at $x=\pm1$, and $1+x^2\ge2x^2$ on $[-1,1]$:&lt;/p&gt;

\[\int_{-1}^1\int_{2x^2}^{1+x^2}(x+2y)\,dy\,dx=\int_{-1}^1\big(-3x^4-x^3+2x^2+x+1\big)dx=-\frac65+\frac43+2=\frac{32}{15}.\]

&lt;/div&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Example 2 (Reversing the order).&lt;/strong&gt; $\int_0^1\int_x^1\sin(y^2)\,dy\,dx$: $\sin(y^2)$ has no elementary antiderivative. The region is the triangle $0\le x\le y\le1$; written as type II:&lt;/p&gt;

\[\int_0^1\int_0^y\sin(y^2)\,dx\,dy=\int_0^1y\sin(y^2)\,dy=\frac{1-\cos1}2\approx0.2298.\]

&lt;/div&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Example 3 (Area).&lt;/strong&gt; The area of $D$ is $\iint_D1\,dA$. The region between $y=x^2$ and $y=x$: $\int_0^1(x-x^2)\,dx=\tfrac16$.&lt;/p&gt;
&lt;/div&gt;

&lt;h2 id=&quot;application-probabilities-for-a-pair-of-random-variables&quot;&gt;Application: probabilities for a pair of random variables&lt;/h2&gt;

&lt;p&gt;If $(X,Y)$ has joint density $p(x,y)$, then $P\big((X,Y)\in D\big)=\iint_Dp\,dA$.&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;$X$, $Y$ independent and uniform on $[0,1]$ ($p=1$ on the square): $P(Y\le X^2)=\int_0^1x^2\,dx=\tfrac13$.&lt;/li&gt;
  &lt;li&gt;Waiting times $X$, $Y$ of two independent exponential events, $p=e^{-x-y}$ for $x,y\ge0$: $P(X&amp;lt;Y)=\int_0^\infty\int_x^\infty e^{-x-y}\,dy\,dx=\int_0^\infty e^{-2x}\,dx=\tfrac12$, as symmetry predicts.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2 id=&quot;exercises&quot;&gt;Exercises&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Basic.&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;$\iint_Dxy\,dA$, where $D$ is the triangle $0\le y\le x\le1$.&lt;/li&gt;
  &lt;li&gt;The area of the region between $y=x^2$ and $y=2x$.&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Answers&lt;/summary&gt;

  &lt;ol&gt;
    &lt;li&gt;$\int_0^1x\cdot\tfrac{x^2}2\,dx=\tfrac18$.&lt;/li&gt;
    &lt;li&gt;$\int_0^2(2x-x^2)\,dx=\tfrac43$.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;p&gt;&lt;strong&gt;Intermediate.&lt;/strong&gt;&lt;/p&gt;

&lt;ol start=&quot;3&quot;&gt;
  &lt;li&gt;Compute $\int_0^1\int_{\sqrt y}^1e^{x^3}\,dx\,dy$ by reversing the order.&lt;/li&gt;
  &lt;li&gt;Compute $\int_0^2\int_{y/2}^1e^{x^2}\,dx\,dy$.&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Answers&lt;/summary&gt;

  &lt;ol start=&quot;3&quot;&gt;
    &lt;li&gt;The region is $0\le y\le x^2$, $0\le x\le1$: $\int_0^1x^2e^{x^3}\,dx=\tfrac{e-1}3$.&lt;/li&gt;
    &lt;li&gt;The region is $0\le y\le2x$, $0\le x\le1$: $\int_0^12xe^{x^2}\,dx=e-1$.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;p&gt;&lt;strong&gt;Advanced.&lt;/strong&gt;&lt;/p&gt;

&lt;ol start=&quot;5&quot;&gt;
  &lt;li&gt;Find the volume of the tetrahedron $x,y,z\ge0$, $x+y+z\le1$ as the double integral of $1-x-y$.&lt;/li&gt;
  &lt;li&gt;$X$, $Y$ are independent and uniform on $[0,1]$. Find $P(X+Y\le1)$ and $P(XY\le\tfrac12)$.&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Hints&lt;/summary&gt;

  &lt;ol start=&quot;5&quot;&gt;
    &lt;li&gt;$\int_0^1\int_0^{1-x}(1-x-y)\,dy\,dx=\int_0^1\tfrac{(1-x)^2}2\,dx=\tfrac16$.&lt;/li&gt;
    &lt;li&gt;$\tfrac12$. $P(XY&amp;gt;\tfrac12)=\int_{1/2}^1\big(1-\tfrac1{2x}\big)dx=\tfrac12-\tfrac{\ln2}2$, so $P(XY\le\tfrac12)=\tfrac12+\tfrac{\ln2}2\approx0.847$.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;h2 id=&quot;summary&quot;&gt;Summary&lt;/h2&gt;

&lt;div class=&quot;content-box summary-box textbook-block&quot;&gt;
  &lt;ul&gt;
    &lt;li&gt;Type I: $y$ runs between two graphs of $x$; type II the other way round.&lt;/li&gt;
    &lt;li&gt;Set the limits by drawing a cut through the region.&lt;/li&gt;
    &lt;li&gt;Reversing the order can turn an impossible integral into an easy one.&lt;/li&gt;
    &lt;li&gt;Probabilities of $(X,Y)$ are double integrals of the joint density.&lt;/li&gt;
  &lt;/ul&gt;
&lt;/div&gt;
</content>
 </entry>
 
 <entry>
   <title>Double integrals over rectangles and Fubini's theorem</title>
   <link href="https://calculus-self-learning.pages.dev/contents/en/chapter13/13_01_Double_integrals_over_rectangles_and_Fubinis_theorem/"/>
   <updated>2026-12-01T00:00:00+00:00</updated>
   <id>https://calculus-self-learning.pages.dev/contents/en/chapter13/13_01_Double_integrals_over_rectangles_and_Fubinis_theorem</id>
   <content type="html">&lt;div class=&quot;textbook-objectives&quot;&gt;

  &lt;p&gt;&lt;strong&gt;Learning objectives.&lt;/strong&gt; After this lesson you can:&lt;/p&gt;

  &lt;ul&gt;
    &lt;li&gt;define the double integral with Riemann sums and see it as the volume under a surface;&lt;/li&gt;
    &lt;li&gt;compute double integrals as two iterated integrals (Fubini’s theorem) and prove the theorem for continuous functions;&lt;/li&gt;
    &lt;li&gt;choose the order of integration that makes the computation easy.&lt;/li&gt;
  &lt;/ul&gt;

&lt;/div&gt;

&lt;h2 id=&quot;why-this-lesson&quot;&gt;Why this lesson&lt;/h2&gt;

&lt;p&gt;A single integral adds up values along an interval. Many quantities are spread over a planar region: the mass of a metal plate with varying density, the rainfall over a province, the probability of a pair of random variables. The double integral adds them up, and Fubini’s theorem reduces the computation to two familiar single integrals.&lt;/p&gt;

&lt;h2 id=&quot;definition&quot;&gt;Definition&lt;/h2&gt;

&lt;div class=&quot;textbook-definition&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Definition.&lt;/strong&gt; Let $f$ be bounded on the rectangle $R=[a,b]\times[c,d]$. Divide $R$ into cells $R_{ij}$ of area $\Delta A_{ij}$ and pick points $(x_{ij}^*,y_{ij}^*)\in R_{ij}$. If the Riemann sums&lt;/p&gt;

\[\sum_{i,j}f(x_{ij}^*,y_{ij}^*)\,\Delta A_{ij}\]

  &lt;p&gt;have a limit as the largest cell diameter tends to 0, independent of the chosen points, the limit is the &lt;strong&gt;double integral&lt;/strong&gt; $\iint_Rf\,dA$.&lt;/p&gt;
&lt;/div&gt;

&lt;p&gt;If $f\ge0$, each term is the volume of a thin box, so $\iint_Rf\,dA$ is the volume of the solid under the surface $z=f(x,y)$. Every continuous function on $R$ is integrable (the proof is as in one variable, using uniform continuity).&lt;/p&gt;

&lt;h2 id=&quot;fubinis-theorem&quot;&gt;Fubini’s theorem&lt;/h2&gt;

&lt;div class=&quot;textbook-theorem&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Theorem 1 (Fubini).&lt;/strong&gt; If $f$ is continuous on $R=[a,b]\times[c,d]$, then&lt;/p&gt;

\[\iint_Rf\,dA=\int_a^b\Big(\int_c^df(x,y)\,dy\Big)dx=\int_c^d\Big(\int_a^bf(x,y)\,dx\Big)dy.\]

&lt;/div&gt;

&lt;div class=&quot;textbook-proof&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Proof.&lt;/strong&gt; Let $F(x)=\int_c^df(x,y)\,dy$; $F$ is continuous because $f$ is uniformly continuous. Let $\varepsilon&amp;gt;0$. By uniform continuity of $f$ on $R$, there is $\delta&amp;gt;0$ with $\lvert f(p)-f(q)\rvert&amp;lt;\varepsilon$ whenever $\lVert p-q\rVert&amp;lt;\delta$. Take a grid of $[a,b]$ by points $x_i$ and of $[c,d]$ by points $y_j$ whose cells have diameter less than $\delta$, and pick points $(x_i^*,y_j^*)$. For each $i$,&lt;/p&gt;

\[\Big\lvert\sum_jf(x_i^*,y_j^*)\Delta y_j-F(x_i^*)\Big\rvert=\Big\lvert\sum_j\int_{y_{j-1}}^{y_j}\big(f(x_i^*,y_j^*)-f(x_i^*,y)\big)dy\Big\rvert\le\varepsilon(d-c).\]

  &lt;p&gt;Multiply by $\Delta x_i$ and add: the double Riemann sum differs from $\sum_iF(x_i^*)\Delta x_i$ by at most $\varepsilon(d-c)(b-a)$. As the grid is refined, the double Riemann sum tends to $\iint_Rf\,dA$ and $\sum_iF(x_i^*)\Delta x_i$ tends to $\int_a^bF\,dx$. Since $\varepsilon$ is arbitrary, the two limits are equal. The other order is proved the same way.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;reel-video&quot;&gt;
  &lt;video controls=&quot;&quot; playsinline=&quot;&quot; preload=&quot;metadata&quot; src=&quot;/public/videos/reels/fubini-slicing.mp4&quot;&gt;&lt;/video&gt;
  &lt;p class=&quot;reel-caption&quot;&gt;Fubini&apos;s theorem by slicing: the volume under z = x²y approximated by columns, then sliced along x or along y, both giving 4; the example sin(x + y), average value, choosing the order, a triangular region, probability, Cavalieri&apos;s principle and a counterexample (silent video, about 3 minutes 1 second).&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Example 1.&lt;/strong&gt; $\iint_{[0,2]\times[1,2]}x^2y\,dA=\int_0^2x^2dx\cdot\int_1^2y\,dy=\dfrac83\cdot\dfrac32=4.$ When $f(x,y)=g(x)h(y)$, the double integral splits into a product of two integrals.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Example 2.&lt;/strong&gt; $\displaystyle\iint_{[0,\pi/2]^2}\sin(x+y)\,dA=\int_0^{\pi/2}\big[-\cos(x+y)\big]_{y=0}^{\pi/2}dx=\int_0^{\pi/2}(\cos x+\sin x)\,dx=2.$&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Example 3 (Choosing the order).&lt;/strong&gt; $\iint_{[0,1]^2}xe^{xy}\,dA$. Integrating in $y$ first: $\int_0^1\big[e^{xy}\big]_{y=0}^{1}dx=\int_0^1(e^x-1)\,dx=e-2$. Integrating in $x$ first needs integration by parts and produces functions such as $e^y/y$ with no elementary antiderivative, even though the final answer is the same.&lt;/p&gt;
&lt;/div&gt;

&lt;h2 id=&quot;applications&quot;&gt;Applications&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Average value.&lt;/strong&gt; The average of $f$ over $R$ is $\dfrac1{\text{area of }R}\iint_Rf\,dA$. If the temperature on the plate $[0,2]\times[1,2]$ is $x^2y$ degrees, the average temperature is $4/2=2$ degrees.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Physics.&lt;/strong&gt; With surface charge density $\sigma(x,y)$ on a plate $R$, the total charge is $\iint_R\sigma\,dA$; with rainfall $p(x,y)$ (mm) over a region, the total water is $\iint p\,dA$.&lt;/p&gt;

&lt;h2 id=&quot;exercises&quot;&gt;Exercises&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Basic.&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;$\iint_{[0,1]\times[0,2]}(x+y)\,dA$.&lt;/li&gt;
  &lt;li&gt;$\iint_{[0,1]^2}xy^2\,dA$.&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Answers&lt;/summary&gt;

  &lt;ol&gt;
    &lt;li&gt;$\int_0^1(2x+2)\,dx=3$.&lt;/li&gt;
    &lt;li&gt;$\tfrac12\cdot\tfrac13=\tfrac16$.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;p&gt;&lt;strong&gt;Intermediate.&lt;/strong&gt;&lt;/p&gt;

&lt;ol start=&quot;3&quot;&gt;
  &lt;li&gt;$\iint_{[1,2]\times[0,1]}ye^{xy}\,dA$ (choose a sensible order).&lt;/li&gt;
  &lt;li&gt;Find the volume of the solid under $z=4-x^2-y^2$ over $[0,1]^2$.&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Answers&lt;/summary&gt;

  &lt;ol start=&quot;3&quot;&gt;
    &lt;li&gt;Integrate in $x$ first: $\int_0^1(e^{2y}-e^y)\,dy=\tfrac{e^2-1}2-(e-1)=\tfrac{(e-1)^2}2\approx1.476$.&lt;/li&gt;
    &lt;li&gt;$4-\tfrac13-\tfrac13=\tfrac{10}3$.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;p&gt;&lt;strong&gt;Advanced.&lt;/strong&gt;&lt;/p&gt;

&lt;ol start=&quot;5&quot;&gt;
  &lt;li&gt;For $f=\dfrac{x^2-y^2}{(x^2+y^2)^2}$ on $[0,1]^2$, show that the two iterated integrals equal $\pi/4$ and $-\pi/4$. Why does this not contradict Fubini’s theorem?&lt;/li&gt;
  &lt;li&gt;Prove that $\iint_{[a,b]\times[c,d]}g(x)h(y)\,dA=\int_a^bg\,dx\cdot\int_c^dh\,dy$ for continuous $g$, $h$.&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Hints&lt;/summary&gt;

  &lt;ol start=&quot;5&quot;&gt;
    &lt;li&gt;$\int_0^1f\,dy=\big[\tfrac{y}{x^2+y^2}\big]_0^1=\tfrac1{1+x^2}$, then $\int_0^1\tfrac{dx}{1+x^2}=\tfrac\pi4$; swapping the roles of $x$ and $y$ gives $-\tfrac\pi4$. The function is unbounded near the origin, so it is not continuous on $R$, and $\iint\lvert f\rvert\,dA=\infty$.&lt;/li&gt;
    &lt;li&gt;By Fubini, the inner integral is $\int_c^dg(x)h(y)\,dy=g(x)\int_c^dh$; then pull out the constant.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;h2 id=&quot;summary&quot;&gt;Summary&lt;/h2&gt;

&lt;div class=&quot;content-box summary-box textbook-block&quot;&gt;
  &lt;ul&gt;
    &lt;li&gt;The double integral is a limit of Riemann sums; for $f\ge0$ it is the volume under the surface.&lt;/li&gt;
    &lt;li&gt;Fubini: for continuous $f$, the double integral equals the iterated integral in either order.&lt;/li&gt;
    &lt;li&gt;Choose the order that makes the inner integral easy; separable functions give a product of integrals.&lt;/li&gt;
    &lt;li&gt;The counterexample shows that hypotheses (continuity, or $\iint\lvert f\rvert&amp;lt;\infty$) are needed.&lt;/li&gt;
  &lt;/ul&gt;
&lt;/div&gt;
</content>
 </entry>
 
 <entry>
   <title>Several constraints and the meaning of the multipliers</title>
   <link href="https://calculus-self-learning.pages.dev/contents/en/chapter12/12_05_Several_constraints_and_the_meaning_of_multipliers/"/>
   <updated>2026-12-01T00:00:00+00:00</updated>
   <id>https://calculus-self-learning.pages.dev/contents/en/chapter12/12_05_Several_constraints_and_the_meaning_of_multipliers</id>
   <content type="html">&lt;div class=&quot;textbook-objectives&quot;&gt;

  &lt;p&gt;&lt;strong&gt;Learning objectives.&lt;/strong&gt; After this lesson you can:&lt;/p&gt;

  &lt;ul&gt;
    &lt;li&gt;solve extremum problems with two constraints using $\nabla f=\lambda\nabla g+\mu\nabla h$;&lt;/li&gt;
    &lt;li&gt;prove $\lambda=dM/dc$, where $M(c)$ is the optimal value;&lt;/li&gt;
    &lt;li&gt;interpret a multiplier as a shadow price (economics) and a constraint force (mechanics).&lt;/li&gt;
  &lt;/ul&gt;

&lt;/div&gt;

&lt;h2 id=&quot;why-this-lesson&quot;&gt;Why this lesson&lt;/h2&gt;

&lt;p&gt;Lesson 12_03 treated $\lambda$ as an auxiliary unknown. In fact it carries valuable information: if the constraint is relaxed by one unit, how much does the optimal value increase? In economics this is the shadow price of a resource; in optimisation it leads to duality and the KKT conditions.&lt;/p&gt;

&lt;h2 id=&quot;two-constraints&quot;&gt;Two constraints&lt;/h2&gt;

&lt;div class=&quot;textbook-theorem&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Theorem 1.&lt;/strong&gt; Suppose $f$, $g$, $h$ (three variables) have continuous partial derivatives, $f$ has a local extremum on the set $\lbrace g=c_1,\ h=c_2\rbrace$ at $a$, and $\nabla g(a)$, $\nabla h(a)$ are not parallel. Then there are $\lambda$, $\mu$ with&lt;/p&gt;

\[\nabla f(a)=\lambda\nabla g(a)+\mu\nabla h(a).\]

&lt;/div&gt;

&lt;div class=&quot;textbook-proof&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Proof (sketch).&lt;/strong&gt; When the two gradients are not parallel, the implicit function theorem for systems (lesson 11_03) shows that near $a$ the constraint set is a differentiable curve $r(t)$, $r(0)=a$, with tangent vector $T=r&apos;(0)\ne0$. As in lesson 12_03, $\nabla f(a)\cdot T=0$, and from $g(r(t))=c_1$, $h(r(t))=c_2$: $\nabla g(a)\cdot T=\nabla h(a)\cdot T=0$. The vectors perpendicular to $T$ in $\mathbb R^3$ form a plane; $\nabla g(a)$ and $\nabla h(a)$ are independent, so they span that plane, and $\nabla f(a)$ lies in it.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Example 1.&lt;/strong&gt; Find the maximum of $f=x+2y+3z$ on the intersection of the plane $x-y+z=1$ and the cylinder $x^2+y^2=1$ (an ellipse, closed and bounded).&lt;/p&gt;

  &lt;p&gt;The system is $(1,2,3)=\lambda(1,-1,1)+\mu(2x,2y,0)$. The $z$ component gives $\lambda=3$. Then $2\mu x=-2$ and $2\mu y=5$, so $x=-1/\mu$, $y=5/(2\mu)$. From $x^2+y^2=1$: $\mu=\pm\sqrt{29}/2$. Substituting $z=1-x+y$: $f=3-2x+5y=3\pm\sqrt{29}$. Maximum $3+\sqrt{29}\approx8.385$, minimum $3-\sqrt{29}$.&lt;/p&gt;
&lt;/div&gt;

&lt;h2 id=&quot;the-meaning-of-the-multiplier&quot;&gt;The meaning of the multiplier&lt;/h2&gt;

&lt;div class=&quot;textbook-theorem&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Theorem 2 (Envelope theorem).&lt;/strong&gt; Let $x^*(c)$ be the optimal point of $f$ on $g=c$ with multiplier $\lambda(c)$, and $M(c)=f(x^*(c))$. If $x^*(c)$ is differentiable in $c$, then&lt;/p&gt;

\[M&apos;(c)=\lambda(c).\]

&lt;/div&gt;

&lt;div class=&quot;textbook-proof&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Proof.&lt;/strong&gt; By the chain rule, $M&apos;(c)=\nabla f(x^*)\cdot\dfrac{dx^*}{dc}=\lambda\,\nabla g(x^*)\cdot\dfrac{dx^*}{dc}$. On the other hand $g(x^*(c))=c$ for all $c$; differentiating gives $\nabla g(x^*)\cdot\dfrac{dx^*}{dc}=1$. So $M&apos;(c)=\lambda$.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Example 2 (Shadow price).&lt;/strong&gt; In example 3 of lesson 12_03, $U=\sqrt{xy}$ with budget $2x+3y=B$. The solution $x=B/4$, $y=B/6$ gives $M(B)=B/\sqrt{24}$ and $M&apos;(B)=1/\sqrt{24}\approx0.204$, exactly the $\lambda$ found there. One extra unit of money raises the maximum utility by about $0.204$: the &lt;strong&gt;marginal utility of income&lt;/strong&gt;.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Example 3.&lt;/strong&gt; Maximise $xy$ subject to $x+y=c$: $y=\lambda$, $x=\lambda$, so $x=y=c/2$ and $\lambda=c/2$. The optimal value $M(c)=c^2/4$ has $M&apos;(c)=c/2=\lambda$.&lt;/p&gt;
&lt;/div&gt;

&lt;h2 id=&quot;applications&quot;&gt;Applications&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Economics.&lt;/strong&gt; In maximising profit with limited resources (machine hours, raw materials), the multiplier of each constraint is the marginal value of that resource: the most it is worth paying for one more unit.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Mechanics.&lt;/strong&gt; A bead slides without friction on a wire $g=c$. Its equation of motion is $m\ddot x=-\nabla V+\lambda\nabla g$; the term $\lambda\nabla g$ is the reaction force of the wire, perpendicular to the wire, and $\lambda$ measures its size.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Optimisation (a first look at KKT).&lt;/strong&gt; With an inequality constraint $g\le c$ when maximising $f$: either the constraint is slack and $\nabla f=0$, or it is active and $\nabla f=\lambda\nabla g$ with $\lambda\ge0$ (relaxing $c$ cannot decrease the optimal value). These are the Karush–Kuhn–Tucker conditions, the core of the Optimisation course.&lt;/p&gt;

&lt;h2 id=&quot;exercises&quot;&gt;Exercises&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Basic.&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;Find the minimum of $x^2+y^2+z^2$ subject to $x+y=2$ and $y+z=2$.&lt;/li&gt;
  &lt;li&gt;Minimise $x^2+y^2$ subject to $x+y=c$. Check that $M&apos;(c)=\lambda$.&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Answers&lt;/summary&gt;

  &lt;ol&gt;
    &lt;li&gt;$2x=\lambda$, $2y=\lambda+\mu$, $2z=\mu$ give $y=x+z$; solving, $x=z=2/3$, $y=4/3$, value $8/3$.&lt;/li&gt;
    &lt;li&gt;$x=y=c/2$, $\lambda=c$, $M=c^2/2$, $M&apos;=c=\lambda$.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;p&gt;&lt;strong&gt;Intermediate.&lt;/strong&gt;&lt;/p&gt;

&lt;ol start=&quot;3&quot;&gt;
  &lt;li&gt;Find the point closest to the origin on the intersection of $x+y+z=1$ and $x-y=0$.&lt;/li&gt;
  &lt;li&gt;In example 1, replace $x-y+z=1$ by $x-y+z=1+\varepsilon$. By about how much does the maximum change?&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Answers&lt;/summary&gt;

  &lt;ol start=&quot;3&quot;&gt;
    &lt;li&gt;$\nabla f=(2x,2y,2z)=\lambda(1,1,1)+\mu(1,-1,0)$; $x=y$ forces $\mu=0$, so $x=y=z=1/3$, squared distance $1/3$.&lt;/li&gt;
    &lt;li&gt;The multiplier of the plane constraint is $\lambda=3$, so the maximum grows by about $3\varepsilon$ (check: $f=3(1+\varepsilon)-2x+5y$).&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;p&gt;&lt;strong&gt;Advanced.&lt;/strong&gt;&lt;/p&gt;

&lt;ol start=&quot;5&quot;&gt;
  &lt;li&gt;Extend theorem 2 to two constraints: $\partial M/\partial c_1=\lambda$, $\partial M/\partial c_2=\mu$.&lt;/li&gt;
  &lt;li&gt;Maximise $f=x+y$ subject to $x^2+y^2\le1$, and subject to $x^2+y^2\le r^2$. Check that $\lambda\ge0$ and $\lambda=dM/d(r^2)$.&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Hints&lt;/summary&gt;

  &lt;ol start=&quot;5&quot;&gt;
    &lt;li&gt;As in the proof of theorem 2: $\nabla g\cdot\partial x^*/\partial c_1=1$ and $\nabla h\cdot\partial x^*/\partial c_1=0$.&lt;/li&gt;
    &lt;li&gt;The constraint is active, $x=y=r/\sqrt2$, $M=r\sqrt2$; $1=2\lambda x$ gives $\lambda=\tfrac1{r\sqrt2}&amp;gt;0$. With $s=r^2$: $M=\sqrt{2s}$, $dM/ds=\tfrac1{\sqrt{2s}}=\lambda$.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;h2 id=&quot;summary&quot;&gt;Summary&lt;/h2&gt;

&lt;div class=&quot;content-box summary-box textbook-block&quot;&gt;
  &lt;ul&gt;
    &lt;li&gt;Two constraints: $\nabla f=\lambda\nabla g+\mu\nabla h$ when the two gradients are independent.&lt;/li&gt;
    &lt;li&gt;Envelope theorem: a multiplier is the derivative of the optimal value with respect to the constraint level.&lt;/li&gt;
    &lt;li&gt;Shadow prices (economics), reaction forces (mechanics).&lt;/li&gt;
    &lt;li&gt;Inequality constraints lead to the KKT conditions with $\lambda\ge0$.&lt;/li&gt;
  &lt;/ul&gt;
&lt;/div&gt;
</content>
 </entry>
 
 <entry>
   <title>Least squares and linear regression</title>
   <link href="https://calculus-self-learning.pages.dev/contents/en/chapter12/12_04_Least_squares_and_linear_regression/"/>
   <updated>2026-12-01T00:00:00+00:00</updated>
   <id>https://calculus-self-learning.pages.dev/contents/en/chapter12/12_04_Least_squares_and_linear_regression</id>
   <content type="html">&lt;div class=&quot;textbook-objectives&quot;&gt;

  &lt;p&gt;&lt;strong&gt;Learning objectives.&lt;/strong&gt; After this lesson you can:&lt;/p&gt;

  &lt;ul&gt;
    &lt;li&gt;derive the normal equations of the least-squares line from $\nabla E=0$;&lt;/li&gt;
    &lt;li&gt;write the problem in matrix form $A^\top A\beta=A^\top y$ and prove the solution is the global minimum;&lt;/li&gt;
    &lt;li&gt;interpret the solution as an orthogonal projection;&lt;/li&gt;
    &lt;li&gt;understand how ridge regression changes the equations.&lt;/li&gt;
  &lt;/ul&gt;

&lt;/div&gt;

&lt;h2 id=&quot;why-this-lesson&quot;&gt;Why this lesson&lt;/h2&gt;

&lt;p&gt;Given data $(x_i,y_i)$, we want the line $y=ax+b$ that “fits best”. We choose $a$, $b$ to minimise the sum of squared errors. This is a two-variable extremum problem from lesson 12_01, and the simplest machine-learning model.&lt;/p&gt;

&lt;h2 id=&quot;the-normal-equations&quot;&gt;The normal equations&lt;/h2&gt;

&lt;p&gt;For $n$ data points the error is&lt;/p&gt;

\[E(a,b)=\sum_{i=1}^n(y_i-ax_i-b)^2.\]

&lt;p&gt;Setting $\partial E/\partial a=\partial E/\partial b=0$:&lt;/p&gt;

\[-2\sum x_i(y_i-ax_i-b)=0,\qquad-2\sum(y_i-ax_i-b)=0,\]

&lt;p&gt;that is, the &lt;strong&gt;normal equations&lt;/strong&gt;&lt;/p&gt;

\[a\sum x_i^2+b\sum x_i=\sum x_iy_i,\qquad a\sum x_i+nb=\sum y_i.\]

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Example 1.&lt;/strong&gt; Data $(0,1)$, $(1,3)$, $(2,4)$, $(3,4)$: $n=4$, $\sum x=6$, $\sum y=12$, $\sum x^2=14$, $\sum xy=23$. The system $14a+6b=23$, $6a+4b=12$ gives $a=1$, $b=1.5$: the line $y=x+1.5$. The residuals $-0.5$, $0.5$, $0.5$, $-0.5$ sum to 0 and $E=1$.&lt;/p&gt;
&lt;/div&gt;

&lt;h2 id=&quot;matrix-form-and-the-global-minimum&quot;&gt;Matrix form and the global minimum&lt;/h2&gt;

&lt;p&gt;Let $A$ be the $n\times2$ matrix with rows $(x_i,1)$ and $\beta=(a,b)^\top$. Then $E(\beta)=\lVert y-A\beta\rVert^2$ and the normal equations read $A^\top A\beta=A^\top y$. The same form works for every model that is linear in its parameters (several variables, polynomials).&lt;/p&gt;

&lt;div class=&quot;textbook-theorem&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Theorem 1.&lt;/strong&gt; If the columns of $A$ are linearly independent, then $A^\top A$ is invertible and $\beta^*=(A^\top A)^{-1}A^\top y$ is the unique global minimum of $E$.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-proof&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Proof.&lt;/strong&gt; For $v\ne0$, $v^\top A^\top Av=\lVert Av\rVert^2&amp;gt;0$ because $Av\ne0$ (independent columns), so $A^\top A$ is positive definite and hence invertible. Let $\beta^*$ solve the normal equations and $r=y-A\beta^*$; then $A^\top r=0$. For every $h$:&lt;/p&gt;

\[E(\beta^*+h)=\lVert r-Ah\rVert^2=\lVert r\rVert^2-2h^\top A^\top r+\lVert Ah\rVert^2=E(\beta^*)+\lVert Ah\rVert^2.\]

  &lt;p&gt;Since $\lVert Ah\rVert^2&amp;gt;0$ for $h\ne0$, $\beta^*$ is the unique global minimum.&lt;/p&gt;
&lt;/div&gt;

&lt;p&gt;&lt;strong&gt;Geometry.&lt;/strong&gt; $A^\top r=0$ says the residual is perpendicular to every column of $A$. So $A\beta^*$ is the &lt;strong&gt;orthogonal projection&lt;/strong&gt; of $y$ onto the column space of $A$: the point of that space closest to $y$. The two views (calculus: derivative equal to zero; geometry: orthogonal projection) give the same solution.&lt;/p&gt;

&lt;div class=&quot;interactive-frame&quot;&gt;
  &lt;div class=&quot;interactive-frame-head&quot;&gt;
    &lt;div class=&quot;interactive-frame-title&quot;&gt;Fitting a line by least squares&lt;/div&gt;
    &lt;div class=&quot;interactive-frame-desc&quot;&gt;Drag the data, tune a and b and compare with the optimum; try ridge too.&lt;/div&gt;
  &lt;/div&gt;
  &lt;iframe src=&quot;/interactives/chapter12/least-squares-en.html&quot; title=&quot;Fitting a line by least squares&quot; loading=&quot;lazy&quot; style=&quot;height: 720px;&quot;&gt;&lt;/iframe&gt;
  &lt;div class=&quot;interactive-frame-foot&quot;&gt;
    &lt;a href=&quot;/interactives/chapter12/least-squares-en.html&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;Open the interactive in a new window&lt;/a&gt;
  &lt;/div&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Example 2 (Through the origin).&lt;/strong&gt; The model $y=ax$ (for example Hooke’s law $F=kx$): $E=\sum(y_i-ax_i)^2$, and $E&apos;(a)=0$ gives $a=\dfrac{\sum x_iy_i}{\sum x_i^2}$.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Example 3 (A polynomial).&lt;/strong&gt; The model $y=ax^2+b$ with data $(0,1)$, $(1,2)$, $(2,5)$: the rows of $A$ are $(x_i^2,1)$. The normal equations $17a+5b=22$, $5a+3b=8$ give $a=b=1$; the data lie exactly on $y=x^2+1$, so $E=0$. A “linear” model is linear in the &lt;em&gt;parameters&lt;/em&gt;, not necessarily in $x$.&lt;/p&gt;
&lt;/div&gt;

&lt;h2 id=&quot;application-ridge-regression-machine-learning&quot;&gt;Application: ridge regression (machine learning)&lt;/h2&gt;

&lt;p&gt;With many features or noisy data, large coefficients are penalised: $E_\lambda=\lVert y-A\beta\rVert^2+\lambda a^2$ (the intercept $b$ is usually not penalised). Differentiating gives&lt;/p&gt;

\[\big(A^\top A+\lambda\operatorname{diag}(1,0)\big)\beta=A^\top y.\]

&lt;p&gt;For the data of example 1 with $\lambda=1$: $15a+6b=23$, $6a+4b=12$, so $a=5/6\approx0.833$ and $b=1.75$. The slope “shrinks” towards 0, and in exchange the model is less sensitive to noise. Also, if the data errors are normally distributed, least squares is exactly maximum likelihood estimation (Probability course).&lt;/p&gt;

&lt;h2 id=&quot;exercises&quot;&gt;Exercises&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Basic.&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;Find the least-squares line for $(1,1)$, $(2,2)$, $(3,2)$.&lt;/li&gt;
  &lt;li&gt;Find the best $a$ for the model $y=ax$ with $(1,2)$, $(2,3)$, $(3,7)$.&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Answers&lt;/summary&gt;

  &lt;ol&gt;
    &lt;li&gt;$14a+6b=11$, $6a+3b=5$: $a=1/2$, $b=2/3$.&lt;/li&gt;
    &lt;li&gt;$a=(2+6+21)/14=29/14$.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;p&gt;&lt;strong&gt;Intermediate.&lt;/strong&gt;&lt;/p&gt;

&lt;ol start=&quot;3&quot;&gt;
  &lt;li&gt;Show that when the model has an intercept $b$, the residuals sum to 0 and the line passes through the mean point $(\bar x,\bar y)$.&lt;/li&gt;
  &lt;li&gt;Show that the Hessian of $E(a,b)$ is $2\begin{pmatrix}\sum x_i^2&amp;amp;\sum x_i\\\sum x_i&amp;amp;n\end{pmatrix}$ and that it is positive definite unless all the $x_i$ are equal.&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Answers&lt;/summary&gt;

  &lt;ol start=&quot;3&quot;&gt;
    &lt;li&gt;The equation $\partial E/\partial b=0$ is $\sum(y_i-ax_i-b)=0$; divide by $n$: $\bar y=a\bar x+b$.&lt;/li&gt;
    &lt;li&gt;Differentiate the normal equations. $D=4\big(n\sum x_i^2-(\sum x_i)^2\big)=4n\sum(x_i-\bar x)^2&amp;gt;0$ and the first entry is positive.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;p&gt;&lt;strong&gt;Advanced.&lt;/strong&gt;&lt;/p&gt;

&lt;ol start=&quot;5&quot;&gt;
  &lt;li&gt;Show that $A^\top A+\lambda I$ is invertible for every $\lambda&amp;gt;0$, even if the columns of $A$ are linearly dependent.&lt;/li&gt;
  &lt;li&gt;Data $(x_i,y_i)$ with $y_i&amp;gt;0$ are believed to follow $y=ce^{kx}$. Reduce finding $c$ and $k$ to linear least squares. What quantity does this approach minimise?&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Hints&lt;/summary&gt;

  &lt;ol start=&quot;5&quot;&gt;
    &lt;li&gt;$v^\top(A^\top A+\lambda I)v=\lVert Av\rVert^2+\lambda\lVert v\rVert^2&amp;gt;0$ for $v\ne0$.&lt;/li&gt;
    &lt;li&gt;$\ln y=\ln c+kx$: regress $\ln y_i$ on $x_i$. It minimises the squared error in $\ln y$, not in $y$; points with small $y$ get relatively more weight.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;h2 id=&quot;summary&quot;&gt;Summary&lt;/h2&gt;

&lt;div class=&quot;content-box summary-box textbook-block&quot;&gt;
  &lt;ul&gt;
    &lt;li&gt;The least-squares line: solve $\nabla E=0$ to get the normal equations.&lt;/li&gt;
    &lt;li&gt;Matrix form $A^\top A\beta=A^\top y$; the solution is the global minimum because $E(\beta^*+h)=E(\beta^*)+\lVert Ah\rVert^2$.&lt;/li&gt;
    &lt;li&gt;Geometry: $A\beta^*$ is the orthogonal projection of $y$ onto the column space.&lt;/li&gt;
    &lt;li&gt;Ridge adds $\lambda$ to the diagonal, shrinking the coefficients and always making the system invertible.&lt;/li&gt;
  &lt;/ul&gt;
&lt;/div&gt;
</content>
 </entry>
 
 <entry>
   <title>Constrained extrema and Lagrange multipliers</title>
   <link href="https://calculus-self-learning.pages.dev/contents/en/chapter12/12_03_Constrained_extrema_and_Lagrange_multipliers/"/>
   <updated>2026-12-01T00:00:00+00:00</updated>
   <id>https://calculus-self-learning.pages.dev/contents/en/chapter12/12_03_Constrained_extrema_and_Lagrange_multipliers</id>
   <content type="html">&lt;div class=&quot;textbook-objectives&quot;&gt;

  &lt;p&gt;&lt;strong&gt;Learning objectives.&lt;/strong&gt; After this lesson you can:&lt;/p&gt;

  &lt;ul&gt;
    &lt;li&gt;solve the problem of extremising $f$ subject to $g=c$ with the system $\nabla f=\lambda\nabla g$, $g=c$;&lt;/li&gt;
    &lt;li&gt;prove the Lagrange condition and see it through tangent level curves;&lt;/li&gt;
    &lt;li&gt;recognise when the method fails ($\nabla g=0$).&lt;/li&gt;
  &lt;/ul&gt;

&lt;/div&gt;

&lt;h2 id=&quot;why-this-lesson&quot;&gt;Why this lesson&lt;/h2&gt;

&lt;p&gt;Most optimisation problems have constraints: maximise utility within a budget, maximise volume with a given amount of material, minimise energy on a surface. Substituting the constraint to eliminate a variable is often messy or impossible. Lagrange gives a clean, symmetric geometric condition.&lt;/p&gt;

&lt;h2 id=&quot;lagranges-theorem&quot;&gt;Lagrange’s theorem&lt;/h2&gt;

&lt;div class=&quot;textbook-theorem&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Theorem 1.&lt;/strong&gt; Suppose $f$ and $g$ have continuous partial derivatives, $f$ has a local extremum on the set $\lbrace g=c\rbrace$ at $a$, and $\nabla g(a)\ne0$. Then there is a number $\lambda$ (the Lagrange multiplier) such that&lt;/p&gt;

\[\nabla f(a)=\lambda\nabla g(a).\]

&lt;/div&gt;

&lt;div class=&quot;textbook-proof&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Proof (two variables).&lt;/strong&gt; Since $\nabla g(a)\ne0$, by the implicit function theorem (lesson 11_03) the set $g=c$ near $a$ is the graph of a differentiable function ($y=\varphi(x)$ or $x=\psi(y)$), so it can be parametrised by a differentiable curve $r(t)$ with $r(0)=a$ and $r&apos;(0)\ne0$. The function $t\mapsto f(r(t))$ has an extremum at $t=0$, so $\nabla f(a)\cdot r&apos;(0)=0$. Also $g(r(t))=c$ gives $\nabla g(a)\cdot r&apos;(0)=0$. In the plane, two vectors perpendicular to the same nonzero vector $r&apos;(0)$ are parallel; since $\nabla g(a)\ne0$, there is $\lambda$ with $\nabla f(a)=\lambda\nabla g(a)$.&lt;/p&gt;

  &lt;p&gt;In three variables the same argument for every curve on the surface $g=c$ through $a$ shows that $\nabla f(a)$ is perpendicular to the tangent plane, hence parallel to the normal $\nabla g(a)$.&lt;/p&gt;
&lt;/div&gt;

&lt;p&gt;The picture: moving along the constraint curve, $f$ increases or decreases as we cross level curves of $f$. At an extremum the constraint curve is &lt;em&gt;tangent&lt;/em&gt; to a level curve, so the two normals $\nabla f$ and $\nabla g$ are parallel.&lt;/p&gt;

&lt;div class=&quot;reel-video&quot;&gt;
  &lt;video controls=&quot;&quot; playsinline=&quot;&quot; preload=&quot;metadata&quot; src=&quot;/public/videos/reels/lagrange-tangent-contours.mp4&quot;&gt;&lt;/video&gt;
  &lt;p class=&quot;reel-caption&quot;&gt;Level curves xy = c swell until they just touch the ellipse x²/4 + y² = 1; at the touching point ∇f is parallel to ∇g (silent video, about 2 minutes).&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;interactive-frame&quot;&gt;
  &lt;div class=&quot;interactive-frame-head&quot;&gt;
    &lt;div class=&quot;interactive-frame-title&quot;&gt;Lagrange multipliers&lt;/div&gt;
    &lt;div class=&quot;interactive-frame-desc&quot;&gt;Move along the constraint; at an extremum ∇f is parallel to ∇g.&lt;/div&gt;
  &lt;/div&gt;
  &lt;iframe src=&quot;/interactives/chapter12/lagrange-en.html&quot; title=&quot;Lagrange multipliers&quot; loading=&quot;lazy&quot; style=&quot;height: 700px;&quot;&gt;&lt;/iframe&gt;
  &lt;div class=&quot;interactive-frame-foot&quot;&gt;
    &lt;a href=&quot;/interactives/chapter12/lagrange-en.html&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;Open the interactive in a new window&lt;/a&gt;
  &lt;/div&gt;
&lt;/div&gt;

&lt;p&gt;&lt;strong&gt;Method.&lt;/strong&gt; Solve $\nabla f=\lambda\nabla g$, $g=c$ (three equations in the three unknowns $x,y,\lambda$ for two variables). Compare $f$ at the solutions; if the constraint set is closed and bounded, the maximum and minimum are among them (together with any points where $\nabla g=0$).&lt;/p&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Example 1.&lt;/strong&gt; Extrema of $f=x^2+2y^2$ on the circle $x^2+y^2=1$. The system: $2x=2\lambda x$, $4y=2\lambda y$. If $x\ne0$ then $\lambda=1$, forcing $y=0$, $x=\pm1$, $f=1$. If $x=0$ then $y=\pm1$ ($\lambda=2$), $f=2$. Maximum $2$, minimum $1$.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Example 2 (The box of largest volume).&lt;/strong&gt; Maximise $V=xyz$ with surface area $2(xy+yz+zx)=24$, $x,y,z&amp;gt;0$. The system:&lt;/p&gt;

\[yz=2\lambda(y+z),\quad xz=2\lambda(x+z),\quad xy=2\lambda(x+y).\]

  &lt;p&gt;Multiply the first equation by $x$, the second by $y$ and subtract: $2\lambda z(x-y)=0$. Since $\lambda\ne0$ (otherwise $yz=0$), $x=y$; likewise $y=z$. The constraint gives $6x^2=24$, $x=2$: a cube of side $2$, $V=8$.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Example 3 (Utility and budget).&lt;/strong&gt; Maximise $U=x^{1/2}y^{1/2}$ subject to $2x+3y=60$. The system $U_x=2\lambda$, $U_y=3\lambda$ gives $\dfrac{U_x}{U_y}=\dfrac yx=\dfrac23$: the marginal rate of substitution (lesson 11_03) equals the price ratio. So $y=2x/3$, $4x=60$, $x=15$, $y=10$, $\lambda=U_x/2\approx0.204$. The meaning of $\lambda$ is in lesson 12_05.&lt;/p&gt;
&lt;/div&gt;

&lt;h2 id=&quot;when-the-method-fails&quot;&gt;When the method fails&lt;/h2&gt;

&lt;p&gt;The condition $\nabla g(a)\ne0$ is needed. Minimise $f=x$ on the curve $y^2=x^3$: since $x^3=y^2\ge0$, $x\ge0$, and the minimum is at $(0,0)$. But $\nabla f=(1,0)$ while $\nabla g=(-3x^2,2y)=(0,0)$ at the origin, so no $\lambda$ exists. Always check the points with $\nabla g=0$ separately.&lt;/p&gt;

&lt;h2 id=&quot;exercises&quot;&gt;Exercises&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Basic.&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;Extrema of $x+y$ on $x^2+y^2=2$.&lt;/li&gt;
  &lt;li&gt;The minimum of $x^2+y^2$ on the line $x+2y=5$.&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Answers&lt;/summary&gt;

  &lt;ol&gt;
    &lt;li&gt;$1=2\lambda x=2\lambda y$, so $x=y=\pm1$: maximum $2$, minimum $-2$.&lt;/li&gt;
    &lt;li&gt;$(x,y)=\lambda(1,2)/2$, so $y=2x$, $x=1$, $y=2$, value $5$.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;p&gt;&lt;strong&gt;Intermediate.&lt;/strong&gt;&lt;/p&gt;

&lt;ol start=&quot;3&quot;&gt;
  &lt;li&gt;Find the point of the plane $x+2y+2z=9$ closest to the origin.&lt;/li&gt;
  &lt;li&gt;Find the maximum of $xy$ on the ellipse $\dfrac{x^2}8+\dfrac{y^2}2=1$.&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Answers&lt;/summary&gt;

  &lt;ol start=&quot;3&quot;&gt;
    &lt;li&gt;$(x,y,z)$ is proportional to $(1,2,2)$: the point $(1,2,2)$, at distance $3$.&lt;/li&gt;
    &lt;li&gt;$y=\lambda x/4$ and $x=\lambda y$ give $\lambda=\pm2$; with $x=2y$: $y^2=1$, so the maximum is $xy=2$ at $\pm(2,1)$.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;p&gt;&lt;strong&gt;Advanced.&lt;/strong&gt;&lt;/p&gt;

&lt;ol start=&quot;5&quot;&gt;
  &lt;li&gt;Use Lagrange to prove the AM-GM inequality for three positive numbers: $xyz\le\big(\tfrac{x+y+z}3\big)^3$.&lt;/li&gt;
  &lt;li&gt;Explain with level curves why in example 1 the points $(\pm1,0)$ give the minimum.&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Hints&lt;/summary&gt;

  &lt;ol start=&quot;5&quot;&gt;
    &lt;li&gt;Maximise $xyz$ subject to $x+y+z=S$: $yz=xz=xy=\lambda$ gives $x=y=z=S/3$. With $x,y,z\ge0$ the constraint set is a closed triangle and $xyz=0$ on its edges, so this is the maximum.&lt;/li&gt;
    &lt;li&gt;The level curves $x^2+2y^2=k$ are ellipses flattened along the $y$-axis. The smallest one touching the circle has $k=1$, touching at $(\pm1,0)$; the largest one that still touches has $k=2$, at $(0,\pm1)$.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;h2 id=&quot;summary&quot;&gt;Summary&lt;/h2&gt;

&lt;div class=&quot;content-box summary-box textbook-block&quot;&gt;
  &lt;ul&gt;
    &lt;li&gt;At a constrained extremum (with $\nabla g\ne0$): $\nabla f=\lambda\nabla g$.&lt;/li&gt;
    &lt;li&gt;Geometry: a level curve of $f$ is tangent to the constraint curve.&lt;/li&gt;
    &lt;li&gt;Solve $\nabla f=\lambda\nabla g$, $g=c$ and compare values; check points with $\nabla g=0$ separately.&lt;/li&gt;
    &lt;li&gt;Economics: the marginal rate of substitution equals the price ratio.&lt;/li&gt;
  &lt;/ul&gt;
&lt;/div&gt;
</content>
 </entry>
 
 <entry>
   <title>Absolute maxima and minima on closed regions</title>
   <link href="https://calculus-self-learning.pages.dev/contents/en/chapter12/12_02_Absolute_maxima_and_minima_on_closed_regions/"/>
   <updated>2026-12-01T00:00:00+00:00</updated>
   <id>https://calculus-self-learning.pages.dev/contents/en/chapter12/12_02_Absolute_maxima_and_minima_on_closed_regions</id>
   <content type="html">&lt;div class=&quot;textbook-objectives&quot;&gt;

  &lt;p&gt;&lt;strong&gt;Learning objectives.&lt;/strong&gt; After this lesson you can:&lt;/p&gt;

  &lt;ul&gt;
    &lt;li&gt;state and prove the extreme value theorem for functions of two variables;&lt;/li&gt;
    &lt;li&gt;find absolute maxima and minima on a closed bounded region by examining the interior and the boundary;&lt;/li&gt;
    &lt;li&gt;solve practical problems on regions that are not closed, with an extra argument.&lt;/li&gt;
  &lt;/ul&gt;

&lt;/div&gt;

&lt;h2 id=&quot;why-this-lesson&quot;&gt;Why this lesson&lt;/h2&gt;

&lt;p&gt;Lesson 12_01 finds &lt;em&gt;local&lt;/em&gt; extrema. In practice we need the &lt;em&gt;absolute&lt;/em&gt; maximum and minimum on a region: the hottest point of a metal plate, the lowest cost within technical limits. These can lie on the boundary, where $\nabla f$ need not vanish.&lt;/p&gt;

&lt;h2 id=&quot;the-extreme-value-theorem&quot;&gt;The extreme value theorem&lt;/h2&gt;

&lt;p&gt;A set $D\subset\mathbb R^2$ is &lt;strong&gt;closed&lt;/strong&gt; if it contains all its boundary points, and &lt;strong&gt;bounded&lt;/strong&gt; if it lies inside some disc.&lt;/p&gt;

&lt;div class=&quot;textbook-theorem&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Theorem 1 (Extreme value theorem).&lt;/strong&gt; A function $f$ continuous on a closed, bounded set $D$ attains a maximum and a minimum on $D$.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-proof&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Proof.&lt;/strong&gt; We use the two-dimensional Bolzano–Weierstrass theorem: every bounded sequence in $\mathbb R^2$ has a convergent subsequence (take a subsequence converging in the $x$ coordinate, then a further subsequence converging in $y$, as in lesson 01_06).&lt;/p&gt;

  &lt;p&gt;&lt;em&gt;$f$ is bounded above.&lt;/em&gt; Otherwise there are $p_n\in D$ with $f(p_n)&amp;gt;n$. A subsequence $p_{n_k}\to p$, and $p\in D$ because $D$ is closed. By continuity $f(p_{n_k})\to f(p)$, which is finite: a contradiction.&lt;/p&gt;

  &lt;p&gt;&lt;em&gt;The maximum is attained.&lt;/em&gt; Let $M=\sup_Df$ and choose $p_n\in D$ with $f(p_n)&amp;gt;M-1/n$. A subsequence converges to some $p\in D$, and $f(p)=\lim f(p_{n_k})=M$. For the minimum, apply this to $-f$.&lt;/p&gt;
&lt;/div&gt;

&lt;p&gt;&lt;strong&gt;Procedure.&lt;/strong&gt; (1) Find the critical points inside $D$ and evaluate $f$ there. (2) Find the maximum and minimum of $f$ on the boundary (usually by parametrising the boundary as a one-variable problem). (3) Compare all the values.&lt;/p&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Example 1.&lt;/strong&gt; $f=x^2-2xy+2y$ on the rectangle $[0,3]\times[0,2]$.&lt;/p&gt;

  &lt;ul&gt;
    &lt;li&gt;Interior: $\nabla f=(2x-2y,\,-2x+2)=0$ gives $(1,1)$, $f=1$.&lt;/li&gt;
    &lt;li&gt;$y=0$: $f=x^2\in[0,9]$. $x=3$: $f=9-4y\in[1,9]$. $y=2$: $f=(x-2)^2\in[0,4]$. $x=0$: $f=2y\in[0,4]$.&lt;/li&gt;
  &lt;/ul&gt;

  &lt;p&gt;The maximum $9$ is at $(3,0)$ and the minimum $0$ at $(0,0)$ and $(2,2)$, all on the boundary.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Example 2.&lt;/strong&gt; $f=x^2+y^2-2x$ on the disc $x^2+y^2\le4$. Interior: $(1,0)$, $f=-1$. On the boundary $x^2+y^2=4$: $f=4-2x$ with $x\in[-2,2]$, from $0$ to $8$. Maximum $8$ at $(-2,0)$, minimum $-1$ at $(1,0)$.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Example 3 (Temperature on a disc).&lt;/strong&gt; $T=x^2+2y^2-x$ on $x^2+y^2\le1$.&lt;/p&gt;

  &lt;ul&gt;
    &lt;li&gt;Interior: $(1/2,0)$, $T=-1/4$.&lt;/li&gt;
    &lt;li&gt;Boundary: $y^2=1-x^2$, $T=2-x^2-x$ for $x\in[-1,1]$; the derivative $-2x-1$ vanishes at $x=-1/2$, $T=9/4$; the endpoints give $T(1)=0$, $T(-1)=2$.&lt;/li&gt;
  &lt;/ul&gt;

  &lt;p&gt;The hottest value $9/4$ is at $(-1/2,\pm\sqrt3/2)$, the coldest $-1/4$ at $(1/2,0)$.&lt;/p&gt;
&lt;/div&gt;

&lt;h2 id=&quot;application-an-open-box&quot;&gt;Application: an open box&lt;/h2&gt;

&lt;p&gt;What is the least material $S=xy+2xz+2yz$ for an open-top rectangular box of volume $32$? Substituting $z=32/(xy)$: $S=xy+\dfrac{64}{y}+\dfrac{64}{x}$ for $x,y&amp;gt;0$. $\nabla S=0$ gives $y=64/x^2$ and $x=64/y^2$, so $x=y=4$, $z=2$, $S=48$.&lt;/p&gt;

&lt;p&gt;The region $x,y&amp;gt;0$ is not closed, so an extra argument is needed: as $x$ or $y$ tends to $0$ or $\infty$, $S\to\infty$ (if $x\to0$ then $64/x\to\infty$; if $x\to\infty$ then $xy$ or $64/y$ is large). So the minimum is attained on a closed bounded set such as $[\varepsilon,R]^2$, at the only critical point.&lt;/p&gt;

&lt;h2 id=&quot;exercises&quot;&gt;Exercises&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Basic.&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;Find the maximum and minimum of $f=x+y$ on the square $[0,1]^2$.&lt;/li&gt;
  &lt;li&gt;Find the maximum and minimum of $f=xy$ on the disc $x^2+y^2\le2$.&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Answers&lt;/summary&gt;

  &lt;ol&gt;
    &lt;li&gt;There are no critical points; the maximum $2$ is at $(1,1)$ and the minimum $0$ at $(0,0)$.&lt;/li&gt;
    &lt;li&gt;Interior: $(0,0)$, $f=0$. Boundary $x=\sqrt2\cos t$, $y=\sqrt2\sin t$: $f=\sin2t$. Maximum $1$ at $\pm(1,1)$, minimum $-1$ at $\pm(1,-1)$.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;p&gt;&lt;strong&gt;Intermediate.&lt;/strong&gt;&lt;/p&gt;

&lt;ol start=&quot;3&quot;&gt;
  &lt;li&gt;$f=x^2+y^2-x-y$ on the triangle $x,y\ge0$, $x+y\le2$.&lt;/li&gt;
  &lt;li&gt;Show that among closed rectangular boxes of fixed volume $V$, the cube has the least surface area.&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Answers&lt;/summary&gt;

  &lt;ol start=&quot;3&quot;&gt;
    &lt;li&gt;Interior $(1/2,1/2)$, $f=-1/2$. Edge $y=0$: $x^2-x\in[-1/4,2]$; edge $x=0$ likewise; edge $x+y=2$: $2(x-1)^2\in[0,2]$. Maximum $2$ at $(2,0)$ and $(0,2)$; minimum $-1/2$.&lt;/li&gt;
    &lt;li&gt;$S=2(xy+V/x+V/y)$; $\nabla S=0$ gives $x=y=V^{1/3}$ and $z=V^{1/3}$; argue at the boundary as for the open box.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;p&gt;&lt;strong&gt;Advanced.&lt;/strong&gt;&lt;/p&gt;

&lt;ol start=&quot;5&quot;&gt;
  &lt;li&gt;Give a continuous function on the open disc $x^2+y^2&amp;lt;1$ with no maximum, and a continuous function on an unbounded closed set with no minimum.&lt;/li&gt;
  &lt;li&gt;Prove: if $f$ is continuous on $\mathbb R^2$ and $f(p)\to+\infty$ as $\lVert p\rVert\to\infty$, then $f$ attains a minimum.&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Hints&lt;/summary&gt;

  &lt;ol start=&quot;5&quot;&gt;
    &lt;li&gt;$f=x$ on the open disc (it approaches 1 but never reaches it); $f=e^{-x}$ on the half-plane $x\ge0$ (it approaches 0 but never reaches it).&lt;/li&gt;
    &lt;li&gt;Choose $R$ with $f&amp;gt;f(0)$ for $\lVert p\rVert&amp;gt;R$. On the closed disc of radius $R$, $f$ attains a minimum (theorem 1); that value is $\le f(0)$, so it is the minimum on the whole plane.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;h2 id=&quot;summary&quot;&gt;Summary&lt;/h2&gt;

&lt;div class=&quot;content-box summary-box textbook-block&quot;&gt;
  &lt;ul&gt;
    &lt;li&gt;A continuous function on a closed, bounded set always attains a maximum and a minimum.&lt;/li&gt;
    &lt;li&gt;Procedure: interior critical points, extrema on the boundary, compare.&lt;/li&gt;
    &lt;li&gt;Absolute extrema often lie on the boundary, where $\nabla f\ne0$.&lt;/li&gt;
    &lt;li&gt;Regions that are not closed: check the behaviour towards the boundary or infinity.&lt;/li&gt;
  &lt;/ul&gt;
&lt;/div&gt;
</content>
 </entry>
 
 <entry>
   <title>Critical points and the Hessian test</title>
   <link href="https://calculus-self-learning.pages.dev/contents/en/chapter12/12_01_Critical_points_and_the_Hessian_test/"/>
   <updated>2026-12-01T00:00:00+00:00</updated>
   <id>https://calculus-self-learning.pages.dev/contents/en/chapter12/12_01_Critical_points_and_the_Hessian_test</id>
   <content type="html">&lt;div class=&quot;textbook-objectives&quot;&gt;

  &lt;p&gt;&lt;strong&gt;Learning objectives.&lt;/strong&gt; After this lesson you can:&lt;/p&gt;

  &lt;ul&gt;
    &lt;li&gt;find critical points by solving $\nabla f=0$;&lt;/li&gt;
    &lt;li&gt;classify minima, maxima and saddle points with $D=f_{xx}f_{yy}-f_{xy}^2$ or the eigenvalues of the Hessian;&lt;/li&gt;
    &lt;li&gt;prove the test from the second-order Taylor formula;&lt;/li&gt;
    &lt;li&gt;recognise the cases where the test is inconclusive.&lt;/li&gt;
  &lt;/ul&gt;

&lt;/div&gt;

&lt;h2 id=&quot;why-this-lesson&quot;&gt;Why this lesson&lt;/h2&gt;

&lt;p&gt;In one variable, extrema occur where $f&apos;=0$, and the sign of $f&apos;&apos;$ tells a valley from a peak. Two variables add a third possibility: a &lt;strong&gt;saddle point&lt;/strong&gt;, curving up in one direction and down in another. In deep learning, most critical points of a loss function are saddle points rather than minima.&lt;/p&gt;

&lt;h2 id=&quot;the-necessary-condition&quot;&gt;The necessary condition&lt;/h2&gt;

&lt;div class=&quot;textbook-theorem&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Theorem 1 (Fermat).&lt;/strong&gt; If $f$ has a local extremum at an interior point $a$ and has partial derivatives there, then $\nabla f(a)=0$.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-proof&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Proof.&lt;/strong&gt; The one-variable function $g(t)=f(a+te_1)$ has a local extremum at $t=0$, so $g&apos;(0)=f_x(a)=0$ (Fermat’s theorem in one variable). Similarly $f_y(a)=0$.&lt;/p&gt;
&lt;/div&gt;

&lt;p&gt;A point with $\nabla f=0$ is a &lt;strong&gt;critical point&lt;/strong&gt; (or stationary point). The condition is only necessary: $f=xy$ has $\nabla f(0,0)=0$ but the origin is not an extremum.&lt;/p&gt;

&lt;h2 id=&quot;the-second-derivative-test&quot;&gt;The second-derivative test&lt;/h2&gt;

&lt;div class=&quot;textbook-theorem&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Theorem 2.&lt;/strong&gt; Suppose $f$ has continuous second partial derivatives near a critical point $a$, and let $D=f_{xx}f_{yy}-f_{xy}^2$ at $a$.&lt;/p&gt;

  &lt;ol&gt;
    &lt;li&gt;$D&amp;gt;0$, $f_{xx}&amp;gt;0$: local minimum.&lt;/li&gt;
    &lt;li&gt;$D&amp;gt;0$, $f_{xx}&amp;lt;0$: local maximum.&lt;/li&gt;
    &lt;li&gt;$D&amp;lt;0$: saddle point.&lt;/li&gt;
    &lt;li&gt;$D=0$: inconclusive.&lt;/li&gt;
  &lt;/ol&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-proof&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Proof.&lt;/strong&gt; By lesson 11_04, since $\nabla f(a)=0$: $f(a+h)-f(a)=\tfrac12Q(h)+R(h)$ with $Q(h)=h^\top Hh$ and $R(h)/\lVert h\rVert^2\to0$. Write $h=(p,q)$, $A=f_{xx}$, $B=f_{xy}$, $C=f_{yy}$. When $A\ne0$, complete the square:&lt;/p&gt;

\[Q=Ap^2+2Bpq+Cq^2=A\Big(p+\frac BAq\Big)^2+\frac DAq^2.\]

  &lt;p&gt;(1) If $A&amp;gt;0$ and $D&amp;gt;0$, then $Q(h)&amp;gt;0$ for $h\ne0$. On the unit circle $Q$ is continuous, so it has a minimum $m&amp;gt;0$; since $Q$ is homogeneous of degree two, $Q(h)\ge m\lVert h\rVert^2$. Then $f(a+h)-f(a)\ge\big(\tfrac m2-\tfrac{\lvert R\rvert}{\lVert h\rVert^2}\big)\lVert h\rVert^2&amp;gt;0$ for small enough $h\ne0$.&lt;/p&gt;

  &lt;p&gt;(2) Apply (1) to $-f$.&lt;/p&gt;

  &lt;p&gt;(3) If $D&amp;lt;0$, $Q$ takes both signs: for $A\ne0$, $q=0$ gives $Q=Ap^2$ with the sign of $A$, and $p=-Bq/A$ gives $Q=Dq^2/A$ with the opposite sign; for $A=0$, $B\ne0$ and $Q(p,q)=q(2Bp+Cq)$ changes sign. Along a direction $u$ with $Q(u)&amp;gt;0$, $f(a+tu)-f(a)=t^2\big(\tfrac12Q(u)+R(tu)/t^2\big)&amp;gt;0$ for small $t$; along a direction with $Q&amp;lt;0$ the difference is negative. So $a$ is a saddle point.&lt;/p&gt;

  &lt;p&gt;(4) See example 2.&lt;/p&gt;
&lt;/div&gt;

&lt;p&gt;In terms of eigenvalues: the symmetric $H$ has two real eigenvalues $\lambda_1$, $\lambda_2$ with $D=\lambda_1\lambda_2$. Both positive: minimum; both negative: maximum; opposite signs: saddle. This extends directly to $n$ variables.&lt;/p&gt;

&lt;div class=&quot;reel-video&quot;&gt;
  &lt;video controls=&quot;&quot; playsinline=&quot;&quot; preload=&quot;metadata&quot; src=&quot;/public/videos/reels/saddle-point-hessian.mp4&quot;&gt;&lt;/video&gt;
  &lt;p class=&quot;reel-caption&quot;&gt;Saddle points and the Hessian: z = x² − y² has a horizontal tangent plane yet curves up along x and down along y; curvature in every direction, the three kinds of critical points, the xy saddle, the D test, the example x³ − 3x + y² and a ball rolling off the saddle (silent video, about 3 minutes 4 seconds).&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;interactive-frame&quot;&gt;
  &lt;div class=&quot;interactive-frame-head&quot;&gt;
    &lt;div class=&quot;interactive-frame-title&quot;&gt;The Hessian and the type of a critical point&lt;/div&gt;
    &lt;div class=&quot;interactive-frame-desc&quot;&gt;Drag the point to see the Hessian, its eigenvalues and the type; an all-green background means a convex function.&lt;/div&gt;
  &lt;/div&gt;
  &lt;iframe src=&quot;/interactives/chapter12/hessian-classifier-en.html&quot; title=&quot;The Hessian and the type of a critical point&quot; loading=&quot;lazy&quot; style=&quot;height: 720px;&quot;&gt;&lt;/iframe&gt;
  &lt;div class=&quot;interactive-frame-foot&quot;&gt;
    &lt;a href=&quot;/interactives/chapter12/hessian-classifier-en.html&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;Open the interactive in a new window&lt;/a&gt;
  &lt;/div&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Example 1.&lt;/strong&gt; $f=x^3-3x+y^2$. $\nabla f=(3x^2-3,2y)=0$ gives $(\pm1,0)$. $H=\operatorname{diag}(6x,2)$.&lt;/p&gt;

  &lt;ul&gt;
    &lt;li&gt;$(1,0)$: $D=12&amp;gt;0$, $f_{xx}=6&amp;gt;0$: minimum, $f=-2$.&lt;/li&gt;
    &lt;li&gt;$(-1,0)$: $D=-12&amp;lt;0$: saddle point.&lt;/li&gt;
  &lt;/ul&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Example 2 ($D=0$).&lt;/strong&gt; $x^4+y^4$ and $x^4-y^4$ both have $H(0,0)=0$, $D=0$. The first has a minimum at the origin, the second a saddle point. Second order carries no information here; higher-order terms decide.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Example 3.&lt;/strong&gt; $f=x^3+y^3-3xy$. $\nabla f=(3x^2-3y,3y^2-3x)=0$ gives $y=x^2$, $x^4=x$, so $(0,0)$ and $(1,1)$. $H=\begin{pmatrix}6x&amp;amp;-3\\-3&amp;amp;6y\end{pmatrix}$.&lt;/p&gt;

  &lt;ul&gt;
    &lt;li&gt;$(0,0)$: $D=-9$: saddle point.&lt;/li&gt;
    &lt;li&gt;$(1,1)$: $D=36-9=27&amp;gt;0$, $f_{xx}=6&amp;gt;0$: minimum, $f=-1$.&lt;/li&gt;
  &lt;/ul&gt;
&lt;/div&gt;

&lt;h2 id=&quot;applications&quot;&gt;Applications&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Economics: profit from two products.&lt;/strong&gt; A firm’s profit is $P(x,y)=-x^2-y^2+xy+10x+4y$ (in millions) as a function of the output of two goods. $\nabla P=(-2x+y+10,\,-2y+x+4)=0$ gives $(x,y)=(8,6)$. $H=\begin{pmatrix}-2&amp;amp;1\\1&amp;amp;-2\end{pmatrix}$, $D=3&amp;gt;0$, $P_{xx}&amp;lt;0$: maximum, $P(8,6)=52$.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Machine learning: saddle points.&lt;/strong&gt; With $n$ parameters, a critical point is a minimum only if all $n$ Hessian eigenvalues are positive. If each sign were “random”, the chance would be about $2^{-n}$, so in high dimensions saddle points are far more common than minima. Noisy gradient descent (SGD) usually escapes a saddle point along a direction with a negative eigenvalue.&lt;/p&gt;

&lt;h2 id=&quot;exercises&quot;&gt;Exercises&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Basic.&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;Find and classify the critical points of $f=x^2+y^2-2x+4y$.&lt;/li&gt;
  &lt;li&gt;Show that the origin is a saddle point of $f=xy$.&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Answers&lt;/summary&gt;

  &lt;ol&gt;
    &lt;li&gt;$(1,-2)$, $D=4&amp;gt;0$, $f_{xx}=2&amp;gt;0$: minimum $f=-5$.&lt;/li&gt;
    &lt;li&gt;$H=\begin{pmatrix}0&amp;amp;1\\1&amp;amp;0\end{pmatrix}$, $D=-1&amp;lt;0$. Along $y=x$, $f=x^2&amp;gt;0$; along $y=-x$, $f=-x^2&amp;lt;0$.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;p&gt;&lt;strong&gt;Intermediate.&lt;/strong&gt;&lt;/p&gt;

&lt;ol start=&quot;3&quot;&gt;
  &lt;li&gt;Find and classify the critical points of $f=x^2+xy+y^2-3x$.&lt;/li&gt;
  &lt;li&gt;Find and classify the critical points of $f=x^3-12x+y^2$.&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Answers&lt;/summary&gt;

  &lt;ol start=&quot;3&quot;&gt;
    &lt;li&gt;$2x+y=3$, $x+2y=0$ give $(2,-1)$; $D=3&amp;gt;0$, $f_{xx}=2$: minimum $f=-3$.&lt;/li&gt;
    &lt;li&gt;$(2,0)$: $D=24&amp;gt;0$, minimum $f=-16$. $(-2,0)$: $D=-24$, saddle point.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;p&gt;&lt;strong&gt;Advanced.&lt;/strong&gt;&lt;/p&gt;

&lt;ol start=&quot;5&quot;&gt;
  &lt;li&gt;Prove that the quadratic form $Ap^2+2Bpq+Cq^2$ is positive for all $(p,q)\ne0$ if and only if $A&amp;gt;0$ and $AC-B^2&amp;gt;0$.&lt;/li&gt;
  &lt;li&gt;(Peano’s example.) $f=(y-x^2)(y-2x^2)$. Show that on every line through the origin $f$ has a minimum at the origin, but the origin is not a local minimum of $f$.&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Hints&lt;/summary&gt;

  &lt;ol start=&quot;5&quot;&gt;
    &lt;li&gt;Forward: $(p,q)=(1,0)$ gives $A&amp;gt;0$; $p=-Bq/A$, $q=1$ gives $D/A&amp;gt;0$. Backward: the completed square in the proof.&lt;/li&gt;
    &lt;li&gt;On $y=mx$ with $m\ne0$: $f=m^2x^2-3mx^3+2x^4&amp;gt;0$ for small $x\ne0$; on $y=0$: $f=2x^4$; on $x=0$: $f=y^2$. But on $y=1.5x^2$: $f=(0.5x^2)(-0.5x^2)&amp;lt;0$.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;h2 id=&quot;summary&quot;&gt;Summary&lt;/h2&gt;

&lt;div class=&quot;content-box summary-box textbook-block&quot;&gt;
  &lt;ul&gt;
    &lt;li&gt;Necessary condition: $\nabla f=0$.&lt;/li&gt;
    &lt;li&gt;$D=f_{xx}f_{yy}-f_{xy}^2$: $D&amp;gt;0$ gives an extremum (the sign of $f_{xx}$ decides which), $D&amp;lt;0$ a saddle, $D=0$ is inconclusive.&lt;/li&gt;
    &lt;li&gt;Equivalently: the signs of the Hessian eigenvalues.&lt;/li&gt;
    &lt;li&gt;In high dimensions, saddle points are much more common than minima.&lt;/li&gt;
  &lt;/ul&gt;
&lt;/div&gt;
</content>
 </entry>
 
 <entry>
   <title>Backpropagation is the chain rule</title>
   <link href="https://calculus-self-learning.pages.dev/contents/en/chapter11/11_05_Backpropagation_is_the_chain_rule/"/>
   <updated>2026-12-01T00:00:00+00:00</updated>
   <id>https://calculus-self-learning.pages.dev/contents/en/chapter11/11_05_Backpropagation_is_the_chain_rule</id>
   <content type="html">&lt;div class=&quot;textbook-objectives&quot;&gt;

  &lt;p&gt;&lt;strong&gt;Learning objectives.&lt;/strong&gt; After this lesson you can:&lt;/p&gt;

  &lt;ul&gt;
    &lt;li&gt;draw the computational graph of an expression and run the forward and backward passes;&lt;/li&gt;
    &lt;li&gt;prove the “sum gradients over branches” rule from the chain rule;&lt;/li&gt;
    &lt;li&gt;compute by hand the gradient of a logistic neuron and of a small two-layer network;&lt;/li&gt;
    &lt;li&gt;check a gradient with central differences.&lt;/li&gt;
  &lt;/ul&gt;

&lt;/div&gt;

&lt;h2 id=&quot;why-this-lesson&quot;&gt;Why this lesson&lt;/h2&gt;

&lt;p&gt;Every neural network is trained by gradient descent, and the gradient is computed by &lt;strong&gt;backpropagation&lt;/strong&gt;. The algorithm contains nothing beyond the chain rule (lesson 11_01), organised cleverly so that the whole gradient costs about as much as one evaluation of the function.&lt;/p&gt;

&lt;h2 id=&quot;computational-graphs&quot;&gt;Computational graphs&lt;/h2&gt;

&lt;p&gt;An expression is broken into elementary operations; each node is an intermediate variable, and an edge $v\to w$ means $w$ is computed directly from $v$. The &lt;strong&gt;forward pass&lt;/strong&gt; computes the node values in order. The &lt;strong&gt;backward pass&lt;/strong&gt; computes $\bar v=\partial L/\partial v$ (the &lt;em&gt;adjoint&lt;/em&gt; of $v$) from the output back to the inputs, starting from $\bar L=1$.&lt;/p&gt;

&lt;div class=&quot;textbook-theorem&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Theorem 1.&lt;/strong&gt; In an acyclic computational graph with output $L$, for every node $v\ne L$:&lt;/p&gt;

\[\bar v=\sum_{w:\ v\to w}\bar w\,\frac{\partial w}{\partial v},\]

  &lt;p&gt;where $\partial w/\partial v$ is the &lt;em&gt;local&lt;/em&gt; partial derivative of the operation that produces $w$.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-proof&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Proof.&lt;/strong&gt; View $L$ as a function of $v$ through the children $w_1,\dots,w_k$ of $v$: changing $v$ (keeping fixed the nodes that do not depend on $v$) affects $L$ only through $w_1,\dots,w_k$. The chain rule with several intermediate variables (lesson 11_01) gives $\dfrac{\partial L}{\partial v}=\sum_i\dfrac{\partial L}{\partial w_i}\dfrac{\partial w_i}{\partial v}$. Visiting the nodes in reverse topological order, every $\bar w_i$ is computed before $\bar v$, so the formula yields all adjoints (induction along that order).&lt;/p&gt;
&lt;/div&gt;

&lt;p&gt;Each edge is used once in the backward pass, so the backward pass costs the same order as the forward pass, however many parameters there are. Computing each partial derivative in the forward direction (forward mode) would need one pass per parameter.&lt;/p&gt;

&lt;div class=&quot;interactive-frame&quot;&gt;
  &lt;div class=&quot;interactive-frame-head&quot;&gt;
    &lt;div class=&quot;interactive-frame-title&quot;&gt;Computation graph: forward and backward passes&lt;/div&gt;
    &lt;div class=&quot;interactive-frame-desc&quot;&gt;Step through the node values, then the adjoints.&lt;/div&gt;
  &lt;/div&gt;
  &lt;iframe src=&quot;/interactives/chapter11/computation-graph-en.html&quot; title=&quot;Computation graph: forward and backward passes&quot; loading=&quot;lazy&quot; style=&quot;height: 720px;&quot;&gt;&lt;/iframe&gt;
  &lt;div class=&quot;interactive-frame-foot&quot;&gt;
    &lt;a href=&quot;/interactives/chapter11/computation-graph-en.html&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;Open the interactive in a new window&lt;/a&gt;
  &lt;/div&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Example 1.&lt;/strong&gt; $f=(x+y)z$ at $(x,y,z)=(-2,5,-4)$. Forward: $q=x+y=3$, $f=qz=-12$. Backward: $\bar f=1$; $\bar z=q=3$; $\bar q=z=-4$; $\bar x=\bar q\cdot1=-4$, $\bar y=-4$. Addition “distributes” the gradient, multiplication “swaps” the values.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Example 2 (A logistic neuron).&lt;/strong&gt; $z=wx+b$, $a=\sigma(z)=\dfrac1{1+e^{-z}}$, $L=-[y\ln a+(1-y)\ln(1-a)]$. Since $\sigma&apos;=\sigma(1-\sigma)$,&lt;/p&gt;

\[\bar z=\Big(-\frac ya+\frac{1-y}{1-a}\Big)a(1-a)=a-y,\qquad\bar w=(a-y)x,\qquad\bar b=a-y.\]

  &lt;p&gt;With $x=2$, $w=0.5$, $b=-0.5$, $y=1$: $z=0.5$, $a\approx0.6225$, $L\approx0.4741$, $\bar w\approx-0.7551$, $\bar b\approx-0.3775$. The gradient is negative, so gradient descent increases $w$ and $b$, pushing $a$ towards 1.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Example 3 (A two-layer network by hand).&lt;/strong&gt; Input $x=(1,2)$, hidden layer $h=\operatorname{ReLU}(W x)$ with $W=\begin{pmatrix}1&amp;amp;-1\\0.5&amp;amp;0.5\end{pmatrix}$, output $\hat y=v\cdot h$ with $v=(2,1)$, loss $L=\tfrac12(\hat y-y)^2$, $y=1$.&lt;/p&gt;

  &lt;p&gt;&lt;em&gt;Forward:&lt;/em&gt; $Wx=(-1,1.5)$, $h=(0,1.5)$, $\hat y=1.5$, $L=0.125$.&lt;/p&gt;

  &lt;p&gt;&lt;em&gt;Backward:&lt;/em&gt; $\bar{\hat y}=\hat y-y=0.5$; $\bar v=0.5\,h=(0,0.75)$; $\bar h=0.5\,v=(1,0.5)$; through the ReLU (derivative 0 for negative input, 1 for positive): $\overline{Wx}=(0,0.5)$; finally $\bar W=\overline{Wx}\,x^\top=\begin{pmatrix}0&amp;amp;0\\0.5&amp;amp;1\end{pmatrix}$.&lt;/p&gt;

  &lt;p&gt;The first row of $\bar W$ is 0 because the first neuron is “off” (ReLU of a negative number): no signal flows back through it.&lt;/p&gt;
&lt;/div&gt;

&lt;h2 id=&quot;application-gradient-checking&quot;&gt;Application: gradient checking&lt;/h2&gt;

&lt;p&gt;When writing a backward pass yourself, compare it with the central difference $\dfrac{L(\theta+\varepsilon e_i)-L(\theta-\varepsilon e_i)}{2\varepsilon}$, whose error is $O(\varepsilon^2)$ (lesson 08_06). For example 3, $\varepsilon=10^{-6}$ reproduces $\bar W$ and $\bar v$ to about $10^{-10}$. Libraries such as PyTorch and JAX implement the backward pass of each elementary operation and combine them by exactly theorem 1.&lt;/p&gt;

&lt;h2 id=&quot;exercises&quot;&gt;Exercises&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Basic.&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;Run the forward and backward passes for $f=(x+2y)^2$ at $(1,1)$.&lt;/li&gt;
  &lt;li&gt;Find $\partial L/\partial w$ and $\partial L/\partial b$ for $\hat y=wx+b$, $L=(\hat y-y)^2$ with $x=3$, $w=1$, $b=0$, $y=2$.&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Answers&lt;/summary&gt;

  &lt;ol&gt;
    &lt;li&gt;$q=3$, $f=9$; $\bar q=2q=6$; $\bar x=6$, $\bar y=12$.&lt;/li&gt;
    &lt;li&gt;$\hat y=3$, $L=1$, $\bar{\hat y}=2(\hat y-y)=2$, $\bar w=2x=6$, $\bar b=2$.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;p&gt;&lt;strong&gt;Intermediate.&lt;/strong&gt;&lt;/p&gt;

&lt;ol start=&quot;3&quot;&gt;
  &lt;li&gt;Prove that $\sigma&apos;(z)=\sigma(z)(1-\sigma(z))$.&lt;/li&gt;
  &lt;li&gt;Compute $f&apos;(3)$ for $f=x\cdot x+x$ with a computational graph in which the node $x$ has three outgoing edges.&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Answers&lt;/summary&gt;

  &lt;ol start=&quot;3&quot;&gt;
    &lt;li&gt;$\sigma&apos;=\dfrac{e^{-z}}{(1+e^{-z})^2}=\sigma\cdot\dfrac{e^{-z}}{1+e^{-z}}=\sigma(1-\sigma)$.&lt;/li&gt;
    &lt;li&gt;The three branches contribute $x+x+1$, total $2x+1=7$, as theorem 1 predicts.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;p&gt;&lt;strong&gt;Advanced.&lt;/strong&gt;&lt;/p&gt;

&lt;ol start=&quot;5&quot;&gt;
  &lt;li&gt;Softmax $p_i=e^{z_i}/\sum_je^{z_j}$ with loss $L=-\sum_ky_k\ln p_k$, where $\sum_ky_k=1$. Prove that $\partial L/\partial z_i=p_i-y_i$.&lt;/li&gt;
  &lt;li&gt;A network has $n$ parameters and a scalar loss. Compare the number of passes forward mode and reverse mode need for the full gradient; when is forward mode better?&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Hints&lt;/summary&gt;

  &lt;ol start=&quot;5&quot;&gt;
    &lt;li&gt;$\ln p_k=z_k-\ln\sum_je^{z_j}$, so $\partial\ln p_k/\partial z_i=\delta_{ki}-p_i$; hence $\partial L/\partial z_i=-\sum_ky_k(\delta_{ki}-p_i)=p_i-y_i$.&lt;/li&gt;
    &lt;li&gt;Forward mode needs $n$ passes; reverse mode needs one forward and one backward pass. Forward mode wins when there are fewer inputs than outputs (a “tall and narrow” Jacobian).&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;h2 id=&quot;summary&quot;&gt;Summary&lt;/h2&gt;

&lt;div class=&quot;content-box summary-box textbook-block&quot;&gt;
  &lt;ul&gt;
    &lt;li&gt;Backpropagation computes the adjoints $\bar v=\sum\bar w\,\partial w/\partial v$ in reverse topological order.&lt;/li&gt;
    &lt;li&gt;It is the chain rule; its cost is the same order as one function evaluation.&lt;/li&gt;
    &lt;li&gt;Addition distributes the gradient, multiplication swaps the values, and an inactive ReLU blocks the gradient.&lt;/li&gt;
    &lt;li&gt;A logistic neuron with cross-entropy has $\bar z=a-y$; always check with central differences.&lt;/li&gt;
  &lt;/ul&gt;
&lt;/div&gt;
</content>
 </entry>
 
 <entry>
   <title>Taylor's formula in several variables</title>
   <link href="https://calculus-self-learning.pages.dev/contents/en/chapter11/11_04_Taylors_formula_in_several_variables/"/>
   <updated>2026-12-01T00:00:00+00:00</updated>
   <id>https://calculus-self-learning.pages.dev/contents/en/chapter11/11_04_Taylors_formula_in_several_variables</id>
   <content type="html">&lt;div class=&quot;textbook-objectives&quot;&gt;

  &lt;p&gt;&lt;strong&gt;Learning objectives.&lt;/strong&gt; After this lesson you can:&lt;/p&gt;

  &lt;ul&gt;
    &lt;li&gt;write the second-order Taylor expansion $f(a+h)\approx f(a)+\nabla f(a)\cdot h+\tfrac12h^\top H(a)h$;&lt;/li&gt;
    &lt;li&gt;prove it by reducing to one variable;&lt;/li&gt;
    &lt;li&gt;use the quadratic approximation to estimate values and understand Newton’s method.&lt;/li&gt;
  &lt;/ul&gt;

&lt;/div&gt;

&lt;h2 id=&quot;why-this-lesson&quot;&gt;Why this lesson&lt;/h2&gt;

&lt;p&gt;The linear approximation (lesson 10_04) is the tangent plane; it cannot see whether the surface bends up or down. The quadratic approximation adds curvature, described by the Hessian matrix. It is the basis for classifying extrema in chapter 12 and for Newton’s method in optimisation.&lt;/p&gt;

&lt;h2 id=&quot;the-formula&quot;&gt;The formula&lt;/h2&gt;

&lt;p&gt;With $h=(h_1,h_2)$ and the Hessian matrix $H=\begin{pmatrix}f_{xx}&amp;amp;f_{xy}\\f_{xy}&amp;amp;f_{yy}\end{pmatrix}$ (symmetric by Schwarz’s theorem):&lt;/p&gt;

\[h^\top Hh=f_{xx}h_1^2+2f_{xy}h_1h_2+f_{yy}h_2^2.\]

&lt;div class=&quot;textbook-theorem&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Theorem 1 (Second-order Taylor).&lt;/strong&gt; If $f$ has continuous second partial derivatives near $a$, then&lt;/p&gt;

\[f(a+h)=f(a)+\nabla f(a)\cdot h+\tfrac12h^\top H(a)h+R(h),\qquad\frac{R(h)}{\lVert h\rVert^2}\to0\ \text{as}\ h\to0.\]

&lt;/div&gt;

&lt;div class=&quot;textbook-proof&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Proof.&lt;/strong&gt; Fix a small $h$ and let $g(t)=f(a+th)$, $t\in[0,1]$. By the chain rule,&lt;/p&gt;

\[g&apos;(t)=\nabla f(a+th)\cdot h,\qquad g&apos;&apos;(t)=h^\top H(a+th)\,h.\]

  &lt;p&gt;(Differentiate $g&apos;(t)=f_xh_1+f_yh_2$ once more and combine $f_{xy}=f_{yx}$.) The one-variable Taylor formula with the Lagrange remainder (lesson 08_01) gives $g(1)=g(0)+g&apos;(0)+\tfrac12g&apos;&apos;(\theta)$ for some $\theta\in(0,1)$. Hence&lt;/p&gt;

\[R(h)=\tfrac12h^\top\big(H(a+\theta h)-H(a)\big)h,\qquad\lvert R(h)\rvert\le\tfrac12\lVert H(a+\theta h)-H(a)\rVert\,\lVert h\rVert^2,\]

  &lt;p&gt;where the matrix norm is the operator norm. The second derivatives are continuous, so $H(a+\theta h)\to H(a)$ and $R(h)/\lVert h\rVert^2\to0$.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Example 1.&lt;/strong&gt; $f=e^x\cos y$ at $(0,0)$: $f=1$, $\nabla f=(1,0)$, $H=\begin{pmatrix}1&amp;amp;0\\0&amp;amp;-1\end{pmatrix}$. So&lt;/p&gt;

\[e^x\cos y\approx1+x+\tfrac12(x^2-y^2).\]

  &lt;p&gt;At $(0.1,0.2)$: the approximation gives $1.085$, the true value is $1.08314$; the linear approximation $1.1$ is much worse.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Example 2.&lt;/strong&gt; $f=\ln(1+x+2y)$ at $(0,0)$: $\nabla f=(1,2)$, $H=-\begin{pmatrix}1&amp;amp;2\\2&amp;amp;4\end{pmatrix}$, so $f\approx(x+2y)-\tfrac12(x+2y)^2$, which is exactly $\ln(1+u)\approx u-u^2/2$ with $u=x+2y$.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Example 3 (Preview of chapter 12).&lt;/strong&gt; $f=x^2+xy+y^2$ has $\nabla f(0,0)=0$ and $H=\begin{pmatrix}2&amp;amp;1\\1&amp;amp;2\end{pmatrix}$ with eigenvalues $1$ and $3$, both positive. Near the origin $f\approx\tfrac12h^\top Hh&amp;gt;0$, so the origin is a minimum.&lt;/p&gt;
&lt;/div&gt;

&lt;h2 id=&quot;application-newtons-method-optimisation-machine-learning&quot;&gt;Application: Newton’s method (optimisation, machine learning)&lt;/h2&gt;

&lt;p&gt;Replace $f$ by the quadratic model $m(h)=f(a)+\nabla f\cdot h+\tfrac12h^\top Hh$ and minimise the model: $\nabla m=\nabla f+Hh=0$, so&lt;/p&gt;

\[h=-H^{-1}\nabla f.\]

&lt;p&gt;For $L=(w_1-1)^2+10w_2^2$ from $(0,1)$ in lesson 11_02: $\nabla L=(-2,20)$, $H=\operatorname{diag}(2,20)$, $h=(1,-1)$, which lands on the minimum $(1,0)$ in one step, regardless of the elongated level curves. The price is computing $H$ and solving a system with it, which is very expensive with millions of parameters.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Physics.&lt;/strong&gt; Near an equilibrium $\nabla V=0$, the potential energy is $V\approx V_0+\tfrac12h^\top Hh$, so every small oscillation is harmonic, with frequencies set by the eigenvalues of $H$.&lt;/p&gt;

&lt;h2 id=&quot;exercises&quot;&gt;Exercises&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Basic.&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;Write the second-order expansion of $f=x^2y$ at $(1,1)$ in $h$, $k$, and find the exact remainder.&lt;/li&gt;
  &lt;li&gt;Write the second-order expansion of $\sin(x+y)$ at $(0,0)$.&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Answers&lt;/summary&gt;

  &lt;ol&gt;
    &lt;li&gt;$1+2h+k+h^2+2hk$; the exact value $(1+h)^2(1+k)$ is larger by exactly $h^2k$.&lt;/li&gt;
    &lt;li&gt;$x+y$ (the second-order terms are 0).&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;p&gt;&lt;strong&gt;Intermediate.&lt;/strong&gt;&lt;/p&gt;

&lt;ol start=&quot;3&quot;&gt;
  &lt;li&gt;Estimate $\sqrt{3.1^2+3.9^2}$ with the first- and second-order approximations of $f=\sqrt{x^2+y^2}$ at $(3,4)$.&lt;/li&gt;
  &lt;li&gt;Take one Newton step for $f=x^4+y^2$ from $(1,1)$.&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Answers&lt;/summary&gt;

  &lt;ol start=&quot;3&quot;&gt;
    &lt;li&gt;$\nabla f=(0.6,0.8)$, $H=\tfrac1{125}\begin{pmatrix}16&amp;amp;-12\\-12&amp;amp;9\end{pmatrix}$. First order: $4.98$; second order: $4.98+0.00196=4.98196$; true value $4.98197$.&lt;/li&gt;
    &lt;li&gt;$\nabla f=(4,2)$, $H=\operatorname{diag}(12,2)$, $h=(-1/3,-1)$, new point $(2/3,0)$.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;p&gt;&lt;strong&gt;Advanced.&lt;/strong&gt;&lt;/p&gt;

&lt;ol start=&quot;5&quot;&gt;
  &lt;li&gt;Prove: if $\nabla f(a)=0$ and $h^\top H(a)h\ge m\lVert h\rVert^2$ for some $m&amp;gt;0$, then $a$ is a strict local minimum.&lt;/li&gt;
  &lt;li&gt;Write the second-order expansion of $f=xyz$ at $(1,1,1)$ and compare with $(1+h)(1+k)(1+l)$.&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Hints&lt;/summary&gt;

  &lt;ol start=&quot;5&quot;&gt;
    &lt;li&gt;$f(a+h)-f(a)=\tfrac12h^\top Hh+R\ge\big(\tfrac m2-\tfrac{\lvert R\rvert}{\lVert h\rVert^2}\big)\lVert h\rVert^2&amp;gt;0$ for small enough $h\ne0$.&lt;/li&gt;
    &lt;li&gt;$1+(h+k+l)+(hk+kl+lh)$; the exact function only adds $hkl$.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;h2 id=&quot;summary&quot;&gt;Summary&lt;/h2&gt;

&lt;div class=&quot;content-box summary-box textbook-block&quot;&gt;
  &lt;ul&gt;
    &lt;li&gt;$f(a+h)\approx f(a)+\nabla f\cdot h+\tfrac12h^\top Hh$, with error $o(\lVert h\rVert^2)$.&lt;/li&gt;
    &lt;li&gt;Proof: apply one-variable Taylor to $g(t)=f(a+th)$.&lt;/li&gt;
    &lt;li&gt;At a critical point, the sign of $h^\top Hh$ decides the type of extremum.&lt;/li&gt;
    &lt;li&gt;Newton: $h=-H^{-1}\nabla f$, exact in one step for quadratics.&lt;/li&gt;
  &lt;/ul&gt;
&lt;/div&gt;
</content>
 </entry>
 
 <entry>
   <title>Implicit functions</title>
   <link href="https://calculus-self-learning.pages.dev/contents/en/chapter11/11_03_Implicit_functions/"/>
   <updated>2026-12-01T00:00:00+00:00</updated>
   <id>https://calculus-self-learning.pages.dev/contents/en/chapter11/11_03_Implicit_functions</id>
   <content type="html">&lt;div class=&quot;textbook-objectives&quot;&gt;

  &lt;p&gt;&lt;strong&gt;Learning objectives.&lt;/strong&gt; After this lesson you can:&lt;/p&gt;

  &lt;ul&gt;
    &lt;li&gt;state and prove the implicit function theorem for an equation $F(x,y)=0$;&lt;/li&gt;
    &lt;li&gt;compute $y&apos;$, $z_x$, $z_y$ of an implicit function without solving the equation;&lt;/li&gt;
    &lt;li&gt;recognise the nonzero-Jacobian condition for systems.&lt;/li&gt;
  &lt;/ul&gt;

&lt;/div&gt;

&lt;h2 id=&quot;why-this-lesson&quot;&gt;Why this lesson&lt;/h2&gt;

&lt;p&gt;Many relations come as equations rather than formulas: the circle $x^2+y^2=25$, an indifference curve $U(x,y)=c$, the equation of state $PV=nRT$. We often cannot (or need not) solve for $y$ in terms of $x$, but we still want the slope. In lesson 02_03 we differentiated implicitly by hand; this lesson explains when that is valid.&lt;/p&gt;

&lt;h2 id=&quot;the-implicit-function-theorem&quot;&gt;The implicit function theorem&lt;/h2&gt;

&lt;div class=&quot;textbook-theorem&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Theorem 1 (Implicit functions).&lt;/strong&gt; Suppose $F$ has continuous partial derivatives near $(a,b)$, $F(a,b)=0$ and $F_y(a,b)\ne0$. Then there are intervals $I\ni a$, $J\ni b$ such that for each $x\in I$ there is exactly one $y=g(x)\in J$ with $F(x,g(x))=0$. Moreover $g$ is differentiable and&lt;/p&gt;

\[g&apos;(x)=-\frac{F_x(x,g(x))}{F_y(x,g(x))}.\]

&lt;/div&gt;

&lt;div class=&quot;textbook-proof&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Proof.&lt;/strong&gt; Assume $F_y(a,b)&amp;gt;0$ (the negative case is similar). Since $F_y$ is continuous, there is $\delta&amp;gt;0$ with $F_y&amp;gt;0$ on the square $\lvert x-a\rvert\le\delta$, $\lvert y-b\rvert\le\delta$.&lt;/p&gt;

  &lt;p&gt;&lt;em&gt;Existence and uniqueness.&lt;/em&gt; The function $y\mapsto F(a,y)$ is strictly increasing and $F(a,b)=0$, so $F(a,b-\delta)&amp;lt;0&amp;lt;F(a,b+\delta)$. Since $F$ is continuous, there is $\eta\in(0,\delta]$ such that $F(x,b-\delta)&amp;lt;0&amp;lt;F(x,b+\delta)$ still holds for $\lvert x-a\rvert&amp;lt;\eta$. For each such $x$, $y\mapsto F(x,y)$ is continuous, strictly increasing on $[b-\delta,b+\delta]$ and changes sign, so by the intermediate value theorem it has exactly one root $y=g(x)$. Take $I=(a-\eta,a+\eta)$ and $J=(b-\delta,b+\delta)$. Running the argument with arbitrarily small $\delta$ shows that $g$ is continuous at $a$, and the same holds at the other points of $I$.&lt;/p&gt;

  &lt;p&gt;&lt;em&gt;Derivative.&lt;/em&gt; For $x$, $x+h\in I$ let $k=g(x+h)-g(x)$. Apply the mean value theorem to $t\mapsto F(x+th,g(x)+tk)$ on $[0,1]$:&lt;/p&gt;

\[0=F(x+h,g(x+h))-F(x,g(x))=F_x(P)\,h+F_y(P)\,k\]

  &lt;p&gt;for some point $P$ on the segment joining the two points. So $k/h=-F_x(P)/F_y(P)$. As $h\to0$, $k\to0$ (because $g$ is continuous), $P\to(x,g(x))$, and continuity of $F_x$, $F_y$ gives the formula.&lt;/p&gt;
&lt;/div&gt;

&lt;p&gt;To remember the formula: differentiate $F(x,y(x))=0$ in $x$ with the chain rule, $F_x+F_yy&apos;=0$.&lt;/p&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Example 1.&lt;/strong&gt; The circle $x^2+y^2=25$ at $(3,4)$: $y&apos;=-\tfrac{2x}{2y}=-\tfrac34$. At $(5,0)$, $F_y=0$: the theorem does not apply, and indeed near $(5,0)$ the circle is not the graph of a function $y(x)$ (the tangent is vertical).&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Example 2 (Folium of Descartes).&lt;/strong&gt; $x^3+y^3=6xy$ at $(3,3)$: $F_x=3x^2-6y=9$, $F_y=3y^2-6x=9$, so $y&apos;=-1$.&lt;/p&gt;
&lt;/div&gt;

&lt;h2 id=&quot;three-variables-and-systems&quot;&gt;Three variables and systems&lt;/h2&gt;

&lt;p&gt;If $F(x,y,z)=0$ and $F_z\ne0$, then near that point $z=z(x,y)$ with&lt;/p&gt;

\[z_x=-\frac{F_x}{F_z},\qquad z_y=-\frac{F_y}{F_z}.\]

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Example 3.&lt;/strong&gt; $x^2+y^2+z^2=14$ at $(1,2,3)$: $z_x=-x/z=-1/3$, $z_y=-y/z=-2/3$.&lt;/p&gt;
&lt;/div&gt;

&lt;p&gt;For a system $F(x,y,u,v)=0$, $G(x,y,u,v)=0$, we can solve for $u$, $v$ in terms of $x$, $y$ near a solution if the Jacobian&lt;/p&gt;

\[\frac{\partial(F,G)}{\partial(u,v)}=\det\begin{pmatrix}F_u&amp;amp;F_v\\G_u&amp;amp;G_v\end{pmatrix}\ne0.\]

&lt;p&gt;The derivatives $u_x$, $v_x$ are found by differentiating both equations in $x$ and solving a $2\times2$ linear system; the nonzero-Jacobian condition is exactly the condition for that system to have a unique solution.&lt;/p&gt;

&lt;h2 id=&quot;applications&quot;&gt;Applications&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Economics: the marginal rate of substitution.&lt;/strong&gt; The indifference curve $U(x,y)=x^{1/2}y^{1/2}=c$ has slope $\dfrac{dy}{dx}=-\dfrac{U_x}{U_y}=-\dfrac yx$. At $(4,9)$, giving up one unit of good $x$ needs about $9/4$ extra units of good $y$ to keep the same utility.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Physics: the cyclic relation.&lt;/strong&gt; For an ideal gas $PV=nRT$:&lt;/p&gt;

\[\frac{\partial P}{\partial V}\cdot\frac{\partial V}{\partial T}\cdot\frac{\partial T}{\partial P}=-\frac{nRT}{V^2}\cdot\frac{nR}{P}\cdot\frac{V}{nR}=-\frac{nRT}{PV}=-1,\]

&lt;p&gt;not $1$ as “cancelling fractions” would suggest.&lt;/p&gt;

&lt;h2 id=&quot;exercises&quot;&gt;Exercises&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Basic.&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;Find $y&apos;$ at $(1,2)$ for $x^2+xy+y^2=7$.&lt;/li&gt;
  &lt;li&gt;Find $y&apos;$ at $(0,1)$ for $e^y+xy=e$.&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Answers&lt;/summary&gt;

  &lt;ol&gt;
    &lt;li&gt;$F_x=2x+y=4$, $F_y=x+2y=5$, $y&apos;=-4/5$.&lt;/li&gt;
    &lt;li&gt;$F_x=y=1$, $F_y=e^y+x=e$, $y&apos;=-1/e$.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;p&gt;&lt;strong&gt;Intermediate.&lt;/strong&gt;&lt;/p&gt;

&lt;ol start=&quot;3&quot;&gt;
  &lt;li&gt;$z$ is defined by $xyz+z^3=2$ near $(1,1,1)$. Find $z_x$ and $z_y$ there.&lt;/li&gt;
  &lt;li&gt;For $x^2+y^2=25$, show that $y&apos;&apos;=-25/y^3$.&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Answers&lt;/summary&gt;

  &lt;ol start=&quot;3&quot;&gt;
    &lt;li&gt;$F_x=yz=1$, $F_y=xz=1$, $F_z=xy+3z^2=4$, so $z_x=z_y=-1/4$.&lt;/li&gt;
    &lt;li&gt;$y&apos;=-x/y$; $y&apos;&apos;=-\dfrac{y-xy&apos;}{y^2}=-\dfrac{y^2+x^2}{y^3}=-\dfrac{25}{y^3}$.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;p&gt;&lt;strong&gt;Advanced.&lt;/strong&gt;&lt;/p&gt;

&lt;ol start=&quot;5&quot;&gt;
  &lt;li&gt;Consider $x^2-y^2=0$ near $(0,0)$. Why does the implicit function theorem not apply, and what does the solution set look like?&lt;/li&gt;
  &lt;li&gt;Prove the cyclic relation $\dfrac{\partial x}{\partial y}\dfrac{\partial y}{\partial z}\dfrac{\partial z}{\partial x}=-1$ for any $F(x,y,z)=0$ with nonzero partial derivatives.&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Hints&lt;/summary&gt;

  &lt;ol start=&quot;5&quot;&gt;
    &lt;li&gt;$F_y(0,0)=0$. The solution set is the two crossing lines $y=x$ and $y=-x$; near the origin there is no unique function $y(x)$.&lt;/li&gt;
    &lt;li&gt;Each factor is a ratio $-F_\bullet/F_\bullet$: $\big(-\tfrac{F_y}{F_x}\big)\big(-\tfrac{F_z}{F_y}\big)\big(-\tfrac{F_x}{F_z}\big)=-1$.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;h2 id=&quot;summary&quot;&gt;Summary&lt;/h2&gt;

&lt;div class=&quot;content-box summary-box textbook-block&quot;&gt;
  &lt;ul&gt;
    &lt;li&gt;If $F(a,b)=0$ and $F_y(a,b)\ne0$, then nearby there is a unique $y=g(x)$ and $g&apos;=-F_x/F_y$.&lt;/li&gt;
    &lt;li&gt;Three variables: $z_x=-F_x/F_z$, $z_y=-F_y/F_z$.&lt;/li&gt;
    &lt;li&gt;Systems: the Jacobian with respect to the unknowns must be nonzero.&lt;/li&gt;
    &lt;li&gt;Applications: the marginal rate of substitution and the cyclic relation $-1$ in thermodynamics.&lt;/li&gt;
  &lt;/ul&gt;
&lt;/div&gt;
</content>
 </entry>
 
 <entry>
   <title>Directional derivatives and the gradient</title>
   <link href="https://calculus-self-learning.pages.dev/contents/en/chapter11/11_02_Directional_derivatives_and_the_gradient/"/>
   <updated>2026-12-01T00:00:00+00:00</updated>
   <id>https://calculus-self-learning.pages.dev/contents/en/chapter11/11_02_Directional_derivatives_and_the_gradient</id>
   <content type="html">&lt;div class=&quot;textbook-objectives&quot;&gt;

  &lt;p&gt;&lt;strong&gt;Learning objectives.&lt;/strong&gt; After this lesson you can:&lt;/p&gt;

  &lt;ul&gt;
    &lt;li&gt;compute directional derivatives with $D_uf=\nabla f\cdot u$;&lt;/li&gt;
    &lt;li&gt;prove that the gradient is the direction of steepest ascent and is perpendicular to level curves;&lt;/li&gt;
    &lt;li&gt;write the tangent plane of a level surface $F(x,y,z)=c$;&lt;/li&gt;
    &lt;li&gt;understand the gradient descent update.&lt;/li&gt;
  &lt;/ul&gt;

&lt;/div&gt;

&lt;h2 id=&quot;why-this-lesson&quot;&gt;Why this lesson&lt;/h2&gt;

&lt;p&gt;Partial derivatives only give rates of change along the two axes. A hiker wants to know how steep the path is in any direction, and which direction is steepest. The answer is the gradient vector. In machine learning, training a model means moving against the gradient of the loss.&lt;/p&gt;

&lt;h2 id=&quot;directional-derivatives-and-the-gradient&quot;&gt;Directional derivatives and the gradient&lt;/h2&gt;

&lt;div class=&quot;textbook-definition&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Definition.&lt;/strong&gt; For a unit vector $u$, the &lt;strong&gt;directional derivative&lt;/strong&gt; of $f$ at $a$ in the direction $u$ is&lt;/p&gt;

\[D_uf(a)=\lim_{h\to0}\frac{f(a+hu)-f(a)}{h}.\]

  &lt;p&gt;The &lt;strong&gt;gradient&lt;/strong&gt; of $f$ is the vector of partial derivatives: $\nabla f=(f_x,f_y)$ (or $(f_x,f_y,f_z)$ in space).&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-theorem&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Theorem 1.&lt;/strong&gt; If $f$ is differentiable at $a$, then $D_uf(a)=\nabla f(a)\cdot u$.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-proof&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Proof.&lt;/strong&gt; Let $g(h)=f(a+hu)=f(a_1+hu_1,a_2+hu_2)$. By definition $D_uf(a)=g&apos;(0)$. By the chain rule (lesson 11_01), $g&apos;(0)=f_x(a)u_1+f_y(a)u_2=\nabla f(a)\cdot u$.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Example 1.&lt;/strong&gt; $f=x^2+3xy$ at $(1,2)$ in the direction $(3,4)$. The unit vector is $u=(3,4)/5$ and $\nabla f=(2x+3y,3x)=(8,3)$. So $D_uf=(8\cdot3+3\cdot4)/5=36/5=7.2$.&lt;/p&gt;
&lt;/div&gt;

&lt;h2 id=&quot;the-direction-of-steepest-ascent&quot;&gt;The direction of steepest ascent&lt;/h2&gt;

&lt;div class=&quot;textbook-theorem&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Theorem 2.&lt;/strong&gt; Suppose $f$ is differentiable at $a$ and $\nabla f(a)\ne0$.&lt;/p&gt;

  &lt;ol&gt;
    &lt;li&gt;The largest value of $D_uf(a)$ is $\lVert\nabla f(a)\rVert$, attained at $u=\nabla f(a)/\lVert\nabla f(a)\rVert$; the smallest is $-\lVert\nabla f(a)\rVert$, in the opposite direction.&lt;/li&gt;
    &lt;li&gt;$\nabla f(a)$ is perpendicular to the level curve (level surface) of $f$ through $a$.&lt;/li&gt;
  &lt;/ol&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-proof&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Proof.&lt;/strong&gt; (1) Let $\theta$ be the angle between $\nabla f$ and $u$. Since $\lVert u\rVert=1$, $D_uf=\nabla f\cdot u=\lVert\nabla f\rVert\cos\theta$, largest at $\theta=0$ and smallest at $\theta=\pi$.&lt;/p&gt;

  &lt;p&gt;(2) Take a differentiable curve $r(t)$ lying on the level set $f=c$ with $r(0)=a$. Then $f(r(t))=c$ for all $t$; differentiating with the chain rule gives $\nabla f(r(t))\cdot r&apos;(t)=0$. At $t=0$, $\nabla f(a)$ is perpendicular to the tangent vector $r&apos;(0)$. This holds for every such curve, so $\nabla f(a)$ is perpendicular to the level set.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;interactive-frame&quot;&gt;
  &lt;div class=&quot;interactive-frame-head&quot;&gt;
    &lt;div class=&quot;interactive-frame-title&quot;&gt;Directional derivative and gradient&lt;/div&gt;
    &lt;div class=&quot;interactive-frame-desc&quot;&gt;Drag the point and turn u; D_u f peaks in the gradient direction.&lt;/div&gt;
  &lt;/div&gt;
  &lt;iframe src=&quot;/interactives/chapter11/gradient-directional-en.html&quot; title=&quot;Directional derivative and gradient&quot; loading=&quot;lazy&quot; style=&quot;height: 700px;&quot;&gt;&lt;/iframe&gt;
  &lt;div class=&quot;interactive-frame-foot&quot;&gt;
    &lt;a href=&quot;/interactives/chapter11/gradient-directional-en.html&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;Open the interactive in a new window&lt;/a&gt;
  &lt;/div&gt;
&lt;/div&gt;

&lt;div class=&quot;reel-video&quot;&gt;
  &lt;video controls=&quot;&quot; playsinline=&quot;&quot; preload=&quot;metadata&quot; src=&quot;/public/videos/reels/gradient-steepest-ascent.mp4&quot;&gt;&lt;/video&gt;
  &lt;p class=&quot;reel-caption&quot;&gt;A ball on a hill: rotate the direction u to see D_u f = ∇f · u; the gradient is perpendicular to level curves and points uphill fastest (silent video, about 2 minutes).&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Example 2 (Temperature).&lt;/strong&gt; The temperature on a metal plate is $T=100e^{-(x^2+2y^2)}$. At $(1,1)$: $\nabla T=100e^{-3}(-2x,-4y)=100e^{-3}(-2,-4)$. An ant that wants to warm up fastest should walk in the direction $(-1,-2)/\sqrt5$, where the temperature rises at $100e^{-3}\sqrt{20}\approx22.3$ degrees per unit length.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Example 3 (Tangent plane of a level surface).&lt;/strong&gt; The sphere $x^2+y^2+z^2=14$ passes through $(1,2,3)$. The normal is $\nabla F=(2x,2y,2z)=(2,4,6)$, so the tangent plane is $2(x-1)+4(y-2)+6(z-3)=0$, that is $x+2y+3z=14$.&lt;/p&gt;
&lt;/div&gt;

&lt;h2 id=&quot;application-gradient-descent-machine-learning&quot;&gt;Application: gradient descent (machine learning)&lt;/h2&gt;

&lt;p&gt;To decrease a loss $L(w)$, move in the direction of steepest descent $-\nabla L$:&lt;/p&gt;

\[w\leftarrow w-\eta\,\nabla L(w),\]

&lt;p&gt;where $\eta&amp;gt;0$ is the learning rate. Take $L=(w_1-1)^2+10w_2^2$, $\nabla L=(2(w_1-1),20w_2)$. Each step multiplies $w_2$ by $1-20\eta$ and $w_1-1$ by $1-2\eta$.&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;$\eta=0.05$ from $(0,1)$: one step reaches $(0.1,0)$. The $w_2$ component converges at once; $w_1$ is still slow.&lt;/li&gt;
  &lt;li&gt;$\eta=0.1$: $w_2$ is multiplied by $-1$ and oscillates $1,-1,1,\dots$ forever.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Elongated level curves (coefficients 1 and 10) make $\eta$ hard to choose; this is why methods such as momentum, Adam and Newton’s method (lesson 11_04) exist.&lt;/p&gt;

&lt;div class=&quot;interactive-frame&quot;&gt;
  &lt;div class=&quot;interactive-frame-head&quot;&gt;
    &lt;div class=&quot;interactive-frame-title&quot;&gt;Gradient descent&lt;/div&gt;
    &lt;div class=&quot;interactive-frame-desc&quot;&gt;Change the learning rate and the start point; watch the path and f.&lt;/div&gt;
  &lt;/div&gt;
  &lt;iframe src=&quot;/interactives/chapter11/gradient-descent-en.html&quot; title=&quot;Gradient descent&quot; loading=&quot;lazy&quot; style=&quot;height: 700px;&quot;&gt;&lt;/iframe&gt;
  &lt;div class=&quot;interactive-frame-foot&quot;&gt;
    &lt;a href=&quot;/interactives/chapter11/gradient-descent-en.html&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;Open the interactive in a new window&lt;/a&gt;
  &lt;/div&gt;
&lt;/div&gt;

&lt;h2 id=&quot;exercises&quot;&gt;Exercises&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Basic.&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;$f=xe^y$. Find $\nabla f(2,0)$ and $D_uf(2,0)$ for $u=(1,1)/\sqrt2$.&lt;/li&gt;
  &lt;li&gt;$f=\ln(x^2+y^2)$. Find the direction and rate of fastest increase at $(1,1)$.&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Answers&lt;/summary&gt;

  &lt;ol&gt;
    &lt;li&gt;$\nabla f=(e^y,xe^y)=(1,2)$; $D_uf=3/\sqrt2$.&lt;/li&gt;
    &lt;li&gt;$\nabla f=\big(\tfrac{2x}{x^2+y^2},\tfrac{2y}{x^2+y^2}\big)=(1,1)$; direction $(1,1)/\sqrt2$, rate $\sqrt2$.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;p&gt;&lt;strong&gt;Intermediate.&lt;/strong&gt;&lt;/p&gt;

&lt;ol start=&quot;3&quot;&gt;
  &lt;li&gt;Using the gradient of $F=x^2+y^2-z$, write the tangent plane of $z=x^2+y^2$ at $(1,1,2)$.&lt;/li&gt;
  &lt;li&gt;At $(2,1)$, in which directions is $f=x^2-y^2$ (instantaneously) unchanged?&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Answers&lt;/summary&gt;

  &lt;ol start=&quot;3&quot;&gt;
    &lt;li&gt;$\nabla F=(2,2,-1)$: $2(x-1)+2(y-1)-(z-2)=0$, that is $z=2x+2y-2$.&lt;/li&gt;
    &lt;li&gt;$\nabla f=(4,-2)$; the perpendicular directions are $\pm(1,2)/\sqrt5$.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;p&gt;&lt;strong&gt;Advanced.&lt;/strong&gt;&lt;/p&gt;

&lt;ol start=&quot;5&quot;&gt;
  &lt;li&gt;Prove that $\nabla(fg)=f\nabla g+g\nabla f$.&lt;/li&gt;
  &lt;li&gt;For $L(w)=\lambda w^2$ with $\lambda&amp;gt;0$, show that gradient descent converges to 0 from every starting point if and only if $0&amp;lt;\eta&amp;lt;1/\lambda$.&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Hints&lt;/summary&gt;

  &lt;ol start=&quot;5&quot;&gt;
    &lt;li&gt;Apply the product rule to each partial derivative.&lt;/li&gt;
    &lt;li&gt;$w_{k+1}=(1-2\eta\lambda)w_k$, so $w_k=(1-2\eta\lambda)^kw_0\to0$ if and only if $\lvert1-2\eta\lambda\rvert&amp;lt;1$, that is $0&amp;lt;\eta&amp;lt;1/\lambda$.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;h2 id=&quot;summary&quot;&gt;Summary&lt;/h2&gt;

&lt;div class=&quot;content-box summary-box textbook-block&quot;&gt;
  &lt;ul&gt;
    &lt;li&gt;$D_uf=\nabla f\cdot u=\lVert\nabla f\rVert\cos\theta$.&lt;/li&gt;
    &lt;li&gt;The gradient points in the direction of fastest increase, its length is that rate, and it is perpendicular to level curves.&lt;/li&gt;
    &lt;li&gt;A level surface $F=c$ has normal $\nabla F$.&lt;/li&gt;
    &lt;li&gt;Gradient descent: $w\leftarrow w-\eta\nabla L$; too large an $\eta$ causes oscillation or divergence.&lt;/li&gt;
  &lt;/ul&gt;
&lt;/div&gt;
</content>
 </entry>
 
 <entry>
   <title>The chain rule and the Jacobian matrix</title>
   <link href="https://calculus-self-learning.pages.dev/contents/en/chapter11/11_01_The_chain_rule_and_the_Jacobian_matrix/"/>
   <updated>2026-12-01T00:00:00+00:00</updated>
   <id>https://calculus-self-learning.pages.dev/contents/en/chapter11/11_01_The_chain_rule_and_the_Jacobian_matrix</id>
   <content type="html">&lt;div class=&quot;textbook-objectives&quot;&gt;

  &lt;p&gt;&lt;strong&gt;Learning objectives.&lt;/strong&gt; After this lesson you can:&lt;/p&gt;

  &lt;ul&gt;
    &lt;li&gt;differentiate composite functions $z=f(x(t),y(t))$ and $z=f(x(s,t),y(s,t))$;&lt;/li&gt;
    &lt;li&gt;prove the chain rule from the definition of differentiability;&lt;/li&gt;
    &lt;li&gt;write the Jacobian matrix and state the chain rule as a matrix product.&lt;/li&gt;
  &lt;/ul&gt;

&lt;/div&gt;

&lt;h2 id=&quot;why-this-lesson&quot;&gt;Why this lesson&lt;/h2&gt;

&lt;p&gt;In practice variables are rarely independent: temperature depends on position, position depends on time; output depends on capital and labour, which change from year to year. The chain rule tells us how the final quantity changes when the underlying variables change. It is also the only tool behind backpropagation (lesson 11_05).&lt;/p&gt;

&lt;h2 id=&quot;the-chain-rule-with-one-parameter&quot;&gt;The chain rule with one parameter&lt;/h2&gt;

&lt;div class=&quot;textbook-theorem&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Theorem 1.&lt;/strong&gt; If $x(t)$, $y(t)$ are differentiable at $t$ and $f$ is differentiable at $(x(t),y(t))$, then $z(t)=f(x(t),y(t))$ is differentiable at $t$ and&lt;/p&gt;

\[\frac{dz}{dt}=f_x\,\frac{dx}{dt}+f_y\,\frac{dy}{dt}.\]

&lt;/div&gt;

&lt;div class=&quot;textbook-proof&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Proof.&lt;/strong&gt; Let $\Delta x=x(t+\Delta t)-x(t)$ and $\Delta y=y(t+\Delta t)-y(t)$. Since $f$ is differentiable (lesson 10_04),&lt;/p&gt;

\[\Delta z=f_x\Delta x+f_y\Delta y+\varepsilon(\Delta x,\Delta y)\sqrt{\Delta x^2+\Delta y^2},\]

  &lt;p&gt;with $\varepsilon\to0$ as $(\Delta x,\Delta y)\to(0,0)$ (set $\varepsilon(0,0)=0$). Divide by $\Delta t\ne0$:&lt;/p&gt;

\[\frac{\Delta z}{\Delta t}=f_x\frac{\Delta x}{\Delta t}+f_y\frac{\Delta y}{\Delta t}\pm\varepsilon\sqrt{\Big(\frac{\Delta x}{\Delta t}\Big)^2+\Big(\frac{\Delta y}{\Delta t}\Big)^2}.\]

  &lt;p&gt;As $\Delta t\to0$: $x$ and $y$ are continuous, so $(\Delta x,\Delta y)\to0$ and $\varepsilon\to0$, while the square root tends to the finite value $\sqrt{x&apos;^2+y&apos;^2}$. The last term tends to 0, which gives the formula.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Example 1.&lt;/strong&gt; $z=x^2y$, $x=\cos t$, $y=\sin t$. By the chain rule:&lt;/p&gt;

\[\frac{dz}{dt}=2xy\cdot(-\sin t)+x^2\cos t=-2\cos t\sin^2t+\cos^3t.\]

  &lt;p&gt;Direct check: $z=\cos^2t\sin t$, $z&apos;=-2\cos t\sin^2t+\cos^3t$. They agree.&lt;/p&gt;
&lt;/div&gt;

&lt;h2 id=&quot;several-parameters&quot;&gt;Several parameters&lt;/h2&gt;

&lt;p&gt;If $x=x(s,t)$ and $y=y(s,t)$, hold one parameter fixed and apply theorem 1:&lt;/p&gt;

\[z_s=f_x\,x_s+f_y\,y_s,\qquad z_t=f_x\,x_t+f_y\,y_t.\]

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Example 2 (Polar coordinates).&lt;/strong&gt; With $x=r\cos\theta$, $y=r\sin\theta$:&lt;/p&gt;

\[z_r=f_x\cos\theta+f_y\sin\theta,\qquad z_\theta=-f_x\,r\sin\theta+f_y\,r\cos\theta.\]

  &lt;p&gt;For $f=x^2+y^2$: $z_r=2x\cos\theta+2y\sin\theta=2r$, as expected from $z=r^2$.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;reel-video&quot;&gt;
  &lt;video controls=&quot;&quot; playsinline=&quot;&quot; preload=&quot;metadata&quot; src=&quot;/public/videos/reels/chain-rule-jacobian.mp4&quot;&gt;&lt;/video&gt;
  &lt;p class=&quot;reel-caption&quot;&gt;The chain rule and the Jacobian matrix: a point moving on a circle, a small grid cell passing through G and then F, area scale factors multiplying, a numerical check, the path diagram, matrix multiplication, polar coordinates and growth rates (silent video, about 3 minutes 12 seconds).&lt;/p&gt;
&lt;/div&gt;

&lt;h2 id=&quot;the-jacobian-matrix&quot;&gt;The Jacobian matrix&lt;/h2&gt;

&lt;div class=&quot;textbook-definition&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Definition.&lt;/strong&gt; For a differentiable $F=(F_1,\dots,F_m):\mathbb R^n\to\mathbb R^m$, the &lt;strong&gt;Jacobian matrix&lt;/strong&gt; is the $m\times n$ matrix&lt;/p&gt;

\[J_F=\begin{pmatrix}\dfrac{\partial F_1}{\partial x_1}&amp;amp;\cdots&amp;amp;\dfrac{\partial F_1}{\partial x_n}\\\vdots&amp;amp;&amp;amp;\vdots\\\dfrac{\partial F_m}{\partial x_1}&amp;amp;\cdots&amp;amp;\dfrac{\partial F_m}{\partial x_n}\end{pmatrix}.\]

  &lt;p&gt;When $m=n$, its determinant is called the &lt;strong&gt;Jacobian&lt;/strong&gt;.&lt;/p&gt;
&lt;/div&gt;

&lt;p&gt;The Jacobian matrix is the best linear approximation of $F$ near a point: $F(a+h)\approx F(a)+J_F(a)h$.&lt;/p&gt;

&lt;div class=&quot;textbook-theorem&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Theorem 2 (Chain rule in matrix form).&lt;/strong&gt; If $G$ is differentiable at $a$ and $F$ is differentiable at $G(a)$, then&lt;/p&gt;

\[J_{F\circ G}(a)=J_F(G(a))\,J_G(a).\]

&lt;/div&gt;

&lt;div class=&quot;textbook-proof&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Proof.&lt;/strong&gt; The entry in row $i$, column $j$ of the left side is $\partial(F_i\circ G)/\partial x_j$. Apply the chain rule (with several intermediate variables $u_k=G_k$; the proof is the same as for theorem 1) to the scalar function $F_i(u_1,\dots,u_p)$:&lt;/p&gt;

\[\frac{\partial(F_i\circ G)}{\partial x_j}=\sum_{k=1}^p\frac{\partial F_i}{\partial u_k}\frac{\partial G_k}{\partial x_j},\]

  &lt;p&gt;which is exactly entry $(i,j)$ of the product $J_F J_G$.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Example 3.&lt;/strong&gt; $G(r,\theta)=(r\cos\theta,r\sin\theta)$ has&lt;/p&gt;

\[J_G=\begin{pmatrix}\cos\theta&amp;amp;-r\sin\theta\\\sin\theta&amp;amp;r\cos\theta\end{pmatrix},\qquad\det J_G=r.\]

  &lt;p&gt;A small cell $dr\,d\theta$ is mapped to a cell of area about $r\,dr\,d\theta$; we will use this in chapter 13. Example 2 is just $(z_r\ z_\theta)=(f_x\ f_y)\,J_G$.&lt;/p&gt;
&lt;/div&gt;

&lt;h2 id=&quot;application-growth-accounting-economics&quot;&gt;Application: growth accounting (economics)&lt;/h2&gt;

&lt;p&gt;For the Cobb–Douglas production function $Q=AK^{0.3}L^{0.7}$, capital $K(t)$ and labour $L(t)$ change over time. The chain rule gives&lt;/p&gt;

\[\frac{Q&apos;}{Q}=\frac{A&apos;}{A}+0.3\,\frac{K&apos;}{K}+0.7\,\frac{L&apos;}{L}.\]

&lt;p&gt;If capital grows 5% a year, labour 1% a year and $A$ is constant, output grows about $0.3\cdot5+0.7\cdot1=2.2$% a year. Observed growth beyond this is attributed to $A$, called total factor productivity.&lt;/p&gt;

&lt;h2 id=&quot;exercises&quot;&gt;Exercises&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Basic.&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;$z=e^{xy}$, $x=t^2$, $y=t^3$. Find $dz/dt$ with the chain rule and check directly.&lt;/li&gt;
  &lt;li&gt;$w=xyz$, $x=t$, $y=t^2$, $z=t^3$. Find $dw/dt$.&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Answers&lt;/summary&gt;

  &lt;ol&gt;
    &lt;li&gt;$dz/dt=ye^{xy}\cdot2t+xe^{xy}\cdot3t^2=5t^4e^{t^5}$, matching $z=e^{t^5}$.&lt;/li&gt;
    &lt;li&gt;$yz\cdot1+xz\cdot2t+xy\cdot3t^2=t^5+2t^5+3t^5=6t^5$.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;p&gt;&lt;strong&gt;Intermediate.&lt;/strong&gt;&lt;/p&gt;

&lt;ol start=&quot;3&quot;&gt;
  &lt;li&gt;Find the Jacobian matrix and the Jacobian of $(u,v)=(x+y,\,xy)$.&lt;/li&gt;
  &lt;li&gt;Show that $u(x,t)=f(x-ct)$ satisfies $u_t+c\,u_x=0$ for every differentiable $f$ (the transport equation).&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Answers&lt;/summary&gt;

  &lt;ol start=&quot;3&quot;&gt;
    &lt;li&gt;$\begin{pmatrix}1&amp;amp;1\\y&amp;amp;x\end{pmatrix}$, Jacobian $x-y$.&lt;/li&gt;
    &lt;li&gt;With $s=x-ct$: $u_t=f&apos;(s)\cdot(-c)$, $u_x=f&apos;(s)$, so $u_t+cu_x=0$.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;p&gt;&lt;strong&gt;Advanced.&lt;/strong&gt;&lt;/p&gt;

&lt;ol start=&quot;5&quot;&gt;
  &lt;li&gt;(Euler’s theorem on homogeneous functions.) If $f(tx,ty)=t^nf(x,y)$ for all $t&amp;gt;0$, then $xf_x+yf_y=nf$. Check it for Cobb–Douglas $K^{0.3}L^{0.7}$.&lt;/li&gt;
  &lt;li&gt;With $x=r\cos\theta$, $y=r\sin\theta$, show that $f_x^2+f_y^2=z_r^2+\dfrac{1}{r^2}z_\theta^2$.&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Hints&lt;/summary&gt;

  &lt;ol start=&quot;5&quot;&gt;
    &lt;li&gt;Differentiate both sides in $t$ and set $t=1$: $xf_x+yf_y=nf$. Cobb–Douglas has $n=1$: $KQ_K+LQ_L=Q$, so paying each factor its marginal product uses up exactly the output.&lt;/li&gt;
    &lt;li&gt;From example 2, $z_r^2+z_\theta^2/r^2=(f_x\cos\theta+f_y\sin\theta)^2+(-f_x\sin\theta+f_y\cos\theta)^2=f_x^2+f_y^2$.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;h2 id=&quot;summary&quot;&gt;Summary&lt;/h2&gt;

&lt;div class=&quot;content-box summary-box textbook-block&quot;&gt;
  &lt;ul&gt;
    &lt;li&gt;$\dfrac{dz}{dt}=f_xx&apos;+f_yy&apos;$; the proof uses the differentiability of $f$.&lt;/li&gt;
    &lt;li&gt;Several parameters: hold the others fixed and use the same formula.&lt;/li&gt;
    &lt;li&gt;The Jacobian matrix collects all partial derivatives; the chain rule is $J_{F\circ G}=J_F\,J_G$.&lt;/li&gt;
    &lt;li&gt;Polar coordinates have Jacobian $r$; Cobb–Douglas gives the growth-accounting formula.&lt;/li&gt;
  &lt;/ul&gt;
&lt;/div&gt;
</content>
 </entry>
 
 <entry>
   <title>Higher partial derivatives and Schwarz's theorem</title>
   <link href="https://calculus-self-learning.pages.dev/contents/en/chapter10/10_05_Higher_partial_derivatives_and_Schwarzs_theorem/"/>
   <updated>2026-12-01T00:00:00+00:00</updated>
   <id>https://calculus-self-learning.pages.dev/contents/en/chapter10/10_05_Higher_partial_derivatives_and_Schwarzs_theorem</id>
   <content type="html">&lt;div class=&quot;textbook-objectives&quot;&gt;

  &lt;p&gt;&lt;strong&gt;Learning objectives.&lt;/strong&gt; After this lesson you can:&lt;/p&gt;

  &lt;ul&gt;
    &lt;li&gt;compute the second partial derivatives $f_{xx}$, $f_{xy}$, $f_{yx}$, $f_{yy}$ and higher ones;&lt;/li&gt;
    &lt;li&gt;state and prove Schwarz’s theorem and know when it does not apply;&lt;/li&gt;
    &lt;li&gt;check whether a function satisfies the Laplace, heat or wave equation;&lt;/li&gt;
    &lt;li&gt;understand the role of the Hessian matrix.&lt;/li&gt;
  &lt;/ul&gt;

&lt;/div&gt;

&lt;h2 id=&quot;why-this-lesson&quot;&gt;Why this lesson&lt;/h2&gt;

&lt;p&gt;The second derivative of a function of one variable measures curvature and classifies extrema. For several variables the second derivatives form the &lt;strong&gt;Hessian matrix&lt;/strong&gt;, the basis of classifying extrema (chapter 12) and of second-order optimisation methods. The basic laws of physics (heat, waves, electric potential) are all equations in second partial derivatives.&lt;/p&gt;

&lt;h2 id=&quot;second-partial-derivatives&quot;&gt;Second partial derivatives&lt;/h2&gt;

&lt;div class=&quot;textbook-definition&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Definition.&lt;/strong&gt; Take partial derivatives of the partial derivatives:&lt;/p&gt;

\[f_{xx}=\frac{\partial^2f}{\partial x^2},\quad f_{yy}=\frac{\partial^2f}{\partial y^2},\quad f_{xy}=(f_x)_y=\frac{\partial^2f}{\partial y\,\partial x},\quad f_{yx}=(f_y)_x=\frac{\partial^2f}{\partial x\,\partial y}.\]

  &lt;p&gt;$f_{xy}$ and $f_{yx}$ are the &lt;strong&gt;mixed partial derivatives&lt;/strong&gt;.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Example 1.&lt;/strong&gt; $f=x^3y^2+e^{xy}$. Then $f_x=3x^2y^2+ye^{xy}$, $f_y=2x^3y+xe^{xy}$, and&lt;/p&gt;

\[f_{xx}=6xy^2+y^2e^{xy},\quad f_{yy}=2x^3+x^2e^{xy},\quad f_{xy}=6x^2y+e^{xy}+xye^{xy}=f_{yx}.\]

&lt;/div&gt;

&lt;p&gt;The two mixed partials agreeing is no accident.&lt;/p&gt;

&lt;h2 id=&quot;schwarzs-theorem&quot;&gt;Schwarz’s theorem&lt;/h2&gt;

&lt;div class=&quot;textbook-theorem&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Theorem 1 (Schwarz, also called Clairaut).&lt;/strong&gt; If $f_{xy}$ and $f_{yx}$ exist near $(a,b)$ and are continuous at $(a,b)$, then $f_{xy}(a,b)=f_{yx}(a,b)$.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-proof&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Proof.&lt;/strong&gt; Consider the “double difference” for small $h\ne0$:&lt;/p&gt;

\[\Delta(h)=f(a+h,b+h)-f(a+h,b)-f(a,b+h)+f(a,b).\]

  &lt;p&gt;&lt;em&gt;First way.&lt;/em&gt; Let $\varphi(x)=f(x,b+h)-f(x,b)$, so $\Delta=\varphi(a+h)-\varphi(a)$. By the mean value theorem, $\Delta=h\varphi&apos;(a+\theta_1h)=h\big[f_x(a+\theta_1h,b+h)-f_x(a+\theta_1h,b)\big]$. Applying the mean value theorem again to $y\mapsto f_x(a+\theta_1h,y)$: $\Delta=h^2f_{xy}(a+\theta_1h,b+\theta_2h)$.&lt;/p&gt;

  &lt;p&gt;&lt;em&gt;Second way.&lt;/em&gt; Let $\psi(y)=f(a+h,y)-f(a,y)$, so $\Delta=\psi(b+h)-\psi(b)$, and the same argument gives $\Delta=h^2f_{yx}(a+\theta_3h,b+\theta_4h)$.&lt;/p&gt;

  &lt;p&gt;So $f_{xy}(a+\theta_1h,b+\theta_2h)=f_{yx}(a+\theta_3h,b+\theta_4h)$. As $h\to0$ both points tend to $(a,b)$, and continuity gives $f_{xy}(a,b)=f_{yx}(a,b)$.&lt;/p&gt;
&lt;/div&gt;

&lt;p&gt;Consequence: for a function with continuous partial derivatives of order $n$, the order of differentiation does not matter. A function of two variables has only $3$ distinct second derivatives and $4$ distinct third derivatives ($f_{xxx}$, $f_{xxy}$, $f_{xyy}$, $f_{yyy}$).&lt;/p&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Example 2 (A counterexample).&lt;/strong&gt; $f(x,y)=\dfrac{xy(x^2-y^2)}{x^2+y^2}$, $f(0,0)=0$. For fixed $y$, $f_x(0,y)=\lim_{h\to0}\tfrac{f(h,y)}h=\lim_{h\to0}\tfrac{y(h^2-y^2)}{h^2+y^2}=-y$, so $f_{xy}(0,0)=-1$. Likewise $f_y(x,0)=x$, so $f_{yx}(0,0)=1$. The mixed partials differ; Schwarz’s theorem does not apply because $f_{xy}$ is not continuous at the origin.&lt;/p&gt;
&lt;/div&gt;

&lt;h2 id=&quot;the-classical-partial-differential-equations&quot;&gt;The classical partial differential equations&lt;/h2&gt;

&lt;div class=&quot;content-box insight-box textbook-block&quot;&gt;
  &lt;ul&gt;
    &lt;li&gt;&lt;strong&gt;Laplace&lt;/strong&gt; $u_{xx}+u_{yy}=0$ (electric potential, steady temperature). Its solutions are &lt;strong&gt;harmonic&lt;/strong&gt; functions: $x^2-y^2$, $e^x\sin y$, $\ln(x^2+y^2)$ (away from the origin).&lt;/li&gt;
    &lt;li&gt;&lt;strong&gt;Heat&lt;/strong&gt; $u_t=k\,u_{xx}$: $u=e^{-kt}\sin x$ (lesson 10_03).&lt;/li&gt;
    &lt;li&gt;&lt;strong&gt;Wave&lt;/strong&gt; $u_{tt}=c^2u_{xx}$: $u=F(x-ct)+G(x+ct)$ for any twice-differentiable $F$, $G$ (d’Alembert’s solution): two waves travelling in opposite directions at speed $c$.&lt;/li&gt;
  &lt;/ul&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Example 3.&lt;/strong&gt; $u=\ln(x^2+y^2)$: $u_x=\tfrac{2x}{x^2+y^2}$, $u_{xx}=\tfrac{2(y^2-x^2)}{(x^2+y^2)^2}$; by symmetry $u_{yy}=\tfrac{2(x^2-y^2)}{(x^2+y^2)^2}$. The sum is 0: $u$ is harmonic away from the origin. Up to a constant, this is the potential of a long charged straight wire.&lt;/p&gt;
&lt;/div&gt;

&lt;h2 id=&quot;applications&quot;&gt;Applications&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Machine learning: the Hessian matrix.&lt;/strong&gt; The matrix $H=\begin{pmatrix}f_{xx}&amp;amp;f_{xy}\\f_{yx}&amp;amp;f_{yy}\end{pmatrix}$ describes the curvature of a loss. By Schwarz’s theorem $H$ is symmetric, so it has real eigenvalues and perpendicular principal directions of curvature. Newton’s method in several variables uses the step $-H^{-1}\nabla f$; in deep learning $H$ is approximated (Adam, K-FAC) because it is too large to compute in full.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Image processing: the Laplacian.&lt;/strong&gt; For an image $u(i,j)$, the difference $u_{xx}\approx u(i+1,j)-2u(i,j)+u(i-1,j)$ (add two Taylor expansions, lesson 08_01) gives the discrete Laplacian with kernel $\begin{pmatrix}0&amp;amp;1&amp;amp;0\\1&amp;amp;-4&amp;amp;1\\0&amp;amp;1&amp;amp;0\end{pmatrix}$. It is large where the intensity changes abruptly, so it is used for edge detection and sharpening.&lt;/p&gt;

&lt;h2 id=&quot;exercises&quot;&gt;Exercises&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Basic.&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;Find all second partial derivatives of $f=x^4-3x^2y^3$.&lt;/li&gt;
  &lt;li&gt;Find all second partial derivatives of $f=\sin(x+2y)$.&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Answers&lt;/summary&gt;

  &lt;ol&gt;
    &lt;li&gt;$f_{xx}=12x^2-6y^3$, $f_{yy}=-18x^2y$, $f_{xy}=f_{yx}=-18xy^2$.&lt;/li&gt;
    &lt;li&gt;$f_{xx}=-\sin(x+2y)$, $f_{xy}=f_{yx}=-2\sin(x+2y)$, $f_{yy}=-4\sin(x+2y)$.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;p&gt;&lt;strong&gt;Intermediate.&lt;/strong&gt;&lt;/p&gt;

&lt;ol start=&quot;3&quot;&gt;
  &lt;li&gt;Which are harmonic: $x^3-3xy^2$, $x^2+y^2$, $e^{-y}\cos x$?&lt;/li&gt;
  &lt;li&gt;For $k&amp;gt;0$, find $\lambda$ so that $u=e^{\lambda t}\sin(3x)$ satisfies $u_t=k\,u_{xx}$.&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Answers&lt;/summary&gt;

  &lt;ol start=&quot;3&quot;&gt;
    &lt;li&gt;$x^3-3xy^2$: $6x-6x=0$, harmonic. $x^2+y^2$: $2+2\ne0$. $e^{-y}\cos x$: $-e^{-y}\cos x+e^{-y}\cos x=0$, harmonic.&lt;/li&gt;
    &lt;li&gt;$\lambda=-9k$: higher frequencies die out faster.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;p&gt;&lt;strong&gt;Advanced.&lt;/strong&gt;&lt;/p&gt;

&lt;ol start=&quot;5&quot;&gt;
  &lt;li&gt;Check the limits of example 2 in detail, and show that $f_{xy}$ is not continuous at the origin.&lt;/li&gt;
  &lt;li&gt;Show that if $u(x,y)$ is harmonic then so is $u_x$ (assume $u$ has continuous third partial derivatives).&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Hints&lt;/summary&gt;

  &lt;ol start=&quot;5&quot;&gt;
    &lt;li&gt;For $(x,y)\ne(0,0)$ a direct computation gives $f_{xy}=\tfrac{x^6+9x^4y^2-9x^2y^4-y^6}{(x^2+y^2)^3}$. Along the $x$-axis it equals 1 and along the $y$-axis $-1$: no limit at the origin.&lt;/li&gt;
    &lt;li&gt;$(u_x)_{xx}+(u_x)_{yy}=(u_{xx}+u_{yy})_x=0$, swapping the order of differentiation by Schwarz’s theorem.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;h2 id=&quot;summary&quot;&gt;Summary&lt;/h2&gt;

&lt;div class=&quot;content-box summary-box textbook-block&quot;&gt;
  &lt;ul&gt;
    &lt;li&gt;Second derivatives: $f_{xx}$, $f_{yy}$ and the two mixed partials $f_{xy}$, $f_{yx}$.&lt;/li&gt;
    &lt;li&gt;Schwarz: if the mixed partials are continuous then $f_{xy}=f_{yx}$; counterexample $\tfrac{xy(x^2-y^2)}{x^2+y^2}$.&lt;/li&gt;
    &lt;li&gt;The Laplace, heat and wave equations use second partial derivatives.&lt;/li&gt;
    &lt;li&gt;The symmetric Hessian describes curvature; the discrete Laplacian detects edges in images.&lt;/li&gt;
  &lt;/ul&gt;
&lt;/div&gt;
</content>
 </entry>
 
 <entry>
   <title>Differentiability and the total differential</title>
   <link href="https://calculus-self-learning.pages.dev/contents/en/chapter10/10_04_Differentiability_and_the_total_differential/"/>
   <updated>2026-12-01T00:00:00+00:00</updated>
   <id>https://calculus-self-learning.pages.dev/contents/en/chapter10/10_04_Differentiability_and_the_total_differential</id>
   <content type="html">&lt;div class=&quot;textbook-objectives&quot;&gt;

  &lt;p&gt;&lt;strong&gt;Learning objectives.&lt;/strong&gt; After this lesson you can:&lt;/p&gt;

  &lt;ul&gt;
    &lt;li&gt;state the definition of differentiability for a function of two variables;&lt;/li&gt;
    &lt;li&gt;explain why having partial derivatives is not enough for differentiability;&lt;/li&gt;
    &lt;li&gt;use the sufficient condition: continuous partial derivatives imply differentiability;&lt;/li&gt;
    &lt;li&gt;use the total differential $df=f_x\,dx+f_y\,dy$ to approximate and to estimate measurement errors.&lt;/li&gt;
  &lt;/ul&gt;

&lt;/div&gt;

&lt;h2 id=&quot;why-this-lesson&quot;&gt;Why this lesson&lt;/h2&gt;

&lt;p&gt;In lesson 10_03 the function $\tfrac{xy}{x^2+y^2}$ had both partial derivatives at the origin and was still discontinuous. Partial derivatives only look along the two axis directions, so they cannot tell whether a surface is “smooth” at a point. The right notion is &lt;strong&gt;differentiability&lt;/strong&gt;: the surface is well approximated by its tangent plane in &lt;strong&gt;every&lt;/strong&gt; direction. It is what the chain rule and the gradient of chapter 11 require.&lt;/p&gt;

&lt;h2 id=&quot;the-definition&quot;&gt;The definition&lt;/h2&gt;

&lt;div class=&quot;textbook-definition&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Definition.&lt;/strong&gt; $f$ is &lt;strong&gt;differentiable&lt;/strong&gt; at $(a,b)$ if there are numbers $A$, $B$ with&lt;/p&gt;

\[f(a+h,b+k)=f(a,b)+Ah+Bk+\varepsilon(h,k)\sqrt{h^2+k^2},\qquad\varepsilon(h,k)\to0\text{ as }(h,k)\to(0,0).\]

  &lt;p&gt;The linear expression $df=A\,dx+B\,dy$ (with $dx=h$, $dy=k$) is the &lt;strong&gt;total differential&lt;/strong&gt;.&lt;/p&gt;
&lt;/div&gt;

&lt;p&gt;In other words, the error of the linear approximation is much smaller than the distance $\sqrt{h^2+k^2}$, just like $f(a+h)=f(a)+f&apos;(a)h+o(h)$ in one variable (lesson 02_04).&lt;/p&gt;

&lt;div class=&quot;textbook-theorem&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Theorem 1.&lt;/strong&gt; If $f$ is differentiable at $(a,b)$, then $f$ is continuous there, the partial derivatives exist, and $A=f_x(a,b)$, $B=f_y(a,b)$.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-proof&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Proof.&lt;/strong&gt; Let $(h,k)\to(0,0)$ in the definition: the right side tends to $f(a,b)$, so $f$ is continuous. Take $k=0$: $\tfrac{f(a+h,b)-f(a,b)}h=A+\varepsilon(h,0)\tfrac{\vert h\vert }h\to A$, so $f_x(a,b)=A$. Likewise $f_y(a,b)=B$.&lt;/p&gt;
&lt;/div&gt;

&lt;p&gt;Consequence: the function $\tfrac{xy}{x^2+y^2}$ ($f(0,0)=0$) is not differentiable at the origin because it is not continuous there.&lt;/p&gt;

&lt;div class=&quot;textbook-theorem&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Theorem 2 (A sufficient condition).&lt;/strong&gt; If $f_x$, $f_y$ exist near $(a,b)$ and are continuous at $(a,b)$, then $f$ is differentiable at $(a,b)$.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-proof&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Proof.&lt;/strong&gt; Write the difference in two steps, each changing one variable:&lt;/p&gt;

\[f(a+h,b+k)-f(a,b)=\big[f(a+h,b+k)-f(a,b+k)\big]+\big[f(a,b+k)-f(a,b)\big].\]

  &lt;p&gt;By the mean value theorem for each one-variable function there are $\theta_1,\theta_2\in(0,1)$ such that the right side equals $f_x(a+\theta_1h,b+k)\,h+f_y(a,b+\theta_2k)\,k$. So the error relative to $f_xh+f_yk$ (evaluated at $(a,b)$) is&lt;/p&gt;

\[\big[f_x(a+\theta_1h,b+k)-f_x(a,b)\big]h+\big[f_y(a,b+\theta_2k)-f_y(a,b)\big]k .\]

  &lt;p&gt;Divide by $\sqrt{h^2+k^2}$, use $\vert h\vert ,\vert k\vert \le\sqrt{h^2+k^2}$ and the continuity of $f_x$, $f_y$ at $(a,b)$: the quotient tends to 0.&lt;/p&gt;
&lt;/div&gt;

&lt;p&gt;So every elementary function (polynomials, $e^{xy}$, $\sin(x+y^2)$, …) is differentiable at every point of its domain where its partial derivatives are continuous.&lt;/p&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Example 1 (Partial derivatives, continuous, still not differentiable).&lt;/strong&gt; $f(x,y)=\sqrt{\vert xy\vert }$. On both axes $f=0$, so $f_x(0,0)=f_y(0,0)=0$; $f$ is continuous. If it were differentiable, the linear approximation at the origin would be $0$. But along $y=x$: $f=\vert x\vert $ while the distance to the origin is $\sqrt2\vert x\vert $, and the ratio $\tfrac1{\sqrt2}$ does not tend to 0. So $f$ is not differentiable at the origin: the graph has “creases” along the diagonals.&lt;/p&gt;
&lt;/div&gt;

&lt;h2 id=&quot;linear-approximation&quot;&gt;Linear approximation&lt;/h2&gt;

\[f(a+\Delta x,b+\Delta y)\approx f(a,b)+f_x(a,b)\,\Delta x+f_y(a,b)\,\Delta y .\]

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Example 2.&lt;/strong&gt; $\sqrt{3.02^2+3.97^2}$. For $f=\sqrt{x^2+y^2}$ at $(3,4)$: $f=5$, $f_x=\tfrac35$, $f_y=\tfrac45$. The approximation is $5+\tfrac35(0.02)+\tfrac45(-0.03)=4.988$; the true value is $4.98812$.&lt;/p&gt;
&lt;/div&gt;

&lt;h2 id=&quot;error-propagation&quot;&gt;Error propagation&lt;/h2&gt;

&lt;p&gt;If $x$, $y$ are measured with errors $\vert \Delta x\vert $, $\vert \Delta y\vert $, the error in $f$ is about $\vert f_x\vert \vert \Delta x\vert +\vert f_y\vert \vert \Delta y\vert $. For a product of powers $f=Cx^my^n$, take logarithms and differentiate: $\dfrac{df}f=m\dfrac{dx}x+n\dfrac{dy}y$, so &lt;strong&gt;relative errors add, weighted by the exponents&lt;/strong&gt;.&lt;/p&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Example 3.&lt;/strong&gt; The volume of a cylinder $V=\pi r^2h$ with $r$ off by $1\%$ and $h$ off by $1\%$: $\left\lvert\tfrac{dV}V\right\rvert\le2(1\%)+1\%=3\%$. The radius is worth measuring twice as carefully as the height.&lt;/p&gt;
&lt;/div&gt;

&lt;h2 id=&quot;applications&quot;&gt;Applications&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Physics: measuring gravity with a pendulum.&lt;/strong&gt; $g=\dfrac{4\pi^2L}{T^2}$. Measuring $L=1.000$ m (to $0.5\%$) and $T=2.007$ s (to $0.5\%$) gives $g\approx9.80$ m/s². The relative error is $\tfrac{dL}L+2\tfrac{dT}T\le0.5\%+1\%=1.5\%$, about $\pm0.15$ m/s². To do better, concentrate on the period (for example time 20 swings and divide).&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Machine learning: why gradient descent lowers the loss.&lt;/strong&gt; By differentiability, for a small step $\Delta w$: $L(w+\Delta w)\approx L(w)+L_{w_1}\Delta w_1+L_{w_2}\Delta w_2$. Choosing $\Delta w_i=-\eta L_{w_i}$ gives $\Delta L\approx-\eta\left(L_{w_1}^2+L_{w_2}^2\right)\le0$. Differentiability is what makes this argument work; for functions with “creases” like example 1 (or ReLU at 0), libraries use one-sided derivatives or subgradients.&lt;/p&gt;

&lt;h2 id=&quot;exercises&quot;&gt;Exercises&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Basic.&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;Find the total differential of $f=x^2y^3$ and $f=e^x\cos y$.&lt;/li&gt;
  &lt;li&gt;Use linear approximation to estimate $1.98^2\cdot1.01^3$.&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Answers&lt;/summary&gt;

  &lt;ol&gt;
    &lt;li&gt;$2xy^3dx+3x^2y^2dy$; $e^x\cos y\,dx-e^x\sin y\,dy$.&lt;/li&gt;
    &lt;li&gt;At $(2,1)$: $f=4$, $df=4(-0.02)+12(0.01)=0.04$, so $\approx4.04$; the true value is $4.0392$.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;p&gt;&lt;strong&gt;Intermediate.&lt;/strong&gt;&lt;/p&gt;

&lt;ol start=&quot;3&quot;&gt;
  &lt;li&gt;A rectangle’s sides are measured as $30$ cm and $40$ cm, each with error at most $0.1$ cm. Estimate the error in the area and in the diagonal.&lt;/li&gt;
  &lt;li&gt;Show directly from the definition that $f=x^2+y^2$ is differentiable everywhere.&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Answers&lt;/summary&gt;

  &lt;ol start=&quot;3&quot;&gt;
    &lt;li&gt;$dA=40(0.1)+30(0.1)=7$ cm². The diagonal is $d=50$: $dd=\tfrac{30(0.1)+40(0.1)}{50}=0.14$ cm.&lt;/li&gt;
    &lt;li&gt;$f(a+h,b+k)-f(a,b)-2ah-2bk=h^2+k^2$, and $\tfrac{h^2+k^2}{\sqrt{h^2+k^2}}=\sqrt{h^2+k^2}\to0$.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;p&gt;&lt;strong&gt;Advanced.&lt;/strong&gt;&lt;/p&gt;

&lt;ol start=&quot;5&quot;&gt;
  &lt;li&gt;Let $f(x,y)=\dfrac{x^2y}{x^2+y^2}$, $f(0,0)=0$. Show that $f$ is continuous and has partial derivatives at the origin, but is not differentiable there.&lt;/li&gt;
  &lt;li&gt;Two resistors in parallel have equivalent resistance $R=\dfrac{R_1R_2}{R_1+R_2}$. With $R_1=100\ \Omega$ and $R_2=400\ \Omega$, each off by $1\%$, estimate the error in $R$.&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Hints&lt;/summary&gt;

  &lt;ol start=&quot;5&quot;&gt;
    &lt;li&gt;Continuity: $\vert f\vert \le\vert y\vert $. $f_x(0,0)=f_y(0,0)=0$ ($f=0$ on both axes). Along $y=x$: $f=\tfrac x2$, but the linear approximation is 0, and the ratio to $\sqrt2\vert x\vert $ is $\tfrac1{2\sqrt2}\not\to0$.&lt;/li&gt;
    &lt;li&gt;$R=80$. $R_{R_1}=\tfrac{R_2^2}{(R_1+R_2)^2}=0.64$, $R_{R_2}=\tfrac{R_1^2}{(R_1+R_2)^2}=0.04$. $dR\le0.64(1)+0.04(4)=0.8\ \Omega$, i.e. $1\%$.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;h2 id=&quot;summary&quot;&gt;Summary&lt;/h2&gt;

&lt;div class=&quot;content-box summary-box textbook-block&quot;&gt;
  &lt;ul&gt;
    &lt;li&gt;Differentiable: $f(a+h,b+k)=f(a,b)+f_xh+f_yk+o\left(\sqrt{h^2+k^2}\right)$.&lt;/li&gt;
    &lt;li&gt;Differentiable implies continuous with partial derivatives; the converse fails (e.g. $\sqrt{\vert xy\vert }$).&lt;/li&gt;
    &lt;li&gt;Continuous partial derivatives imply differentiability; elementary functions are differentiable wherever their partials are continuous.&lt;/li&gt;
    &lt;li&gt;$df=f_xdx+f_ydy$; for $f=Cx^my^n$ the relative error is $m\tfrac{dx}x+n\tfrac{dy}y$.&lt;/li&gt;
  &lt;/ul&gt;
&lt;/div&gt;
</content>
 </entry>
 
 <entry>
   <title>Partial derivatives and tangent planes</title>
   <link href="https://calculus-self-learning.pages.dev/contents/en/chapter10/10_03_Partial_derivatives_and_tangent_planes/"/>
   <updated>2026-12-01T00:00:00+00:00</updated>
   <id>https://calculus-self-learning.pages.dev/contents/en/chapter10/10_03_Partial_derivatives_and_tangent_planes</id>
   <content type="html">&lt;div class=&quot;textbook-objectives&quot;&gt;

  &lt;p&gt;&lt;strong&gt;Learning objectives.&lt;/strong&gt; After this lesson you can:&lt;/p&gt;

  &lt;ul&gt;
    &lt;li&gt;define and compute the partial derivatives $f_x$, $f_y$;&lt;/li&gt;
    &lt;li&gt;explain a partial derivative as the slope of a slice;&lt;/li&gt;
    &lt;li&gt;write the equation of the tangent plane to the graph $z=f(x,y)$;&lt;/li&gt;
    &lt;li&gt;use partial derivatives in economics, physics and machine learning.&lt;/li&gt;
  &lt;/ul&gt;

&lt;/div&gt;

&lt;h2 id=&quot;why-this-lesson&quot;&gt;Why this lesson&lt;/h2&gt;

&lt;p&gt;To know how temperature changes as you walk east, keep the latitude fixed and vary only the longitude. Partial derivatives do exactly that: fix every variable but one and differentiate as a function of one variable. They are the most basic tool of multivariable calculus and the basis of gradient descent.&lt;/p&gt;

&lt;h2 id=&quot;the-definition&quot;&gt;The definition&lt;/h2&gt;

&lt;div class=&quot;textbook-definition&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Definition.&lt;/strong&gt; The partial derivatives of $f$ with respect to $x$ and to $y$ at $(a,b)$ are&lt;/p&gt;

\[f_x(a,b)=\frac{\partial f}{\partial x}(a,b)=\lim_{h\to0}\frac{f(a+h,b)-f(a,b)}h,\qquad f_y(a,b)=\lim_{h\to0}\frac{f(a,b+h)-f(a,b)}h,\]

  &lt;p&gt;when the limits exist.&lt;/p&gt;
&lt;/div&gt;

&lt;p&gt;&lt;strong&gt;Computing them:&lt;/strong&gt; treat the other variables as constants and use every one-variable rule.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Geometric meaning:&lt;/strong&gt; slicing the graph with the plane $y=b$ gives the curve $z=f(x,b)$; $f_x(a,b)$ is the slope of this curve at $x=a$. Likewise $f_y$ is the slope of the slice $x=a$.&lt;/p&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Example 1.&lt;/strong&gt; $f(x,y)=x^2+3xy-y^2$: $f_x=2x+3y$, $f_y=3x-2y$. At $(1,2)$: $f=3$, $f_x=8$, $f_y=-1$. In the $x$ direction the function rises fast (slope 8); in the $y$ direction it falls slowly.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Example 2.&lt;/strong&gt; $f(x,y)=e^x\sin y$: $f_x=e^x\sin y$, $f_y=e^x\cos y$. $g(x,y)=x^y$ ($x&amp;gt;0$): $g_x=yx^{y-1}$ (a power with fixed exponent), $g_y=x^y\ln x$ (an exponential with fixed base).&lt;/p&gt;
&lt;/div&gt;

&lt;h2 id=&quot;the-tangent-plane&quot;&gt;The tangent plane&lt;/h2&gt;

&lt;div class=&quot;textbook-theorem&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Theorem 1.&lt;/strong&gt; If $f_x$, $f_y$ exist at $(a,b)$, the unique plane containing the tangent lines of the slices $y=b$ and $x=a$ at the point $(a,b,f(a,b))$ is&lt;/p&gt;

\[z=f(a,b)+f_x(a,b)(x-a)+f_y(a,b)(y-b),\]

  &lt;p&gt;with normal vector $(f_x(a,b),f_y(a,b),-1)$.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-proof&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Proof.&lt;/strong&gt; The slice $y=b$ is the curve $t\mapsto(t,b,f(t,b))$, whose tangent vector at $t=a$ is $\mathbf u=(1,0,f_x)$. Likewise the slice $x=a$ has tangent $\mathbf v=(0,1,f_y)$. The two vectors are not parallel, so the plane containing them has normal $\mathbf u\times\mathbf v=(-f_x,-f_y,1)$ (lesson 09_01), parallel to $(f_x,f_y,-1)$. The plane through $(a,b,f(a,b))$ with this normal is $f_x(x-a)+f_y(y-b)-(z-f(a,b))=0$.&lt;/p&gt;
&lt;/div&gt;

&lt;p&gt;When $f$ is differentiable (lesson 10_04), this plane really is the best approximation of the surface near the point of tangency.&lt;/p&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Example 3.&lt;/strong&gt; For example 1 at $(1,2)$: $z=3+8(x-1)-(y-2)$.&lt;/p&gt;

  &lt;p&gt;For $f=e^x\sin y$ at $\left(0,\tfrac\pi2\right)$: $f=1$, $f_x=1$, $f_y=0$, so $z=1+x$. The approximation $f\left(0.1,\tfrac\pi2+0.1\right)\approx1.1$; the true value is $1.0996$.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;interactive-frame&quot;&gt;
  &lt;div class=&quot;interactive-frame-head&quot;&gt;
    &lt;div class=&quot;interactive-frame-title&quot;&gt;The tangent plane&lt;/div&gt;
    &lt;div class=&quot;interactive-frame-desc&quot;&gt;Move (x₀, y₀); the two slices give f_x and f_y.&lt;/div&gt;
  &lt;/div&gt;
  &lt;iframe src=&quot;/interactives/chapter10/tangent-plane-en.html&quot; title=&quot;The tangent plane&quot; loading=&quot;lazy&quot; style=&quot;height: 720px;&quot;&gt;&lt;/iframe&gt;
  &lt;div class=&quot;interactive-frame-foot&quot;&gt;
    &lt;a href=&quot;/interactives/chapter10/tangent-plane-en.html&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;Open the interactive in a new window&lt;/a&gt;
  &lt;/div&gt;
&lt;/div&gt;

&lt;h2 id=&quot;short-video&quot;&gt;Short video&lt;/h2&gt;

&lt;div class=&quot;reel-video&quot;&gt;
  &lt;video controls=&quot;&quot; playsinline=&quot;&quot; preload=&quot;metadata&quot; src=&quot;/public/videos/reels/partial-derivatives-slices.mp4&quot;&gt;&lt;/video&gt;
  &lt;p class=&quot;reel-caption&quot;&gt;Partial derivatives as slopes of two slices: fix y to get fₓ, fix x to get fᵧ; the two tangent lines span the tangent plane, secants turn into tangents, linear approximation, the example eˣ sin y, and the slope in every direction (silent video, about 3 minutes 12 seconds).&lt;/p&gt;
&lt;/div&gt;

&lt;h2 id=&quot;applications&quot;&gt;Applications&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Economics: marginal products.&lt;/strong&gt; With $Q=K^{0.3}L^{0.7}$: $Q_L=0.7\tfrac QL$ is the marginal product of labour and $Q_K=0.3\tfrac QK$ that of capital. At $K=8$, $L=27$ ($Q\approx18.74$): $Q_L\approx0.486$, $Q_K\approx0.703$. One more unit of capital raises output more than one more unit of labour; a firm compares these numbers with the price of capital and the wage.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Physics: the heat equation.&lt;/strong&gt; The temperature $u(x,t)$ along a metal rod satisfies the partial differential equation $u_t=k\,u_{xx}$. The function $u=e^{-kt}\sin x$ is a solution: $u_t=-ke^{-kt}\sin x$ and $u_{xx}=-e^{-kt}\sin x$. The amplitude decays exponentially as heat spreads.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Machine learning: the gradient of a loss.&lt;/strong&gt; For one data point $(x,y)$ and the model $\hat y=wx+b$, the loss $L=(wx+b-y)^2$ has $L_w=2(wx+b-y)x$ and $L_b=2(wx+b-y)$. Gradient descent updates $w\leftarrow w-\eta L_w$, $b\leftarrow b-\eta L_b$: each parameter moves against the slope of its own slice.&lt;/p&gt;

&lt;h2 id=&quot;exercises&quot;&gt;Exercises&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Basic.&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;Find $f_x$, $f_y$ for $f=x^3y^2-4xy$ and $f=\ln(x^2+y^2)$.&lt;/li&gt;
  &lt;li&gt;Find $f_x$, $f_y$ for $f=\sin(xy)$ and $f=\dfrac x{x+y}$.&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Answers&lt;/summary&gt;

  &lt;ol&gt;
    &lt;li&gt;$3x^2y^2-4y$, $2x^3y-4x$; $\tfrac{2x}{x^2+y^2}$, $\tfrac{2y}{x^2+y^2}$.&lt;/li&gt;
    &lt;li&gt;$y\cos(xy)$, $x\cos(xy)$; $\tfrac{y}{(x+y)^2}$, $-\tfrac{x}{(x+y)^2}$.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;p&gt;&lt;strong&gt;Intermediate.&lt;/strong&gt;&lt;/p&gt;

&lt;ol start=&quot;3&quot;&gt;
  &lt;li&gt;Write the tangent plane of $z=\sqrt{x^2+y^2}$ at $(3,4)$.&lt;/li&gt;
  &lt;li&gt;Write the tangent plane of $z=x^2+y^2$ at $(1,1)$ and find where it meets the $z$-axis.&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Answers&lt;/summary&gt;

  &lt;ol start=&quot;3&quot;&gt;
    &lt;li&gt;$f_x=\tfrac35$, $f_y=\tfrac45$: $z=5+\tfrac35(x-3)+\tfrac45(y-4)$.&lt;/li&gt;
    &lt;li&gt;$z=2+2(x-1)+2(y-1)=2x+2y-2$; it meets $Oz$ at $(0,0,-2)$.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;p&gt;&lt;strong&gt;Advanced.&lt;/strong&gt;&lt;/p&gt;

&lt;ol start=&quot;5&quot;&gt;
  &lt;li&gt;Show that $u=\sin(x-ct)$ satisfies the wave equation $u_{tt}=c^2u_{xx}$. More generally, show that $u=F(x-ct)$ is a solution for every twice-differentiable $F$.&lt;/li&gt;
  &lt;li&gt;Let $f(x,y)=\dfrac{xy}{x^2+y^2}$, $f(0,0)=0$. Show that $f_x(0,0)=f_y(0,0)=0$, although $f$ is not continuous at the origin (lesson 10_02).&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Hints&lt;/summary&gt;

  &lt;ol start=&quot;5&quot;&gt;
    &lt;li&gt;Chain rule: $u_t=-cF&apos;(x-ct)$, $u_{tt}=c^2F&apos;&apos;$, $u_{xx}=F&apos;&apos;$.&lt;/li&gt;
    &lt;li&gt;$f(h,0)=0$ for every $h$, so $\tfrac{f(h,0)-f(0,0)}h=0$. Partial derivatives only look along the two axes and do not see the behaviour in other directions.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;h2 id=&quot;summary&quot;&gt;Summary&lt;/h2&gt;

&lt;div class=&quot;content-box summary-box textbook-block&quot;&gt;
  &lt;ul&gt;
    &lt;li&gt;$f_x$: the derivative in $x$ with $y$ held constant; the slope of the slice $y=b$.&lt;/li&gt;
    &lt;li&gt;Tangent plane: $z=f(a,b)+f_x(a,b)(x-a)+f_y(a,b)(y-b)$, with normal $(f_x,f_y,-1)$.&lt;/li&gt;
    &lt;li&gt;Having partial derivatives does not imply continuity.&lt;/li&gt;
    &lt;li&gt;Applications: marginal products, the heat and wave equations, the gradient of a loss.&lt;/li&gt;
  &lt;/ul&gt;
&lt;/div&gt;
</content>
 </entry>
 
 <entry>
   <title>Limits and continuity of functions of several variables</title>
   <link href="https://calculus-self-learning.pages.dev/contents/en/chapter10/10_02_Limits_and_continuity_of_functions_of_several_variables/"/>
   <updated>2026-12-01T00:00:00+00:00</updated>
   <id>https://calculus-self-learning.pages.dev/contents/en/chapter10/10_02_Limits_and_continuity_of_functions_of_several_variables</id>
   <content type="html">&lt;div class=&quot;textbook-objectives&quot;&gt;

  &lt;p&gt;&lt;strong&gt;Learning objectives.&lt;/strong&gt; After this lesson you can:&lt;/p&gt;

  &lt;ul&gt;
    &lt;li&gt;state the definition of the limit of a function of two variables;&lt;/li&gt;
    &lt;li&gt;show that a limit does not exist by approaching along two different paths;&lt;/li&gt;
    &lt;li&gt;prove that a limit exists with polar coordinates and the squeeze principle;&lt;/li&gt;
    &lt;li&gt;recognise continuous functions and compute limits by substitution.&lt;/li&gt;
  &lt;/ul&gt;

&lt;/div&gt;

&lt;h2 id=&quot;why-this-lesson&quot;&gt;Why this lesson&lt;/h2&gt;

&lt;p&gt;For a function of one variable, $x$ approaches $a$ from only two sides. In the plane, $(x,y)$ can approach $(a,b)$ along infinitely many paths: straight, curved, spiralling. The limit exists only if &lt;strong&gt;every&lt;/strong&gt; path gives the same result. Understanding this prepares the notion of differentiability in lesson 10_04, where some functions have partial derivatives yet are not even continuous.&lt;/p&gt;

&lt;h2 id=&quot;the-definition&quot;&gt;The definition&lt;/h2&gt;

&lt;div class=&quot;textbook-definition&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Definition.&lt;/strong&gt; We say $\displaystyle\lim_{(x,y)\to(a,b)}f(x,y)=L$ if for every $\varepsilon&amp;gt;0$ there is $\delta&amp;gt;0$ such that&lt;/p&gt;

\[0&amp;lt;\sqrt{(x-a)^2+(y-b)^2}&amp;lt;\delta\ \Rightarrow\ |f(x,y)-L|&amp;lt;\varepsilon\]

  &lt;p&gt;(for $(x,y)$ in the domain). $f$ is &lt;strong&gt;continuous&lt;/strong&gt; at $(a,b)$ if $\lim_{(x,y)\to(a,b)}f(x,y)=f(a,b)$.&lt;/p&gt;
&lt;/div&gt;

&lt;p&gt;The definition is exactly as in one variable, with $\vert x-a\vert $ replaced by the distance in the plane. The sum, product, quotient (nonzero denominator) and composition rules still hold with the same proofs. So &lt;strong&gt;polynomials are continuous everywhere, rational functions wherever the denominator is nonzero&lt;/strong&gt;, and compositions of continuous functions are continuous: $e^{xy}$, $\sin(x^2+y)$, $\ln(1+x^2+y^2)$ are continuous on $\mathbb R^2$.&lt;/p&gt;

&lt;h2 id=&quot;two-paths-with-two-different-limits&quot;&gt;Two paths with two different limits&lt;/h2&gt;

&lt;div class=&quot;textbook-theorem&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Theorem 1.&lt;/strong&gt; If $f(x,y)\to L_1$ as $(x,y)\to(a,b)$ along a curve $C_1$ and $f(x,y)\to L_2$ along $C_2$ with $L_1\ne L_2$, then $\lim_{(x,y)\to(a,b)}f(x,y)$ does not exist.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-proof&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Proof.&lt;/strong&gt; Suppose the limit is $L$. Take $\varepsilon=\tfrac{\vert L_1-L_2\vert }3&amp;gt;0$ and the corresponding $\delta$. Points of $C_1$ and $C_2$ close enough to $(a,b)$ lie in the disc of radius $\delta$, so the values of $f$ there are within $\varepsilon$ of $L$. Letting the point approach $(a,b)$ along each curve: $\vert L_1-L\vert \le\varepsilon$ and $\vert L_2-L\vert \le\varepsilon$. Hence $\vert L_1-L_2\vert \le2\varepsilon=\tfrac23\vert L_1-L_2\vert $, a contradiction.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Example 1.&lt;/strong&gt; $f(x,y)=\dfrac{xy}{x^2+y^2}$ at the origin. Along $y=mx$: $f=\dfrac{mx^2}{(1+m^2)x^2}=\dfrac m{1+m^2}$. For $m=0$ the limit is 0, for $m=1$ it is $\tfrac12$. So the limit does not exist.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Example 2 (All lines are not enough).&lt;/strong&gt; $f(x,y)=\dfrac{x^2y}{x^4+y^2}$. Along $y=mx$: $f=\dfrac{mx^3}{x^4+m^2x^2}=\dfrac{mx}{x^2+m^2}\to0$; along the axis $x=0$ it is also 0. But along the parabola $y=x^2$: $f=\dfrac{x^4}{2x^4}=\tfrac12$. The limit does not exist, although every line gives 0.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;interactive-frame&quot;&gt;
  &lt;div class=&quot;interactive-frame-head&quot;&gt;
    &lt;div class=&quot;interactive-frame-title&quot;&gt;Approaching the origin along several paths&lt;/div&gt;
    &lt;div class=&quot;interactive-frame-desc&quot;&gt;Compare the limits along a line, a parabola and a spiral.&lt;/div&gt;
  &lt;/div&gt;
  &lt;iframe src=&quot;/interactives/chapter10/limit-two-paths-en.html&quot; title=&quot;Approaching the origin along several paths&quot; loading=&quot;lazy&quot; style=&quot;height: 720px;&quot;&gt;&lt;/iframe&gt;
  &lt;div class=&quot;interactive-frame-foot&quot;&gt;
    &lt;a href=&quot;/interactives/chapter10/limit-two-paths-en.html&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;Open the interactive in a new window&lt;/a&gt;
  &lt;/div&gt;
&lt;/div&gt;

&lt;h2 id=&quot;proving-a-limit-exists-polar-coordinates&quot;&gt;Proving a limit exists: polar coordinates&lt;/h2&gt;

&lt;p&gt;Put $x=a+r\cos\theta$, $y=b+r\sin\theta$. If $\vert f(x,y)-L\vert \le g(r)$ with $g(r)\to0$ &lt;strong&gt;independently of $\theta$&lt;/strong&gt;, then $f\to L$ (the squeeze principle).&lt;/p&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Example 3.&lt;/strong&gt; $\displaystyle\lim_{(x,y)\to(0,0)}\frac{x^2y}{x^2+y^2}$. In polar coordinates: $\dfrac{r^3\cos^2\theta\sin\theta}{r^2}=r\cos^2\theta\sin\theta$, with absolute value $\le r\to0$. The limit is 0.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Example 4.&lt;/strong&gt; $\displaystyle\lim_{(x,y)\to(0,0)}\frac{\sin(x^2+y^2)}{x^2+y^2}=\lim_{t\to0^+}\frac{\sin t}t=1$ with $t=x^2+y^2$: the function depends only on $r$, so it reduces to a one-variable limit.&lt;/p&gt;
&lt;/div&gt;

&lt;p&gt;A warning: for example 2, polar coordinates give $\dfrac{r\cos^2\theta\sin\theta}{r^2\cos^4\theta+\sin^2\theta}$; when $\theta$ changes with $r$ (along the parabola), the expression does not tend to 0. The estimate must be uniform in $\theta$.&lt;/p&gt;

&lt;h2 id=&quot;applications&quot;&gt;Applications&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Physics: the potential of a point charge.&lt;/strong&gt; The potential $V=\dfrac{kq}{\sqrt{x^2+y^2+z^2}}$ is continuous everywhere except the origin, where it tends to infinity in every direction. By contrast, the function $\tfrac{xy}{x^2+y^2}$ of example 1 is bounded yet has no limit: its value depends on the direction of approach. This kind of “directional discontinuity” is typical when dividing two quantities that both tend to 0.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Machine learning: continuous losses.&lt;/strong&gt; Optimisation algorithms assume the loss is continuous in the parameters: a small change in the parameters gives a small change in the loss. Accuracy (the fraction of correct predictions) is a step function, not continuous, so one optimises the cross-entropy, a continuous (and differentiable) surrogate.&lt;/p&gt;

&lt;h2 id=&quot;exercises&quot;&gt;Exercises&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Basic.&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;Compute $\displaystyle\lim_{(x,y)\to(1,2)}\frac{x^2+y}{x+y^2}$ and $\displaystyle\lim_{(x,y)\to(0,0)}e^{-x^2-y^2}\cos(xy)$.&lt;/li&gt;
  &lt;li&gt;Show that $\displaystyle\lim_{(x,y)\to(0,0)}\frac{x^2-y^2}{x^2+y^2}$ does not exist.&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Answers&lt;/summary&gt;

  &lt;ol&gt;
    &lt;li&gt;$\tfrac35$; $1$ (continuous functions, substitute).&lt;/li&gt;
    &lt;li&gt;Along the $x$-axis: 1; along the $y$-axis: $-1$.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;p&gt;&lt;strong&gt;Intermediate.&lt;/strong&gt;&lt;/p&gt;

&lt;ol start=&quot;3&quot;&gt;
  &lt;li&gt;Compute $\displaystyle\lim_{(x,y)\to(0,0)}\frac{x^3+y^3}{x^2+y^2}$.&lt;/li&gt;
  &lt;li&gt;Study $\displaystyle\lim_{(x,y)\to(0,0)}\frac{xy^2}{x^2+y^4}$.&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Answers&lt;/summary&gt;

  &lt;ol start=&quot;3&quot;&gt;
    &lt;li&gt;Polar coordinates: $r(\cos^3\theta+\sin^3\theta)$, with absolute value $\le2r\to0$. The limit is 0.&lt;/li&gt;
    &lt;li&gt;Along lines: 0. Along $x=y^2$: $\tfrac{y^4}{2y^4}=\tfrac12$. It does not exist.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;p&gt;&lt;strong&gt;Advanced.&lt;/strong&gt;&lt;/p&gt;

&lt;ol start=&quot;5&quot;&gt;
  &lt;li&gt;For which $p&amp;gt;0$ does $\displaystyle\lim_{(x,y)\to(0,0)}\frac{\vert x\vert ^p\vert y\vert ^p}{x^2+y^2}$ exist?&lt;/li&gt;
  &lt;li&gt;Let $f(x,y)=\dfrac{xy}{x^2+y^2}$, $f(0,0)=0$. Show that $f(x,0)$ and $f(0,y)$ are continuous functions of one variable at 0, but $f$ is not continuous at the origin.&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Hints&lt;/summary&gt;

  &lt;ol start=&quot;5&quot;&gt;
    &lt;li&gt;Polar coordinates: $r^{2p-2}\vert \cos\theta\sin\theta\vert ^p$. For $p&amp;gt;1$ the limit is 0. For $p\le1$, along $y=x$ the value is $\tfrac{\vert x\vert ^{2p}}{2x^2}$, equal to $\tfrac12$ for $p=1$ and unbounded for $p&amp;lt;1$: no limit.&lt;/li&gt;
    &lt;li&gt;$f(x,0)=0$ and $f(0,y)=0$ everywhere. But along $y=x$, $f=\tfrac12\ne f(0,0)$.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;h2 id=&quot;summary&quot;&gt;Summary&lt;/h2&gt;

&lt;div class=&quot;content-box summary-box textbook-block&quot;&gt;
  &lt;ul&gt;
    &lt;li&gt;$\lim_{(x,y)\to(a,b)}f=L$: $f$ is close to $L$ whenever the distance to $(a,b)$ is small enough, however we approach.&lt;/li&gt;
    &lt;li&gt;Two paths with different values mean no limit; all lines agreeing is still not enough.&lt;/li&gt;
    &lt;li&gt;To prove existence: polar coordinates with an estimate $\vert f-L\vert \le g(r)\to0$ independent of $\theta$.&lt;/li&gt;
    &lt;li&gt;Polynomials, rational functions (nonzero denominator) and their compositions are continuous.&lt;/li&gt;
  &lt;/ul&gt;
&lt;/div&gt;
</content>
 </entry>
 
 <entry>
   <title>Functions of several variables, graphs and level curves</title>
   <link href="https://calculus-self-learning.pages.dev/contents/en/chapter10/10_01_Functions_of_several_variables_graphs_and_level_curves/"/>
   <updated>2026-12-01T00:00:00+00:00</updated>
   <id>https://calculus-self-learning.pages.dev/contents/en/chapter10/10_01_Functions_of_several_variables_graphs_and_level_curves</id>
   <content type="html">&lt;div class=&quot;textbook-objectives&quot;&gt;

  &lt;p&gt;&lt;strong&gt;Learning objectives.&lt;/strong&gt; After this lesson you can:&lt;/p&gt;

  &lt;ul&gt;
    &lt;li&gt;find the domain of a function of two or three variables;&lt;/li&gt;
    &lt;li&gt;relate the graph $z=f(x,y)$ to the contour map $f(x,y)=c$;&lt;/li&gt;
    &lt;li&gt;sketch level curves of simple functions and read steepness from their spacing;&lt;/li&gt;
    &lt;li&gt;recognise the level surfaces of a function of three variables.&lt;/li&gt;
  &lt;/ul&gt;

&lt;/div&gt;

&lt;h2 id=&quot;why-this-lesson&quot;&gt;Why this lesson&lt;/h2&gt;

&lt;p&gt;Most real quantities depend on several variables: temperature depends on position and time, output on capital and labour, the loss of a neural network on millions of parameters. Before differentiating, we need a way to &lt;strong&gt;see&lt;/strong&gt; these functions. A topographic map with its contour lines is the best visual tool.&lt;/p&gt;

&lt;h2 id=&quot;functions-of-several-variables&quot;&gt;Functions of several variables&lt;/h2&gt;

&lt;div class=&quot;textbook-definition&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Definition.&lt;/strong&gt; A &lt;strong&gt;function of two variables&lt;/strong&gt; $f:D\to\mathbb R$ with $D\subset\mathbb R^2$ assigns a number $f(x,y)$ to each point $(x,y)\in D$. $D$ is the &lt;strong&gt;domain&lt;/strong&gt;. The &lt;strong&gt;graph&lt;/strong&gt; of $f$ is the surface $\lbrace (x,y,z):z=f(x,y)\rbrace $ in $\mathbb R^3$. The &lt;strong&gt;level curve&lt;/strong&gt; for the value $c$ is the set $\lbrace (x,y):f(x,y)=c\rbrace $ in the plane.&lt;/p&gt;
&lt;/div&gt;

&lt;p&gt;A level curve is the projection onto the $xy$-plane of the intersection of the graph with the horizontal plane $z=c$, exactly the method of traces of lesson 09_05.&lt;/p&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Example 1.&lt;/strong&gt; $f(x,y)=\sqrt{9-x^2-y^2}$: the domain is the disc $x^2+y^2\le9$; the graph is the upper half of the sphere of radius 3; the level curve $f=c$ ($0\le c\le3$) is the circle of radius $\sqrt{9-c^2}$. The circles crowd together near the edge, where the sphere is steep.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Example 2.&lt;/strong&gt; $f(x,y)=100-x^2-2y^2$ (a “hill”): the level curve $f=c$ is the ellipse $x^2+2y^2=100-c$, with the summit at the origin at height 100. $g(x,y)=x^2-y^2$ (a saddle): the level curves are the hyperbolas $x^2-y^2=c$, and for $c=0$ the pair of lines $y=\pm x$ crossing at the saddle point.&lt;/p&gt;
&lt;/div&gt;

&lt;h2 id=&quot;reading-a-contour-map&quot;&gt;Reading a contour map&lt;/h2&gt;

&lt;p&gt;On a map with level curves equally spaced in value ($c,c+h,c+2h,\dots$), the &lt;strong&gt;closer&lt;/strong&gt; the curves, the &lt;strong&gt;steeper&lt;/strong&gt; the function. Two level curves for different values never cross (each point has only one value of $f$).&lt;/p&gt;

&lt;div class=&quot;textbook-theorem&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Proposition 1.&lt;/strong&gt; For a linear function $f(x,y)=ax+by$ ($a,b$ not both 0), the level curves are parallel lines perpendicular to the vector $(a,b)$, and the level curves $f=c$ and $f=c+1$ are $\dfrac1{\sqrt{a^2+b^2}}$ apart.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-proof&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Proof.&lt;/strong&gt; The line $ax+by=c$ has normal $(a,b)$. Take a point $P$ on $f=c$; by the distance formula (lesson 09_02, in the plane), the distance from $P$ to the line $ax+by=c+1$ is $\tfrac{\vert ax_P+by_P-(c+1)\vert }{\sqrt{a^2+b^2}}=\tfrac{1}{\sqrt{a^2+b^2}}$.&lt;/p&gt;
&lt;/div&gt;

&lt;p&gt;So the function increases fastest in the direction $(a,b)$, at the rate $\sqrt{a^2+b^2}$ per unit length. Chapter 11 shows that for any function this direction is the &lt;strong&gt;gradient&lt;/strong&gt;, always perpendicular to the level curve.&lt;/p&gt;

&lt;div class=&quot;interactive-frame&quot;&gt;
  &lt;div class=&quot;interactive-frame-head&quot;&gt;
    &lt;div class=&quot;interactive-frame-title&quot;&gt;Graphs and level curves&lt;/div&gt;
    &lt;div class=&quot;interactive-frame-desc&quot;&gt;The surface z = f(x, y), the plane z = c and the matching level curves.&lt;/div&gt;
  &lt;/div&gt;
  &lt;iframe src=&quot;/interactives/chapter10/level-curves-en.html&quot; title=&quot;Graphs and level curves&quot; loading=&quot;lazy&quot; style=&quot;height: 700px;&quot;&gt;&lt;/iframe&gt;
  &lt;div class=&quot;interactive-frame-foot&quot;&gt;
    &lt;a href=&quot;/interactives/chapter10/level-curves-en.html&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;Open the interactive in a new window&lt;/a&gt;
  &lt;/div&gt;
&lt;/div&gt;

&lt;h2 id=&quot;functions-of-three-variables-and-level-surfaces&quot;&gt;Functions of three variables and level surfaces&lt;/h2&gt;

&lt;p&gt;For $f(x,y,z)$ the graph lives in $\mathbb R^4$ and cannot be drawn, but the &lt;strong&gt;level surfaces&lt;/strong&gt; $f(x,y,z)=c$ can. For example $f=x^2+y^2+z^2$ has spheres as level surfaces; $f=x^2+y^2-z^2$ has hyperboloids of one sheet ($c&amp;gt;0$), a cone ($c=0$) and hyperboloids of two sheets ($c&amp;lt;0$).&lt;/p&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Example 3.&lt;/strong&gt; The temperature around a point heat source at the origin: $T(x,y,z)=\dfrac{100}{1+x^2+y^2+z^2}$. The isothermal surface $T=20$ is the sphere $x^2+y^2+z^2=4$ of radius 2.&lt;/p&gt;
&lt;/div&gt;

&lt;h2 id=&quot;short-video&quot;&gt;Short video&lt;/h2&gt;

&lt;div class=&quot;reel-video&quot;&gt;
  &lt;video controls=&quot;&quot; playsinline=&quot;&quot; preload=&quot;metadata&quot; src=&quot;/public/videos/reels/surface-and-level-curves.mp4&quot;&gt;&lt;/video&gt;
  &lt;p class=&quot;reel-caption&quot;&gt;The surface z = f(x, y) sliced by horizontal planes, level curves stamped onto a map; the camera rises to a top view, then a saddle (silent video, about 2 minutes).&lt;/p&gt;
&lt;/div&gt;

&lt;h2 id=&quot;applications&quot;&gt;Applications&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Economics: the Cobb–Douglas production function.&lt;/strong&gt; Output $Q(K,L)=AK^\alpha L^{1-\alpha}$ with capital $K$, labour $L$ and $0&amp;lt;\alpha&amp;lt;1$. The level curves $Q=c$ are called &lt;strong&gt;isoquants&lt;/strong&gt;: all combinations of capital and labour giving the same output. With $A=1$ and $\alpha=0.3$: $Q(8,27)\approx18.74$ and $Q(16,54)\approx37.49$, twice as much: doubling both inputs doubles output (constant returns to scale), because $Q(tK,tL)=t^\alpha t^{1-\alpha}Q=tQ$.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Machine learning: loss landscapes.&lt;/strong&gt; For linear regression with two parameters, the squared loss $L(w,b)=\tfrac1n\sum(wx_i+b-y_i)^2$ is a quadratic polynomial in $(w,b)$; its level curves are concentric ellipses around the optimum. The flatter the ellipses, the more gradient descent zigzags. Drawing the level curves is the quickest way to see why data should be normalised.&lt;/p&gt;

&lt;h2 id=&quot;exercises&quot;&gt;Exercises&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Basic.&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;Find the domains of $f(x,y)=\ln(x-y)$ and $g(x,y)=\dfrac1{\sqrt{1-x^2-y^2}}$.&lt;/li&gt;
  &lt;li&gt;Describe the level curves of $f(x,y)=y-x^2$ and $f(x,y)=xy$.&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Answers&lt;/summary&gt;

  &lt;ol&gt;
    &lt;li&gt;The half-plane $y&amp;lt;x$; the open disc $x^2+y^2&amp;lt;1$.&lt;/li&gt;
    &lt;li&gt;The parabolas $y=x^2+c$; the hyperbolas $xy=c$ (for $c=0$, the two axes).&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;p&gt;&lt;strong&gt;Intermediate.&lt;/strong&gt;&lt;/p&gt;

&lt;ol start=&quot;3&quot;&gt;
  &lt;li&gt;Sketch the level curves $c=1,2,3$ of $f(x,y)=\vert x\vert +\vert y\vert $. What does the graph look like?&lt;/li&gt;
  &lt;li&gt;For $Q=K^{0.3}L^{0.7}$, write the isoquant $Q=10$ as $K$ in terms of $L$.&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Answers&lt;/summary&gt;

  &lt;ol start=&quot;3&quot;&gt;
    &lt;li&gt;Squares rotated by $45^\circ$ with vertices $(\pm c,0)$, $(0,\pm c)$. The graph is an inverted square pyramid (apex at the origin).&lt;/li&gt;
    &lt;li&gt;$K=10^{1/0.3}L^{-7/3}\approx2154\,L^{-7/3}$.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;p&gt;&lt;strong&gt;Advanced.&lt;/strong&gt;&lt;/p&gt;

&lt;ol start=&quot;5&quot;&gt;
  &lt;li&gt;Show that if $f(tx,ty)=f(x,y)$ for all $t&amp;gt;0$ (homogeneous of degree 0), every level curve is a union of rays from the origin.&lt;/li&gt;
  &lt;li&gt;Describe the level surfaces of $f(x,y,z)=z-x^2-y^2$ and of $f(x,y,z)=\dfrac{x^2+y^2}{z^2}$.&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Hints&lt;/summary&gt;

  &lt;ol start=&quot;5&quot;&gt;
    &lt;li&gt;If $f(x_0,y_0)=c$ then $f(tx_0,ty_0)=c$ for all $t&amp;gt;0$: the whole ray through $(x_0,y_0)$ lies on the level curve.&lt;/li&gt;
    &lt;li&gt;The paraboloids $z=x^2+y^2+c$ (translated along $Oz$). The cones $x^2+y^2=cz^2$ (vertex removed) for $c&amp;gt;0$; for $c=0$, the $z$-axis without the origin.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;h2 id=&quot;summary&quot;&gt;Summary&lt;/h2&gt;

&lt;div class=&quot;content-box summary-box textbook-block&quot;&gt;
  &lt;ul&gt;
    &lt;li&gt;A function of two variables has a surface $z=f(x,y)$ as its graph; the level curve $f=c$ is a horizontal slice projected down.&lt;/li&gt;
    &lt;li&gt;With level curves equally spaced in value, closer means steeper; they never cross.&lt;/li&gt;
    &lt;li&gt;A linear function $ax+by$: parallel level lines perpendicular to $(a,b)$, $\tfrac1{\sqrt{a^2+b^2}}$ apart.&lt;/li&gt;
    &lt;li&gt;Functions of three variables are pictured with level surfaces; examples are isoquants, isotherms and loss landscapes.&lt;/li&gt;
  &lt;/ul&gt;
&lt;/div&gt;
</content>
 </entry>
 
 <entry>
   <title>Motion in space</title>
   <link href="https://calculus-self-learning.pages.dev/contents/en/chapter09/09_06_Motion_in_space/"/>
   <updated>2026-12-01T00:00:00+00:00</updated>
   <id>https://calculus-self-learning.pages.dev/contents/en/chapter09/09_06_Motion_in_space</id>
   <content type="html">&lt;div class=&quot;textbook-objectives&quot;&gt;

  &lt;p&gt;&lt;strong&gt;Learning objectives.&lt;/strong&gt; After this lesson you can:&lt;/p&gt;

  &lt;ul&gt;
    &lt;li&gt;compute the velocity, speed and acceleration of a motion $\mathbf r(t)$;&lt;/li&gt;
    &lt;li&gt;define and compute the curvature $\kappa$ of a curve;&lt;/li&gt;
    &lt;li&gt;split acceleration into its tangential component $a_T$ and normal component $a_N$;&lt;/li&gt;
    &lt;li&gt;solve projectile and uniform circular motion problems.&lt;/li&gt;
  &lt;/ul&gt;

&lt;/div&gt;

&lt;h2 id=&quot;why-this-lesson&quot;&gt;Why this lesson&lt;/h2&gt;

&lt;p&gt;Newton’s law $\mathbf F=m\mathbf a$ is a vector equation. To understand why a car skids on a bend, why a satellite does not fall, or why a robot must slow down before turning, we split the acceleration into the part that changes the &lt;strong&gt;speed&lt;/strong&gt; and the part that changes the &lt;strong&gt;direction&lt;/strong&gt;. The second part depends on the curvature of the path.&lt;/p&gt;

&lt;h2 id=&quot;velocity-and-acceleration&quot;&gt;Velocity and acceleration&lt;/h2&gt;

&lt;div class=&quot;textbook-definition&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Definition.&lt;/strong&gt; For a position $\mathbf r(t)$: the &lt;strong&gt;velocity&lt;/strong&gt; is $\mathbf v=\mathbf r&apos;(t)$, the &lt;strong&gt;speed&lt;/strong&gt; is $\lVert\mathbf v\rVert=\tfrac{ds}{dt}$, the &lt;strong&gt;acceleration&lt;/strong&gt; is $\mathbf a=\mathbf r&apos;&apos;(t)$. When $\mathbf v\ne\mathbf 0$: the &lt;strong&gt;unit tangent vector&lt;/strong&gt; is $\mathbf T=\tfrac{\mathbf v}{\lVert\mathbf v\rVert}$; the &lt;strong&gt;unit normal vector&lt;/strong&gt; is $\mathbf N=\tfrac{\mathbf T&apos;}{\lVert\mathbf T&apos;\rVert}$ (when $\mathbf T&apos;\ne\mathbf 0$).&lt;/p&gt;
&lt;/div&gt;

&lt;p&gt;Since $\lVert\mathbf T\rVert=1$, $\mathbf T&apos;\perp\mathbf T$ (exercise 6 of lesson 09_03): $\mathbf N$ points to the side the curve is bending toward.&lt;/p&gt;

&lt;h2 id=&quot;curvature&quot;&gt;Curvature&lt;/h2&gt;

&lt;div class=&quot;textbook-definition&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Definition.&lt;/strong&gt; The &lt;strong&gt;curvature&lt;/strong&gt; is the rate at which the tangent vector turns per unit arc length: $\kappa=\left\lVert\dfrac{d\mathbf T}{ds}\right\rVert$. The radius of curvature is $\tfrac1\kappa$.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-theorem&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Theorem 1.&lt;/strong&gt; For a smooth motion $\mathbf r(t)$:&lt;/p&gt;

\[\mathbf a=\frac{d\lVert\mathbf v\rVert}{dt}\,\mathbf T+\kappa\lVert\mathbf v\rVert^2\,\mathbf N,\qquad\kappa=\frac{\lVert\mathbf r&apos;\times\mathbf r&apos;&apos;\rVert}{\lVert\mathbf r&apos;\rVert^3}.\]

  &lt;p&gt;Hence $a_T=\dfrac{d\lVert\mathbf v\rVert}{dt}=\dfrac{\mathbf v\cdot\mathbf a}{\lVert\mathbf v\rVert}$ and $a_N=\kappa\lVert\mathbf v\rVert^2=\dfrac{\lVert\mathbf v\times\mathbf a\rVert}{\lVert\mathbf v\rVert}$.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-proof&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Proof.&lt;/strong&gt; Write $\mathbf v=\lVert\mathbf v\rVert\mathbf T$ and differentiate: $\mathbf a=\tfrac{d\lVert\mathbf v\rVert}{dt}\mathbf T+\lVert\mathbf v\rVert\mathbf T&apos;$. By the chain rule $\mathbf T&apos;=\tfrac{d\mathbf T}{ds}\tfrac{ds}{dt}$, and $\tfrac{d\mathbf T}{ds}=\kappa\mathbf N$ (same direction as $\mathbf T&apos;$, length $\kappa$). So $\mathbf T&apos;=\kappa\lVert\mathbf v\rVert\mathbf N$, which gives the first formula.&lt;/p&gt;

  &lt;p&gt;Take the cross product with $\mathbf v=\lVert\mathbf v\rVert\mathbf T$: $\mathbf v\times\mathbf a=\kappa\lVert\mathbf v\rVert^3\,\mathbf T\times\mathbf N$ (since $\mathbf T\times\mathbf T=\mathbf 0$). As $\mathbf T\perp\mathbf N$ are unit vectors, $\lVert\mathbf T\times\mathbf N\rVert=1$. Hence $\kappa=\tfrac{\lVert\mathbf v\times\mathbf a\rVert}{\lVert\mathbf v\rVert^3}$. The formula for $a_T$ follows from $\mathbf v\cdot\mathbf a=\lVert\mathbf v\rVert a_T$.&lt;/p&gt;
&lt;/div&gt;

&lt;p&gt;For a plane graph $y=f(x)$ (parametrised as $(t,f(t),0)$), the formula gives $\kappa=\dfrac{\vert f&apos;&apos;(x)\vert }{\left(1+f&apos;(x)^2\right)^{3/2}}$.&lt;/p&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Example 1.&lt;/strong&gt; A circle of radius $R$, $\mathbf r=(R\cos t,R\sin t,0)$: $\lVert\mathbf r&apos;\rVert=R$, $\lVert\mathbf r&apos;\times\mathbf r&apos;&apos;\rVert=R^2$, so $\kappa=\tfrac1R$: small circles bend a lot. The helix $(\cos t,\sin t,t)$: $\mathbf r&apos;\times\mathbf r&apos;&apos;=(\sin t,-\cos t,1)$ of length $\sqrt2$, so $\kappa=\tfrac{\sqrt2}{2\sqrt2}=\tfrac12$.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Example 2.&lt;/strong&gt; The motion $\mathbf r=(t,t^2,0)$ at $t=1$: $\mathbf v=(1,2,0)$, $\mathbf a=(0,2,0)$, $\mathbf v\times\mathbf a=(0,0,2)$. So $\kappa=\tfrac2{5^{3/2}}\approx0.179$, $a_T=\tfrac4{\sqrt5}\approx1.789$, $a_N=\tfrac2{\sqrt5}\approx0.894$. Check: $a_T^2+a_N^2=\tfrac{16}5+\tfrac45=4=\lVert\mathbf a\rVert^2$.&lt;/p&gt;
&lt;/div&gt;

&lt;h2 id=&quot;projectiles&quot;&gt;Projectiles&lt;/h2&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Example 3.&lt;/strong&gt; Ignoring air resistance, an object thrown from the origin with speed $v_0$ at angle $\alpha$ has $\mathbf a=(0,-g)$; integrating twice:&lt;/p&gt;

\[\mathbf r(t)=\left(v_0\cos\alpha\,t,\ v_0\sin\alpha\,t-\tfrac12gt^2\right).\]

  &lt;p&gt;It lands at $t=\tfrac{2v_0\sin\alpha}g$, with range $\tfrac{v_0^2\sin2\alpha}g$, largest at $\alpha=45^\circ$. With $v_0=20$ m/s and $g=9.8$ m/s², the maximum range is $40.8$ m.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;interactive-frame&quot;&gt;
  &lt;div class=&quot;interactive-frame-head&quot;&gt;
    &lt;div class=&quot;interactive-frame-title&quot;&gt;Velocity and acceleration&lt;/div&gt;
    &lt;div class=&quot;interactive-frame-desc&quot;&gt;Acceleration split into tangential and normal parts.&lt;/div&gt;
  &lt;/div&gt;
  &lt;iframe src=&quot;/interactives/chapter09/motion-in-space-en.html&quot; title=&quot;Velocity and acceleration&quot; loading=&quot;lazy&quot; style=&quot;height: 700px;&quot;&gt;&lt;/iframe&gt;
  &lt;div class=&quot;interactive-frame-foot&quot;&gt;
    &lt;a href=&quot;/interactives/chapter09/motion-in-space-en.html&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;Open the interactive in a new window&lt;/a&gt;
  &lt;/div&gt;
&lt;/div&gt;

&lt;h2 id=&quot;applications&quot;&gt;Applications&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Physics: satellite orbits.&lt;/strong&gt; Uniform circular motion with radius $r$ and speed $v$ has $a_T=0$ and $a_N=\tfrac{v^2}r$. Gravity supplies this acceleration: $\tfrac{v^2}r=\tfrac{GM}{r^2}$, so $v=\sqrt{GM/r}$. With $GM=3.986\times10^{14}$ m³/s² and an altitude of 400 km ($r=6771$ km): $v\approx7.67$ km/s and a period of about 92 minutes, as for the International Space Station.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Traffic: bends and transition curves.&lt;/strong&gt; A car at 72 km/h (20 m/s) on a bend of radius 100 m has normal acceleration $\tfrac{20^2}{100}=4$ m/s², about $0.41g$. If a straight road joined a circular arc directly, the curvature would jump from 0 to $\tfrac1{100}$ and passengers would be jolted. Road and railway engineers insert a clothoid, whose curvature grows linearly with arc length, so that $a_N$ builds up gradually.&lt;/p&gt;

&lt;h2 id=&quot;exercises&quot;&gt;Exercises&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Basic.&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;Let $\mathbf r=(t,t^2,t^3)$. Find the velocity, speed and acceleration at $t=1$.&lt;/li&gt;
  &lt;li&gt;Find the curvature of $y=\sin x$ at $x=\tfrac\pi2$ and at $x=0$.&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Answers&lt;/summary&gt;

  &lt;ol&gt;
    &lt;li&gt;$\mathbf v=(1,2,3)$, speed $\sqrt{14}$, $\mathbf a=(0,2,6)$.&lt;/li&gt;
    &lt;li&gt;At $\tfrac\pi2$: $f&apos;=0$, $\vert f&apos;&apos;\vert =1$, $\kappa=1$. At 0: $f&apos;&apos;=0$, $\kappa=0$ (an inflection point).&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;p&gt;&lt;strong&gt;Intermediate.&lt;/strong&gt;&lt;/p&gt;

&lt;ol start=&quot;3&quot;&gt;
  &lt;li&gt;For the motion of exercise 1 at $t=1$, find $\kappa$, $a_T$, $a_N$.&lt;/li&gt;
  &lt;li&gt;An object is thrown with $v_0=20$ m/s. Which launch angle gives a range of 30 m?&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Answers&lt;/summary&gt;

  &lt;ol start=&quot;3&quot;&gt;
    &lt;li&gt;$\mathbf v\times\mathbf a=(6,-6,2)$ of length $\sqrt{76}$. $\kappa=\tfrac{\sqrt{76}}{14^{3/2}}\approx0.166$, $a_T=\tfrac{22}{\sqrt{14}}\approx5.88$, $a_N=\tfrac{\sqrt{76}}{\sqrt{14}}\approx2.33$.&lt;/li&gt;
    &lt;li&gt;$\sin2\alpha=\tfrac{30\cdot9.8}{400}=0.735$: $\alpha\approx23.7^\circ$ or $66.3^\circ$.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;p&gt;&lt;strong&gt;Advanced.&lt;/strong&gt;&lt;/p&gt;

&lt;ol start=&quot;5&quot;&gt;
  &lt;li&gt;Show that for motion at constant speed the acceleration is perpendicular to the velocity.&lt;/li&gt;
  &lt;li&gt;Find the curvature of the helix $(a\cos t,a\sin t,bt)$ and explain the limiting cases $b=0$ and $a\to0$.&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Hints&lt;/summary&gt;

  &lt;ol start=&quot;5&quot;&gt;
    &lt;li&gt;Differentiate $\mathbf v\cdot\mathbf v=c$: $2\,\mathbf v\cdot\mathbf a=0$. This is also $a_T=0$ in theorem 1.&lt;/li&gt;
    &lt;li&gt;$\kappa=\tfrac a{a^2+b^2}$. For $b=0$: a circle, $\kappa=\tfrac1a$. As $a\to0$ the helix straightens into a line and $\kappa\to0$.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;h2 id=&quot;summary&quot;&gt;Summary&lt;/h2&gt;

&lt;div class=&quot;content-box summary-box textbook-block&quot;&gt;
  &lt;ul&gt;
    &lt;li&gt;$\mathbf v=\mathbf r&apos;$, $\mathbf a=\mathbf r&apos;&apos;$, $\mathbf T=\tfrac{\mathbf v}{\lVert\mathbf v\rVert}$, $\mathbf N=\tfrac{\mathbf T&apos;}{\lVert\mathbf T&apos;\rVert}$.&lt;/li&gt;
    &lt;li&gt;Curvature $\kappa=\tfrac{\lVert\mathbf r&apos;\times\mathbf r&apos;&apos;\rVert}{\lVert\mathbf r&apos;\rVert^3}$; a circle of radius $R$ has $\kappa=\tfrac1R$.&lt;/li&gt;
    &lt;li&gt;$\mathbf a=a_T\mathbf T+a_N\mathbf N$ with $a_T=\tfrac{\mathbf v\cdot\mathbf a}{\lVert\mathbf v\rVert}$, $a_N=\kappa\lVert\mathbf v\rVert^2$.&lt;/li&gt;
    &lt;li&gt;Applications: projectiles, satellites $v=\sqrt{GM/r}$, the design of bends.&lt;/li&gt;
  &lt;/ul&gt;
&lt;/div&gt;
</content>
 </entry>
 
 <entry>
   <title>Quadric surfaces</title>
   <link href="https://calculus-self-learning.pages.dev/contents/en/chapter09/09_05_Quadric_surfaces/"/>
   <updated>2026-12-01T00:00:00+00:00</updated>
   <id>https://calculus-self-learning.pages.dev/contents/en/chapter09/09_05_Quadric_surfaces</id>
   <content type="html">&lt;div class=&quot;textbook-objectives&quot;&gt;

  &lt;p&gt;&lt;strong&gt;Learning objectives.&lt;/strong&gt; After this lesson you can:&lt;/p&gt;

  &lt;ul&gt;
    &lt;li&gt;identify the six kinds of quadric surface from their standard equations;&lt;/li&gt;
    &lt;li&gt;sketch a surface by looking at its traces in planes parallel to the coordinate planes;&lt;/li&gt;
    &lt;li&gt;bring an equation to standard form by completing the square;&lt;/li&gt;
    &lt;li&gt;explain the saddle shape and the focusing property of a parabolic dish.&lt;/li&gt;
  &lt;/ul&gt;

&lt;/div&gt;

&lt;h2 id=&quot;why-this-lesson&quot;&gt;Why this lesson&lt;/h2&gt;

&lt;p&gt;Quadric surfaces are the “second-degree graphs” of space, like parabolas, ellipses and hyperbolas in the plane. They are everywhere: satellite dishes, cooling towers, telescope mirrors. More importantly for calculus: near a critical point every smooth function of two variables looks like a paraboloid (an extremum) or a saddle, and chapter 12 uses this to classify extrema.&lt;/p&gt;

&lt;h2 id=&quot;the-method-of-traces&quot;&gt;The method of traces&lt;/h2&gt;

&lt;p&gt;To picture a surface $F(x,y,z)=0$, cut it with planes $z=k$ (then $x=k$, $y=k$) and identify the plane curves obtained. Stacking the traces gives the shape of the surface, much like a CT scanner.&lt;/p&gt;

&lt;h2 id=&quot;the-six-standard-quadrics&quot;&gt;The six standard quadrics&lt;/h2&gt;

&lt;div class=&quot;content-box insight-box textbook-block&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Identification table&lt;/strong&gt; (with $a,b,c&amp;gt;0$).&lt;/p&gt;

  &lt;table&gt;
    &lt;thead&gt;
      &lt;tr&gt;
        &lt;th&gt;Surface&lt;/th&gt;
        &lt;th&gt;Equation&lt;/th&gt;
        &lt;th&gt;Trace $z=k$&lt;/th&gt;
        &lt;th&gt;Trace $x=k$ or $y=k$&lt;/th&gt;
      &lt;/tr&gt;
    &lt;/thead&gt;
    &lt;tbody&gt;
      &lt;tr&gt;
        &lt;td&gt;Ellipsoid&lt;/td&gt;
        &lt;td&gt;$\tfrac{x^2}{a^2}+\tfrac{y^2}{b^2}+\tfrac{z^2}{c^2}=1$&lt;/td&gt;
        &lt;td&gt;ellipse (for $\vert k\vert&amp;lt;c$)&lt;/td&gt;
        &lt;td&gt;ellipse&lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr&gt;
        &lt;td&gt;Elliptic paraboloid&lt;/td&gt;
        &lt;td&gt;$z=\tfrac{x^2}{a^2}+\tfrac{y^2}{b^2}$&lt;/td&gt;
        &lt;td&gt;ellipse ($k&amp;gt;0$)&lt;/td&gt;
        &lt;td&gt;parabola opening up&lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr&gt;
        &lt;td&gt;Hyperbolic paraboloid (saddle)&lt;/td&gt;
        &lt;td&gt;$z=\tfrac{x^2}{a^2}-\tfrac{y^2}{b^2}$&lt;/td&gt;
        &lt;td&gt;hyperbola&lt;/td&gt;
        &lt;td&gt;parabolas, one up, one down&lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr&gt;
        &lt;td&gt;Hyperboloid of one sheet&lt;/td&gt;
        &lt;td&gt;$\tfrac{x^2}{a^2}+\tfrac{y^2}{b^2}-\tfrac{z^2}{c^2}=1$&lt;/td&gt;
        &lt;td&gt;ellipse for every $k$&lt;/td&gt;
        &lt;td&gt;hyperbola&lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr&gt;
        &lt;td&gt;Hyperboloid of two sheets&lt;/td&gt;
        &lt;td&gt;$\tfrac{z^2}{c^2}-\tfrac{x^2}{a^2}-\tfrac{y^2}{b^2}=1$&lt;/td&gt;
        &lt;td&gt;ellipse for $\vert k\vert&amp;gt;c$, empty for $\vert k\vert&amp;lt;c$&lt;/td&gt;
        &lt;td&gt;hyperbola&lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr&gt;
        &lt;td&gt;Cone&lt;/td&gt;
        &lt;td&gt;$\tfrac{z^2}{c^2}=\tfrac{x^2}{a^2}+\tfrac{y^2}{b^2}$&lt;/td&gt;
        &lt;td&gt;ellipse ($k\ne0$), a point ($k=0$)&lt;/td&gt;
        &lt;td&gt;a pair of lines or a hyperbola&lt;/td&gt;
      &lt;/tr&gt;
    &lt;/tbody&gt;
  &lt;/table&gt;

  &lt;p&gt;The variable that appears to the first power (paraboloids) or with the odd sign (hyperboloids, cones) gives the axis of the surface.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Example 1 (A hyperboloid of one sheet).&lt;/strong&gt; $x^2+y^2-z^2=1$. The trace $z=k$ is a circle of radius $\sqrt{1+k^2}$, smallest ($=1$) at the “waist” $z=0$ and widening as $\vert k\vert $ grows. The trace $x=0$ is the hyperbola $y^2-z^2=1$. The surface is a tube flaring at both ends, like a cooling tower.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Example 2 (Completing the square).&lt;/strong&gt; $x^2+2y^2+z^2-4x+4y=0$. Write $x^2-4x=(x-2)^2-4$ and $2y^2+4y=2(y+1)^2-2$:&lt;/p&gt;

\[(x-2)^2+2(y+1)^2+z^2=6\iff\frac{(x-2)^2}6+\frac{(y+1)^2}3+\frac{z^2}6=1 .\]

  &lt;p&gt;An ellipsoid with centre $(2,-1,0)$ and semi-axes $\sqrt6,\sqrt3,\sqrt6$.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Example 3.&lt;/strong&gt; $4x^2-y^2+2z^2+4=0$, i.e. $\tfrac{y^2}4-x^2-\tfrac{z^2}2=1$: a hyperboloid of two sheets with axis $Oy$; it does not meet the planes $y=k$ for $\vert k\vert &amp;lt;2$.&lt;/p&gt;
&lt;/div&gt;

&lt;h2 id=&quot;two-properties-worth-remembering&quot;&gt;Two properties worth remembering&lt;/h2&gt;

&lt;div class=&quot;textbook-theorem&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Theorem 1.&lt;/strong&gt; (a) The surface $z=xy$ is the hyperbolic paraboloid $z=\tfrac{u^2-v^2}2$ in the axes $u=\tfrac{x+y}{\sqrt2}$, $v=\tfrac{x-y}{\sqrt2}$ (rotated by $45^\circ$). (b) The hyperboloid of one sheet $x^2+y^2-z^2=1$ contains two families of lines: through each of its points pass two lines lying entirely on the surface.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-proof&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Proof.&lt;/strong&gt; (a) $u^2-v^2=\tfrac{(x+y)^2-(x-y)^2}2=2xy$, so $\tfrac{u^2-v^2}2=xy$. The change $(x,y)\mapsto(u,v)$ is a rotation, so it does not change the shape.&lt;/p&gt;

  &lt;p&gt;(b) For each angle $\alpha$, consider the line $\big(\cos\alpha-t\sin\alpha,\ \sin\alpha+t\cos\alpha,\ \pm t\big)$. Then $x^2+y^2=1+t^2$ (the cross terms cancel) and $z^2=t^2$, so $x^2+y^2-z^2=1$ for every $t$. As $\alpha$ varies, these lines (with the $+$ sign and with the $-$ sign) cover the surface.&lt;/p&gt;
&lt;/div&gt;

&lt;p&gt;Property (b) explains why cooling towers and some radio towers (such as the Shukhov tower) can be built from straight steel bars.&lt;/p&gt;

&lt;div class=&quot;interactive-frame&quot;&gt;
  &lt;div class=&quot;interactive-frame-head&quot;&gt;
    &lt;div class=&quot;interactive-frame-title&quot;&gt;Quadric surfaces and their traces&lt;/div&gt;
    &lt;div class=&quot;interactive-frame-desc&quot;&gt;Pick a surface, drag a, b, c and the plane z = k.&lt;/div&gt;
  &lt;/div&gt;
  &lt;iframe src=&quot;/interactives/chapter09/quadric-surfaces-en.html&quot; title=&quot;Quadric surfaces and their traces&quot; loading=&quot;lazy&quot; style=&quot;height: 700px;&quot;&gt;&lt;/iframe&gt;
  &lt;div class=&quot;interactive-frame-foot&quot;&gt;
    &lt;a href=&quot;/interactives/chapter09/quadric-surfaces-en.html&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;Open the interactive in a new window&lt;/a&gt;
  &lt;/div&gt;
&lt;/div&gt;

&lt;h2 id=&quot;applications&quot;&gt;Applications&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Machine learning: saddle points.&lt;/strong&gt; The function $f(x,y)=x^2-y^2$ has a saddle as its graph: at the origin the derivative in every direction is 0, yet the origin is not a minimum (the function decreases in the $y$ direction). In neural networks with many parameters, most points with zero gradient are saddle points rather than local minima. Noisy gradient descent (SGD) helps escape them.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Engineering: parabolic dishes.&lt;/strong&gt; The paraboloid $z=\tfrac{x^2+y^2}{4f}$ reflects every ray parallel to its axis into the focus $(0,0,f)$. A dish 60 cm across and 6 cm deep: $6=\tfrac{30^2}{4f}$, so $f=37.5$ cm; the receiver sits 37.5 cm above the bottom of the dish. Car headlights use the reverse: a light source at the focus gives a parallel beam.&lt;/p&gt;

&lt;h2 id=&quot;exercises&quot;&gt;Exercises&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Basic.&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;Identify: $x^2+y^2=z$, $x^2+4y^2+9z^2=36$, $x^2-y^2-z^2=1$.&lt;/li&gt;
  &lt;li&gt;Identify $y^2+z^2=x^2$ and describe the traces $x=k$.&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Answers&lt;/summary&gt;

  &lt;ol&gt;
    &lt;li&gt;A paraboloid of revolution; an ellipsoid with semi-axes $6,3,2$; a hyperboloid of two sheets with axis $Ox$.&lt;/li&gt;
    &lt;li&gt;A cone with axis $Ox$; the trace $x=k$ is a circle of radius $\vert k\vert $.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;p&gt;&lt;strong&gt;Intermediate.&lt;/strong&gt;&lt;/p&gt;

&lt;ol start=&quot;3&quot;&gt;
  &lt;li&gt;Bring $x^2+y^2-z^2-2x+4y+5=0$ to standard form and identify it.&lt;/li&gt;
  &lt;li&gt;Find the intersection of the paraboloid $z=x^2+y^2$ with the plane $z=2x$.&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Answers&lt;/summary&gt;

  &lt;ol start=&quot;3&quot;&gt;
    &lt;li&gt;$(x-1)^2+(y+2)^2-z^2=0$: a cone with vertex $(1,-2,0)$ and axis parallel to $Oz$.&lt;/li&gt;
    &lt;li&gt;$x^2-2x+y^2=0$, i.e. $(x-1)^2+y^2=1$, on the plane $z=2x$: an ellipse (its projection on the $xy$-plane is a circle).&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;p&gt;&lt;strong&gt;Advanced.&lt;/strong&gt;&lt;/p&gt;

&lt;ol start=&quot;5&quot;&gt;
  &lt;li&gt;Show that the hyperbolic paraboloid $z=xy$ also contains two families of lines.&lt;/li&gt;
  &lt;li&gt;Show that a ray parallel to the $z$-axis hitting the parabola $z=\tfrac{x^2}{4f}$ reflects through the focus $(0,f)$. Hint: at the point $(x_0,z_0)$, compare the angles of the incoming ray and of the line to the focus with the normal.&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Hints&lt;/summary&gt;

  &lt;ol start=&quot;5&quot;&gt;
    &lt;li&gt;For fixed $x=a$, $z=ay$ is the line $(a,t,at)$; likewise $y=b$ gives $(t,b,bt)$.&lt;/li&gt;
    &lt;li&gt;The normal is proportional to $\left(-\tfrac{x_0}{2f},1\right)$. The distance from $(x_0,z_0)$ to the focus is $z_0+f$ (the distance to the directrix $z=-f$). So the triangle formed by the point, the focus and the foot on the directrix is isosceles, and the normal bisects it: the angle of incidence equals the angle of reflection.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;h2 id=&quot;summary&quot;&gt;Summary&lt;/h2&gt;

&lt;div class=&quot;content-box summary-box textbook-block&quot;&gt;
  &lt;ul&gt;
    &lt;li&gt;Six quadric surfaces: ellipsoid, elliptic paraboloid, hyperbolic paraboloid, hyperboloids of one and two sheets, cone.&lt;/li&gt;
    &lt;li&gt;Identify them with traces $z=k$, $x=k$, $y=k$ and complete the square to find the centre.&lt;/li&gt;
    &lt;li&gt;$z=xy$ is a saddle rotated by $45^\circ$; the hyperboloid of one sheet contains two families of lines.&lt;/li&gt;
    &lt;li&gt;Applications: saddle points in machine learning, the focus of a parabolic dish.&lt;/li&gt;
  &lt;/ul&gt;
&lt;/div&gt;
</content>
 </entry>
 
 <entry>
   <title>Polar, cylindrical and spherical coordinates</title>
   <link href="https://calculus-self-learning.pages.dev/contents/en/chapter09/09_04_Polar_cylindrical_and_spherical_coordinates/"/>
   <updated>2026-12-01T00:00:00+00:00</updated>
   <id>https://calculus-self-learning.pages.dev/contents/en/chapter09/09_04_Polar_cylindrical_and_spherical_coordinates</id>
   <content type="html">&lt;div class=&quot;textbook-objectives&quot;&gt;

  &lt;p&gt;&lt;strong&gt;Learning objectives.&lt;/strong&gt; After this lesson you can:&lt;/p&gt;

  &lt;ul&gt;
    &lt;li&gt;convert between Cartesian and polar coordinates;&lt;/li&gt;
    &lt;li&gt;sketch familiar polar curves;&lt;/li&gt;
    &lt;li&gt;compute the area of a region bounded by a polar curve with $\tfrac12\int r^2\,d\theta$;&lt;/li&gt;
    &lt;li&gt;convert between Cartesian, cylindrical and spherical coordinates, and recognise simple surfaces in each.&lt;/li&gt;
  &lt;/ul&gt;

&lt;/div&gt;

&lt;h2 id=&quot;why-this-lesson&quot;&gt;Why this lesson&lt;/h2&gt;

&lt;p&gt;A good coordinate system makes a problem much easier. The circle $x^2+y^2=4$ is just $r=2$ in polar coordinates. Radar, positions on the Earth (latitude, longitude), and the gravitational field around a planet are all naturally “round”. Chapter 13 will use these systems to compute multiple integrals.&lt;/p&gt;

&lt;h2 id=&quot;polar-coordinates&quot;&gt;Polar coordinates&lt;/h2&gt;

&lt;p&gt;A point $P$ in the plane is given by its distance $r$ from the origin and the angle $\theta$ from the positive $x$-axis:&lt;/p&gt;

\[x=r\cos\theta,\quad y=r\sin\theta;\qquad r=\sqrt{x^2+y^2},\quad\tan\theta=\frac yx .\]

&lt;p&gt;The angle $\theta$ must be chosen in the right quadrant (the function &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;atan2(y, x)&lt;/code&gt; in programming does this). A point has many polar coordinates: $(r,\theta)$, $(r,\theta+2\pi)$, and $(-r,\theta+\pi)$ if $r&amp;lt;0$ is allowed.&lt;/p&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Example 1.&lt;/strong&gt; $(-1,\sqrt3)$: $r=2$, and the point is in the second quadrant, so $\theta=\tfrac{2\pi}3$ (not $-\tfrac\pi3$).&lt;/p&gt;

  &lt;p&gt;The curve $r=2\cos\theta$: multiplying by $r$ gives $x^2+y^2=2x$, i.e. $(x-1)^2+y^2=1$, the circle with centre $(1,0)$ and radius 1.&lt;/p&gt;
&lt;/div&gt;

&lt;p&gt;&lt;strong&gt;Some polar curves.&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;$r=a$: a circle; $\theta=\alpha$: a line through the origin.&lt;/li&gt;
  &lt;li&gt;$r=1+\cos\theta$: the &lt;strong&gt;cardioid&lt;/strong&gt; (heart shape), passing through the origin at $\theta=\pi$.&lt;/li&gt;
  &lt;li&gt;$r=\cos k\theta$: a &lt;strong&gt;rose&lt;/strong&gt; with $k$ petals if $k$ is odd and $2k$ petals if $k$ is even.&lt;/li&gt;
  &lt;li&gt;$r=e^{a\theta}$: the logarithmic spiral (shells, spiral galaxies).&lt;/li&gt;
&lt;/ul&gt;

&lt;h2 id=&quot;area-in-polar-coordinates&quot;&gt;Area in polar coordinates&lt;/h2&gt;

&lt;div class=&quot;textbook-theorem&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Theorem 1.&lt;/strong&gt; If $f\ge0$ is continuous on $[\alpha,\beta]$ with $\beta-\alpha\le2\pi$, the area of the region bounded by $r=f(\theta)$ and the rays $\theta=\alpha$, $\theta=\beta$ is&lt;/p&gt;

\[A=\frac12\int_\alpha^\beta f(\theta)^2\,d\theta .\]

&lt;/div&gt;

&lt;div class=&quot;textbook-proof&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Proof.&lt;/strong&gt; Split $[\alpha,\beta]$ into small angles $\Delta\theta_i$. The region for each angle is nearly a circular sector of radius $f(\theta_i^*)$ with area $\tfrac12f(\theta_i^*)^2\Delta\theta_i$ (a sector of angle $\Delta\theta$ is the fraction $\tfrac{\Delta\theta}{2\pi}$ of the area $\pi r^2$). Adding gives a Riemann sum of $\tfrac12f^2$. Squeezing each subregion between the sectors with the smallest and largest radius shows that the limit is the area.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Example 2 (The cardioid).&lt;/strong&gt; $A=\tfrac12\int_0^{2\pi}(1+\cos\theta)^2d\theta=\tfrac12\int_0^{2\pi}\left(1+2\cos\theta+\cos^2\theta\right)d\theta=\tfrac12(2\pi+0+\pi)=\tfrac{3\pi}2$.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Example 3 (One rose petal).&lt;/strong&gt; $r=\cos2\theta$ has a petal on $-\tfrac\pi4\le\theta\le\tfrac\pi4$: $A=\tfrac12\int_{-\pi/4}^{\pi/4}\cos^22\theta\,d\theta=\tfrac12\cdot\tfrac\pi4=\tfrac\pi8$. All four petals: $\tfrac\pi2$.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Example 4 (The region between two curves).&lt;/strong&gt; Inside $r=2\cos\theta$ and outside $r=1$: the curves meet where $\cos\theta=\tfrac12$, $\theta=\pm\tfrac\pi3$. The area is $\tfrac12\int_{-\pi/3}^{\pi/3}\left(4\cos^2\theta-1\right)d\theta=\tfrac\pi3+\tfrac{\sqrt3}2\approx1.913$.&lt;/p&gt;
&lt;/div&gt;

&lt;p&gt;The arc length of a polar curve $r=f(\theta)$ is $\int\sqrt{r^2+(dr/d\theta)^2}\,d\theta$ (lesson 09_03 applied to $(f\cos\theta,f\sin\theta)$); the cardioid has length 8.&lt;/p&gt;

&lt;div class=&quot;interactive-frame&quot;&gt;
  &lt;div class=&quot;interactive-frame-head&quot;&gt;
    &lt;div class=&quot;interactive-frame-title&quot;&gt;Polar curves and area&lt;/div&gt;
    &lt;div class=&quot;interactive-frame-desc&quot;&gt;Trace r = f(θ) and add up the areas of the sectors.&lt;/div&gt;
  &lt;/div&gt;
  &lt;iframe src=&quot;/interactives/chapter09/polar-curves-en.html&quot; title=&quot;Polar curves and area&quot; loading=&quot;lazy&quot; style=&quot;height: 720px;&quot;&gt;&lt;/iframe&gt;
  &lt;div class=&quot;interactive-frame-foot&quot;&gt;
    &lt;a href=&quot;/interactives/chapter09/polar-curves-en.html&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;Open the interactive in a new window&lt;/a&gt;
  &lt;/div&gt;
&lt;/div&gt;

&lt;h2 id=&quot;cylindrical-and-spherical-coordinates&quot;&gt;Cylindrical and spherical coordinates&lt;/h2&gt;

&lt;div class=&quot;textbook-definition&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Cylindrical coordinates&lt;/strong&gt; $(r,\theta,z)$: polar coordinates for $(x,y)$, keeping $z$. The surface $r=a$ is a cylinder.&lt;/p&gt;

  &lt;p&gt;&lt;strong&gt;Spherical coordinates&lt;/strong&gt; $(\rho,\varphi,\theta)$, where $\rho\ge0$ is the distance from the origin, $\varphi\in[0,\pi]$ the angle from the positive $z$-axis and $\theta$ as in polar coordinates:&lt;/p&gt;

\[x=\rho\sin\varphi\cos\theta,\quad y=\rho\sin\varphi\sin\theta,\quad z=\rho\cos\varphi .\]

  &lt;p&gt;The surface $\rho=a$ is a sphere; $\varphi=\alpha$ is a cone; $\theta=\alpha$ is a half-plane.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Example 5.&lt;/strong&gt; The point $(1,1,\sqrt2)$: $\rho=\sqrt{1+1+2}=2$, $\cos\varphi=\tfrac{\sqrt2}2$ so $\varphi=\tfrac\pi4$, and $\theta=\tfrac\pi4$. Cylindrical coordinates: $(\sqrt2,\tfrac\pi4,\sqrt2)$. The cone $z=\sqrt{x^2+y^2}$ is $\varphi=\tfrac\pi4$ in spherical coordinates and $z=r$ in cylindrical coordinates.&lt;/p&gt;
&lt;/div&gt;

&lt;h2 id=&quot;short-video&quot;&gt;Short video&lt;/h2&gt;

&lt;div class=&quot;reel-video&quot;&gt;
  &lt;video controls=&quot;&quot; playsinline=&quot;&quot; preload=&quot;metadata&quot; src=&quot;/public/videos/reels/polar-grid-warp.mp4&quot;&gt;&lt;/video&gt;
  &lt;p class=&quot;reel-caption&quot;&gt;A (θ, r) grid sheet rolls up into the polar grid, cells of area r dr dθ, roses r = cos kθ, and the spherical grid (silent video, about 2 minutes).&lt;/p&gt;
&lt;/div&gt;

&lt;h2 id=&quot;applications&quot;&gt;Applications&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Geography: distances on the Earth.&lt;/strong&gt; Latitude is $90^\circ-\varphi$ and longitude is $\theta$. With radius $R=6371$ km, convert the positions to Cartesian coordinates and use the dot product; the angle between the position vectors gives the great-circle distance $R\cdot\theta$. Hanoi ($21.03^\circ$N, $105.85^\circ$E) and Ho Chi Minh City ($10.78^\circ$N, $106.70^\circ$E): an angle of $0.1795$ rad, a distance of about $1143$ km.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Radar and robots.&lt;/strong&gt; Radar measures the distance $r$ and the angle $\theta$ of a target directly; the two-link robot of lesson 09_03 reaches an annulus, described most simply in polar coordinates: $\vert L_1-L_2\vert \le r\le L_1+L_2$.&lt;/p&gt;

&lt;h2 id=&quot;exercises&quot;&gt;Exercises&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Basic.&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;Convert to polar coordinates: $(0,-3)$, $(-2,-2)$.&lt;/li&gt;
  &lt;li&gt;Convert $r=4\sin\theta$ to Cartesian coordinates and identify the curve.&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Answers&lt;/summary&gt;

  &lt;ol&gt;
    &lt;li&gt;$(3,\tfrac{3\pi}2)$; $(2\sqrt2,\tfrac{5\pi}4)$.&lt;/li&gt;
    &lt;li&gt;$x^2+y^2=4y$, i.e. $x^2+(y-2)^2=4$: the circle with centre $(0,2)$ and radius 2.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;p&gt;&lt;strong&gt;Intermediate.&lt;/strong&gt;&lt;/p&gt;

&lt;ol start=&quot;3&quot;&gt;
  &lt;li&gt;Find the area inside $r=2\sin\theta$.&lt;/li&gt;
  &lt;li&gt;Write the sphere $x^2+y^2+z^2=2z$ in spherical coordinates.&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Answers&lt;/summary&gt;

  &lt;ol start=&quot;3&quot;&gt;
    &lt;li&gt;$\tfrac12\int_0^\pi4\sin^2\theta\,d\theta=\pi$ (a circle of radius 1).&lt;/li&gt;
    &lt;li&gt;$\rho^2=2\rho\cos\varphi$, i.e. $\rho=2\cos\varphi$.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;p&gt;&lt;strong&gt;Advanced.&lt;/strong&gt;&lt;/p&gt;

&lt;ol start=&quot;5&quot;&gt;
  &lt;li&gt;Find the area of one petal of $r=\sin3\theta$ and of the whole rose.&lt;/li&gt;
  &lt;li&gt;Show that the cardioid $r=1+\cos\theta$ has length 8.&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Hints&lt;/summary&gt;

  &lt;ol start=&quot;5&quot;&gt;
    &lt;li&gt;One petal on $[0,\tfrac\pi3]$: $\tfrac12\int_0^{\pi/3}\sin^23\theta\,d\theta=\tfrac\pi{12}$; three petals: $\tfrac\pi4$.&lt;/li&gt;
    &lt;li&gt;$r^2+r&apos;^2=(1+\cos\theta)^2+\sin^2\theta=2+2\cos\theta=4\cos^2\tfrac\theta2$; $\int_0^{2\pi}2\left\lvert\cos\tfrac\theta2\right\rvert d\theta=8$.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;h2 id=&quot;summary&quot;&gt;Summary&lt;/h2&gt;

&lt;div class=&quot;content-box summary-box textbook-block&quot;&gt;
  &lt;ul&gt;
    &lt;li&gt;Polar: $x=r\cos\theta$, $y=r\sin\theta$; choose $\theta$ in the right quadrant.&lt;/li&gt;
    &lt;li&gt;Polar area: $\tfrac12\int_\alpha^\beta r^2\,d\theta$; the cardioid has area $\tfrac{3\pi}2$, one petal of $\cos2\theta$ has $\tfrac\pi8$.&lt;/li&gt;
    &lt;li&gt;Cylindrical $(r,\theta,z)$; spherical $x=\rho\sin\varphi\cos\theta$, $y=\rho\sin\varphi\sin\theta$, $z=\rho\cos\varphi$.&lt;/li&gt;
    &lt;li&gt;Applications: geographic distances, radar, the reach of a robot.&lt;/li&gt;
  &lt;/ul&gt;
&lt;/div&gt;
</content>
 </entry>
 
 <entry>
   <title>Parametric curves</title>
   <link href="https://calculus-self-learning.pages.dev/contents/en/chapter09/09_03_Parametric_curves/"/>
   <updated>2026-12-01T00:00:00+00:00</updated>
   <id>https://calculus-self-learning.pages.dev/contents/en/chapter09/09_03_Parametric_curves</id>
   <content type="html">&lt;div class=&quot;textbook-objectives&quot;&gt;

  &lt;p&gt;&lt;strong&gt;Learning objectives.&lt;/strong&gt; After this lesson you can:&lt;/p&gt;

  &lt;ul&gt;
    &lt;li&gt;describe a curve by a vector function $\mathbf r(t)$ and sketch familiar curves;&lt;/li&gt;
    &lt;li&gt;compute the tangent vector $\mathbf r&apos;(t)$, write the tangent line and the slope $\tfrac{dy}{dx}$;&lt;/li&gt;
    &lt;li&gt;compute the arc length $\int_a^b\lVert\mathbf r&apos;(t)\rVert\,dt$;&lt;/li&gt;
    &lt;li&gt;reparametrise a curve by arc length.&lt;/li&gt;
  &lt;/ul&gt;

&lt;/div&gt;

&lt;h2 id=&quot;why-this-lesson&quot;&gt;Why this lesson&lt;/h2&gt;

&lt;p&gt;Many curves are not graphs of a function $y=f(x)$: circles, the path of a point on a wheel, the helix of a spring, the path of a robot arm. Describing them with a parameter $t$ (often time) is both natural and convenient: each coordinate is a function of one variable, and every tool of chapters 2–6 applies at once.&lt;/p&gt;

&lt;h2 id=&quot;vector-functions-and-curves&quot;&gt;Vector functions and curves&lt;/h2&gt;

&lt;div class=&quot;textbook-definition&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Definition.&lt;/strong&gt; A &lt;strong&gt;vector function&lt;/strong&gt; is $\mathbf r(t)=(x(t),y(t),z(t))$ for $t\in I$. The set of points $\mathbf r(t)$ is a &lt;strong&gt;parametric curve&lt;/strong&gt;. Limits, continuity and derivatives are taken coordinate by coordinate:&lt;/p&gt;

\[\mathbf r&apos;(t)=\lim_{h\to0}\frac{\mathbf r(t+h)-\mathbf r(t)}h=(x&apos;(t),y&apos;(t),z&apos;(t)).\]

  &lt;p&gt;The curve is &lt;strong&gt;smooth&lt;/strong&gt; if $\mathbf r&apos;$ is continuous and $\mathbf r&apos;(t)\ne\mathbf 0$.&lt;/p&gt;
&lt;/div&gt;

&lt;p&gt;Examples: the circle $(\cos t,\sin t)$; the ellipse $(a\cos t,b\sin t)$; the helix $(\cos t,\sin t,t)$; the cycloid $(t-\sin t,\,1-\cos t)$, the path of a point on the rim of a wheel of radius 1 rolling along a line.&lt;/p&gt;

&lt;h2 id=&quot;tangents&quot;&gt;Tangents&lt;/h2&gt;

&lt;p&gt;The vector $\mathbf r(t+h)-\mathbf r(t)$ is a chord; dividing by $h$ and letting $h\to0$ gives $\mathbf r&apos;(t)$, tangent to the curve. If $t$ is time, $\mathbf r&apos;(t)$ is the &lt;strong&gt;velocity&lt;/strong&gt; (lesson 09_06). The tangent line at $t_0$ is $\mathbf r(t_0)+s\,\mathbf r&apos;(t_0)$.&lt;/p&gt;

&lt;p&gt;For a plane curve with $x&apos;(t)\ne0$, the chain rule gives&lt;/p&gt;

\[\frac{dy}{dx}=\frac{y&apos;(t)}{x&apos;(t)} .\]

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Example 1.&lt;/strong&gt; The ellipse $(2\cos t,\sin t)$ at $t=\tfrac\pi4$: the point is $\left(\sqrt2,\tfrac{\sqrt2}2\right)$ and $\tfrac{dy}{dx}=\tfrac{\cos t}{-2\sin t}=-\tfrac12$.&lt;/p&gt;

  &lt;p&gt;The helix $(\cos t,\sin t,t)$ at $t=\tfrac\pi2$: the point is $\left(0,1,\tfrac\pi2\right)$ and $\mathbf r&apos;=(-\sin t,\cos t,1)=(-1,0,1)$. The tangent line is $\left(0,1,\tfrac\pi2\right)+s(-1,0,1)$.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Example 2 (A non-smooth point).&lt;/strong&gt; $\mathbf r(t)=(t^2,t^3)$ has $\mathbf r&apos;(0)=\mathbf 0$. The curve ($y^2=x^3$) has a cusp at the origin: a differentiable parametrisation can still trace a curve with a sharp corner where the velocity vanishes.&lt;/p&gt;
&lt;/div&gt;

&lt;h2 id=&quot;arc-length&quot;&gt;Arc length&lt;/h2&gt;

&lt;div class=&quot;textbook-theorem&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Theorem 1.&lt;/strong&gt; If $\mathbf r$ is smooth on $[a,b]$ and traces the curve exactly once, its length is&lt;/p&gt;

\[L=\int_a^b\lVert\mathbf r&apos;(t)\rVert\,dt=\int_a^b\sqrt{x&apos;(t)^2+y&apos;(t)^2+z&apos;(t)^2}\,dt .\]

&lt;/div&gt;

&lt;div class=&quot;textbook-proof&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Proof sketch.&lt;/strong&gt; Partition $[a,b]$ by $t_0&amp;lt;t_1&amp;lt;\cdots&amp;lt;t_n$ and approximate the curve by a polygon. By the mean value theorem in each coordinate, each segment has length approximately $\lVert\mathbf r&apos;(t_i^*)\rVert\Delta t_i$. The total is a Riemann sum of $\lVert\mathbf r&apos;\rVert$ (as in lesson 06_02, which is the case $\mathbf r(t)=(t,f(t))$).&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Example 3.&lt;/strong&gt; The helix $(\cos t,\sin t,t)$: $\lVert\mathbf r&apos;\rVert=\sqrt{\sin^2t+\cos^2t+1}=\sqrt2$. One turn ($0\le t\le2\pi$) has length $2\pi\sqrt2\approx8.886$, exactly the diagonal of a $2\pi\times2\pi$ rectangle when the cylinder is “unrolled”.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Example 4 (The cycloid).&lt;/strong&gt; $\mathbf r&apos;=(1-\cos t,\sin t)$, $\lVert\mathbf r&apos;\rVert=\sqrt{2-2\cos t}=2\left\lvert\sin\tfrac t2\right\rvert$. One arch ($0\le t\le2\pi$) has length $\int_0^{2\pi}2\sin\tfrac t2\,dt=8$: four times the wheel’s diameter.&lt;/p&gt;
&lt;/div&gt;

&lt;p&gt;&lt;strong&gt;The arc-length parametrisation.&lt;/strong&gt; Let $s(t)=\int_a^t\lVert\mathbf r&apos;(u)\rVert\,du$. Since $s&apos;(t)=\lVert\mathbf r&apos;(t)\rVert&amp;gt;0$ we can change variable to $s$; then $\left\lVert\tfrac{d\mathbf r}{ds}\right\rVert=1$: the curve is traced at unit speed. For the helix: $s=\sqrt2\,t$, so $\mathbf r(s)=\left(\cos\tfrac s{\sqrt2},\sin\tfrac s{\sqrt2},\tfrac s{\sqrt2}\right)$. This parametrisation is used to define curvature in lesson 09_06.&lt;/p&gt;

&lt;div class=&quot;interactive-frame&quot;&gt;
  &lt;div class=&quot;interactive-frame-head&quot;&gt;
    &lt;div class=&quot;interactive-frame-title&quot;&gt;Parametric curves&lt;/div&gt;
    &lt;div class=&quot;interactive-frame-desc&quot;&gt;Let t run: tangent vector, arc length and osculating circle.&lt;/div&gt;
  &lt;/div&gt;
  &lt;iframe src=&quot;/interactives/chapter09/parametric-curve-en.html&quot; title=&quot;Parametric curves&quot; loading=&quot;lazy&quot; style=&quot;height: 720px;&quot;&gt;&lt;/iframe&gt;
  &lt;div class=&quot;interactive-frame-foot&quot;&gt;
    &lt;a href=&quot;/interactives/chapter09/parametric-curve-en.html&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;Open the interactive in a new window&lt;/a&gt;
  &lt;/div&gt;
&lt;/div&gt;

&lt;h2 id=&quot;applications&quot;&gt;Applications&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Robotics: a two-link arm.&lt;/strong&gt; An arm has two links of lengths $L_1,L_2$ and joint angles $\theta_1,\theta_2$. The hand is at&lt;/p&gt;

\[\mathbf p=\big(L_1\cos\theta_1+L_2\cos(\theta_1+\theta_2),\ L_1\sin\theta_1+L_2\sin(\theta_1+\theta_2)\big).\]

&lt;p&gt;As the angles change in time, the hand traces a parametric curve; the velocity $\mathbf p&apos;(t)$ tells how fast the joints must turn. By the law of cosines, $\lVert\mathbf p\rVert^2=L_1^2+L_2^2+2L_1L_2\cos\theta_2$, so the reachable region is the annulus $\vert L_1-L_2\vert \le\lVert\mathbf p\rVert\le L_1+L_2$.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Graphics: Bézier curves.&lt;/strong&gt; Fonts and vector drawing tools use cubic Bézier curves $\mathbf B(t)=(1-t)^3\mathbf P_0+3(1-t)^2t\,\mathbf P_1+3(1-t)t^2\mathbf P_2+t^3\mathbf P_3$, $t\in[0,1]$. We have $\mathbf B&apos;(0)=3(\mathbf P_1-\mathbf P_0)$: the control point $\mathbf P_1$ sets the tangent direction at the start, which is the “handle” you drag in design software.&lt;/p&gt;

&lt;h2 id=&quot;exercises&quot;&gt;Exercises&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Basic.&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;Find the tangent line of $(t^2,t^3)$ at $t=1$.&lt;/li&gt;
  &lt;li&gt;Find the unit tangent vector of $(e^t\cos t,e^t\sin t)$ at $t=0$.&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Answers&lt;/summary&gt;

  &lt;ol&gt;
    &lt;li&gt;The point is $(1,1)$ and $\mathbf r&apos;=(2,3)$: $(1,1)+s(2,3)$, slope $\tfrac32$.&lt;/li&gt;
    &lt;li&gt;$\mathbf r&apos;=e^t(\cos t-\sin t,\sin t+\cos t)=(1,1)$ at 0; the unit vector is $\tfrac1{\sqrt2}(1,1)$.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;p&gt;&lt;strong&gt;Intermediate.&lt;/strong&gt;&lt;/p&gt;

&lt;ol start=&quot;3&quot;&gt;
  &lt;li&gt;Find the length of $(t,t^{3/2})$, $0\le t\le4$.&lt;/li&gt;
  &lt;li&gt;Find the length of $(e^t\cos t,e^t\sin t)$, $0\le t\le1$ (a logarithmic spiral).&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Answers&lt;/summary&gt;

  &lt;ol start=&quot;3&quot;&gt;
    &lt;li&gt;$\int_0^4\sqrt{1+\tfrac94t}\,dt=\tfrac8{27}\left(10^{3/2}-1\right)\approx9.073$.&lt;/li&gt;
    &lt;li&gt;$\lVert\mathbf r&apos;\rVert=\sqrt2\,e^t$, so the length is $\sqrt2(e-1)\approx2.430$.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;p&gt;&lt;strong&gt;Advanced.&lt;/strong&gt;&lt;/p&gt;

&lt;ol start=&quot;5&quot;&gt;
  &lt;li&gt;Find the length of the astroid $(\cos^3t,\sin^3t)$, $0\le t\le2\pi$.&lt;/li&gt;
  &lt;li&gt;Show that if $\lVert\mathbf r(t)\rVert$ is constant then $\mathbf r&apos;(t)\perp\mathbf r(t)$. Explain geometrically.&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Hints&lt;/summary&gt;

  &lt;ol start=&quot;5&quot;&gt;
    &lt;li&gt;$\lVert\mathbf r&apos;\rVert=3\vert \cos t\sin t\vert $; on $[0,\tfrac\pi2]$ the integral is $\tfrac32$; times 4 gives length 6.&lt;/li&gt;
    &lt;li&gt;Differentiate $\mathbf r\cdot\mathbf r=c$: $2\,\mathbf r\cdot\mathbf r&apos;=0$. The curve lies on a sphere, so its tangent is perpendicular to the radius.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;h2 id=&quot;summary&quot;&gt;Summary&lt;/h2&gt;

&lt;div class=&quot;content-box summary-box textbook-block&quot;&gt;
  &lt;ul&gt;
    &lt;li&gt;A parametric curve $\mathbf r(t)=(x(t),y(t),z(t))$ is differentiated coordinate by coordinate.&lt;/li&gt;
    &lt;li&gt;$\mathbf r&apos;(t)$ is the tangent vector (velocity); the tangent line is $\mathbf r(t_0)+s\mathbf r&apos;(t_0)$; the plane slope is $\tfrac{y&apos;}{x&apos;}$.&lt;/li&gt;
    &lt;li&gt;Arc length is $\int_a^b\lVert\mathbf r&apos;(t)\rVert\,dt$; one turn of the helix is $2\pi\sqrt2$, one arch of the cycloid is 8.&lt;/li&gt;
    &lt;li&gt;In the arc-length parameter, $\lVert d\mathbf r/ds\rVert=1$.&lt;/li&gt;
  &lt;/ul&gt;
&lt;/div&gt;
</content>
 </entry>
 
 <entry>
   <title>Lines and planes</title>
   <link href="https://calculus-self-learning.pages.dev/contents/en/chapter09/09_02_Lines_and_planes/"/>
   <updated>2026-12-01T00:00:00+00:00</updated>
   <id>https://calculus-self-learning.pages.dev/contents/en/chapter09/09_02_Lines_and_planes</id>
   <content type="html">&lt;div class=&quot;textbook-objectives&quot;&gt;

  &lt;p&gt;&lt;strong&gt;Learning objectives.&lt;/strong&gt; After this lesson you can:&lt;/p&gt;

  &lt;ul&gt;
    &lt;li&gt;write parametric equations of the line through a point in a given direction;&lt;/li&gt;
    &lt;li&gt;write the equation of a plane through a point with a normal vector, or through three points;&lt;/li&gt;
    &lt;li&gt;find where a line meets a plane and the angle between two planes;&lt;/li&gt;
    &lt;li&gt;compute the distance from a point to a plane and between skew lines.&lt;/li&gt;
  &lt;/ul&gt;

&lt;/div&gt;

&lt;h2 id=&quot;why-this-lesson&quot;&gt;Why this lesson&lt;/h2&gt;

&lt;p&gt;Lines and planes are the “linear” objects of space. They are first-order approximations of curves and surfaces: tangent lines (lesson 09_03) and tangent planes (chapter 10). In machine learning a linear classifier is exactly a plane (a hyperplane) splitting the data space in two.&lt;/p&gt;

&lt;h2 id=&quot;lines&quot;&gt;Lines&lt;/h2&gt;

&lt;div class=&quot;textbook-definition&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Definition.&lt;/strong&gt; The line through $P_0$ (position vector $\mathbf r_0$) with direction vector $\mathbf d\ne\mathbf 0$ is the set of points&lt;/p&gt;

\[\mathbf r(t)=\mathbf r_0+t\,\mathbf d,\qquad t\in\mathbb R,\]

  &lt;p&gt;that is, $x=x_0+td_1$, $y=y_0+td_2$, $z=z_0+td_3$.&lt;/p&gt;
&lt;/div&gt;

&lt;p&gt;Think of $t$ as time: a particle starts at $P_0$ and moves in a straight line with constant velocity $\mathbf d$.&lt;/p&gt;

&lt;h2 id=&quot;planes&quot;&gt;Planes&lt;/h2&gt;

&lt;div class=&quot;textbook-definition&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Definition.&lt;/strong&gt; The plane through $P_0$ with normal vector $\mathbf n=(a,b,c)\ne\mathbf 0$ is the set of points $P$ with $\overrightarrow{P_0P}\perp\mathbf n$:&lt;/p&gt;

\[\mathbf n\cdot(\mathbf r-\mathbf r_0)=0\iff ax+by+cz=d,\qquad d=\mathbf n\cdot\mathbf r_0 .\]

&lt;/div&gt;

&lt;p&gt;Through three non-collinear points $A,B,C$: take $\mathbf n=\overrightarrow{AB}\times\overrightarrow{AC}$ (lesson 09_01).&lt;/p&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Example 1.&lt;/strong&gt; The plane through $A(1,0,0)$, $B(0,2,0)$, $C(0,0,3)$: $\mathbf n=(-1,2,0)\times(-1,0,3)=(6,3,2)$, so $6x+3y+2z=6$ (substitute $A$ to find $d$). Dividing by 6 gives the “intercept form” $\tfrac x1+\tfrac y2+\tfrac z3=1$, which shows the three intercepts at once.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Example 2 (Intersection).&lt;/strong&gt; The line through the origin in direction $(1,2,3)$ is $\mathbf r(t)=(t,2t,3t)$. Substituting into $6x+3y+2z=6$: $6t+6t+6t=6$, $t=\tfrac13$. The intersection point is $\left(\tfrac13,\tfrac23,1\right)$.&lt;/p&gt;
&lt;/div&gt;

&lt;p&gt;&lt;strong&gt;The angle between two planes&lt;/strong&gt; is the angle between their normals (taking the acute angle): $\cos\varphi=\tfrac{\vert \mathbf n_1\cdot\mathbf n_2\vert }{\lVert\mathbf n_1\rVert\lVert\mathbf n_2\rVert}$. For the plane of example 1 and the plane $z=0$ (normal $\mathbf k$): $\cos\varphi=\tfrac27$, $\varphi\approx73.4^\circ$.&lt;/p&gt;

&lt;h2 id=&quot;distances&quot;&gt;Distances&lt;/h2&gt;

&lt;div class=&quot;textbook-theorem&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Theorem 1.&lt;/strong&gt; The distance from a point $Q(x_1,y_1,z_1)$ to the plane $ax+by+cz=d$ is&lt;/p&gt;

\[\operatorname{dist}=\frac{|ax_1+by_1+cz_1-d|}{\sqrt{a^2+b^2+c^2}}.\]

&lt;/div&gt;

&lt;div class=&quot;textbook-proof&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Proof.&lt;/strong&gt; Take any $P_0$ on the plane. The distance is the length of the projection of $\overrightarrow{P_0Q}$ onto the normal: $\dfrac{\vert \mathbf n\cdot(\mathbf q-\mathbf r_0)\vert }{\lVert\mathbf n\rVert}$. And $\mathbf n\cdot\mathbf q-\mathbf n\cdot\mathbf r_0=ax_1+by_1+cz_1-d$.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Example 3.&lt;/strong&gt; From the origin to $6x+3y+2z=6$: $\tfrac6{\sqrt{49}}=\tfrac67$. From $(1,1,1)$: $\tfrac{\vert 6+3+2-6\vert }7=\tfrac57$.&lt;/p&gt;
&lt;/div&gt;

&lt;p&gt;&lt;strong&gt;Two skew lines&lt;/strong&gt; $\mathbf r=\mathbf a+t\mathbf u$ and $\mathbf r=\mathbf b+s\mathbf v$ (not parallel): the vector $\mathbf n=\mathbf u\times\mathbf v$ is perpendicular to both, so the distance is $\dfrac{\vert (\mathbf b-\mathbf a)\cdot(\mathbf u\times\mathbf v)\vert }{\lVert\mathbf u\times\mathbf v\rVert}$; it is 0 when the lines meet.&lt;/p&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Example 4.&lt;/strong&gt; $L_1:(1,0,0)+t(1,1,0)$, $L_2:(0,0,2)+s(0,1,1)$. $\mathbf u\times\mathbf v=(1,-1,1)$, $\mathbf b-\mathbf a=(-1,0,2)$, dot product $1$. The distance is $\tfrac1{\sqrt3}\approx0.577$.&lt;/p&gt;
&lt;/div&gt;

&lt;h2 id=&quot;applications&quot;&gt;Applications&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;3D graphics: lighting.&lt;/strong&gt; Each triangle of a 3D model has normal $\mathbf n=\overrightarrow{AB}\times\overrightarrow{AC}$ (the vertex order decides which side is the “outside”). In the Lambert model the brightness is proportional to $\max(0,\hat{\mathbf n}\cdot\hat{\mathbf l})$, where $\hat{\mathbf l}$ points toward the light.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Machine learning: support vector machines.&lt;/strong&gt; A linear classifier uses the hyperplane $\mathbf w\cdot\mathbf x+b=0$. By theorem 1 (in $\mathbb R^n$), the distance from a data point $\mathbf x$ to the hyperplane is $\tfrac{\vert \mathbf w\cdot\mathbf x+b\vert }{\lVert\mathbf w\rVert}$. Normalising $\vert \mathbf w\cdot\mathbf x+b\vert =1$ at the nearest points, the margin is $\tfrac2{\lVert\mathbf w\rVert}$; an SVM maximises the margin by minimising $\lVert\mathbf w\rVert$.&lt;/p&gt;

&lt;h2 id=&quot;exercises&quot;&gt;Exercises&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Basic.&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;Write parametric equations of the line through $A(1,2,3)$ and $B(3,1,0)$.&lt;/li&gt;
  &lt;li&gt;Write the equation of the plane through $(1,-1,2)$ perpendicular to $(2,1,-1)$.&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Answers&lt;/summary&gt;

  &lt;ol&gt;
    &lt;li&gt;$(1,2,3)+t(2,-1,-3)$.&lt;/li&gt;
    &lt;li&gt;$2x+y-z=-1$.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;p&gt;&lt;strong&gt;Intermediate.&lt;/strong&gt;&lt;/p&gt;

&lt;ol start=&quot;3&quot;&gt;
  &lt;li&gt;Find the line of intersection of the planes $x+y+z=1$ and $x-y=0$.&lt;/li&gt;
  &lt;li&gt;Find the distance between the parallel planes $x+2y+2z=3$ and $x+2y+2z=12$.&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Answers&lt;/summary&gt;

  &lt;ol start=&quot;3&quot;&gt;
    &lt;li&gt;Direction $(1,1,1)\times(1,-1,0)=(1,1,-2)$; a common point $(0,0,1)$. The line is $(0,0,1)+t(1,1,-2)$.&lt;/li&gt;
    &lt;li&gt;Take $(3,0,0)$ on the first plane: $\tfrac{\vert 3-12\vert }3=3$.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;p&gt;&lt;strong&gt;Advanced.&lt;/strong&gt;&lt;/p&gt;

&lt;ol start=&quot;5&quot;&gt;
  &lt;li&gt;Find the point of the plane $6x+3y+2z=6$ closest to the origin.&lt;/li&gt;
  &lt;li&gt;Show that four points $A,B,C,D$ are coplanar if and only if $\overrightarrow{AD}\cdot(\overrightarrow{AB}\times\overrightarrow{AC})=0$, and check it for $(1,0,0)$, $(0,2,0)$, $(0,0,3)$, $\left(\tfrac13,\tfrac23,1\right)$.&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Hints&lt;/summary&gt;

  &lt;ol start=&quot;5&quot;&gt;
    &lt;li&gt;Move from the origin along the normal: $t(6,3,2)$ with $49t=6$. The point is $\tfrac6{49}(6,3,2)$, at distance $\tfrac67$.&lt;/li&gt;
    &lt;li&gt;The parallelepiped’s volume is 0. For the given points: $\overrightarrow{AD}=\left(-\tfrac23,\tfrac23,1\right)$, and its dot product with $(6,3,2)$ is $-4+2+2=0$.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;h2 id=&quot;summary&quot;&gt;Summary&lt;/h2&gt;

&lt;div class=&quot;content-box summary-box textbook-block&quot;&gt;
  &lt;ul&gt;
    &lt;li&gt;Line: $\mathbf r=\mathbf r_0+t\mathbf d$. Plane: $\mathbf n\cdot(\mathbf r-\mathbf r_0)=0$, i.e. $ax+by+cz=d$.&lt;/li&gt;
    &lt;li&gt;The normal through three points: $\overrightarrow{AB}\times\overrightarrow{AC}$.&lt;/li&gt;
    &lt;li&gt;Distance from a point to a plane: $\tfrac{\vert ax_1+by_1+cz_1-d\vert }{\sqrt{a^2+b^2+c^2}}$; between skew lines: $\tfrac{\vert (\mathbf b-\mathbf a)\cdot(\mathbf u\times\mathbf v)\vert }{\lVert\mathbf u\times\mathbf v\rVert}$.&lt;/li&gt;
    &lt;li&gt;Applications: lighting in graphics, the SVM margin.&lt;/li&gt;
  &lt;/ul&gt;
&lt;/div&gt;
</content>
 </entry>
 
 <entry>
   <title>Vectors in R² and R³</title>
   <link href="https://calculus-self-learning.pages.dev/contents/en/chapter09/09_01_Vectors_in_R2_and_R3/"/>
   <updated>2026-12-01T00:00:00+00:00</updated>
   <id>https://calculus-self-learning.pages.dev/contents/en/chapter09/09_01_Vectors_in_R2_and_R3</id>
   <content type="html">&lt;div class=&quot;textbook-objectives&quot;&gt;

  &lt;p&gt;&lt;strong&gt;Learning objectives.&lt;/strong&gt; After this lesson you can:&lt;/p&gt;

  &lt;ul&gt;
    &lt;li&gt;add vectors, multiply them by scalars and compute lengths;&lt;/li&gt;
    &lt;li&gt;compute the dot product, the angle between two vectors and projections;&lt;/li&gt;
    &lt;li&gt;compute the cross product and use it to find areas and normal vectors;&lt;/li&gt;
    &lt;li&gt;compute the volume of a parallelepiped with the triple product.&lt;/li&gt;
  &lt;/ul&gt;

&lt;/div&gt;

&lt;h2 id=&quot;why-this-lesson&quot;&gt;Why this lesson&lt;/h2&gt;

&lt;p&gt;From this chapter on, calculus moves to several dimensions. Position, velocity, force and gradients are all vectors. The two products in this lesson answer two basic geometric questions: how “alike” two directions are (the dot product), and how much area they “sweep out” (the cross product).&lt;/p&gt;

&lt;h2 id=&quot;vectors-and-length&quot;&gt;Vectors and length&lt;/h2&gt;

&lt;p&gt;A vector in $\mathbb R^3$ is a triple $\mathbf u=(u_1,u_2,u_3)$, pictured as an arrow from the origin to the point $(u_1,u_2,u_3)$. Addition and scalar multiplication work coordinate by coordinate. The &lt;strong&gt;length&lt;/strong&gt; is $\lVert\mathbf u\rVert=\sqrt{u_1^2+u_2^2+u_3^2}$ (Pythagoras twice). The unit vector in the direction of $\mathbf u$ is $\tfrac{\mathbf u}{\lVert\mathbf u\rVert}$. The basis vectors are $\mathbf i=(1,0,0)$, $\mathbf j=(0,1,0)$, $\mathbf k=(0,0,1)$.&lt;/p&gt;

&lt;h2 id=&quot;the-dot-product&quot;&gt;The dot product&lt;/h2&gt;

&lt;div class=&quot;textbook-definition&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Definition.&lt;/strong&gt; $\mathbf u\cdot\mathbf v=u_1v_1+u_2v_2+u_3v_3$.&lt;/p&gt;
&lt;/div&gt;

&lt;p&gt;Properties: symmetric, linear in each argument, $\mathbf u\cdot\mathbf u=\lVert\mathbf u\rVert^2$.&lt;/p&gt;

&lt;div class=&quot;textbook-theorem&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Theorem 1.&lt;/strong&gt; If $\theta\in[0,\pi]$ is the angle between two nonzero vectors, then $\mathbf u\cdot\mathbf v=\lVert\mathbf u\rVert\,\lVert\mathbf v\rVert\cos\theta$. In particular $\mathbf u\perp\mathbf v$ if and only if $\mathbf u\cdot\mathbf v=0$.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-proof&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Proof.&lt;/strong&gt; The triangle has sides $\mathbf u$, $\mathbf v$ and third side $\mathbf u-\mathbf v$. The law of cosines gives $\lVert\mathbf u-\mathbf v\rVert^2=\lVert\mathbf u\rVert^2+\lVert\mathbf v\rVert^2-2\lVert\mathbf u\rVert\lVert\mathbf v\rVert\cos\theta$. Expanding the left side with the dot product gives $\lVert\mathbf u\rVert^2-2\,\mathbf u\cdot\mathbf v+\lVert\mathbf v\rVert^2$. Compare the two sides.&lt;/p&gt;
&lt;/div&gt;

&lt;p&gt;Consequence: the Cauchy–Schwarz inequality $\vert \mathbf u\cdot\mathbf v\vert \le\lVert\mathbf u\rVert\lVert\mathbf v\rVert$.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Projection.&lt;/strong&gt; The projection of $\mathbf v$ onto the direction of $\mathbf u$ is&lt;/p&gt;

\[\operatorname{proj}_{\mathbf u}\mathbf v=\frac{\mathbf u\cdot\mathbf v}{\lVert\mathbf u\rVert^2}\,\mathbf u,\]

&lt;p&gt;and $\mathbf v-\operatorname{proj}_{\mathbf u}\mathbf v$ is perpendicular to $\mathbf u$.&lt;/p&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Example 1.&lt;/strong&gt; $\mathbf u=(1,2,2)$, $\mathbf v=(2,-1,2)$. Then $\mathbf u\cdot\mathbf v=2-2+4=4$ and $\lVert\mathbf u\rVert=\lVert\mathbf v\rVert=3$, so $\cos\theta=\tfrac49$, $\theta\approx63.6^\circ$. The projection is $\operatorname{proj}_{\mathbf u}\mathbf v=\tfrac49(1,2,2)$.&lt;/p&gt;
&lt;/div&gt;

&lt;h2 id=&quot;the-cross-product&quot;&gt;The cross product&lt;/h2&gt;

&lt;div class=&quot;textbook-definition&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Definition.&lt;/strong&gt; For $\mathbf u,\mathbf v\in\mathbb R^3$,&lt;/p&gt;

\[\mathbf u\times\mathbf v=\begin{vmatrix}\mathbf i&amp;amp;\mathbf j&amp;amp;\mathbf k\\u_1&amp;amp;u_2&amp;amp;u_3\\v_1&amp;amp;v_2&amp;amp;v_3\end{vmatrix}=(u_2v_3-u_3v_2,\ u_3v_1-u_1v_3,\ u_1v_2-u_2v_1).\]

&lt;/div&gt;

&lt;div class=&quot;textbook-theorem&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Theorem 2.&lt;/strong&gt; (a) $\mathbf u\times\mathbf v$ is perpendicular to both $\mathbf u$ and $\mathbf v$, following the right-hand rule. (b) $\lVert\mathbf u\times\mathbf v\rVert=\lVert\mathbf u\rVert\lVert\mathbf v\rVert\sin\theta$, the area of the parallelogram spanned by $\mathbf u$ and $\mathbf v$. (c) $\mathbf v\times\mathbf u=-\mathbf u\times\mathbf v$; $\mathbf u\times\mathbf v=\mathbf 0$ if and only if the vectors are parallel.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-proof&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Proof.&lt;/strong&gt; (a) Direct computation: $\mathbf u\cdot(\mathbf u\times\mathbf v)=u_1(u_2v_3-u_3v_2)+u_2(u_3v_1-u_1v_3)+u_3(u_1v_2-u_2v_1)=0$. (b) Expanding gives Lagrange’s identity $\lVert\mathbf u\times\mathbf v\rVert^2=\lVert\mathbf u\rVert^2\lVert\mathbf v\rVert^2-(\mathbf u\cdot\mathbf v)^2=\lVert\mathbf u\rVert^2\lVert\mathbf v\rVert^2(1-\cos^2\theta)$. The parallelogram’s area is the base $\lVert\mathbf u\rVert$ times the height $\lVert\mathbf v\rVert\sin\theta$. (c) Swapping two rows of a determinant changes its sign.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Example 2.&lt;/strong&gt; For $\mathbf u,\mathbf v$ of example 1: $\mathbf u\times\mathbf v=(2\cdot2-2\cdot(-1),\ 2\cdot2-1\cdot2,\ 1\cdot(-1)-2\cdot2)=(6,2,-5)$. Check: $(6,2,-5)\cdot(1,2,2)=0$. The parallelogram has area $\sqrt{65}\approx8.06$; the triangle spanned by the two vectors has half that area.&lt;/p&gt;
&lt;/div&gt;

&lt;p&gt;&lt;strong&gt;The triple product.&lt;/strong&gt; $\mathbf w\cdot(\mathbf u\times\mathbf v)=\det[\mathbf u;\mathbf v;\mathbf w]$; its absolute value is the volume of the parallelepiped spanned by the three vectors (base $\lVert\mathbf u\times\mathbf v\rVert$ times the height, the projection of $\mathbf w$ onto the normal). It is 0 when the three vectors are coplanar.&lt;/p&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Example 3.&lt;/strong&gt; With $\mathbf w=(1,0,1)$: $\mathbf w\cdot(6,2,-5)=1$. The parallelepiped spanned by $\mathbf u,\mathbf v,\mathbf w$ has volume 1.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;interactive-frame&quot;&gt;
  &lt;div class=&quot;interactive-frame-head&quot;&gt;
    &lt;div class=&quot;interactive-frame-title&quot;&gt;Dot and cross products&lt;/div&gt;
    &lt;div class=&quot;interactive-frame-desc&quot;&gt;Drag the two vectors; watch the angle, the projection and the parallelogram area.&lt;/div&gt;
  &lt;/div&gt;
  &lt;iframe src=&quot;/interactives/chapter09/dot-cross-en.html&quot; title=&quot;Dot and cross products&quot; loading=&quot;lazy&quot; style=&quot;height: 720px;&quot;&gt;&lt;/iframe&gt;
  &lt;div class=&quot;interactive-frame-foot&quot;&gt;
    &lt;a href=&quot;/interactives/chapter09/dot-cross-en.html&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;Open the interactive in a new window&lt;/a&gt;
  &lt;/div&gt;
&lt;/div&gt;

&lt;h2 id=&quot;short-video&quot;&gt;Short video&lt;/h2&gt;

&lt;div class=&quot;reel-video&quot;&gt;
  &lt;video controls=&quot;&quot; playsinline=&quot;&quot; preload=&quot;metadata&quot; src=&quot;/public/videos/reels/cross-product-right-hand.mp4&quot;&gt;&lt;/video&gt;
  &lt;p class=&quot;reel-caption&quot;&gt;Cross product and the right-hand rule: the parallelogram spanned by u and v, the vector u × v perpendicular to both with length equal to the area; swapping the order flips the direction, and changing the angle changes the area as |u||v| sin θ; tilting v out of the plane, the box volume |(u × v) · w|, the component formula with an example, torque on a wrench, and the area of a triangle in space (silent video, about 3 minutes 2 seconds).&lt;/p&gt;
&lt;/div&gt;

&lt;h2 id=&quot;applications&quot;&gt;Applications&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Physics: work and torque.&lt;/strong&gt; A constant force $\mathbf F$ moving an object by $\mathbf d$ does work $W=\mathbf F\cdot\mathbf d$: only the component of the force along the motion counts. The torque of a force $\mathbf F$ applied at position $\mathbf r$ is $\boldsymbol\tau=\mathbf r\times\mathbf F$; that is why a long wrench makes turning easier.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Machine learning: cosine similarity.&lt;/strong&gt; Texts or sentences are represented by embedding vectors. The similarity $\cos\theta=\tfrac{\mathbf u\cdot\mathbf v}{\lVert\mathbf u\rVert\lVert\mathbf v\rVert}$ measures how aligned two vectors are, regardless of length; it is the standard measure in semantic search.&lt;/p&gt;

&lt;h2 id=&quot;exercises&quot;&gt;Exercises&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Basic.&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;Let $\mathbf u=(3,0,4)$, $\mathbf v=(1,1,1)$. Compute $\lVert\mathbf u\rVert$, $\mathbf u\cdot\mathbf v$ and the angle between them.&lt;/li&gt;
  &lt;li&gt;Compute $\mathbf i\times\mathbf j$, $\mathbf j\times\mathbf k$, $\mathbf k\times\mathbf i$.&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Answers&lt;/summary&gt;

  &lt;ol&gt;
    &lt;li&gt;$5$; $7$; $\cos\theta=\tfrac7{5\sqrt3}\approx0.808$, $\theta\approx36.1^\circ$.&lt;/li&gt;
    &lt;li&gt;$\mathbf k$, $\mathbf i$, $\mathbf j$.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;p&gt;&lt;strong&gt;Intermediate.&lt;/strong&gt;&lt;/p&gt;

&lt;ol start=&quot;3&quot;&gt;
  &lt;li&gt;Find the area of the triangle with vertices $A(1,0,0)$, $B(0,2,0)$, $C(0,0,3)$.&lt;/li&gt;
  &lt;li&gt;Find $t$ so that $(1,t,2)$ is perpendicular to $(3,-1,t)$.&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Answers&lt;/summary&gt;

  &lt;ol start=&quot;3&quot;&gt;
    &lt;li&gt;$\overrightarrow{AB}\times\overrightarrow{AC}=(-1,2,0)\times(-1,0,3)=(6,3,2)$, of length 7, so the area is $\tfrac72$.&lt;/li&gt;
    &lt;li&gt;$3-t+2t=0$, $t=-3$.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;p&gt;&lt;strong&gt;Advanced.&lt;/strong&gt;&lt;/p&gt;

&lt;ol start=&quot;5&quot;&gt;
  &lt;li&gt;Prove $\lVert\mathbf u+\mathbf v\rVert\le\lVert\mathbf u\rVert+\lVert\mathbf v\rVert$ from the Cauchy–Schwarz inequality.&lt;/li&gt;
  &lt;li&gt;Verify $\mathbf u\times(\mathbf v\times\mathbf w)=(\mathbf u\cdot\mathbf w)\mathbf v-(\mathbf u\cdot\mathbf v)\mathbf w$ for $\mathbf v=\mathbf i$, $\mathbf w=\mathbf j$, and explain why the general case follows by linearity.&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Hints&lt;/summary&gt;

  &lt;ol start=&quot;5&quot;&gt;
    &lt;li&gt;$\lVert\mathbf u+\mathbf v\rVert^2=\lVert\mathbf u\rVert^2+2\,\mathbf u\cdot\mathbf v+\lVert\mathbf v\rVert^2\le(\lVert\mathbf u\rVert+\lVert\mathbf v\rVert)^2$.&lt;/li&gt;
    &lt;li&gt;$\mathbf i\times\mathbf j=\mathbf k$ and $\mathbf u\times\mathbf k=(u_2,-u_1,0)=u_2\mathbf i-u_1\mathbf j$, matching the right side. Both sides are linear in $\mathbf v$ and in $\mathbf w$, so it suffices to check pairs of basis vectors.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;h2 id=&quot;summary&quot;&gt;Summary&lt;/h2&gt;

&lt;div class=&quot;content-box summary-box textbook-block&quot;&gt;
  &lt;ul&gt;
    &lt;li&gt;$\mathbf u\cdot\mathbf v=\sum u_iv_i=\lVert\mathbf u\rVert\lVert\mathbf v\rVert\cos\theta$; it is 0 for perpendicular vectors; $\operatorname{proj}_{\mathbf u}\mathbf v=\tfrac{\mathbf u\cdot\mathbf v}{\lVert\mathbf u\rVert^2}\mathbf u$.&lt;/li&gt;
    &lt;li&gt;$\mathbf u\times\mathbf v$ is perpendicular to both, its length is the parallelogram’s area, and it changes sign when the factors are swapped.&lt;/li&gt;
    &lt;li&gt;$\vert \mathbf w\cdot(\mathbf u\times\mathbf v)\vert $ is the volume of the parallelepiped.&lt;/li&gt;
    &lt;li&gt;Applications: work, torque, cosine similarity.&lt;/li&gt;
  &lt;/ul&gt;
&lt;/div&gt;
</content>
 </entry>
 
 <entry>
   <title>Approximation in computing</title>
   <link href="https://calculus-self-learning.pages.dev/contents/en/chapter08/08_06_Approximation_in_computing/"/>
   <updated>2026-12-01T00:00:00+00:00</updated>
   <id>https://calculus-self-learning.pages.dev/contents/en/chapter08/08_06_Approximation_in_computing</id>
   <content type="html">&lt;div class=&quot;textbook-objectives&quot;&gt;

  &lt;p&gt;&lt;strong&gt;Learning objectives.&lt;/strong&gt; After this lesson you can:&lt;/p&gt;

  &lt;ul&gt;
    &lt;li&gt;explain the steps a numerical library uses to evaluate $e^x$ and $\sin x$;&lt;/li&gt;
    &lt;li&gt;evaluate polynomials with Horner’s scheme;&lt;/li&gt;
    &lt;li&gt;distinguish truncation error (from cutting a series) and rounding error (from floating-point numbers);&lt;/li&gt;
    &lt;li&gt;choose a sensible step $h$ for numerical derivatives, and recognise and avoid catastrophic cancellation.&lt;/li&gt;
  &lt;/ul&gt;

&lt;/div&gt;

&lt;h2 id=&quot;why-this-lesson&quot;&gt;Why this lesson&lt;/h2&gt;

&lt;p&gt;The previous lessons gave series that converge to exact values. But a computer can add only finitely many terms, and every operation rounds to about 16 digits. Understanding these two sources of error prevents very real bugs: a machine learning model producing &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;NaN&lt;/code&gt;, a numerical derivative that is completely wrong, a root of a quadratic that is off by 25%.&lt;/p&gt;

&lt;h2 id=&quot;how-a-computer-evaluates-ex&quot;&gt;How a computer evaluates $e^x$&lt;/h2&gt;

&lt;p&gt;Truncating $\sum\tfrac{x^n}{n!}$ directly is a poor idea for large $\vert x\vert $: it needs many terms, and large terms cause errors. Libraries use three steps.&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;&lt;strong&gt;Range reduction.&lt;/strong&gt; Write $x=k\ln2+r$ with $k$ an integer and $\vert r\vert \le\tfrac{\ln2}2\approx0.347$. Then $e^x=2^k e^r$, and multiplying by $2^k$ in binary just adds to the exponent.&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;A polynomial on a small interval.&lt;/strong&gt; On $\vert r\vert \le0.347$ the Taylor polynomial of degree 11 has error at most $\tfrac{e^{0.347}\,0.347^{12}}{12!}\approx9\times10^{-15}$, close to machine precision. (Real libraries use a slightly lower-degree “minimax” polynomial whose error is uniform over the interval.)&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Horner’s scheme.&lt;/strong&gt; Evaluate $p(r)=c_0+c_1r+\cdots+c_nr^n$ as $c_0+r(c_1+r(c_2+\cdots+r\,c_n))$: only $n$ multiplications and $n$ additions.&lt;/li&gt;
&lt;/ol&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Example 1.&lt;/strong&gt; $x=10$: $k=\operatorname{round}(10/\ln2)=14$, $r=10-14\ln2=0.29594$. The degree-11 Taylor polynomial of $e^r$ times $2^{14}=16384$ gives $22026.4657948067$, matching $e^{10}$ to 15 digits.&lt;/p&gt;
&lt;/div&gt;

&lt;p&gt;For $\sin x$, reduce modulo $\tfrac\pi2$: $x=k\tfrac\pi2+r$ with $\vert r\vert \le\tfrac\pi4$, then use $\pm\sin r$ or $\pm\cos r$ according to $k$ modulo 4.&lt;/p&gt;

&lt;h2 id=&quot;floating-point-numbers-and-rounding-error&quot;&gt;Floating-point numbers and rounding error&lt;/h2&gt;

&lt;p&gt;A &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;double&lt;/code&gt; (IEEE 754) has the form $\pm1.b_1b_2\dots b_{52}\times2^e$. The gap between 1 and the next &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;double&lt;/code&gt; is the &lt;strong&gt;machine epsilon&lt;/strong&gt; $\varepsilon=2^{-52}\approx2.2\times10^{-16}$. Each operation returns the exact result rounded, with relative error at most $\tfrac\varepsilon2$.&lt;/p&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Example 2.&lt;/strong&gt; In Python, &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;0.1 + 0.2&lt;/code&gt; gives &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;0.30000000000000004&lt;/code&gt;, because $0.1$ has no exact binary representation. And &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;1e16 + 1 - 1e16&lt;/code&gt; gives &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;0.0&lt;/code&gt;: at magnitude $10^{16}$ consecutive doubles are 2 apart, so the 1 is “swallowed”. In &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;float16&lt;/code&gt; (used to train neural networks), $\varepsilon\approx9.8\times10^{-4}$, so $1+0.0004$ rounds to 1.&lt;/p&gt;
&lt;/div&gt;

&lt;h2 id=&quot;truncation-and-rounding-error-together&quot;&gt;Truncation and rounding error together&lt;/h2&gt;

&lt;p&gt;The numerical derivative $D(h)=\tfrac{f(x+h)-f(x)}h$ has two errors.&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;strong&gt;Truncation:&lt;/strong&gt; by Taylor, $D(h)-f&apos;(x)=\tfrac h2f&apos;&apos;(c)$, which shrinks as $h$ shrinks.&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Rounding:&lt;/strong&gt; $f(x+h)$ and $f(x)$ are each off by about $\varepsilon\vert f(x)\vert $; dividing by $h$ gives an error of about $\tfrac{2\varepsilon\vert f(x)\vert }h$, which grows as $h$ shrinks.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The total $E(h)\approx\tfrac h2\vert f&apos;&apos;\vert +\tfrac{2\varepsilon\vert f\vert }h$ is smallest at $h=2\sqrt{\varepsilon\vert f\vert /\vert f&apos;&apos;\vert }$, of order $\sqrt\varepsilon\approx10^{-8}$.&lt;/p&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Example 3.&lt;/strong&gt; For $f=e^x$ at $x=1$, the error of $D(h)$ against $e$:&lt;/p&gt;

  &lt;table&gt;
    &lt;thead&gt;
      &lt;tr&gt;
        &lt;th&gt;$h$&lt;/th&gt;
        &lt;th&gt;$10^{-4}$&lt;/th&gt;
        &lt;th&gt;$10^{-6}$&lt;/th&gt;
        &lt;th&gt;$10^{-8}$&lt;/th&gt;
        &lt;th&gt;$10^{-10}$&lt;/th&gt;
        &lt;th&gt;$10^{-12}$&lt;/th&gt;
      &lt;/tr&gt;
    &lt;/thead&gt;
    &lt;tbody&gt;
      &lt;tr&gt;
        &lt;td&gt;error&lt;/td&gt;
        &lt;td&gt;$1.4\times10^{-4}$&lt;/td&gt;
        &lt;td&gt;$1.4\times10^{-6}$&lt;/td&gt;
        &lt;td&gt;$6.6\times10^{-9}$&lt;/td&gt;
        &lt;td&gt;$1.5\times10^{-6}$&lt;/td&gt;
        &lt;td&gt;$4.3\times10^{-4}$&lt;/td&gt;
      &lt;/tr&gt;
    &lt;/tbody&gt;
  &lt;/table&gt;

  &lt;p&gt;Making $h$ smaller than $10^{-8}$ makes the result &lt;strong&gt;worse&lt;/strong&gt;.&lt;/p&gt;
&lt;/div&gt;

&lt;h2 id=&quot;catastrophic-cancellation&quot;&gt;Catastrophic cancellation&lt;/h2&gt;

&lt;p&gt;Subtracting two nearly equal numbers wipes out the leading correct digits and leaves only rounding “noise”. The cure: transform the formula before computing, often with a Taylor expansion or an algebraic identity.&lt;/p&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Example 4.&lt;/strong&gt;&lt;/p&gt;

  &lt;ul&gt;
    &lt;li&gt;$1-\cos x$ at $x=10^{-8}$: the machine gives $0$, because $\cos x$ rounds to 1. Using $2\sin^2\tfrac x2$ (or $\tfrac{x^2}2$ by Taylor) gives the correct $5\times10^{-17}$.&lt;/li&gt;
    &lt;li&gt;$\ln(1+x)$ and $e^x-1$ at $x=10^{-10}$: the direct formulas are wrong in the 8th digit. The functions &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;log1p&lt;/code&gt; and &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;expm1&lt;/code&gt; use Taylor expansions for small $x$ and are accurate.&lt;/li&gt;
    &lt;li&gt;The small root of $x^2-10^8x+1=0$: the formula $\tfrac{b-\sqrt{b^2-4}}2$ gives $7.45\times10^{-9}$, 25% off. Rewriting it as $\tfrac{2}{b+\sqrt{b^2-4}}$ gives the correct $10^{-8}$.&lt;/li&gt;
    &lt;li&gt;$e^{-20}$ from the series $\sum\tfrac{(-20)^n}{n!}$: the terms grow to about $4\times10^7$ and then cancel, giving $7.2\times10^{-10}$, off by a factor of 3. Computing $\tfrac1{e^{20}}$ (a series of positive terms) gives the correct $2.061\times10^{-9}$.&lt;/li&gt;
  &lt;/ul&gt;
&lt;/div&gt;

&lt;h2 id=&quot;applications&quot;&gt;Applications&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Machine learning: the log-sum-exp trick.&lt;/strong&gt; Softmax needs $\log\sum_ie^{x_i}$. With $x_i=1000$, $e^{1000}$ overflows to infinity. Let $m=\max x_i$ and use $\log\sum e^{x_i}=m+\log\sum e^{x_i-m}$: every exponent is $\le0$, so nothing overflows. Likewise, libraries compute the cross-entropy loss with &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;log1p&lt;/code&gt; and &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;logsumexp&lt;/code&gt; instead of the direct formula.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Engineering: low-precision training.&lt;/strong&gt; Training in &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;float16&lt;/code&gt;/&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;bfloat16&lt;/code&gt; is faster and uses less memory, but the large $\varepsilon$ swallows small updates (example 2). So a &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;float32&lt;/code&gt; copy of the weights is kept and the loss is multiplied by a scale factor (loss scaling).&lt;/p&gt;

&lt;h2 id=&quot;exercises&quot;&gt;Exercises&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Basic.&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;Write $p(x)=2x^3-3x^2+4x-5$ in Horner form and compute $p(2)$.&lt;/li&gt;
  &lt;li&gt;For $x=10^{-5}$, why is $\sqrt{1+x}-1$ inaccurate? Rewrite the formula.&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Answers&lt;/summary&gt;

  &lt;ol&gt;
    &lt;li&gt;$-5+x(4+x(-3+2x))$; $p(2)=-5+2(4+2\cdot1)=7$.&lt;/li&gt;
    &lt;li&gt;It subtracts two numbers close to 1. Write $\tfrac{x}{\sqrt{1+x}+1}\approx\tfrac x2$.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;p&gt;&lt;strong&gt;Intermediate.&lt;/strong&gt;&lt;/p&gt;

&lt;ol start=&quot;3&quot;&gt;
  &lt;li&gt;For the central difference $\tfrac{f(x+h)-f(x-h)}{2h}$ the truncation error is $\tfrac{h^2}6f&apos;&apos;&apos;(c)$. Of what order is the optimal $h$?&lt;/li&gt;
  &lt;li&gt;To compute $\sin x$ for $\vert x\vert \le\tfrac\pi4$ to $10^{-16}$ with a Taylor polynomial, what degree is needed?&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Answers&lt;/summary&gt;

  &lt;ol start=&quot;3&quot;&gt;
    &lt;li&gt;Balance $h^2$ against $\tfrac\varepsilon h$: $h\sim\varepsilon^{1/3}\approx6\times10^{-6}$, with error of order $\varepsilon^{2/3}\approx4\times10^{-11}$.&lt;/li&gt;
    &lt;li&gt;We need $\tfrac{(\pi/4)^{n+1}}{(n+1)!}&amp;lt;10^{-16}$. Since $T_{15}=T_{16}$ (only odd powers), the error of $T_{15}$ is at most $\tfrac{(\pi/4)^{17}}{17!}\approx4.6\times10^{-17}$. Degree 15 suffices.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;p&gt;&lt;strong&gt;Advanced.&lt;/strong&gt;&lt;/p&gt;

&lt;ol start=&quot;5&quot;&gt;
  &lt;li&gt;Why does Python’s &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;math.exp(-20)&lt;/code&gt; give the right answer while the direct series does not? Explain using the steps of “How a computer evaluates $e^x$”.&lt;/li&gt;
  &lt;li&gt;The sample variance computed as $\tfrac1n\sum x_i^2-\bar x^2$ gives $0$ instead of $\tfrac23$ for the data $10^9+1,\ 10^9+2,\ 10^9+3$ (with other data it can even be negative). Explain, and suggest a stable method.&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Hints&lt;/summary&gt;

  &lt;ol start=&quot;5&quot;&gt;
    &lt;li&gt;Range reduction: $-20=-29\ln2+r$ with small $\vert r\vert $; the series for $e^r$ has no cancellation, and multiplying by $2^{-29}$ is exact.&lt;/li&gt;
    &lt;li&gt;Two nearly equal numbers of size $10^{18}$ are subtracted and all correct digits are lost. Subtract the mean first, $\tfrac1n\sum(x_i-\bar x)^2$, or use Welford’s algorithm.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;h2 id=&quot;summary&quot;&gt;Summary&lt;/h2&gt;

&lt;div class=&quot;content-box summary-box textbook-block&quot;&gt;
  &lt;ul&gt;
    &lt;li&gt;Libraries evaluate $e^x$, $\sin x$ with range reduction, a polynomial on a small interval and Horner’s scheme.&lt;/li&gt;
    &lt;li&gt;A &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;double&lt;/code&gt; has $\varepsilon=2^{-52}\approx2.2\times10^{-16}$; each operation has relative error at most $\tfrac\varepsilon2$.&lt;/li&gt;
    &lt;li&gt;Truncation error falls as $h$ shrinks while rounding error grows; numerical derivatives are best at $h\sim\sqrt\varepsilon$.&lt;/li&gt;
    &lt;li&gt;Avoid subtracting nearly equal numbers: transform the formula, use &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;log1p&lt;/code&gt;, &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;expm1&lt;/code&gt;, log-sum-exp.&lt;/li&gt;
  &lt;/ul&gt;
&lt;/div&gt;
</content>
 </entry>
 
 <entry>
   <title>Uniform convergence and Fourier series (introduction)</title>
   <link href="https://calculus-self-learning.pages.dev/contents/en/chapter08/08_05_Uniform_convergence_and_Fourier_series/"/>
   <updated>2026-12-01T00:00:00+00:00</updated>
   <id>https://calculus-self-learning.pages.dev/contents/en/chapter08/08_05_Uniform_convergence_and_Fourier_series</id>
   <content type="html">&lt;div class=&quot;textbook-objectives&quot;&gt;

  &lt;p&gt;&lt;strong&gt;Learning objectives.&lt;/strong&gt; After this lesson you can:&lt;/p&gt;

  &lt;ul&gt;
    &lt;li&gt;distinguish pointwise and uniform convergence of a sequence of functions;&lt;/li&gt;
    &lt;li&gt;use the Weierstrass M-test to prove that a series of functions converges uniformly;&lt;/li&gt;
    &lt;li&gt;know that uniform convergence lets limits pass through continuity and integrals;&lt;/li&gt;
    &lt;li&gt;compute the Fourier coefficients of a square wave and explain the Gibbs phenomenon.&lt;/li&gt;
  &lt;/ul&gt;

&lt;/div&gt;

&lt;h2 id=&quot;why-this-lesson&quot;&gt;Why this lesson&lt;/h2&gt;

&lt;p&gt;In lesson 08_04 we swapped “integral” and “infinite sum”. Such swaps are not always valid. This lesson gives a safe condition, uniform convergence, and then introduces a second very important kind of series of functions: Fourier series, which write a periodic function as a sum of $\sin$ and $\cos$ waves.&lt;/p&gt;

&lt;h2 id=&quot;pointwise-and-uniform-convergence&quot;&gt;Pointwise and uniform convergence&lt;/h2&gt;

&lt;div class=&quot;textbook-definition&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Definition.&lt;/strong&gt; A sequence of functions $f_n$ on a set $I$:&lt;/p&gt;

  &lt;p&gt;&lt;strong&gt;converges pointwise&lt;/strong&gt; to $f$ if $f_n(x)\to f(x)$ for each $x\in I$;&lt;/p&gt;

  &lt;p&gt;&lt;strong&gt;converges uniformly&lt;/strong&gt; to $f$ if $\displaystyle\sup_{x\in I}\vert f_n(x)-f(x)\vert \to0$, that is, for every $\varepsilon&amp;gt;0$ there is $N$ (independent of $x$) with $\vert f_n(x)-f(x)\vert &amp;lt;\varepsilon$ for all $n\ge N$ and all $x\in I$.&lt;/p&gt;
&lt;/div&gt;

&lt;p&gt;Picture: uniform convergence means that for large $n$ the whole graph of $f_n$ lies in a “tube” of width $2\varepsilon$ around the graph of $f$.&lt;/p&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Example 1.&lt;/strong&gt; $f_n(x)=x^n$ on $[0,1]$ converges pointwise to $f(x)=0$ for $x&amp;lt;1$ and $f(1)=1$. The limit is &lt;strong&gt;not continuous&lt;/strong&gt;, although every $f_n$ is. The convergence is not uniform: $\sup_{[0,1)}x^n=1$ for every $n$. On $[0,0.9]$ it converges uniformly to 0, since $\sup=0.9^n\to0$.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Example 2 (An integral that cannot be swapped).&lt;/strong&gt; $f_n(x)=nxe^{-nx^2}$ on $[0,1]$ converges pointwise to 0, but $\int_0^1f_n\,dx=\tfrac{1-e^{-n}}2\to\tfrac12\ne0$. The peak of $f_n$ has height $\sqrt{n/2}\,e^{-1/2}$, ever taller and narrower.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-theorem&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Theorem 1.&lt;/strong&gt; If $f_n\to f$ uniformly on $[a,b]$ and every $f_n$ is continuous, then $f$ is continuous and $\displaystyle\int_a^bf_n\,dx\to\int_a^bf\,dx$.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-proof&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Proof.&lt;/strong&gt; &lt;em&gt;Continuity.&lt;/em&gt; Given $\varepsilon&amp;gt;0$, choose $n$ with $\sup\vert f_n-f\vert &amp;lt;\tfrac\varepsilon3$. Since $f_n$ is continuous at $x_0$, there is $\delta$ with $\vert f_n(x)-f_n(x_0)\vert &amp;lt;\tfrac\varepsilon3$ when $\vert x-x_0\vert &amp;lt;\delta$. Then&lt;/p&gt;

\[|f(x)-f(x_0)|\le|f(x)-f_n(x)|+|f_n(x)-f_n(x_0)|+|f_n(x_0)-f(x_0)|&amp;lt;\varepsilon .\]

  &lt;p&gt;&lt;em&gt;Integrals.&lt;/em&gt; $\left\lvert\int_a^b(f_n-f)\right\rvert\le(b-a)\sup\vert f_n-f\vert \to0$.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-theorem&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Theorem 2 (Weierstrass M-test).&lt;/strong&gt; If $\vert u_n(x)\vert \le M_n$ for all $x\in I$ and $\sum M_n$ converges, then $\sum u_n(x)$ converges uniformly (and absolutely) on $I$.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-proof&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Proof.&lt;/strong&gt; The series converges absolutely at each $x$ by comparison. The remainder satisfies $\left\lvert\sum_{n&amp;gt;N}u_n(x)\right\rvert\le\sum_{n&amp;gt;N}M_n$, a number independent of $x$ that tends to 0.&lt;/p&gt;
&lt;/div&gt;

&lt;p&gt;&lt;strong&gt;Consequence for power series.&lt;/strong&gt; If $\sum c_nx^n$ has radius $R$ and $0&amp;lt;r&amp;lt;R$, then on $[-r,r]$ we have $\vert c_nx^n\vert \le\vert c_n\vert r^n=M_n$ with $\sum M_n$ convergent. So a power series converges uniformly on every closed interval inside its interval of convergence: this is why the computations of lesson 08_04 are valid.&lt;/p&gt;

&lt;h2 id=&quot;the-fourier-series-of-a-square-wave&quot;&gt;The Fourier series of a square wave&lt;/h2&gt;

&lt;p&gt;A $2\pi$-periodic function can (under suitable conditions) be written as&lt;/p&gt;

\[f(x)=\frac{a_0}2+\sum_{n=1}^\infty\big(a_n\cos nx+b_n\sin nx\big),\qquad a_n=\frac1\pi\int_{-\pi}^{\pi}f(x)\cos nx\,dx,\quad b_n=\frac1\pi\int_{-\pi}^{\pi}f(x)\sin nx\,dx .\]

&lt;p&gt;The coefficient formulas come from orthogonality: $\int_{-\pi}^{\pi}\sin mx\sin nx\,dx=0$ for $m\ne n$ and $\pi$ for $m=n$ (likewise for $\cos$, and $\int\sin mx\cos nx=0$). Multiplying both sides by $\sin nx$ and integrating leaves only the $n$-th term.&lt;/p&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Example 3 (The square wave).&lt;/strong&gt; Let $f(x)=-1$ on $(-\pi,0)$ and $f(x)=1$ on $(0,\pi)$, repeated periodically. The function is odd, so $a_n=0$, and&lt;/p&gt;

\[b_n=\frac2\pi\int_0^\pi\sin nx\,dx=\frac{2}{n\pi}(1-\cos n\pi)=\begin{cases}\dfrac4{n\pi}&amp;amp;n\text{ odd}\\0&amp;amp;n\text{ even.}\end{cases}\]

  &lt;p&gt;So&lt;/p&gt;

\[f(x)=\frac4\pi\left(\sin x+\frac{\sin3x}3+\frac{\sin5x}5+\cdots\right).\]

  &lt;p&gt;At $x=\tfrac\pi2$: $1=\tfrac4\pi\left(1-\tfrac13+\tfrac15-\cdots\right)$, the Leibniz series for $\tfrac\pi4$ from lesson 08_04 again.&lt;/p&gt;
&lt;/div&gt;

&lt;p&gt;&lt;strong&gt;The Gibbs phenomenon.&lt;/strong&gt; Every partial sum is continuous while the square wave jumps at $x=0$. By theorem 1 the series cannot converge uniformly on an interval containing the jump. What the graph shows: near the jump the partial sums always overshoot to about $1.179$ (about $9\%$ of the jump of 2), however many terms we take. The overshoot gets narrower, not lower. (A computation with 50 odd terms gives a maximum of $1.1790$.)&lt;/p&gt;

&lt;div class=&quot;interactive-frame&quot;&gt;
  &lt;div class=&quot;interactive-frame-head&quot;&gt;
    &lt;div class=&quot;interactive-frame-title&quot;&gt;Fourier partial sums and the Gibbs phenomenon&lt;/div&gt;
    &lt;div class=&quot;interactive-frame-desc&quot;&gt;Add harmonics; compare the square wave (not uniform) with the triangle wave (uniform).&lt;/div&gt;
  &lt;/div&gt;
  &lt;iframe src=&quot;/interactives/chapter08/fourier-partial-sums-en.html&quot; title=&quot;Fourier partial sums and the Gibbs phenomenon&quot; loading=&quot;lazy&quot; style=&quot;height: 720px;&quot;&gt;&lt;/iframe&gt;
  &lt;div class=&quot;interactive-frame-foot&quot;&gt;
    &lt;a href=&quot;/interactives/chapter08/fourier-partial-sums-en.html&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;Open the interactive in a new window&lt;/a&gt;
  &lt;/div&gt;
&lt;/div&gt;

&lt;h2 id=&quot;applications&quot;&gt;Applications&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Sound and signals.&lt;/strong&gt; A musical note is a sum of a fundamental frequency and its harmonics $2f,3f,\dots$; the Fourier coefficients determine the timbre. A square wave has only odd harmonics with amplitudes $\tfrac1n$ and sounds “buzzy”, like a clarinet. A low-pass filter removes the high harmonics, i.e. truncates the Fourier series.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Machine learning: positional encoding.&lt;/strong&gt; A transformer encodes the position $p$ of a token by the vector $\big(\sin(\omega_kp),\cos(\omega_kp)\big)_k$ with many frequencies $\omega_k$, the same idea as a Fourier series: different frequencies describe position at different scales.&lt;/p&gt;

&lt;h2 id=&quot;exercises&quot;&gt;Exercises&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Basic.&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;Does $f_n(x)=\tfrac{x}{n}$ converge uniformly on $[0,1]$? On $\mathbb R$?&lt;/li&gt;
  &lt;li&gt;Show that $\sum\dfrac{\sin nx}{n^2}$ converges uniformly on $\mathbb R$ and that its sum is continuous.&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Answers&lt;/summary&gt;

  &lt;ol&gt;
    &lt;li&gt;On $[0,1]$: $\sup=\tfrac1n\to0$, uniform. On $\mathbb R$: $\sup=\infty$, not uniform (though it converges pointwise to 0).&lt;/li&gt;
    &lt;li&gt;The M-test with $M_n=\tfrac1{n^2}$; theorem 1.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;p&gt;&lt;strong&gt;Intermediate.&lt;/strong&gt;&lt;/p&gt;

&lt;ol start=&quot;3&quot;&gt;
  &lt;li&gt;Find the Fourier series of $f(x)=x$ on $(-\pi,\pi)$.&lt;/li&gt;
  &lt;li&gt;Use exercise 3 at $x=\tfrac\pi2$ to recover the Leibniz series.&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Answers&lt;/summary&gt;

  &lt;ol start=&quot;3&quot;&gt;
    &lt;li&gt;$f$ is odd, $b_n=\tfrac2\pi\int_0^\pi x\sin nx\,dx=\tfrac{2(-1)^{n+1}}n$. So $x=2\left(\sin x-\tfrac{\sin2x}2+\tfrac{\sin3x}3-\cdots\right)$.&lt;/li&gt;
    &lt;li&gt;$\sin\tfrac{n\pi}2$ is $1,0,-1,0,\dots$: $\tfrac\pi2=2\left(1-\tfrac13+\tfrac15-\cdots\right)$.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;p&gt;&lt;strong&gt;Advanced.&lt;/strong&gt;&lt;/p&gt;

&lt;ol start=&quot;5&quot;&gt;
  &lt;li&gt;Parseval’s identity says $\tfrac1\pi\int_{-\pi}^{\pi}f^2=\tfrac{a_0^2}2+\sum(a_n^2+b_n^2)$. Apply it to the square wave to compute $\sum\tfrac1{(2k+1)^2}$, then deduce $\sum\tfrac1{n^2}=\tfrac{\pi^2}6$.&lt;/li&gt;
  &lt;li&gt;Show that $\int_{-\pi}^{\pi}\sin mx\sin nx\,dx=0$ for distinct positive integers $m\ne n$.&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Hints&lt;/summary&gt;

  &lt;ol start=&quot;5&quot;&gt;
    &lt;li&gt;The left side is 2. The right side is $\tfrac{16}{\pi^2}\sum\tfrac1{(2k+1)^2}$, so $\sum\tfrac1{(2k+1)^2}=\tfrac{\pi^2}8$. With $S=\sum\tfrac1{n^2}$: $S=\tfrac{\pi^2}8+\tfrac S4$, so $S=\tfrac{\pi^2}6$.&lt;/li&gt;
    &lt;li&gt;$\sin mx\sin nx=\tfrac12\big(\cos(m-n)x-\cos(m+n)x\big)$, and $\int_{-\pi}^{\pi}\cos kx\,dx=0$ for $k\ne0$.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;h2 id=&quot;summary&quot;&gt;Summary&lt;/h2&gt;

&lt;div class=&quot;content-box summary-box textbook-block&quot;&gt;
  &lt;ul&gt;
    &lt;li&gt;Uniform convergence: $\sup\vert f_n-f\vert \to0$; stronger than pointwise convergence.&lt;/li&gt;
    &lt;li&gt;A uniform limit of continuous functions is continuous and can be swapped with integrals.&lt;/li&gt;
    &lt;li&gt;M-test: $\vert u_n\vert \le M_n$ with $\sum M_n&amp;lt;\infty$ gives uniform convergence; power series converge uniformly on $[-r,r]$, $r&amp;lt;R$.&lt;/li&gt;
    &lt;li&gt;Square wave $=\tfrac4\pi\sum_{n\text{ odd}}\tfrac{\sin nx}n$; near the jump there is the Gibbs phenomenon (an overshoot of about $9\%$).&lt;/li&gt;
  &lt;/ul&gt;
&lt;/div&gt;
</content>
 </entry>
 
 <entry>
   <title>Term-by-term differentiation and integration</title>
   <link href="https://calculus-self-learning.pages.dev/contents/en/chapter08/08_04_Term_by_term_differentiation_and_integration/"/>
   <updated>2026-12-01T00:00:00+00:00</updated>
   <id>https://calculus-self-learning.pages.dev/contents/en/chapter08/08_04_Term_by_term_differentiation_and_integration</id>
   <content type="html">&lt;div class=&quot;textbook-objectives&quot;&gt;

  &lt;p&gt;&lt;strong&gt;Learning objectives.&lt;/strong&gt; After this lesson you can:&lt;/p&gt;

  &lt;ul&gt;
    &lt;li&gt;differentiate and integrate power series term by term, knowing that the radius of convergence is unchanged;&lt;/li&gt;
    &lt;li&gt;derive the expansions of $\ln(1+x)$ and $\arctan x$ from the geometric series;&lt;/li&gt;
    &lt;li&gt;approximate integrals without elementary antiderivatives, such as $\int_0^1e^{-x^2}dx$;&lt;/li&gt;
    &lt;li&gt;sum numerical series such as $\sum\tfrac n{2^n}$ and $\sum\tfrac1{n2^n}$.&lt;/li&gt;
  &lt;/ul&gt;

&lt;/div&gt;

&lt;h2 id=&quot;why-this-lesson&quot;&gt;Why this lesson&lt;/h2&gt;

&lt;p&gt;The antiderivative of $e^{-x^2}$ (the normal curve of statistics) or of $\tfrac{\sin x}x$ cannot be written with elementary functions (lesson 04_04). Their expansions can, and integrating a power series is as easy as integrating a polynomial. This lesson makes that rigorous.&lt;/p&gt;

&lt;h2 id=&quot;the-main-theorem&quot;&gt;The main theorem&lt;/h2&gt;

&lt;div class=&quot;textbook-theorem&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Theorem 1.&lt;/strong&gt; Suppose $f(x)=\sum_{n=0}^\infty c_n(x-a)^n$ has radius of convergence $R&amp;gt;0$. Then on $(a-R,a+R)$:&lt;/p&gt;

  &lt;ol&gt;
    &lt;li&gt;$f$ is differentiable and $f&apos;(x)=\sum_{n=1}^\infty nc_n(x-a)^{n-1}$;&lt;/li&gt;
    &lt;li&gt;$\displaystyle\int_a^xf(t)\,dt=\sum_{n=0}^\infty\frac{c_n}{n+1}(x-a)^{n+1}$;&lt;/li&gt;
  &lt;/ol&gt;

  &lt;p&gt;and both new series have radius of convergence $R$.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-proof&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Proof sketch.&lt;/strong&gt; &lt;em&gt;The radius.&lt;/em&gt; Take $0&amp;lt;\vert x-a\vert &amp;lt;r&amp;lt;R$. Since $\sum\vert c_n\vert r^n$ converges, $\vert c_n\vert r^n\le M$. Then $\vert nc_n(x-a)^{n-1}\vert \le\tfrac Mr\,n\,q^{n-1}$ with $q=\tfrac{\vert x-a\vert }r&amp;lt;1$, and $\sum nq^{n-1}$ converges (ratio test). Conversely, $\vert c_n(x-a)^n\vert \le\vert x-a\vert \cdot\vert nc_n(x-a)^{n-1}\vert $ for $n\ge1$, so the derived series cannot converge where the original diverges. The same argument works for the integrated series.&lt;/p&gt;

  &lt;p&gt;&lt;em&gt;The derivative really is the derived series.&lt;/em&gt; We must swap a limit and an infinite sum; this is valid because a power series converges uniformly on every interval $[a-r,a+r]$ with $r&amp;lt;R$ (lesson 08_05). So term-by-term integration is valid, and the derivative part follows from the fundamental theorem of calculus applied to the derived series.&lt;/p&gt;
&lt;/div&gt;

&lt;p&gt;Consequence: $f$ has derivatives of all orders and $c_n=\tfrac{f^{(n)}(a)}{n!}$. So &lt;strong&gt;every power series is the Taylor series of its sum&lt;/strong&gt;, and the expansion is unique: however it is found, the coefficients are the same.&lt;/p&gt;

&lt;h2 id=&quot;new-expansions-from-the-geometric-series&quot;&gt;New expansions from the geometric series&lt;/h2&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Example 1 ($\ln(1+x)$).&lt;/strong&gt; For $\vert t\vert &amp;lt;1$, $\tfrac1{1+t}=\sum(-1)^nt^n$. Integrating from 0 to $x$:&lt;/p&gt;

\[\ln(1+x)=\sum_{n=0}^\infty\frac{(-1)^nx^{n+1}}{n+1}=x-\frac{x^2}2+\frac{x^3}3-\cdots,\qquad|x|&amp;lt;1 .\]

  &lt;p&gt;At $x=1$ the series converges by Leibniz, and Abel’s theorem (which we accept) says the sum equals the limit of the function: $\ln2=1-\tfrac12+\tfrac13-\cdots$, as in lesson 07_04.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Example 2 ($\arctan x$ and $\pi$).&lt;/strong&gt; Integrating $\tfrac1{1+t^2}=\sum(-1)^nt^{2n}$:&lt;/p&gt;

\[\arctan x=\sum_{n=0}^\infty\frac{(-1)^nx^{2n+1}}{2n+1}=x-\frac{x^3}3+\frac{x^5}5-\cdots,\qquad|x|\le1 .\]

  &lt;p&gt;At $x=1$: $\tfrac\pi4=1-\tfrac13+\tfrac15-\cdots$ (the Leibniz series), but 1000 terms give only $\pi\approx3.1406$. Machin’s formula $\tfrac\pi4=4\arctan\tfrac15-\arctan\tfrac1{239}$ converges far faster: 5 terms for $\arctan\tfrac15$ and 2 terms for $\arctan\tfrac1{239}$ already give $\pi$ with error $3\times10^{-8}$. Programs that compute trillions of digits of $\pi$ use ideas of the same kind.&lt;/p&gt;
&lt;/div&gt;

&lt;h2 id=&quot;integrals-without-elementary-antiderivatives&quot;&gt;Integrals without elementary antiderivatives&lt;/h2&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Example 3.&lt;/strong&gt; From $e^{-x^2}=\sum\tfrac{(-1)^nx^{2n}}{n!}$:&lt;/p&gt;

\[\int_0^1e^{-x^2}dx=\sum_{n=0}^\infty\frac{(-1)^n}{n!\,(2n+1)}=1-\frac13+\frac1{10}-\frac1{42}+\frac1{216}-\frac1{1320}+\cdots\]

  &lt;p&gt;Six terms give $0.746729$; the series alternates, so the error is at most $\tfrac1{6!\cdot13}=1.1\times10^{-4}$. The true value is $0.746824$.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Example 4 (The sine integral).&lt;/strong&gt; $\displaystyle\int_0^1\frac{\sin x}x\,dx=\sum_{n=0}^\infty\frac{(-1)^n}{(2n+1)!\,(2n+1)}=1-\frac1{18}+\frac1{600}-\frac1{35280}+\cdots\approx0.946083 .$&lt;/p&gt;
&lt;/div&gt;

&lt;h2 id=&quot;summing-numerical-series&quot;&gt;Summing numerical series&lt;/h2&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Example 5.&lt;/strong&gt; Differentiate $\sum_{n\ge0}x^n=\tfrac1{1-x}$ and multiply by $x$: $\sum_{n\ge1}nx^n=\dfrac x{(1-x)^2}$. At $x=\tfrac12$: $\sum\tfrac n{2^n}=2$.&lt;/p&gt;

  &lt;p&gt;Put $x=-\tfrac12$ into $\ln(1+x)$ and change sign: $\sum_{n\ge1}\dfrac1{n2^n}=-\ln\left(1-\tfrac12\right)=\ln2$.&lt;/p&gt;
&lt;/div&gt;

&lt;h2 id=&quot;applications&quot;&gt;Applications&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Statistics: the error function.&lt;/strong&gt; The probability that a standard normal variable lies in $[-z,z]$ is $\operatorname{erf}(z/\sqrt2)$, where $\operatorname{erf}(x)=\tfrac2{\sqrt\pi}\int_0^xe^{-t^2}dt=\tfrac2{\sqrt\pi}\sum\tfrac{(-1)^nx^{2n+1}}{n!(2n+1)}$. Numerical libraries use this series for small $x$ and an asymptotic expansion for large $x$.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Probability: the mean of the geometric distribution.&lt;/strong&gt; If each trial succeeds with probability $p$, the number of trials $N$ until success has $P(N=n)=(1-p)^{n-1}p$. Its mean is $\sum n(1-p)^{n-1}p=p\cdot\tfrac1{(1-(1-p))^2}=\tfrac1p$, by differentiating the geometric series. For example, rolling a die until a 6 takes 6 rolls on average.&lt;/p&gt;

&lt;h2 id=&quot;exercises&quot;&gt;Exercises&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Basic.&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;From $\tfrac1{1-x}=\sum x^n$, expand $\tfrac1{(1-x)^2}$ and $\tfrac1{(1-x)^3}$.&lt;/li&gt;
  &lt;li&gt;Expand $\int_0^x\cos(t^2)\,dt$ (a Fresnel integral) up to degree 9.&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Answers&lt;/summary&gt;

  &lt;ol&gt;
    &lt;li&gt;$\sum(n+1)x^n$; $\sum\tfrac{(n+1)(n+2)}2x^n$.&lt;/li&gt;
    &lt;li&gt;$x-\tfrac{x^5}{10}+\tfrac{x^9}{216}-\cdots$.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;p&gt;&lt;strong&gt;Intermediate.&lt;/strong&gt;&lt;/p&gt;

&lt;ol start=&quot;3&quot;&gt;
  &lt;li&gt;Compute $\sum_{n\ge1}\dfrac{n^2}{2^n}$.&lt;/li&gt;
  &lt;li&gt;Compute $\displaystyle\int_0^{0.5}\frac{dx}{1+x^4}$ with error below $10^{-4}$.&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Answers&lt;/summary&gt;

  &lt;ol start=&quot;3&quot;&gt;
    &lt;li&gt;Differentiate $\sum nx^n=\tfrac x{(1-x)^2}$ and multiply by $x$: $\sum n^2x^n=\tfrac{x(1+x)}{(1-x)^3}$. At $x=\tfrac12$: $6$.&lt;/li&gt;
    &lt;li&gt;$\sum(-1)^n\tfrac{0.5^{4n+1}}{4n+1}=0.5-0.00625+0.000217-\cdots\approx0.49397$; the next term is $\approx9.4\times10^{-6}$.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;p&gt;&lt;strong&gt;Advanced.&lt;/strong&gt;&lt;/p&gt;

&lt;ol start=&quot;5&quot;&gt;
  &lt;li&gt;Find the function $f$ with expansion $\sum_{n\ge0}\dfrac{x^{2n+1}}{2n+1}$ on $(-1,1)$.&lt;/li&gt;
  &lt;li&gt;Show that $y=\sum\tfrac{x^n}{n!}$ satisfies $y&apos;=y$, $y(0)=1$, and deduce $y=e^x$.&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Hints&lt;/summary&gt;

  &lt;ol start=&quot;5&quot;&gt;
    &lt;li&gt;Differentiating gives $\sum x^{2n}=\tfrac1{1-x^2}$, so $f(x)=\tfrac12\ln\tfrac{1+x}{1-x}=\operatorname{artanh}x$.&lt;/li&gt;
    &lt;li&gt;Term-by-term differentiation gives the same series back. Let $g=ye^{-x}$: $g&apos;=0$, $g(0)=1$.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;h2 id=&quot;summary&quot;&gt;Summary&lt;/h2&gt;

&lt;div class=&quot;content-box summary-box textbook-block&quot;&gt;
  &lt;ul&gt;
    &lt;li&gt;Inside the interval of convergence a power series can be differentiated and integrated term by term; the radius is unchanged.&lt;/li&gt;
    &lt;li&gt;Every power series is the Taylor series of its sum; expansions are unique.&lt;/li&gt;
    &lt;li&gt;From the geometric series: $\ln(1+x)$, $\arctan x$, $\sum nx^n=\tfrac x{(1-x)^2}$.&lt;/li&gt;
    &lt;li&gt;Integrating series gives values of $\int e^{-x^2}$, $\int\tfrac{\sin x}x$ and the error function.&lt;/li&gt;
  &lt;/ul&gt;
&lt;/div&gt;
</content>
 </entry>
 
 <entry>
   <title>Maclaurin series of elementary functions</title>
   <link href="https://calculus-self-learning.pages.dev/contents/en/chapter08/08_03_Maclaurin_series_of_elementary_functions/"/>
   <updated>2026-12-01T00:00:00+00:00</updated>
   <id>https://calculus-self-learning.pages.dev/contents/en/chapter08/08_03_Maclaurin_series_of_elementary_functions</id>
   <content type="html">&lt;div class=&quot;textbook-objectives&quot;&gt;

  &lt;p&gt;&lt;strong&gt;Learning objectives.&lt;/strong&gt; After this lesson you can:&lt;/p&gt;

  &lt;ul&gt;
    &lt;li&gt;write the Taylor series of a function and know when it converges to that function;&lt;/li&gt;
    &lt;li&gt;remember and prove the expansions of $e^x$, $\sin x$, $\cos x$, $\ln(1+x)$, $(1+x)^\alpha$;&lt;/li&gt;
    &lt;li&gt;combine known expansions by substitution, multiplication and addition;&lt;/li&gt;
    &lt;li&gt;use expansions to compute approximate values.&lt;/li&gt;
  &lt;/ul&gt;

&lt;/div&gt;

&lt;h2 id=&quot;why-this-lesson&quot;&gt;Why this lesson&lt;/h2&gt;

&lt;p&gt;A pocket calculator does not “know” $\sin$ or $\ln$; it only adds and multiplies. Maclaurin expansions turn elementary functions into power series, and the five expansions in this lesson are a table every engineer uses all the time.&lt;/p&gt;

&lt;h2 id=&quot;taylor-series&quot;&gt;Taylor series&lt;/h2&gt;

&lt;div class=&quot;textbook-definition&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Definition.&lt;/strong&gt; If $f$ has derivatives of all orders at $a$, the &lt;strong&gt;Taylor series&lt;/strong&gt; of $f$ at $a$ is $\displaystyle\sum_{n=0}^\infty\frac{f^{(n)}(a)}{n!}(x-a)^n$. When $a=0$ it is the &lt;strong&gt;Maclaurin series&lt;/strong&gt;.&lt;/p&gt;
&lt;/div&gt;

&lt;p&gt;The Taylor series equals $f(x)$ exactly when the remainder $R_n(x)\to0$ (lesson 08_01). This is not automatic: the function $f(x)=e^{-1/x^2}$ (with $f(0)=0$) has all derivatives at 0 equal to 0, so its Maclaurin series is the zero series, which differs from $f$ at every $x\ne0$.&lt;/p&gt;

&lt;div class=&quot;textbook-theorem&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Theorem 1.&lt;/strong&gt; If there is $M$ with $\vert f^{(n)}(t)\vert \le M$ for all $n$ and all $t$ in an interval $I$ containing $a$, then the Taylor series of $f$ converges to $f(x)$ for every $x\in I$.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-proof&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Proof.&lt;/strong&gt; By theorem 1 of lesson 08_01, $\vert R_n(x)\vert \le\dfrac{M\vert x-a\vert ^{n+1}}{(n+1)!}$. For every number $r$, $\tfrac{r^{n}}{n!}\to0$ (it is the term of the convergent series $\sum\tfrac{r^n}{n!}$, lesson 07_03). So $R_n(x)\to0$.&lt;/p&gt;
&lt;/div&gt;

&lt;h2 id=&quot;the-five-basic-expansions&quot;&gt;The five basic expansions&lt;/h2&gt;

&lt;div class=&quot;content-box insight-box textbook-block&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Table of Maclaurin series.&lt;/strong&gt;&lt;/p&gt;

\[e^x=\sum_{n=0}^\infty\frac{x^n}{n!}=1+x+\frac{x^2}{2!}+\frac{x^3}{3!}+\cdots\qquad(x\in\mathbb R)\]

\[\sin x=\sum_{n=0}^\infty\frac{(-1)^nx^{2n+1}}{(2n+1)!}=x-\frac{x^3}{3!}+\frac{x^5}{5!}-\cdots\qquad(x\in\mathbb R)\]

\[\cos x=\sum_{n=0}^\infty\frac{(-1)^nx^{2n}}{(2n)!}=1-\frac{x^2}{2!}+\frac{x^4}{4!}-\cdots\qquad(x\in\mathbb R)\]

\[\ln(1+x)=\sum_{n=1}^\infty\frac{(-1)^{n+1}x^n}{n}=x-\frac{x^2}2+\frac{x^3}3-\cdots\qquad(-1&amp;lt;x\le1)\]

\[(1+x)^\alpha=\sum_{n=0}^\infty\binom\alpha nx^n=1+\alpha x+\frac{\alpha(\alpha-1)}{2!}x^2+\cdots\qquad(|x|&amp;lt;1)\]

  &lt;p&gt;with $\binom\alpha n=\dfrac{\alpha(\alpha-1)\cdots(\alpha-n+1)}{n!}$.&lt;/p&gt;
&lt;/div&gt;

&lt;p&gt;&lt;strong&gt;Why.&lt;/strong&gt; For $e^x$: on $[-r,r]$ every derivative is bounded by $e^r$; use theorem 1. For $\sin$, $\cos$: every derivative is bounded by 1. For $\ln(1+x)$: the derivatives $f^{(n)}(0)=(-1)^{n+1}(n-1)!$ give the coefficients; the easiest proof that the series converges to the function is by integrating the geometric series, in lesson 08_04. For $(1+x)^\alpha$: the coefficients come from $f^{(n)}(0)=\alpha(\alpha-1)\cdots(\alpha-n+1)$; the ratio of coefficients $\tfrac{\alpha-n}{n+1}\to-1$, so $R=1$ (when $\alpha$ is not a natural number). When $\alpha$ is a natural number the series stops and we get the binomial theorem.&lt;/p&gt;

&lt;div class=&quot;interactive-frame&quot;&gt;
  &lt;div class=&quot;interactive-frame-head&quot;&gt;
    &lt;div class=&quot;interactive-frame-title&quot;&gt;Maclaurin polynomials of elementary functions&lt;/div&gt;
    &lt;div class=&quot;interactive-frame-desc&quot;&gt;Keep a = 0, raise n and compare sin x, eˣ with ln(1 + x), arctan x.&lt;/div&gt;
  &lt;/div&gt;
  &lt;iframe src=&quot;/interactives/chapter08/taylor-polynomial-en.html&quot; title=&quot;Maclaurin polynomials of elementary functions&quot; loading=&quot;lazy&quot; style=&quot;height: 720px;&quot;&gt;&lt;/iframe&gt;
  &lt;div class=&quot;interactive-frame-foot&quot;&gt;
    &lt;a href=&quot;/interactives/chapter08/taylor-polynomial-en.html&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;Open the interactive in a new window&lt;/a&gt;
  &lt;/div&gt;
&lt;/div&gt;

&lt;h2 id=&quot;examples&quot;&gt;Examples&lt;/h2&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Example 1 (Computing $\cos0.2$).&lt;/strong&gt; $\cos0.2\approx1-\tfrac{0.04}2+\tfrac{0.0016}{24}=0.9800667$. The series alternates with decreasing terms, so the error is at most the next term $\tfrac{0.2^6}{720}=8.9\times10^{-8}$ (lesson 07_04). The true value is $0.98006658$.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Example 2 (Computing $\ln2$ quickly).&lt;/strong&gt; The series $1-\tfrac12+\tfrac13-\cdots$ converges very slowly: 10 terms give only $0.6456$. Subtract two expansions:&lt;/p&gt;

\[\ln\frac{1+x}{1-x}=\ln(1+x)-\ln(1-x)=2\left(x+\frac{x^3}3+\frac{x^5}5+\cdots\right).\]

  &lt;p&gt;Choose $x=\tfrac13$ so that $\tfrac{1+x}{1-x}=2$: four terms give $2\left(\tfrac13+\tfrac1{81}+\tfrac1{1215}+\tfrac1{15309}\right)=0.693135$, an error of $1.2\times10^{-5}$ from $\ln2=0.693147$.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Example 3 (Combining expansions).&lt;/strong&gt; Substitution: $e^{-x^2}=1-x^2+\tfrac{x^4}{2}-\tfrac{x^6}6+\cdots$. Multiplication, up to degree 3:&lt;/p&gt;

\[e^x\sin x=\left(1+x+\tfrac{x^2}2+\tfrac{x^3}6\right)\left(x-\tfrac{x^3}6\right)+o(x^3)=x+x^2+\tfrac{x^3}3+o(x^3).\]

&lt;/div&gt;

&lt;h2 id=&quot;eulers-formula&quot;&gt;Euler’s formula&lt;/h2&gt;

&lt;p&gt;Replace $x$ by $ix$ (with $i^2=-1$) in the series for $e^x$ and separate the even and odd parts:&lt;/p&gt;

\[e^{ix}=\left(1-\frac{x^2}{2!}+\frac{x^4}{4!}-\cdots\right)+i\left(x-\frac{x^3}{3!}+\frac{x^5}{5!}-\cdots\right)=\cos x+i\sin x .\]

&lt;p&gt;With $x=\pi$: $e^{i\pi}+1=0$. This formula underlies alternating current, signal processing and Fourier series (lesson 08_05).&lt;/p&gt;

&lt;h2 id=&quot;short-video&quot;&gt;Short video&lt;/h2&gt;

&lt;div class=&quot;reel-video&quot;&gt;
  &lt;video controls=&quot;&quot; playsinline=&quot;&quot; preload=&quot;metadata&quot; src=&quot;/public/videos/reels/taylor-hugs-sine.mp4&quot;&gt;&lt;/video&gt;
  &lt;p class=&quot;reel-caption&quot;&gt;Maclaurin polynomials of degree 1, 3, 5, …, 17 hug the sine graph in turn, the matching region widening (silent video, about 2 minutes).&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;reel-video&quot;&gt;
  &lt;video controls=&quot;&quot; playsinline=&quot;&quot; preload=&quot;metadata&quot; src=&quot;/public/videos/reels/euler-formula-series.mp4&quot;&gt;&lt;/video&gt;
  &lt;p class=&quot;reel-caption&quot;&gt;Euler&apos;s formula from series: the terms of e^(ix) form a polyline in the complex plane, the real part gives cos, the imaginary part sin, and the end point rotates on the unit circle (silent video, about 1 minute 57 seconds).&lt;/p&gt;
&lt;/div&gt;

&lt;h2 id=&quot;applications&quot;&gt;Applications&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Physics: relativistic kinetic energy.&lt;/strong&gt; The kinetic energy of a mass $m$ at speed $v$ is $mc^2(\gamma-1)$ with $\gamma=(1-v^2/c^2)^{-1/2}$. The binomial expansion with $\alpha=-\tfrac12$ gives&lt;/p&gt;

\[\gamma=1+\frac12\frac{v^2}{c^2}+\frac38\frac{v^4}{c^4}+\cdots\quad\Rightarrow\quad mc^2(\gamma-1)=\frac12mv^2+\frac38m\frac{v^4}{c^2}+\cdots\]

&lt;p&gt;The first term is Newton’s kinetic energy. At $v=0.1c$: $\gamma-1=0.0050378$, and two terms give $0.0050375$.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Machine learning: activation functions near 0.&lt;/strong&gt; Near 0, $\tanh x=x-\tfrac{x^3}3+\cdots$ and the sigmoid $\sigma(x)=\tfrac12+\tfrac x4-\tfrac{x^3}{48}+\cdots$ are almost linear. That is why a deep network with these activations and very small initial weights behaves almost like a linear map.&lt;/p&gt;

&lt;h2 id=&quot;exercises&quot;&gt;Exercises&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Basic.&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;Write the Maclaurin series of $x\cos x$ and $\dfrac1{1+x}$.&lt;/li&gt;
  &lt;li&gt;Write the first 4 terms of $\sqrt{1+x}$.&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Answers&lt;/summary&gt;

  &lt;ol&gt;
    &lt;li&gt;$x-\tfrac{x^3}2+\tfrac{x^5}{24}-\cdots$; $1-x+x^2-x^3+\cdots$ ($\vert x\vert &amp;lt;1$).&lt;/li&gt;
    &lt;li&gt;$1+\tfrac x2-\tfrac{x^2}8+\tfrac{x^3}{16}$.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;p&gt;&lt;strong&gt;Intermediate.&lt;/strong&gt;&lt;/p&gt;

&lt;ol start=&quot;3&quot;&gt;
  &lt;li&gt;Compute $\displaystyle\lim_{x\to0}\frac{x-\ln(1+x)}{x^2}$ and $\displaystyle\lim_{x\to0}\frac{\sin x-x\cos x}{x^3}$.&lt;/li&gt;
  &lt;li&gt;Compute $e^{-0.5}$ with error below $10^{-3}$.&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Answers&lt;/summary&gt;

  &lt;ol start=&quot;3&quot;&gt;
    &lt;li&gt;$\tfrac12$; $-\tfrac16+\tfrac12=\tfrac13$.&lt;/li&gt;
    &lt;li&gt;Alternating series: $1-0.5+0.125-0.020833+0.002604=0.60677$, next term $0.00026$. The true value is $0.60653$.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;p&gt;&lt;strong&gt;Advanced.&lt;/strong&gt;&lt;/p&gt;

&lt;ol start=&quot;5&quot;&gt;
  &lt;li&gt;Show that every derivative of $f(x)=e^{-1/x^2}$ ($f(0)=0$) at 0 is 0.&lt;/li&gt;
  &lt;li&gt;Use Euler’s formula to derive $\cos(a+b)$ and $\sin(a+b)$ from $e^{i(a+b)}=e^{ia}e^{ib}$.&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Hints&lt;/summary&gt;

  &lt;ol start=&quot;5&quot;&gt;
    &lt;li&gt;For $x\ne0$, by induction $f^{(n)}(x)=P_n(1/x)e^{-1/x^2}$ with $P_n$ a polynomial. With $t=1/x$, $t^ke^{-t^2}\to0$. At 0 use the definition of the derivative and the same limit.&lt;/li&gt;
    &lt;li&gt;Multiply $(\cos a+i\sin a)(\cos b+i\sin b)$ and compare real and imaginary parts.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;h2 id=&quot;summary&quot;&gt;Summary&lt;/h2&gt;

&lt;div class=&quot;content-box summary-box textbook-block&quot;&gt;
  &lt;ul&gt;
    &lt;li&gt;A Taylor series equals the function when $R_n\to0$; uniformly bounded derivatives suffice.&lt;/li&gt;
    &lt;li&gt;$e^x$, $\sin x$, $\cos x$ converge on $\mathbb R$; $\ln(1+x)$ on $(-1,1]$; $(1+x)^\alpha$ for $\vert x\vert &amp;lt;1$.&lt;/li&gt;
    &lt;li&gt;Substitute, multiply and subtract known expansions instead of computing derivatives.&lt;/li&gt;
    &lt;li&gt;$e^{ix}=\cos x+i\sin x$.&lt;/li&gt;
  &lt;/ul&gt;
&lt;/div&gt;
</content>
 </entry>
 
 <entry>
   <title>Power series and the radius of convergence</title>
   <link href="https://calculus-self-learning.pages.dev/contents/en/chapter08/08_02_Power_series_and_the_radius_of_convergence/"/>
   <updated>2026-12-01T00:00:00+00:00</updated>
   <id>https://calculus-self-learning.pages.dev/contents/en/chapter08/08_02_Power_series_and_the_radius_of_convergence</id>
   <content type="html">&lt;div class=&quot;textbook-objectives&quot;&gt;

  &lt;p&gt;&lt;strong&gt;Learning objectives.&lt;/strong&gt; After this lesson you can:&lt;/p&gt;

  &lt;ul&gt;
    &lt;li&gt;recognise a power series centred at $a$;&lt;/li&gt;
    &lt;li&gt;prove that a power series converges on an interval (Abel’s lemma);&lt;/li&gt;
    &lt;li&gt;find the radius of convergence with the ratio or root test;&lt;/li&gt;
    &lt;li&gt;check the two endpoints separately to get the interval of convergence.&lt;/li&gt;
  &lt;/ul&gt;

&lt;/div&gt;

&lt;h2 id=&quot;why-this-lesson&quot;&gt;Why this lesson&lt;/h2&gt;

&lt;p&gt;Lesson 08_01 used Taylor polynomials of finite degree. Letting the degree go to infinity gives a &lt;strong&gt;power series&lt;/strong&gt;, a “polynomial of infinite degree”. Unlike a polynomial, a power series may converge only for some values of $x$. Before using an expansion we must know where it holds.&lt;/p&gt;

&lt;h2 id=&quot;power-series&quot;&gt;Power series&lt;/h2&gt;

&lt;div class=&quot;textbook-definition&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Definition.&lt;/strong&gt; A &lt;strong&gt;power series centred at $a$&lt;/strong&gt; is a series of the form&lt;/p&gt;

\[\sum_{n=0}^\infty c_n(x-a)^n=c_0+c_1(x-a)+c_2(x-a)^2+\cdots\]

  &lt;p&gt;with constant coefficients $c_n$. Each $x$ gives a numerical series; the set of $x$ where it converges is the &lt;strong&gt;domain of convergence&lt;/strong&gt;.&lt;/p&gt;
&lt;/div&gt;

&lt;p&gt;A familiar example: the geometric series $\sum x^n=\tfrac1{1-x}$ converges exactly when $\vert x\vert &amp;lt;1$ (lesson 07_02).&lt;/p&gt;

&lt;div class=&quot;textbook-theorem&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Theorem 1 (Abel’s lemma).&lt;/strong&gt; If $\sum c_nx_0^n$ converges for some $x_0\ne0$, then $\sum c_nx^n$ converges absolutely for every $\vert x\vert &amp;lt;\vert x_0\vert $.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-proof&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Proof.&lt;/strong&gt; Since $\sum c_nx_0^n$ converges, $c_nx_0^n\to0$ and so is bounded: $\vert c_nx_0^n\vert \le M$. For $\vert x\vert &amp;lt;\vert x_0\vert $ let $q=\tfrac{\vert x\vert }{\vert x_0\vert }&amp;lt;1$. Then $\vert c_nx^n\vert =\vert c_nx_0^n\vert \,q^n\le Mq^n$. The geometric series $\sum Mq^n$ converges; use the comparison test.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-theorem&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Corollary (Radius of convergence).&lt;/strong&gt; For every power series $\sum c_n(x-a)^n$ there is a number $R\in[0,\infty]$, the &lt;strong&gt;radius of convergence&lt;/strong&gt;, such that the series converges absolutely for $\vert x-a\vert &amp;lt;R$ and diverges for $\vert x-a\vert &amp;gt;R$. At the endpoints $x=a\pm R$ it may converge or diverge.&lt;/p&gt;
&lt;/div&gt;

&lt;p&gt;Indeed, let $R$ be the supremum of the $\vert x-a\vert $ where the series converges; Abel’s lemma gives convergence inside, and outside the series diverges by the definition of $R$.&lt;/p&gt;

&lt;h2 id=&quot;finding-the-radius&quot;&gt;Finding the radius&lt;/h2&gt;

&lt;p&gt;Apply the ratio test to $\vert c_n(x-a)^n\vert $: the ratio is $\left\lvert\tfrac{c_{n+1}}{c_n}\right\rvert\vert x-a\vert $. So&lt;/p&gt;

\[\text{if }\left\lvert\frac{c_{n+1}}{c_n}\right\rvert\to L\text{ then }R=\frac1L\qquad(R=\infty\text{ if }L=0,\ R=0\text{ if }L=\infty).\]

&lt;p&gt;Similarly, if $\sqrt[n]{\vert c_n\vert }\to L$ then $R=\tfrac1L$ (the Cauchy–Hadamard formula uses $\limsup$ and always holds).&lt;/p&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Example 1.&lt;/strong&gt;&lt;/p&gt;

  &lt;ul&gt;
    &lt;li&gt;$\sum\dfrac{x^n}{n!}$: $\tfrac{c_{n+1}}{c_n}=\tfrac1{n+1}\to0$, $R=\infty$: convergent for every $x$.&lt;/li&gt;
    &lt;li&gt;$\sum n!\,x^n$: the ratio is $n+1\to\infty$, $R=0$: convergent only at $x=0$.&lt;/li&gt;
    &lt;li&gt;$\sum\dfrac{x^n}{n}$: $R=1$. At $x=1$: the harmonic series, divergent. At $x=-1$: alternating, convergent. Domain $[-1,1)$.&lt;/li&gt;
    &lt;li&gt;$\sum\dfrac{x^n}{n^2}$: $R=1$, absolutely convergent at both endpoints. Domain $[-1,1]$.&lt;/li&gt;
  &lt;/ul&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Example 2 (A centre other than 0).&lt;/strong&gt; $\displaystyle\sum_{n\ge1}\frac{(x-2)^n}{n\,3^n}$. The ratio is $\tfrac{n}{3(n+1)}\to\tfrac13$, so $R=3$: convergent for $-1&amp;lt;x&amp;lt;5$. At $x=5$: $\sum\tfrac1n$ diverges. At $x=-1$: $\sum\tfrac{(-1)^n}n$ converges. Domain $[-1,5)$.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Example 3 (Only even powers).&lt;/strong&gt; $\sum\dfrac{x^{2n}}{4^n}$. The odd coefficients are 0, so the ratio $\tfrac{c_{n+1}}{c_n}$ cannot be used; apply the ratio test to the terms themselves: $\tfrac{x^2}4&amp;lt;1$ when $\vert x\vert &amp;lt;2$. It is a geometric series with ratio $\tfrac{x^2}4$ and sum $\tfrac4{4-x^2}$; at $x=\pm2$ the terms equal 1 and it diverges. Domain $(-2,2)$.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;interactive-frame&quot;&gt;
  &lt;div class=&quot;interactive-frame-head&quot;&gt;
    &lt;div class=&quot;interactive-frame-title&quot;&gt;Radius and interval of convergence&lt;/div&gt;
    &lt;div class=&quot;interactive-frame-desc&quot;&gt;Increase N: inside the interval the partial sums settle, outside they blow up.&lt;/div&gt;
  &lt;/div&gt;
  &lt;iframe src=&quot;/interactives/chapter08/radius-of-convergence-en.html&quot; title=&quot;Radius and interval of convergence&quot; loading=&quot;lazy&quot; style=&quot;height: 720px;&quot;&gt;&lt;/iframe&gt;
  &lt;div class=&quot;interactive-frame-foot&quot;&gt;
    &lt;a href=&quot;/interactives/chapter08/radius-of-convergence-en.html&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;Open the interactive in a new window&lt;/a&gt;
  &lt;/div&gt;
&lt;/div&gt;

&lt;h2 id=&quot;applications&quot;&gt;Applications&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Why $\tfrac1{1+x^2}$ expands only for $\vert x\vert &amp;lt;1$.&lt;/strong&gt; The function $\tfrac1{1+x^2}=\sum(-1)^nx^{2n}$ is smooth on all of $\mathbb R$, yet the series converges only for $\vert x\vert &amp;lt;1$. The reason lies in the complex numbers: $1+x^2=0$ at $x=\pm i$, at distance exactly 1 from the centre 0. The radius of convergence is the distance from the centre to the nearest “bad point” in the complex plane. In numerical work this explains why higher-degree Taylor polynomials of $\tfrac1{1+x^2}$ get worse for $\vert x\vert &amp;gt;1$.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Probability: generating functions.&lt;/strong&gt; For a random variable taking values $0,1,2,\dots$ with probabilities $p_n$, the probability generating function $G(s)=\sum p_ns^n$ has radius at least 1 because $\sum p_n=1$. For example the geometric distribution $p_n=(1-p)p^n$ gives $G(s)=\tfrac{1-p}{1-ps}$, with $R=\tfrac1p&amp;gt;1$.&lt;/p&gt;

&lt;h2 id=&quot;exercises&quot;&gt;Exercises&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Basic.&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;Find the domain of convergence: $\sum\dfrac{x^n}{2^n}$, $\sum n x^n$.&lt;/li&gt;
  &lt;li&gt;Find the domain of convergence: $\sum\dfrac{(x+1)^n}{\sqrt n}$.&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Answers&lt;/summary&gt;

  &lt;ol&gt;
    &lt;li&gt;$(-2,2)$; $(-1,1)$ (at $\pm1$ the terms do not tend to 0).&lt;/li&gt;
    &lt;li&gt;$R=1$, centre $-1$. At $x=0$: $\sum\tfrac1{\sqrt n}$ diverges; at $x=-2$: alternating, convergent. Domain $[-2,0)$.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;p&gt;&lt;strong&gt;Intermediate.&lt;/strong&gt;&lt;/p&gt;

&lt;ol start=&quot;3&quot;&gt;
  &lt;li&gt;Find the radius of $\sum\dfrac{(2n)!}{(n!)^2}x^n$ and of $\sum\dfrac{n^n}{n!}x^n$.&lt;/li&gt;
  &lt;li&gt;Show that if $\sum c_nx^n$ has radius $R$ then $\sum c_nx^{2n}$ has radius $\sqrt R$.&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Answers&lt;/summary&gt;

  &lt;ol start=&quot;3&quot;&gt;
    &lt;li&gt;Ratio $\tfrac{(2n+2)(2n+1)}{(n+1)^2}\to4$, $R=\tfrac14$. Ratio $\left(1+\tfrac1n\right)^n\to e$, $R=\tfrac1e$.&lt;/li&gt;
    &lt;li&gt;$\sum c_n(x^2)^n$ converges when $x^2&amp;lt;R$ and diverges when $x^2&amp;gt;R$.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;p&gt;&lt;strong&gt;Advanced.&lt;/strong&gt;&lt;/p&gt;

&lt;ol start=&quot;5&quot;&gt;
  &lt;li&gt;Give power series whose domains of convergence are $(-1,1)$, $(-1,1]$ and $[-1,1]$.&lt;/li&gt;
  &lt;li&gt;Find the radius of the expansion of $\tfrac1{x^2-4x+5}$ at $a=0$ without computing coefficients.&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Hints&lt;/summary&gt;

  &lt;ol start=&quot;5&quot;&gt;
    &lt;li&gt;$\sum x^n$; $\sum\tfrac{(-1)^nx^n}{n}$; $\sum\tfrac{x^n}{n^2}$.&lt;/li&gt;
    &lt;li&gt;The denominator vanishes at $x=2\pm i$, at distance $\sqrt5$ from 0. So $R=\sqrt5$.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;h2 id=&quot;summary&quot;&gt;Summary&lt;/h2&gt;

&lt;div class=&quot;content-box summary-box textbook-block&quot;&gt;
  &lt;ul&gt;
    &lt;li&gt;A power series $\sum c_n(x-a)^n$ converges absolutely for $\vert x-a\vert &amp;lt;R$ and diverges for $\vert x-a\vert &amp;gt;R$ (Abel’s lemma).&lt;/li&gt;
    &lt;li&gt;$R=\tfrac1L$ with $L=\lim\left\lvert\tfrac{c_{n+1}}{c_n}\right\rvert$ or $L=\lim\sqrt[n]{\vert c_n\vert }$.&lt;/li&gt;
    &lt;li&gt;The endpoints must be checked separately with the tests of chapter 7.&lt;/li&gt;
    &lt;li&gt;$R$ equals the distance from the centre to the nearest singularity in the complex plane.&lt;/li&gt;
  &lt;/ul&gt;
&lt;/div&gt;
</content>
 </entry>
 
 <entry>
   <title>Taylor's formula and the remainder</title>
   <link href="https://calculus-self-learning.pages.dev/contents/en/chapter08/08_01_Taylors_formula_and_the_remainder/"/>
   <updated>2026-12-01T00:00:00+00:00</updated>
   <id>https://calculus-self-learning.pages.dev/contents/en/chapter08/08_01_Taylors_formula_and_the_remainder</id>
   <content type="html">&lt;div class=&quot;textbook-objectives&quot;&gt;

  &lt;p&gt;&lt;strong&gt;Learning objectives.&lt;/strong&gt; After this lesson you can:&lt;/p&gt;

  &lt;ul&gt;
    &lt;li&gt;write the Taylor polynomial of degree $n$ of a function at a point;&lt;/li&gt;
    &lt;li&gt;state and prove Taylor’s formula with the Lagrange remainder;&lt;/li&gt;
    &lt;li&gt;estimate the error of the approximation and choose a degree that reaches a given accuracy;&lt;/li&gt;
    &lt;li&gt;use the Peano remainder to compute limits.&lt;/li&gt;
  &lt;/ul&gt;

&lt;/div&gt;

&lt;h2 id=&quot;why-this-lesson&quot;&gt;Why this lesson&lt;/h2&gt;

&lt;p&gt;The linear approximation $f(x)\approx f(a)+f&apos;(a)(x-a)$ (lesson 02_04) matches the value and the slope at $a$. To do better we also match the curvature, then higher derivatives. The result is a polynomial, something a computer evaluates with additions and multiplications. The key question is: &lt;strong&gt;how wrong is it?&lt;/strong&gt; Taylor’s formula answers that.&lt;/p&gt;

&lt;h2 id=&quot;taylor-polynomials&quot;&gt;Taylor polynomials&lt;/h2&gt;

&lt;div class=&quot;textbook-definition&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Definition.&lt;/strong&gt; Let $f$ have derivatives up to order $n$ at $a$. The &lt;strong&gt;Taylor polynomial of degree $n$&lt;/strong&gt; of $f$ at $a$ is&lt;/p&gt;

\[T_n(x)=\sum_{k=0}^n\frac{f^{(k)}(a)}{k!}(x-a)^k=f(a)+f&apos;(a)(x-a)+\frac{f&apos;&apos;(a)}{2!}(x-a)^2+\cdots+\frac{f^{(n)}(a)}{n!}(x-a)^n .\]

  &lt;p&gt;When $a=0$ it is called the &lt;strong&gt;Maclaurin&lt;/strong&gt; polynomial. The difference $R_n(x)=f(x)-T_n(x)$ is the &lt;strong&gt;remainder&lt;/strong&gt;.&lt;/p&gt;
&lt;/div&gt;

&lt;p&gt;The coefficients $\tfrac{f^{(k)}(a)}{k!}$ are chosen so that $T_n^{(k)}(a)=f^{(k)}(a)$ for $k=0,\dots,n$: the $k$-th derivative of $(x-a)^k$ is $k!$, and the other terms vanish at $a$.&lt;/p&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Example 1.&lt;/strong&gt; For $f(x)=e^x$ every derivative is $e^x$, equal to 1 at 0, so $T_n(x)=1+x+\tfrac{x^2}{2!}+\cdots+\tfrac{x^n}{n!}$. For $f(x)=\sin x$ the derivatives at 0 cycle through $0,1,0,-1$, so $T_5(x)=x-\tfrac{x^3}{6}+\tfrac{x^5}{120}$ (and $T_6=T_5$).&lt;/p&gt;
&lt;/div&gt;

&lt;h2 id=&quot;the-lagrange-remainder&quot;&gt;The Lagrange remainder&lt;/h2&gt;

&lt;div class=&quot;textbook-theorem&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Theorem 1 (Taylor).&lt;/strong&gt; If $f$ has derivatives up to order $n+1$ on an interval containing $a$ and $x$, there is $c$ between $a$ and $x$ with&lt;/p&gt;

\[f(x)=T_n(x)+\frac{f^{(n+1)}(c)}{(n+1)!}(x-a)^{n+1}.\]

&lt;/div&gt;

&lt;div class=&quot;textbook-proof&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Proof.&lt;/strong&gt; Fix $x$ and set, for $t$ between $a$ and $x$,&lt;/p&gt;

\[\varphi(t)=f(x)-\sum_{k=0}^n\frac{f^{(k)}(t)}{k!}(x-t)^k,\qquad \psi(t)=(x-t)^{n+1}.\]

  &lt;p&gt;Then $\varphi(x)=0$, $\varphi(a)=R_n(x)$, $\psi(x)=0$, $\psi(a)=(x-a)^{n+1}$. When we differentiate $\varphi$ the terms cancel in pairs (a telescoping sum), leaving $\varphi&apos;(t)=-\dfrac{f^{(n+1)}(t)}{n!}(x-t)^n$. Also $\psi&apos;(t)=-(n+1)(x-t)^n$. By Cauchy’s mean value theorem (lesson 02_05) there is $c$ between $a$ and $x$ with&lt;/p&gt;

\[\frac{\varphi(a)-\varphi(x)}{\psi(a)-\psi(x)}=\frac{\varphi&apos;(c)}{\psi&apos;(c)}=\frac{f^{(n+1)}(c)}{(n+1)!},\]

  &lt;p&gt;that is, $R_n(x)=\dfrac{f^{(n+1)}(c)}{(n+1)!}(x-a)^{n+1}$.&lt;/p&gt;
&lt;/div&gt;

&lt;p&gt;For $n=0$ this is the mean value theorem $f(x)-f(a)=f&apos;(c)(x-a)$. The practical consequence: if $\vert f^{(n+1)}\vert \le M$ between $a$ and $x$, then&lt;/p&gt;

\[|R_n(x)|\le\frac{M}{(n+1)!}|x-a|^{n+1}.\]

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Example 2 (Computing $e$).&lt;/strong&gt; With $x=1$, $n=7$: $T_7(1)=1+1+\tfrac12+\cdots+\tfrac1{5040}=2.718254$. Since $e^c\le e&amp;lt;3$ for $c\in(0,1)$, the error is at most $\tfrac{3}{8!}=7.4\times10^{-5}$. In fact $e-T_7(1)=2.8\times10^{-5}$.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Example 3 (Computing $\sin0.5$).&lt;/strong&gt; Use $T_5=T_6$ and $\vert \sin^{(7)}\vert \le1$: $\sin0.5\approx0.5-\tfrac{0.125}6+\tfrac{0.03125}{120}=0.4794271$, with error at most $\tfrac{0.5^7}{7!}=1.55\times10^{-6}$. The true value is $0.4794255$.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Example 4 (Computing $\sqrt{1.1}$).&lt;/strong&gt; For $f(x)=\sqrt{1+x}$: $f&apos;(0)=\tfrac12$, $f&apos;&apos;(0)=-\tfrac14$, so $T_2(x)=1+\tfrac x2-\tfrac{x^2}8$ and $\sqrt{1.1}\approx1.04875$. We have $f&apos;&apos;&apos;(c)=\tfrac38(1+c)^{-5/2}\le\tfrac38$ for $c&amp;gt;0$, so $\vert R_2(0.1)\vert \le\tfrac{3/8}{6}(0.1)^3=6.25\times10^{-5}$. The true value is $1.0488088$, an error of $5.9\times10^{-5}$.&lt;/p&gt;
&lt;/div&gt;

&lt;h2 id=&quot;the-peano-remainder-and-limits&quot;&gt;The Peano remainder and limits&lt;/h2&gt;

&lt;div class=&quot;textbook-theorem&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Theorem 2 (Peano).&lt;/strong&gt; If $f$ has continuous derivatives up to order $n$ near $a$, then $f(x)=T_n(x)+o\big((x-a)^n\big)$ as $x\to a$, meaning $\dfrac{R_n(x)}{(x-a)^n}\to0$.&lt;/p&gt;
&lt;/div&gt;

&lt;p&gt;When $f^{(n+1)}$ is bounded this follows at once from theorem 1. The Peano form replaces repeated use of L’Hôpital’s rule:&lt;/p&gt;

\[\lim_{x\to0}\frac{\sin x-x}{x^3}=\lim_{x\to0}\frac{-\tfrac{x^3}6+o(x^3)}{x^3}=-\frac16 .\]

&lt;div class=&quot;interactive-frame&quot;&gt;
  &lt;div class=&quot;interactive-frame-head&quot;&gt;
    &lt;div class=&quot;interactive-frame-title&quot;&gt;Taylor polynomials and the remainder&lt;/div&gt;
    &lt;div class=&quot;interactive-frame-desc&quot;&gt;Pick a function, the centre a and the degree n; the red segment is the remainder at x.&lt;/div&gt;
  &lt;/div&gt;
  &lt;iframe src=&quot;/interactives/chapter08/taylor-polynomial-en.html&quot; title=&quot;Taylor polynomials and the remainder&quot; loading=&quot;lazy&quot; style=&quot;height: 720px;&quot;&gt;&lt;/iframe&gt;
  &lt;div class=&quot;interactive-frame-foot&quot;&gt;
    &lt;a href=&quot;/interactives/chapter08/taylor-polynomial-en.html&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;Open the interactive in a new window&lt;/a&gt;
  &lt;/div&gt;
&lt;/div&gt;

&lt;h2 id=&quot;applications&quot;&gt;Applications&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Physics: the small pendulum.&lt;/strong&gt; The pendulum equation $\theta&apos;&apos;=-\tfrac gL\sin\theta$ has no elementary solution. For small angles, $\sin\theta\approx\theta$ gives simple harmonic motion with period $2\pi\sqrt{L/g}$. The error is $\vert \sin\theta-\theta\vert \le\tfrac{\theta^3}6$: at $\theta=0.2$ rad (about $11.5^\circ$) the relative error is below $0.7\%$.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Machine learning: the quadratic approximation and Newton’s method.&lt;/strong&gt; Near a point $w$, a loss satisfies $L(w+h)\approx L(w)+L&apos;(w)h+\tfrac12L&apos;&apos;(w)h^2$. Minimising this quadratic in $h$ gives $h=-\tfrac{L&apos;(w)}{L&apos;&apos;(w)}$: the Newton step (lesson 03_05). Gradient descent uses the first-order approximation and therefore needs a learning rate; Newton also uses the curvature.&lt;/p&gt;

&lt;h2 id=&quot;exercises&quot;&gt;Exercises&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Basic.&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;Write $T_3$ of $\ln(1+x)$ at 0.&lt;/li&gt;
  &lt;li&gt;Write $T_4$ of $\cos x$ at 0, and $T_2$ of $\tfrac1x$ at $a=1$.&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Answers&lt;/summary&gt;

  &lt;ol&gt;
    &lt;li&gt;$x-\tfrac{x^2}2+\tfrac{x^3}3$.&lt;/li&gt;
    &lt;li&gt;$1-\tfrac{x^2}2+\tfrac{x^4}{24}$; $1-(x-1)+(x-1)^2$.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;p&gt;&lt;strong&gt;Intermediate.&lt;/strong&gt;&lt;/p&gt;

&lt;ol start=&quot;3&quot;&gt;
  &lt;li&gt;What is the smallest degree $n$ for which $T_n(0.1)$ approximates $e^{0.1}$ with error below $10^{-6}$?&lt;/li&gt;
  &lt;li&gt;Compute $\displaystyle\lim_{x\to0}\frac{e^x-1-x}{x^2}$ and $\displaystyle\lim_{x\to0}\frac{1-\cos x}{x^2}$ with Taylor expansions.&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Answers&lt;/summary&gt;

  &lt;ol start=&quot;3&quot;&gt;
    &lt;li&gt;The error is $\le\tfrac{e^{0.1}(0.1)^{n+1}}{(n+1)!}$. For $n=3$: $4.6\times10^{-6}$, not enough; for $n=4$: $9.2\times10^{-8}$. So $n=4$.&lt;/li&gt;
    &lt;li&gt;$\tfrac12$ and $\tfrac12$.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;p&gt;&lt;strong&gt;Advanced.&lt;/strong&gt;&lt;/p&gt;

&lt;ol start=&quot;5&quot;&gt;
  &lt;li&gt;Show that $\cos x\ge1-\tfrac{x^2}2$ for all $x$.&lt;/li&gt;
  &lt;li&gt;Prove that $e$ is irrational. Hint: suppose $e=\tfrac pq$ and multiply $e=T_q(1)+R_q(1)$ by $q!$.&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Hints&lt;/summary&gt;

  &lt;ol start=&quot;5&quot;&gt;
    &lt;li&gt;Let $g(x)=\cos x-1+\tfrac{x^2}2$. Then $g(0)=0$, $g&apos;(x)=x-\sin x\ge0$ for $x\ge0$, and $g$ is even.&lt;/li&gt;
    &lt;li&gt;$q!\,e$ and $q!\,T_q(1)$ are integers, so $q!\,R_q(1)=q!\tfrac{e^c}{(q+1)!}=\tfrac{e^c}{q+1}$ is an integer. But $0&amp;lt;\tfrac{e^c}{q+1}&amp;lt;\tfrac3{q+1}&amp;lt;1$ for $q\ge2$ (and $e$ is not an integer). Contradiction.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;h2 id=&quot;summary&quot;&gt;Summary&lt;/h2&gt;

&lt;div class=&quot;content-box summary-box textbook-block&quot;&gt;
  &lt;ul&gt;
    &lt;li&gt;$T_n(x)=\sum_{k=0}^n\tfrac{f^{(k)}(a)}{k!}(x-a)^k$ matches $f$ up to the $n$-th derivative at $a$.&lt;/li&gt;
    &lt;li&gt;Lagrange: $R_n(x)=\tfrac{f^{(n+1)}(c)}{(n+1)!}(x-a)^{n+1}$, so $\vert R_n\vert \le\tfrac{M\vert x-a\vert ^{n+1}}{(n+1)!}$.&lt;/li&gt;
    &lt;li&gt;Peano: $R_n=o\big((x-a)^n\big)$, useful for limits.&lt;/li&gt;
    &lt;li&gt;Applications: $\sin\theta\approx\theta$ for the pendulum; the quadratic approximation leads to Newton’s method.&lt;/li&gt;
  &lt;/ul&gt;
&lt;/div&gt;
</content>
 </entry>
 
 <entry>
   <title>Rearrangements and the Cauchy product</title>
   <link href="https://calculus-self-learning.pages.dev/contents/en/chapter07/07_05_Rearrangements_and_the_Cauchy_product/"/>
   <updated>2026-12-01T00:00:00+00:00</updated>
   <id>https://calculus-self-learning.pages.dev/contents/en/chapter07/07_05_Rearrangements_and_the_Cauchy_product</id>
   <content type="html">&lt;div class=&quot;textbook-objectives&quot;&gt;

  &lt;p&gt;&lt;strong&gt;Learning objectives.&lt;/strong&gt; This optional lesson helps you:&lt;/p&gt;

  &lt;ul&gt;
    &lt;li&gt;see that rearranging terms can change the sum of a conditionally convergent series;&lt;/li&gt;
    &lt;li&gt;understand the algorithm behind Riemann’s rearrangement theorem;&lt;/li&gt;
    &lt;li&gt;know that the sum of an absolutely convergent series does not depend on the order;&lt;/li&gt;
    &lt;li&gt;multiply two series with the Cauchy product and know when the product converges correctly.&lt;/li&gt;
  &lt;/ul&gt;

&lt;/div&gt;

&lt;h2 id=&quot;why-this-lesson&quot;&gt;Why this lesson&lt;/h2&gt;

&lt;p&gt;For finite sums addition is commutative: changing the order does not change the result. For infinite series this &lt;strong&gt;can fail&lt;/strong&gt;. It is not only a theoretical matter: when a program adds terms in parallel in a different order, or when we multiply two power series (chapter 8), we need to know when rearranging is allowed.&lt;/p&gt;

&lt;h2 id=&quot;a-surprising-example&quot;&gt;A surprising example&lt;/h2&gt;

&lt;p&gt;We know $1-\tfrac12+\tfrac13-\tfrac14+\cdots=\ln2$. Rearrange it: after each positive term take two negative terms.&lt;/p&gt;

\[\left(1-\tfrac12\right)-\tfrac14+\left(\tfrac13-\tfrac16\right)-\tfrac18+\left(\tfrac15-\tfrac1{10}\right)-\tfrac1{12}+\cdots\]

&lt;p&gt;Each bracket is $\tfrac1{2k-1}-\tfrac1{2(2k-1)}=\tfrac1{2(2k-1)}$, so the new series equals&lt;/p&gt;

\[\tfrac12-\tfrac14+\tfrac16-\tfrac18+\cdots=\tfrac12\left(1-\tfrac12+\tfrac13-\cdots\right)=\tfrac12\ln2\approx0.3466 .\]

&lt;p&gt;The same terms in a different order, and the sum is halved. (Computing 200000 groups gives $0.346573$.)&lt;/p&gt;

&lt;h2 id=&quot;riemanns-rearrangement-theorem&quot;&gt;Riemann’s rearrangement theorem&lt;/h2&gt;

&lt;div class=&quot;textbook-theorem&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Theorem 1 (Riemann).&lt;/strong&gt; If $\sum a_n$ converges conditionally, then for every real $L$ (and also $\pm\infty$) there is a rearrangement of its terms whose sum is $L$.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-proof&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Proof sketch.&lt;/strong&gt; Split into positive terms $p_1,p_2,\dots$ and negative terms $-q_1,-q_2,\dots$. Since $\sum a_n$ converges but $\sum\vert a_n\vert =\infty$, both $\sum p_k$ and $\sum q_k$ diverge (if one converged, so would the other, and then $\sum\vert a_n\vert $ would converge), and $p_k,q_k\to0$.&lt;/p&gt;

  &lt;p&gt;Greedy algorithm: take positive terms until the sum exceeds $L$; then negative terms until it drops below $L$; repeat. Each sub-series diverges, so $L$ can always be crossed; at each turn the sum is within the last term taken of $L$, and these terms tend to 0. So the partial sums tend to $L$.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Example 1 (Reaching 1.5).&lt;/strong&gt; For $1-\tfrac12+\tfrac13-\cdots$ and $L=1.5$:&lt;/p&gt;

  &lt;ul&gt;
    &lt;li&gt;$1+\tfrac13+\tfrac15=1.5333&amp;gt;1.5$; stop.&lt;/li&gt;
    &lt;li&gt;$-\tfrac12$: $1.0333&amp;lt;1.5$; stop.&lt;/li&gt;
    &lt;li&gt;$+\tfrac17+\tfrac19+\tfrac1{11}+\tfrac1{13}+\tfrac1{15}$: $1.5218&amp;gt;1.5$; stop.&lt;/li&gt;
    &lt;li&gt;$-\tfrac14$: $1.2718$; and so on.&lt;/li&gt;
  &lt;/ul&gt;

  &lt;p&gt;The oscillations around $1.5$ shrink because the terms shrink.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;interactive-frame&quot;&gt;
  &lt;div class=&quot;interactive-frame-head&quot;&gt;
    &lt;div class=&quot;interactive-frame-title&quot;&gt;Rearranging to reach a sum L&lt;/div&gt;
    &lt;div class=&quot;interactive-frame-desc&quot;&gt;Choose L; the greedy rearrangement drives the partial sums to L.&lt;/div&gt;
  &lt;/div&gt;
  &lt;iframe src=&quot;/interactives/chapter07/rearrangement-en.html&quot; title=&quot;Rearranging to reach a sum L&quot; loading=&quot;lazy&quot; style=&quot;height: 700px;&quot;&gt;&lt;/iframe&gt;
  &lt;div class=&quot;interactive-frame-foot&quot;&gt;
    &lt;a href=&quot;/interactives/chapter07/rearrangement-en.html&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;Open the interactive in a new window&lt;/a&gt;
  &lt;/div&gt;
&lt;/div&gt;

&lt;div class=&quot;reel-video&quot;&gt;
  &lt;video controls=&quot;&quot; playsinline=&quot;&quot; preload=&quot;metadata&quot; src=&quot;/public/videos/reels/riemann-rearrangement.mp4&quot;&gt;&lt;/video&gt;
  &lt;p class=&quot;reel-caption&quot;&gt;Rearranging the alternating harmonic series: partial sums jump back and forth around the target L; change L and the same terms converge to a different number; the pattern of p positive and q negative terms giving ln 2 + ½ ln(p/q), partial sums climbing to infinity, why the positive and negative parts both diverge, and the absolutely convergent series 1 − 1/4 + 1/9 − … whose sum does not change (silent video, about 3 minutes 30 seconds).&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-theorem&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Theorem 2 (Dirichlet).&lt;/strong&gt; If $\sum a_n$ converges absolutely, every rearrangement converges to the same sum.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-proof&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Proof sketch.&lt;/strong&gt; Given $\varepsilon&amp;gt;0$, pick $N$ with $\sum_{n&amp;gt;N}\vert a_n\vert &amp;lt;\varepsilon$. After enough terms, a rearrangement contains all of $a_1,\dots,a_N$. The difference between its partial sum and $S_N$ consists only of terms with index above $N$, so its absolute value is below $\varepsilon$.&lt;/p&gt;
&lt;/div&gt;

&lt;h2 id=&quot;the-cauchy-product&quot;&gt;The Cauchy product&lt;/h2&gt;

&lt;p&gt;To multiply two series, collect the products $a_kb_{n-k}$ with the same index sum, as when multiplying polynomials.&lt;/p&gt;

&lt;div class=&quot;textbook-definition&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Definition.&lt;/strong&gt; The &lt;strong&gt;Cauchy product&lt;/strong&gt; of $\sum_{n\ge0}a_n$ and $\sum_{n\ge0}b_n$ is $\sum_{n\ge0}c_n$ with $c_n=\sum_{k=0}^na_kb_{n-k}$.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-theorem&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Theorem 3 (Mertens).&lt;/strong&gt; If $\sum a_n=A$ converges absolutely and $\sum b_n=B$ converges, the Cauchy product converges with sum $AB$. (If both converge absolutely, so does the Cauchy product.)&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Example 2.&lt;/strong&gt; For $\vert x\vert &amp;lt;1$, square $\sum x^n=\tfrac1{1-x}$: $c_n=\sum_{k=0}^nx^kx^{n-k}=(n+1)x^n$. So&lt;/p&gt;

\[\sum_{n\ge0}(n+1)x^n=\frac1{(1-x)^2}.\]

  &lt;p&gt;At $x=\tfrac12$: $\sum(n+1)2^{-n}=4$, consistent with $\sum k2^{-k}=2$ in lesson 07_03.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Example 3 (Powers of $e$).&lt;/strong&gt; Let $E(a)=\sum\tfrac{a^n}{n!}$ (chapter 8 shows $E(a)=e^a$). The series converges absolutely for every $a$, and by the binomial formula&lt;/p&gt;

\[c_n=\sum_{k=0}^n\frac{a^k}{k!}\frac{b^{n-k}}{(n-k)!}=\frac{(a+b)^n}{n!},\]

  &lt;p&gt;so $E(a)E(b)=E(a+b)$: the rule $e^ae^b=e^{a+b}$ follows from the Cauchy product.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Example 4 (A counterexample).&lt;/strong&gt; Take $a_n=b_n=\tfrac{(-1)^n}{\sqrt{n+1}}$, convergent by Leibniz but not absolutely. Then $c_n=(-1)^n\sum_{k=0}^n\tfrac1{\sqrt{(k+1)(n-k+1)}}$. By AM-GM, $\sqrt{(k+1)(n-k+1)}\le\tfrac{n+2}2$, so $\vert c_n\vert \ge\tfrac{2(n+1)}{n+2}\to2$. The terms do not tend to 0: the Cauchy product diverges.&lt;/p&gt;
&lt;/div&gt;

&lt;h2 id=&quot;applications&quot;&gt;Applications&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Probability: the sum of two independent variables.&lt;/strong&gt; If $X,Y$ are independent with non-negative integer values, $P(X+Y=n)=\sum_kP(X=k)P(Y=n-k)$: exactly a Cauchy product (a convolution). With $X\sim\text{Poisson}(\lambda)$ and $Y\sim\text{Poisson}(\mu)$, example 3 gives $X+Y\sim\text{Poisson}(\lambda+\mu)$.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Computing: parallel summation.&lt;/strong&gt; When a GPU adds millions of numbers in different orders, even for finite data the floating-point results can differ slightly. For conditionally convergent series this becomes a real problem; prefer absolutely convergent representations.&lt;/p&gt;

&lt;h2 id=&quot;exercises&quot;&gt;Exercises&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Basic.&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;Compute the Cauchy product of $\sum x^n$ and $\sum(-1)^nx^n$ for $\vert x\vert &amp;lt;1$, and check it against $\tfrac1{1-x^2}$.&lt;/li&gt;
  &lt;li&gt;Following Riemann’s algorithm, write the first 6 terms of a rearrangement of $1-\tfrac12+\tfrac13-\cdots$ with sum $0$.&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Answers&lt;/summary&gt;

  &lt;ol&gt;
    &lt;li&gt;$c_n=x^n\sum_{k=0}^n(-1)^k$, which is $x^n$ for even $n$ and 0 for odd $n$: $\sum x^{2m}=\tfrac1{1-x^2}$.&lt;/li&gt;
    &lt;li&gt;$1$ (above 0); $-\tfrac12,-\tfrac14,-\tfrac16,-\tfrac18$ (sums $0.5,\ 0.25,\ 0.0833,\ -0.0417$, stopping once below 0); $+\tfrac13$ ($0.2917$). The first six terms: $1,-\tfrac12,-\tfrac14,-\tfrac16,-\tfrac18,\tfrac13$.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;p&gt;&lt;strong&gt;Intermediate.&lt;/strong&gt;&lt;/p&gt;

&lt;ol start=&quot;3&quot;&gt;
  &lt;li&gt;Show that rearranging a convergent positive series does not change its sum.&lt;/li&gt;
  &lt;li&gt;Square the series $\sum\tfrac{x^n}{n!}$ and check the result against $\sum\tfrac{(2x)^n}{n!}$.&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Answers&lt;/summary&gt;

  &lt;ol start=&quot;3&quot;&gt;
    &lt;li&gt;A convergent positive series converges absolutely; apply theorem 2.&lt;/li&gt;
    &lt;li&gt;$c_n=\tfrac{x^n}{n!}\sum_k\binom nk=\tfrac{(2x)^n}{n!}$.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;p&gt;&lt;strong&gt;Advanced.&lt;/strong&gt;&lt;/p&gt;

&lt;ol start=&quot;5&quot;&gt;
  &lt;li&gt;Rearrange $1-\tfrac12+\tfrac13-\cdots$ as two positive terms then one negative: $1+\tfrac13-\tfrac12+\tfrac15+\tfrac17-\tfrac14+\cdots$. Use $\sum_{k\le n}\tfrac1k=\ln n+\gamma+o(1)$ to show the sum is $\tfrac32\ln2$.&lt;/li&gt;
  &lt;li&gt;In the proof of theorem 1, explain why $\sum p_k$ and $\sum q_k$ both diverge.&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Hints&lt;/summary&gt;

  &lt;ol start=&quot;5&quot;&gt;
    &lt;li&gt;After $n$ blocks the sum is $\sum_{k\le 2n}\tfrac1{2k-1}-\sum_{k\le n}\tfrac1{2k}=\left(H_{4n}-\tfrac12H_{2n}\right)-\tfrac12H_n\to\ln4-\tfrac12\ln2=\tfrac32\ln2$.&lt;/li&gt;
    &lt;li&gt;$\sum_{n\le N}a_n=P_N-Q_N$ and $\sum_{n\le N}\vert a_n\vert =P_N+Q_N$. If one of $P_N,Q_N$ converged, the convergent difference would force the other to converge, contradicting $\sum\vert a_n\vert =\infty$.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;h2 id=&quot;summary&quot;&gt;Summary&lt;/h2&gt;

&lt;div class=&quot;content-box summary-box textbook-block&quot;&gt;
  &lt;ul&gt;
    &lt;li&gt;A conditionally convergent series can be rearranged to any sum (Riemann).&lt;/li&gt;
    &lt;li&gt;The sum of an absolutely convergent series does not depend on the order (Dirichlet).&lt;/li&gt;
    &lt;li&gt;The Cauchy product $c_n=\sum a_kb_{n-k}$ converges to $AB$ when at least one series converges absolutely (Mertens); e.g. $e^ae^b=e^{a+b}$.&lt;/li&gt;
    &lt;li&gt;Without absolute convergence the Cauchy product can diverge.&lt;/li&gt;
  &lt;/ul&gt;
&lt;/div&gt;
</content>
 </entry>
 
 <entry>
   <title>Alternating series, absolute and conditional convergence</title>
   <link href="https://calculus-self-learning.pages.dev/contents/en/chapter07/07_04_Alternating_series_and_absolute_convergence/"/>
   <updated>2026-12-01T00:00:00+00:00</updated>
   <id>https://calculus-self-learning.pages.dev/contents/en/chapter07/07_04_Alternating_series_and_absolute_convergence</id>
   <content type="html">&lt;div class=&quot;textbook-objectives&quot;&gt;

  &lt;p&gt;&lt;strong&gt;Learning objectives.&lt;/strong&gt; After this lesson you can:&lt;/p&gt;

  &lt;ul&gt;
    &lt;li&gt;state and prove the Leibniz test for alternating series;&lt;/li&gt;
    &lt;li&gt;estimate the error when truncating an alternating series;&lt;/li&gt;
    &lt;li&gt;distinguish absolute and conditional convergence;&lt;/li&gt;
    &lt;li&gt;prove that absolute convergence implies convergence.&lt;/li&gt;
  &lt;/ul&gt;

&lt;/div&gt;

&lt;h2 id=&quot;why-this-lesson&quot;&gt;Why this lesson&lt;/h2&gt;

&lt;p&gt;The harmonic series $1+\tfrac12+\tfrac13+\cdots$ diverges. But with alternating signs, $1-\tfrac12+\tfrac13-\tfrac14+\cdots$, the terms cancel and the partial sums oscillate around a fixed value, $\ln2\approx0.6931$. Many important expansions (such as $e^{-1}$, $\sin x$, $\arctan x$) are alternating, and for them there is a very simple error estimate.&lt;/p&gt;

&lt;h2 id=&quot;the-leibniz-test&quot;&gt;The Leibniz test&lt;/h2&gt;

&lt;div class=&quot;textbook-definition&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Definition.&lt;/strong&gt; An &lt;strong&gt;alternating&lt;/strong&gt; series has the form $\sum_{n\ge1}(-1)^{n+1}b_n=b_1-b_2+b_3-\cdots$ with $b_n&amp;gt;0$.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-theorem&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Theorem 1 (Leibniz).&lt;/strong&gt; If $b_n$ decreases and $b_n\to0$, the series $\sum(-1)^{n+1}b_n$ converges to a sum $S$, and for every $N$:&lt;/p&gt;

\[|S-S_N|\le b_{N+1},\]

  &lt;p&gt;and $S-S_N$ has the sign of the first omitted term.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-proof&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Proof.&lt;/strong&gt; Consider the even partial sums: $S_{2m+2}=S_{2m}+(b_{2m+1}-b_{2m+2})\ge S_{2m}$, so $(S_{2m})$ increases. Also $S_{2m}=b_1-(b_2-b_3)-\cdots-(b_{2m-2}-b_{2m-1})-b_{2m}\le b_1$. By the monotone convergence theorem, $S_{2m}\to S$. Since $S_{2m+1}=S_{2m}+b_{2m+1}$ and $b_{2m+1}\to0$, also $S_{2m+1}\to S$. Hence $S_N\to S$.&lt;/p&gt;

  &lt;p&gt;Likewise the odd partial sums decrease, so $S_{2m}\le S\le S_{2m+1}$ for all $m$: $S$ always lies between two consecutive partial sums. Therefore $\vert S-S_N\vert \le\vert S_{N+1}-S_N\vert =b_{N+1}$.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Example 1 ($1/e$).&lt;/strong&gt; Chapter 8 shows that $\dfrac1e=\sum_{n\ge0}\dfrac{(-1)^n}{n!}=1-1+\tfrac12-\tfrac16+\tfrac1{24}-\tfrac1{120}+\cdots$. The sum up to $n=5$:&lt;/p&gt;

\[S=1-1+0.5-0.16667+0.04167-0.00833=0.36667 .\]

  &lt;p&gt;The error is at most the next term, $\tfrac1{720}\approx0.00139$. In fact $\tfrac1e=0.367879$, an error of $0.00121$.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Example 2 (How many terms).&lt;/strong&gt; To compute $\sum_{n\ge1}\dfrac{(-1)^{n+1}}{n^4}$ with error below $10^{-4}$ we need $\tfrac1{(N+1)^4}&amp;lt;10^{-4}$, i.e. $N+1&amp;gt;10$, so $N=10$ terms. For $1-\tfrac12+\tfrac13-\cdots$ the same accuracy needs $N\ge10^4$ terms: conditionally convergent series often converge very slowly.&lt;/p&gt;
&lt;/div&gt;

&lt;h2 id=&quot;absolute-and-conditional-convergence&quot;&gt;Absolute and conditional convergence&lt;/h2&gt;

&lt;div class=&quot;textbook-definition&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Definition.&lt;/strong&gt; A series $\sum a_n$ &lt;strong&gt;converges absolutely&lt;/strong&gt; if $\sum\vert a_n\vert $ converges. A series that converges but not absolutely is &lt;strong&gt;conditionally convergent&lt;/strong&gt;.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-theorem&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Theorem 2.&lt;/strong&gt; Absolute convergence implies convergence.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-proof&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Proof.&lt;/strong&gt; We have $0\le a_n+\vert a_n\vert \le2\vert a_n\vert $. By comparison, $\sum(a_n+\vert a_n\vert )$ converges. So $\sum a_n=\sum(a_n+\vert a_n\vert )-\sum\vert a_n\vert $ is a difference of two convergent series.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Example 3.&lt;/strong&gt;&lt;/p&gt;

  &lt;ul&gt;
    &lt;li&gt;$\sum\dfrac{(-1)^n}{n^2}$ converges absolutely.&lt;/li&gt;
    &lt;li&gt;$\sum\dfrac{(-1)^{n+1}}n$ converges conditionally: it converges by Leibniz (sum $\ln2$), but its absolute series is the harmonic series.&lt;/li&gt;
    &lt;li&gt;$\sum\dfrac{\sin n}{n^2}$ (signs not regularly alternating): $\left\lvert\dfrac{\sin n}{n^2}\right\rvert\le\dfrac1{n^2}$, so it converges absolutely.&lt;/li&gt;
    &lt;li&gt;In general, $\sum\dfrac{(-1)^n}{n^p}$ converges absolutely for $p&amp;gt;1$, conditionally for $0&amp;lt;p\le1$, and diverges for $p\le0$.&lt;/li&gt;
  &lt;/ul&gt;
&lt;/div&gt;

&lt;p&gt;The ratio and root tests (lesson 07_03) apply to $\vert a_n\vert $: if $\rho&amp;lt;1$ the series converges absolutely; if $\rho&amp;gt;1$ the terms do not tend to 0 and the series diverges.&lt;/p&gt;

&lt;p&gt;The difference between the two kinds of convergence runs deep: lesson 07_05 shows that only absolutely convergent series can be rearranged without changing the sum.&lt;/p&gt;

&lt;h2 id=&quot;applications&quot;&gt;Applications&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Physics: the energy of a crystal (the Madelung constant).&lt;/strong&gt; In a line of alternating positive and negative ions spaced $d$ apart, the potential energy of one ion is proportional to $2\left(1-\tfrac12+\tfrac13-\cdots\right)=2\ln2\approx1.386$. This series converges conditionally; in three-dimensional crystals (such as NaCl) the analogous sums depend on the order of summation, and physicists use special summation methods (Ewald).&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Numerics: a free error estimate.&lt;/strong&gt; When a function has an alternating expansion with decreasing terms, such as $\sin x=x-\tfrac{x^3}6+\cdots$ for $\vert x\vert \le1$, theorem 1 gives the error at once: $\vert \sin x-x\vert \le\tfrac{\vert x\vert ^3}6$. For $x=0.1$ the error is below $1.7\times10^{-4}$.&lt;/p&gt;

&lt;h2 id=&quot;exercises&quot;&gt;Exercises&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Basic.&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;Absolutely convergent, conditionally convergent or divergent: $\sum\dfrac{(-1)^n}{\sqrt n}$, $\sum\dfrac{(-1)^n n}{n+1}$, $\sum\dfrac{(-1)^n}{2^n}$.&lt;/li&gt;
  &lt;li&gt;Compute $\sum_{n\ge1}\dfrac{(-1)^{n+1}}{n^3}$ with error below $0.01$.&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Answers&lt;/summary&gt;

  &lt;ol&gt;
    &lt;li&gt;Conditionally convergent; divergent (terms do not tend to 0); absolutely convergent.&lt;/li&gt;
    &lt;li&gt;We need $\tfrac1{(N+1)^3}&amp;lt;0.01$, so $N=4$: $1-\tfrac18+\tfrac1{27}-\tfrac1{64}\approx0.896$ (true value $0.9015$).&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;p&gt;&lt;strong&gt;Intermediate.&lt;/strong&gt;&lt;/p&gt;

&lt;ol start=&quot;3&quot;&gt;
  &lt;li&gt;Show that $\sum_{n\ge2}\dfrac{(-1)^n}{\ln n}$ converges conditionally.&lt;/li&gt;
  &lt;li&gt;For which $x$ does $\sum\dfrac{x^n}n$ converge absolutely, conditionally?&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Answers&lt;/summary&gt;

  &lt;ol start=&quot;3&quot;&gt;
    &lt;li&gt;$\tfrac1{\ln n}$ decreases to 0: convergent by Leibniz. $\tfrac1{\ln n}&amp;gt;\tfrac1n$, so the absolute series diverges.&lt;/li&gt;
    &lt;li&gt;The ratio tends to $\vert x\vert $: absolutely convergent for $\vert x\vert &amp;lt;1$, divergent for $\vert x\vert &amp;gt;1$. At $x=1$ divergent (harmonic); at $x=-1$ conditionally convergent.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;p&gt;&lt;strong&gt;Advanced.&lt;/strong&gt;&lt;/p&gt;

&lt;ol start=&quot;5&quot;&gt;
  &lt;li&gt;Explain why “$b_n$ decreasing” is needed in the Leibniz test: consider $\tfrac1{\sqrt2-1}-\tfrac1{\sqrt2+1}+\tfrac1{\sqrt3-1}-\tfrac1{\sqrt3+1}+\cdots$.&lt;/li&gt;
  &lt;li&gt;Show that if $\sum a_n$ converges absolutely then $\sum a_n^2$ converges. Is the converse true?&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Hints&lt;/summary&gt;

  &lt;ol start=&quot;5&quot;&gt;
    &lt;li&gt;Each pair equals $\dfrac1{\sqrt n-1}-\dfrac1{\sqrt n+1}=\dfrac2{n-1}$; the sum of the pairs diverges like the harmonic series, even though $b_n\to0$.&lt;/li&gt;
    &lt;li&gt;$\vert a_n\vert \to0$, so $\vert a_n\vert &amp;lt;1$ for large $n$ and $a_n^2\le\vert a_n\vert $. The converse fails: $a_n=\tfrac1n$.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;h2 id=&quot;summary&quot;&gt;Summary&lt;/h2&gt;

&lt;div class=&quot;content-box summary-box textbook-block&quot;&gt;
  &lt;ul&gt;
    &lt;li&gt;Leibniz: if $b_n$ decreases to 0, $\sum(-1)^{n+1}b_n$ converges and $\vert S-S_N\vert \le b_{N+1}$.&lt;/li&gt;
    &lt;li&gt;Absolute convergence ($\sum\vert a_n\vert &amp;lt;\infty$) implies convergence.&lt;/li&gt;
    &lt;li&gt;Conditional convergence: convergent but $\sum\vert a_n\vert =\infty$, e.g. $\sum\tfrac{(-1)^{n+1}}n=\ln2$; often slow.&lt;/li&gt;
    &lt;li&gt;The ratio and root tests applied to $\vert a_n\vert $ give absolute convergence.&lt;/li&gt;
  &lt;/ul&gt;
&lt;/div&gt;
</content>
 </entry>
 
 <entry>
   <title>Convergence tests for positive series</title>
   <link href="https://calculus-self-learning.pages.dev/contents/en/chapter07/07_03_Convergence_tests_for_positive_series/"/>
   <updated>2026-12-01T00:00:00+00:00</updated>
   <id>https://calculus-self-learning.pages.dev/contents/en/chapter07/07_03_Convergence_tests_for_positive_series</id>
   <content type="html">&lt;div class=&quot;textbook-objectives&quot;&gt;

  &lt;p&gt;&lt;strong&gt;Learning objectives.&lt;/strong&gt; After this lesson you can:&lt;/p&gt;

  &lt;ul&gt;
    &lt;li&gt;use the integral test to show that the $p$-series converges exactly when $p&amp;gt;1$, and estimate the remainder;&lt;/li&gt;
    &lt;li&gt;use the comparison and limit comparison tests against $p$-series or geometric series;&lt;/li&gt;
    &lt;li&gt;use the ratio and root tests for terms with factorials or $n$-th powers;&lt;/li&gt;
    &lt;li&gt;choose a suitable test for each kind of term.&lt;/li&gt;
  &lt;/ul&gt;

&lt;/div&gt;

&lt;h2 id=&quot;why-this-lesson&quot;&gt;Why this lesson&lt;/h2&gt;

&lt;p&gt;Very few series can be summed exactly like the geometric series. Usually we just need to know whether a series converges and then approximate its sum by computer. For a positive series $a_n\ge0$ the partial sums increase, so by the monotone convergence theorem (lesson 07_01): &lt;strong&gt;a positive series converges if and only if its partial sums are bounded above&lt;/strong&gt;. Every test in this lesson rests on this remark.&lt;/p&gt;

&lt;h2 id=&quot;the-integral-test&quot;&gt;The integral test&lt;/h2&gt;

&lt;div class=&quot;textbook-theorem&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Theorem 1 (Integral test).&lt;/strong&gt; Let $f$ be continuous, positive and decreasing on $[1,\infty)$, and $a_n=f(n)$. Then $\sum a_n$ and $\int_1^\infty f(x)\,dx$ both converge or both diverge. When they converge, the remainder $R_N=\sum_{n&amp;gt;N}a_n$ satisfies&lt;/p&gt;

\[\int_{N+1}^\infty f(x)\,dx\le R_N\le\int_N^\infty f(x)\,dx .\]

&lt;/div&gt;

&lt;div class=&quot;textbook-proof&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Proof.&lt;/strong&gt; Since $f$ decreases, $f(n+1)\le f(x)\le f(n)$ on $[n,n+1]$. Integrating: $a_{n+1}\le\int_n^{n+1}f\le a_n$. Summing from $n=1$ to $N-1$: $S_N-a_1\le\int_1^Nf\le S_{N-1}$. If the integral converges, $S_N\le a_1+\int_1^\infty f$ is bounded; if it diverges, $S_{N-1}\ge\int_1^Nf\to\infty$. The remainder estimate is the same argument on $[N,\infty)$.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-theorem&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Corollary ($p$-series).&lt;/strong&gt; $\displaystyle\sum_{n=1}^\infty\frac1{n^p}$ converges if and only if $p&amp;gt;1$ (compare $\int_1^\infty x^{-p}\,dx$, lesson 05_05).&lt;/p&gt;
&lt;/div&gt;

&lt;p&gt;The integral test also explains why $\sum_{n\le N}\tfrac1n\approx\ln N$. A famous result (Euler): $\sum\tfrac1{n^2}=\tfrac{\pi^2}6\approx1.645$; chapter 8 shows why.&lt;/p&gt;

&lt;h2 id=&quot;comparison&quot;&gt;Comparison&lt;/h2&gt;

&lt;div class=&quot;textbook-theorem&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Theorem 2 (Comparison).&lt;/strong&gt; If $0\le a_n\le b_n$ for all large $n$: if $\sum b_n$ converges so does $\sum a_n$; if $\sum a_n$ diverges so does $\sum b_n$.&lt;/p&gt;

  &lt;p&gt;&lt;strong&gt;Theorem 3 (Limit comparison).&lt;/strong&gt; If $a_n,b_n&amp;gt;0$ and $\dfrac{a_n}{b_n}\to L\in(0,\infty)$, the two series both converge or both diverge.&lt;/p&gt;
&lt;/div&gt;

&lt;p&gt;The proofs are as for improper integrals (lesson 05_05): the partial sums of $\sum a_n$ are bounded by those of $\sum b_n$. Tip: keep the “dominant” terms of numerator and denominator to guess the comparison series.&lt;/p&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Example 1.&lt;/strong&gt;&lt;/p&gt;

  &lt;ul&gt;
    &lt;li&gt;$\sum\dfrac1{n^2+1}$ converges: $\dfrac1{n^2+1}&amp;lt;\dfrac1{n^2}$.&lt;/li&gt;
    &lt;li&gt;$\sum\dfrac1{\sqrt n}$ diverges: a $p$-series with $p=\tfrac12$.&lt;/li&gt;
    &lt;li&gt;$\sum\dfrac{2n+3}{n^3-n+5}$ converges: limit comparison with $\dfrac{2n}{n^3}=\dfrac2{n^2}$, the ratio tends to 1.&lt;/li&gt;
    &lt;li&gt;$\sum\dfrac{\ln n}{n^2}$ converges: for large $n$, $\ln n\le\sqrt n$, so the term is $\le\dfrac1{n^{3/2}}$.&lt;/li&gt;
  &lt;/ul&gt;
&lt;/div&gt;

&lt;h2 id=&quot;the-ratio-and-root-tests&quot;&gt;The ratio and root tests&lt;/h2&gt;

&lt;div class=&quot;textbook-theorem&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Theorem 4 (Ratio test, d’Alembert).&lt;/strong&gt; Let $a_n&amp;gt;0$ with $\dfrac{a_{n+1}}{a_n}\to\rho$. If $\rho&amp;lt;1$ the series converges; if $\rho&amp;gt;1$ it diverges; if $\rho=1$ the test is inconclusive.&lt;/p&gt;

  &lt;p&gt;&lt;strong&gt;Theorem 5 (Root test, Cauchy).&lt;/strong&gt; Let $a_n\ge0$ with $\sqrt[n]{a_n}\to\rho$. Same conclusions.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-proof&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Proof (theorem 4, case $\rho&amp;lt;1$).&lt;/strong&gt; Pick $q$ with $\rho&amp;lt;q&amp;lt;1$. There is $N$ with $\dfrac{a_{n+1}}{a_n}&amp;lt;q$ for $n\ge N$, so $a_{N+k}&amp;lt;a_Nq^k$. The geometric series $\sum a_Nq^k$ converges; use comparison. If $\rho&amp;gt;1$, $a_n$ increases from some index on and does not tend to 0.&lt;/p&gt;
&lt;/div&gt;

&lt;p&gt;For the $p$-series, $\tfrac{a_{n+1}}{a_n}=\left(\tfrac n{n+1}\right)^p\to1$ for every $p$: the ratio test cannot tell $p&amp;gt;1$ from $p\le1$.&lt;/p&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Example 2.&lt;/strong&gt;&lt;/p&gt;

  &lt;ul&gt;
    &lt;li&gt;$\sum\dfrac{2^n}{n!}$: $\dfrac{a_{n+1}}{a_n}=\dfrac2{n+1}\to0$, convergent (the sum is $e^2-1$, chapter 8).&lt;/li&gt;
    &lt;li&gt;$\sum\dfrac{n!}{n^n}$: $\dfrac{a_{n+1}}{a_n}=\left(\dfrac n{n+1}\right)^n\to\dfrac1e&amp;lt;1$, convergent.&lt;/li&gt;
    &lt;li&gt;$\sum\left(\dfrac n{2n+1}\right)^n$: $\sqrt[n]{a_n}=\dfrac n{2n+1}\to\dfrac12$, convergent.&lt;/li&gt;
  &lt;/ul&gt;
&lt;/div&gt;

&lt;div class=&quot;content-box insight-box textbook-block&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Choosing a test.&lt;/strong&gt;&lt;/p&gt;

  &lt;ol&gt;
    &lt;li&gt;Terms do not tend to 0? Divergent at once.&lt;/li&gt;
    &lt;li&gt;A ratio of powers of $n$ (with roots or $\ln$)? Comparison or limit comparison with a $p$-series.&lt;/li&gt;
    &lt;li&gt;Contains $n!$, $a^n$, $n^n$? Ratio test.&lt;/li&gt;
    &lt;li&gt;The whole term is an $n$-th power? Root test.&lt;/li&gt;
    &lt;li&gt;The term is $f(n)$ with $f$ easy to integrate (like $\tfrac1{n\ln n}$)? Integral test.&lt;/li&gt;
  &lt;/ol&gt;
&lt;/div&gt;

&lt;div class=&quot;interactive-frame&quot;&gt;
  &lt;div class=&quot;interactive-frame-head&quot;&gt;
    &lt;div class=&quot;interactive-frame-title&quot;&gt;Convergence tests&lt;/div&gt;
    &lt;div class=&quot;interactive-frame-desc&quot;&gt;Partial sums, ratio, n-th root and comparison with 1/nᵖ.&lt;/div&gt;
  &lt;/div&gt;
  &lt;iframe src=&quot;/interactives/chapter07/series-tests-en.html&quot; title=&quot;Convergence tests&quot; loading=&quot;lazy&quot; style=&quot;height: 700px;&quot;&gt;&lt;/iframe&gt;
  &lt;div class=&quot;interactive-frame-foot&quot;&gt;
    &lt;a href=&quot;/interactives/chapter07/series-tests-en.html&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;Open the interactive in a new window&lt;/a&gt;
  &lt;/div&gt;
&lt;/div&gt;

&lt;h2 id=&quot;applications&quot;&gt;Applications&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Machine learning: the Robbins–Monro conditions.&lt;/strong&gt; Stochastic gradient descent converges (under suitable assumptions) when the learning rates satisfy $\sum\eta_n=\infty$ and $\sum\eta_n^2&amp;lt;\infty$. The schedule $\eta_n=\tfrac1n$ satisfies both (the harmonic series diverges, $\sum\tfrac1{n^2}$ converges). The schedule $\eta_n=\tfrac1{\sqrt n}$ fails the second condition, and so does a constant learning rate.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Computation: error estimates.&lt;/strong&gt; How many terms make $\sum\tfrac1{n^3}$ accurate to $10^{-3}$? By theorem 1, $R_N\le\int_N^\infty\tfrac{dx}{x^3}=\tfrac1{2N^2}&amp;lt;10^{-3}$ when $N\ge23$.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Computer science: expected number of steps.&lt;/strong&gt; A randomised algorithm stops at step $k$ with probability $2^{-k}$. The mean number of steps $\sum\tfrac k{2^k}$ converges by the ratio test ($\rho=\tfrac12$) and equals 2 (exercise 6 of lesson 07_02).&lt;/p&gt;

&lt;h2 id=&quot;exercises&quot;&gt;Exercises&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Basic.&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;Decide convergence: $\sum\dfrac1{n^3+n}$, $\sum\dfrac1{2n-1}$.&lt;/li&gt;
  &lt;li&gt;Decide convergence: $\sum\dfrac{n^2}{3^n}$, $\sum\dfrac{(2n)!}{(n!)^2}$.&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Answers&lt;/summary&gt;

  &lt;ol&gt;
    &lt;li&gt;Convergent (compare $\tfrac1{n^3}$); divergent (limit comparison with $\tfrac1n$).&lt;/li&gt;
    &lt;li&gt;Ratio $\to\tfrac13$: convergent. Ratio $\dfrac{(2n+2)(2n+1)}{(n+1)^2}\to4$: divergent.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;p&gt;&lt;strong&gt;Intermediate.&lt;/strong&gt;&lt;/p&gt;

&lt;ol start=&quot;3&quot;&gt;
  &lt;li&gt;Decide convergence: $\sum_{n\ge2}\dfrac1{n\ln n}$ and $\sum_{n\ge2}\dfrac1{n(\ln n)^2}$.&lt;/li&gt;
  &lt;li&gt;For fixed $k$, show that $\sum\dfrac{n^k}{e^n}$ converges.&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Answers&lt;/summary&gt;

  &lt;ol start=&quot;3&quot;&gt;
    &lt;li&gt;Integral test: $\int\tfrac{dx}{x\ln x}=\ln\ln x\to\infty$, divergent; $\int\tfrac{dx}{x(\ln x)^2}=-\tfrac1{\ln x}$ converges, so the series converges.&lt;/li&gt;
    &lt;li&gt;Ratio $\left(\tfrac{n+1}n\right)^k\tfrac1e\to\tfrac1e&amp;lt;1$.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;p&gt;&lt;strong&gt;Advanced.&lt;/strong&gt;&lt;/p&gt;

&lt;ol start=&quot;5&quot;&gt;
  &lt;li&gt;Use the integral test to show $1.6\le\sum_{n=1}^\infty\tfrac1{n^2}\le1.7$ from the first 3 terms only.&lt;/li&gt;
  &lt;li&gt;Show that $\ln(N+1)\le\sum_{n=1}^N\tfrac1n\le1+\ln N$.&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Hints&lt;/summary&gt;

  &lt;ol start=&quot;5&quot;&gt;
    &lt;li&gt;$S_3=1+\tfrac14+\tfrac19\approx1.3611$. The remainder satisfies $\int_4^\infty\tfrac{dx}{x^2}=\tfrac14\le R_3\le\int_3^\infty\tfrac{dx}{x^2}=\tfrac13$. The sum lies in $[1.611,\ 1.695]$.&lt;/li&gt;
    &lt;li&gt;From the proof of theorem 1 with $f=\tfrac1x$: $\int_1^{N+1}\tfrac{dx}x\le S_N\le1+\int_1^N\tfrac{dx}x$.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;h2 id=&quot;summary&quot;&gt;Summary&lt;/h2&gt;

&lt;div class=&quot;content-box summary-box textbook-block&quot;&gt;
  &lt;ul&gt;
    &lt;li&gt;A positive series converges if and only if its partial sums are bounded.&lt;/li&gt;
    &lt;li&gt;Integral test: $\sum f(n)$ and $\int_1^\infty f$ behave alike; the $p$-series converges exactly when $p&amp;gt;1$; the remainder lies between two integrals.&lt;/li&gt;
    &lt;li&gt;Comparison and limit comparison: match against a $p$-series or a geometric series.&lt;/li&gt;
    &lt;li&gt;Ratio and root tests: $\rho&amp;lt;1$ converges, $\rho&amp;gt;1$ diverges, $\rho=1$ inconclusive; suited to factorials and $n$-th powers.&lt;/li&gt;
  &lt;/ul&gt;
&lt;/div&gt;
</content>
 </entry>
 
 <entry>
   <title>Series, geometric series and the harmonic series</title>
   <link href="https://calculus-self-learning.pages.dev/contents/en/chapter07/07_02_Series_geometric_and_harmonic_series/"/>
   <updated>2026-12-01T00:00:00+00:00</updated>
   <id>https://calculus-self-learning.pages.dev/contents/en/chapter07/07_02_Series_geometric_and_harmonic_series</id>
   <content type="html">&lt;div class=&quot;textbook-objectives&quot;&gt;

  &lt;p&gt;&lt;strong&gt;Learning objectives.&lt;/strong&gt; After this lesson you can:&lt;/p&gt;

  &lt;ul&gt;
    &lt;li&gt;define the sum of a series through its sequence of partial sums;&lt;/li&gt;
    &lt;li&gt;sum geometric and telescoping series;&lt;/li&gt;
    &lt;li&gt;use the term test $a_n\to0$ to show that a series diverges;&lt;/li&gt;
    &lt;li&gt;prove that the harmonic series diverges and estimate its partial sums;&lt;/li&gt;
    &lt;li&gt;compute the present value of an annuity and the discounted return in reinforcement learning.&lt;/li&gt;
  &lt;/ul&gt;

&lt;/div&gt;

&lt;h2 id=&quot;why-this-lesson&quot;&gt;Why this lesson&lt;/h2&gt;

&lt;p&gt;A ball bounces infinitely many times; is the total distance finite? An allowance paid every year for ever is worth how much today? A reinforcement learning agent receives a reward at each step, each later step multiplied by $\gamma&amp;lt;1$; what is the total reward? All three questions are sums of &lt;strong&gt;infinitely many&lt;/strong&gt; terms.&lt;/p&gt;

&lt;h2 id=&quot;series-and-partial-sums&quot;&gt;Series and partial sums&lt;/h2&gt;

&lt;div class=&quot;textbook-definition&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Definition 1 (Series).&lt;/strong&gt; For a sequence $(a_n)$, the $N$-th partial sum is $S_N=a_1+a_2+\dots+a_N$. The series $\sum_{n=1}^\infty a_n$ &lt;strong&gt;converges&lt;/strong&gt; with sum $S$ if $S_N\to S$; otherwise it &lt;strong&gt;diverges&lt;/strong&gt;.&lt;/p&gt;
&lt;/div&gt;

&lt;p&gt;If $\sum a_n=A$ and $\sum b_n=B$, then $\sum(\alpha a_n+\beta b_n)=\alpha A+\beta B$ (limit laws for partial sums). Removing or adding finitely many terms does not change convergence.&lt;/p&gt;

&lt;div class=&quot;textbook-theorem&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Theorem 1 (Geometric series).&lt;/strong&gt; For $a\ne0$, the series $\sum_{n=0}^\infty ar^n$ converges if and only if $\lvert r\rvert&amp;lt;1$, and then&lt;/p&gt;

\[\sum_{n=0}^\infty ar^n=\frac a{1-r} .\]

&lt;/div&gt;

&lt;div class=&quot;textbook-proof&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Proof.&lt;/strong&gt; For $r\ne1$: $S_N=a+ar+\dots+ar^N$ and $rS_N=ar+\dots+ar^{N+1}$. Subtracting, $(1-r)S_N=a(1-r^{N+1})$, so $S_N=a\dfrac{1-r^{N+1}}{1-r}$. When $\lvert r\rvert&amp;lt;1$, $r^{N+1}\to0$ and $S_N\to\dfrac a{1-r}$. When $\lvert r\rvert\ge1$, $ar^N$ does not tend to 0, so the series diverges (theorem 2).&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Example 1.&lt;/strong&gt;&lt;/p&gt;

  &lt;ul&gt;
    &lt;li&gt;$0.999\ldots=\dfrac9{10}+\dfrac9{100}+\dots=\dfrac{9/10}{1-1/10}=1$.&lt;/li&gt;
    &lt;li&gt;$\sum_{n=1}^\infty\dfrac1{n(n+1)}$: since $\dfrac1{n(n+1)}=\dfrac1n-\dfrac1{n+1}$, the partial sums &lt;strong&gt;telescope&lt;/strong&gt;: $S_N=1-\dfrac1{N+1}\to1$.&lt;/li&gt;
  &lt;/ul&gt;
&lt;/div&gt;

&lt;h2 id=&quot;the-term-test-and-the-harmonic-series&quot;&gt;The term test and the harmonic series&lt;/h2&gt;

&lt;div class=&quot;textbook-theorem&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Theorem 2 (Term test).&lt;/strong&gt; If $\sum a_n$ converges, then $a_n\to0$. Equivalently: if $a_n\not\to0$, the series diverges.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-proof&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Proof.&lt;/strong&gt; $a_n=S_n-S_{n-1}\to S-S=0$.&lt;/p&gt;
&lt;/div&gt;

&lt;p&gt;The converse is &lt;strong&gt;false&lt;/strong&gt;: $a_n\to0$ is not enough for convergence.&lt;/p&gt;

&lt;div class=&quot;textbook-theorem&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Theorem 3 (The harmonic series diverges).&lt;/strong&gt; $\displaystyle\sum_{n=1}^\infty\frac1n=\infty$, even though $\dfrac1n\to0$.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-proof&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Proof (Oresme, 14th century).&lt;/strong&gt; Group the terms in blocks of $1,1,2,4,8,\dots$:&lt;/p&gt;

\[1+\tfrac12+\left(\tfrac13+\tfrac14\right)+\left(\tfrac15+\dots+\tfrac18\right)+\dots\ge1+\tfrac12+\tfrac24+\tfrac48+\dots\]

  &lt;p&gt;The block $\left(\tfrac1{2^{k-1}+1}+\dots+\tfrac1{2^k}\right)$ has $2^{k-1}$ terms, each $\ge\tfrac1{2^k}$, so the block is $\ge\tfrac12$. Hence $S_{2^k}\ge1+\tfrac k2\to\infty$. The partial sums increase, so $S_N\to\infty$.&lt;/p&gt;
&lt;/div&gt;

&lt;p&gt;The harmonic series diverges very slowly: $S_N\approx\ln N+0.5772$ (the Euler–Mascheroni constant; lesson 07_03 explains the $\ln N$). A million terms give only $S_{10^6}\approx14.39$.&lt;/p&gt;

&lt;h2 id=&quot;short-video&quot;&gt;Short video&lt;/h2&gt;

&lt;div class=&quot;reel-video&quot;&gt;
  &lt;video controls=&quot;&quot; playsinline=&quot;&quot; preload=&quot;metadata&quot; src=&quot;/public/videos/reels/harmonic-stacking.mp4&quot;&gt;&lt;/video&gt;
  &lt;p class=&quot;reel-caption&quot;&gt;Stacking blocks over a table edge: the overhang is half the harmonic sum and grows without bound (silent video, about 2 minutes).&lt;/p&gt;
&lt;/div&gt;

&lt;h2 id=&quot;applications&quot;&gt;Applications&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Economics: annuities.&lt;/strong&gt; You receive $P$ at the end of each year for $n$ years, with interest rate $i$ per year. The present value is a finite geometric sum with ratio $\tfrac1{1+i}$:&lt;/p&gt;

\[PV=\sum_{k=1}^n\frac P{(1+i)^k}=P\,\frac{1-(1+i)^{-n}}i .\]

&lt;p&gt;With $P=10$ million, $i=8\%$, $n=10$: $PV\approx67.10$ million. As $n\to\infty$ (a perpetuity): $PV=\tfrac Pi=125$ million.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Machine learning: discounting in reinforcement learning.&lt;/strong&gt; The discounted return is $G=\sum_{k=0}^\infty\gamma^kr_k$. If every $\lvert r_k\rvert\le R$ and $0\le\gamma&amp;lt;1$, then $\lvert G\rvert\le\dfrac R{1-\gamma}$. With $\gamma=0.9$ and reward 1 at every step, $G=10$: $\tfrac1{1-\gamma}$ is often called the agent’s “effective horizon”.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Computer science: divide and conquer.&lt;/strong&gt; If each level of recursion works on half the data of the previous one (e.g. quickselect for the median in the good case), the total work is $n+\tfrac n2+\tfrac n4+\dots\le2n$: linear.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Physics: a bouncing ball.&lt;/strong&gt; Dropped from 2 m, rebounding to 80% each time. Distance $=2+2\sum_{k=1}^\infty2\cdot0.8^k=2+2\cdot\dfrac{1.6}{0.2}=18$ m: infinitely many bounces but a finite distance.&lt;/p&gt;

&lt;h2 id=&quot;exercises&quot;&gt;Exercises&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Basic.&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;Compute $\sum_{n=0}^\infty\left(\tfrac23\right)^n$ and $\sum_{n=1}^\infty3\left(-\tfrac12\right)^n$.&lt;/li&gt;
  &lt;li&gt;Write $0.272727\ldots$ as a fraction.&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Answers&lt;/summary&gt;

  &lt;ol&gt;
    &lt;li&gt;$3$; $3\cdot\dfrac{-1/2}{1+1/2}=-1$.&lt;/li&gt;
    &lt;li&gt;$\dfrac{27}{100}\cdot\dfrac1{1-1/100}=\dfrac{27}{99}=\dfrac3{11}$.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;p&gt;&lt;strong&gt;Intermediate.&lt;/strong&gt;&lt;/p&gt;

&lt;ol start=&quot;3&quot;&gt;
  &lt;li&gt;Compute $\sum_{n=1}^\infty\dfrac1{n^2+3n+2}$.&lt;/li&gt;
  &lt;li&gt;Show that $\sum\dfrac n{n+1}$ and $\sum\ln\left(1+\dfrac1n\right)$ diverge.&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Answers&lt;/summary&gt;

  &lt;ol start=&quot;3&quot;&gt;
    &lt;li&gt;$\dfrac1{(n+1)(n+2)}=\dfrac1{n+1}-\dfrac1{n+2}$ telescopes: the sum is $\tfrac12$.&lt;/li&gt;
    &lt;li&gt;$\tfrac n{n+1}\to1\ne0$. For the second, $a_n\to0$ but the partial sums telescope: $S_N=\ln(N+1)\to\infty$.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;p&gt;&lt;strong&gt;Advanced.&lt;/strong&gt;&lt;/p&gt;

&lt;ol start=&quot;5&quot;&gt;
  &lt;li&gt;A geometric random variable $X$ (the number of trials until the first success, success probability $p$) has $P(X=k)=p(1-p)^{k-1}$. Show the probabilities add to 1 and $E[X]=\sum_{k\ge1}kp(1-p)^{k-1}=\dfrac1p$.&lt;/li&gt;
  &lt;li&gt;For $\lvert x\rvert&amp;lt;1$, compute $\sum_{k=1}^\infty kx^k$ and deduce $\sum_{k\ge1}\dfrac k{2^k}$.&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Hints&lt;/summary&gt;

  &lt;ol start=&quot;5&quot;&gt;
    &lt;li&gt;A geometric series with ratio $q=1-p$. With $T=\sum kq^{k-1}$: $T-qT=\sum_{k\ge0}q^k=\tfrac1{1-q}$, so $T=\tfrac1{(1-q)^2}=\tfrac1{p^2}$ and $E[X]=pT=\tfrac1p$.&lt;/li&gt;
    &lt;li&gt;The same trick: $\sum kx^k=\dfrac x{(1-x)^2}$. With $x=\tfrac12$ the sum is 2.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;h2 id=&quot;summary&quot;&gt;Summary&lt;/h2&gt;

&lt;div class=&quot;content-box summary-box textbook-block&quot;&gt;
  &lt;ul&gt;
    &lt;li&gt;$\sum a_n=\lim S_N$; a series converges when its partial sums converge.&lt;/li&gt;
    &lt;li&gt;Geometric series: $\sum_{n\ge0}ar^n=\tfrac a{1-r}$ for $\lvert r\rvert&amp;lt;1$, divergent for $\lvert r\rvert\ge1$.&lt;/li&gt;
    &lt;li&gt;Telescoping: write $a_n=b_n-b_{n+1}$, then $S_N=b_1-b_{N+1}$.&lt;/li&gt;
    &lt;li&gt;If $a_n\not\to0$ the series diverges; but $a_n\to0$ is not enough: the harmonic series diverges, $S_N\approx\ln N$.&lt;/li&gt;
    &lt;li&gt;Annuities, discounted rewards and bouncing balls are all geometric series.&lt;/li&gt;
  &lt;/ul&gt;
&lt;/div&gt;
</content>
 </entry>
 
 <entry>
   <title>Sequences and their limits</title>
   <link href="https://calculus-self-learning.pages.dev/contents/en/chapter07/07_01_Sequences_and_their_limits/"/>
   <updated>2026-12-01T00:00:00+00:00</updated>
   <id>https://calculus-self-learning.pages.dev/contents/en/chapter07/07_01_Sequences_and_their_limits</id>
   <content type="html">&lt;div class=&quot;textbook-objectives&quot;&gt;

  &lt;p&gt;&lt;strong&gt;Learning objectives.&lt;/strong&gt; After this lesson you can:&lt;/p&gt;

  &lt;ul&gt;
    &lt;li&gt;state the $\varepsilon$–$N$ definition of the limit of a sequence and use it on simple examples;&lt;/li&gt;
    &lt;li&gt;compute limits of sequences with the limit laws, the squeeze theorem and limits of the corresponding functions;&lt;/li&gt;
    &lt;li&gt;use the monotone convergence theorem to show that a recursive sequence converges and find its limit;&lt;/li&gt;
    &lt;li&gt;analyse the convergence of gradient descent on a quadratic.&lt;/li&gt;
  &lt;/ul&gt;

&lt;/div&gt;

&lt;h2 id=&quot;why-this-lesson&quot;&gt;Why this lesson&lt;/h2&gt;

&lt;p&gt;Newton’s method (lesson 03_05), gradient descent and periodic compound interest all produce &lt;strong&gt;sequences&lt;/strong&gt; $a_1,a_2,a_3,\dots$ The question is always: does the sequence approach some value, and how fast? Series (the following lessons) are also defined through the sequence of partial sums.&lt;/p&gt;

&lt;h2 id=&quot;limits-of-sequences&quot;&gt;Limits of sequences&lt;/h2&gt;

&lt;div class=&quot;textbook-definition&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Definition 1 (Limit of a sequence).&lt;/strong&gt; The sequence $(a_n)$ has limit $L$, written $\lim_{n\to\infty}a_n=L$ or $a_n\to L$, if for every $\varepsilon&amp;gt;0$ there is $N$ such that $\lvert a_n-L\rvert&amp;lt;\varepsilon$ for all $n&amp;gt;N$. A sequence with a finite limit &lt;strong&gt;converges&lt;/strong&gt;; otherwise it &lt;strong&gt;diverges&lt;/strong&gt;.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Example 1.&lt;/strong&gt; $\dfrac{n+1}{2n-1}\to\dfrac12$. We have $\left\lvert\dfrac{n+1}{2n-1}-\dfrac12\right\rvert=\dfrac{3}{2(2n-1)}$. For this to be below $\varepsilon$ it suffices that $2n-1&amp;gt;\dfrac3{2\varepsilon}$, so take $N=\dfrac3{4\varepsilon}+\dfrac12$.&lt;/p&gt;
&lt;/div&gt;

&lt;p&gt;The limit laws for sums, differences, products and quotients and the squeeze theorem (lessons 01_03, 01_04) hold for sequences with the same proofs. One more useful bridge:&lt;/p&gt;

&lt;div class=&quot;textbook-theorem&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Theorem 1.&lt;/strong&gt; If $\lim_{x\to\infty}f(x)=L$ and $a_n=f(n)$, then $a_n\to L$. If $a_n\to L$ and $g$ is continuous at $L$, then $g(a_n)\to g(L)$.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Example 2 (Standard limits).&lt;/strong&gt;&lt;/p&gt;

  &lt;ul&gt;
    &lt;li&gt;$r^n\to0$ if $\lvert r\rvert&amp;lt;1$; $r^n\to\infty$ if $r&amp;gt;1$; $(-1)^n$ diverges (it oscillates between $\pm1$).&lt;/li&gt;
    &lt;li&gt;$\dfrac{\ln n}n\to0$: L’Hôpital gives $\lim_{x\to\infty}\frac{\ln x}x=\lim\frac{1/x}1=0$.&lt;/li&gt;
    &lt;li&gt;$n^{1/n}=e^{\ln n/n}\to e^0=1$.&lt;/li&gt;
    &lt;li&gt;$\left(1+\dfrac rn\right)^n\to e^r$, because $n\ln(1+\tfrac rn)\to r$ (lesson 01_04).&lt;/li&gt;
  &lt;/ul&gt;
&lt;/div&gt;

&lt;h2 id=&quot;monotone-bounded-sequences&quot;&gt;Monotone bounded sequences&lt;/h2&gt;

&lt;div class=&quot;textbook-theorem&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Theorem 2 (Monotone convergence).&lt;/strong&gt; An increasing sequence that is bounded above converges, and its limit is $\sup_na_n$. Likewise a decreasing sequence bounded below converges.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-proof&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Proof.&lt;/strong&gt; The set $\lbrace a_n\rbrace$ is bounded above, so it has a least upper bound $L=\sup a_n$ (completeness axiom, lesson 00_01). Let $\varepsilon&amp;gt;0$. Since $L-\varepsilon$ is not an upper bound, there is $N$ with $a_N&amp;gt;L-\varepsilon$. The sequence is increasing, so for $n&amp;gt;N$: $L-\varepsilon&amp;lt;a_N\le a_n\le L$, i.e. $\lvert a_n-L\rvert&amp;lt;\varepsilon$.&lt;/p&gt;
&lt;/div&gt;

&lt;p&gt;The theorem shows convergence without knowing the limit in advance. For a recursive sequence $a_{n+1}=g(a_n)$ with $g$ continuous, if $a_n\to L$ then $L=g(L)$: the limit is a fixed point.&lt;/p&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Example 3.&lt;/strong&gt; $a_1=\sqrt2$, $a_{n+1}=\sqrt{2+a_n}$, i.e. $\sqrt2,\ \sqrt{2+\sqrt2},\ \sqrt{2+\sqrt{2+\sqrt2}},\dots$&lt;/p&gt;

  &lt;ul&gt;
    &lt;li&gt;Bounded above by 2: $a_1&amp;lt;2$, and if $a_n&amp;lt;2$ then $a_{n+1}&amp;lt;\sqrt4=2$.&lt;/li&gt;
    &lt;li&gt;Increasing: $a_{n+1}^2-a_n^2=2+a_n-a_n^2=(2-a_n)(1+a_n)&amp;gt;0$.&lt;/li&gt;
  &lt;/ul&gt;

  &lt;p&gt;By theorem 2, $a_n\to L$ with $L=\sqrt{2+L}$, i.e. $L^2-L-2=0$, $L=2$ (discard $L=-1$). Numerically $a_7\approx1.99985$.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;content-box warning-box textbook-block&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Prove convergence first.&lt;/strong&gt; For $a_{n+1}=2a_n$, $a_1=1$, the equation $L=2L$ gives $L=0$, yet the sequence $1,2,4,8,\dots$ goes to infinity. The fixed-point equation gives the limit only &lt;strong&gt;if&lt;/strong&gt; the limit exists.&lt;/p&gt;
&lt;/div&gt;

&lt;h2 id=&quot;applications&quot;&gt;Applications&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Economics: compound interest.&lt;/strong&gt; Deposit 100 million VND at 8% per year, compounded $n$ times a year: after one year you have $100\left(1+\tfrac{0.08}n\right)^n$ million. Monthly ($n=12$): $108.30$ million. As $n\to\infty$ (continuous compounding): $100e^{0.08}\approx108.33$ million. The difference is only about 29 thousand VND.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Machine learning: when gradient descent converges.&lt;/strong&gt; For $f(x)=\tfrac a2x^2$ ($a&amp;gt;0$), the step $x_{n+1}=x_n-\eta f&apos;(x_n)=(1-\eta a)x_n$ gives $x_n=(1-\eta a)^nx_0$. The sequence converges to the minimum 0 exactly when $\lvert1-\eta a\rvert&amp;lt;1$, i.e. $0&amp;lt;\eta&amp;lt;\tfrac2a$. A learning rate above $\tfrac2a$ makes the iterates oscillate and diverge. This is why “too large a learning rate” makes the loss blow up.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Physics: a bouncing ball.&lt;/strong&gt; A ball dropped from 2 m rebounds to 80% of its previous height each time: $h_n=2\cdot0.8^n\to0$. The total distance is a geometric series (lesson 07_02).&lt;/p&gt;

&lt;h2 id=&quot;exercises&quot;&gt;Exercises&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Basic.&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;Find $\lim\dfrac{3n^2+1}{n^2-n}$ and $\lim\dfrac{(-1)^n}n$.&lt;/li&gt;
  &lt;li&gt;Find $\lim\dfrac n{2^n}$ and $\lim\left(1+\dfrac2n\right)^n$.&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Answers&lt;/summary&gt;

  &lt;ol&gt;
    &lt;li&gt;$3$; $0$ (squeeze between $\pm\tfrac1n$).&lt;/li&gt;
    &lt;li&gt;$0$ (L’Hôpital on $x/2^x$); $e^2$.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;p&gt;&lt;strong&gt;Intermediate.&lt;/strong&gt;&lt;/p&gt;

&lt;ol start=&quot;3&quot;&gt;
  &lt;li&gt;Let $a_1=0$, $a_{n+1}=\sqrt{6+a_n}$. Show that the sequence converges and find its limit.&lt;/li&gt;
  &lt;li&gt;Prove from the definition that $\dfrac1{n^2}\to0$.&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Answers&lt;/summary&gt;

  &lt;ol start=&quot;3&quot;&gt;
    &lt;li&gt;By induction $0\le a_n&amp;lt;3$, and the sequence increases since $6+a_n-a_n^2=(3-a_n)(2+a_n)&amp;gt;0$. The limit satisfies $L^2=6+L$, so $L=3$.&lt;/li&gt;
    &lt;li&gt;Given $\varepsilon&amp;gt;0$ take $N=1/\sqrt\varepsilon$; for $n&amp;gt;N$, $\tfrac1{n^2}&amp;lt;\varepsilon$.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;p&gt;&lt;strong&gt;Advanced.&lt;/strong&gt;&lt;/p&gt;

&lt;ol start=&quot;5&quot;&gt;
  &lt;li&gt;Fibonacci: $F_1=F_2=1$, $F_{n+2}=F_{n+1}+F_n$. Assuming $r_n=F_{n+1}/F_n$ converges, show that the limit is $\varphi=\tfrac{1+\sqrt5}2$.&lt;/li&gt;
  &lt;li&gt;Let $a_1=1$, $a_{n+1}=\dfrac{a_n}2+\dfrac1{a_n}$ (Newton for $x^2=2$). Show $a_n\ge\sqrt2$ for $n\ge2$, the sequence decreases from $n=2$, and $a_n\to\sqrt2$.&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Hints&lt;/summary&gt;

  &lt;ol start=&quot;5&quot;&gt;
    &lt;li&gt;$r_{n+1}=1+\tfrac1{r_n}$, so $L=1+\tfrac1L$, $L^2-L-1=0$, $L&amp;gt;0$.&lt;/li&gt;
    &lt;li&gt;AM–GM: $\tfrac{a}2+\tfrac1a\ge2\sqrt{\tfrac12}=\sqrt2$. When $a_n\ge\sqrt2$: $a_{n+1}-a_n=\tfrac{2-a_n^2}{2a_n}\le0$. Decreasing and bounded below; the limit satisfies $L=\tfrac L2+\tfrac1L$.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;h2 id=&quot;summary&quot;&gt;Summary&lt;/h2&gt;

&lt;div class=&quot;content-box summary-box textbook-block&quot;&gt;
  &lt;ul&gt;
    &lt;li&gt;$a_n\to L$: for every $\varepsilon&amp;gt;0$, from some index on, $\lvert a_n-L\rvert&amp;lt;\varepsilon$.&lt;/li&gt;
    &lt;li&gt;Limit laws and the squeeze theorem work as for functions; $f(x)\to L$ as $x\to\infty$ implies $f(n)\to L$.&lt;/li&gt;
    &lt;li&gt;Standard limits: $r^n\to0$ ($\lvert r\rvert&amp;lt;1$), $\ln n/n\to0$, $n^{1/n}\to1$, $(1+r/n)^n\to e^r$.&lt;/li&gt;
    &lt;li&gt;Bounded monotone sequences converge. For recursive sequences: prove convergence first, then solve $L=g(L)$.&lt;/li&gt;
    &lt;li&gt;Gradient descent on $\tfrac a2x^2$ converges exactly when $0&amp;lt;\eta&amp;lt;2/a$.&lt;/li&gt;
  &lt;/ul&gt;
&lt;/div&gt;
</content>
 </entry>
 
 <entry>
   <title>Applications in economics and science</title>
   <link href="https://calculus-self-learning.pages.dev/contents/en/chapter06/06_05_Applications_in_economics_and_science/"/>
   <updated>2026-12-01T00:00:00+00:00</updated>
   <id>https://calculus-self-learning.pages.dev/contents/en/chapter06/06_05_Applications_in_economics_and_science</id>
   <content type="html">&lt;div class=&quot;textbook-objectives&quot;&gt;

  &lt;p&gt;&lt;strong&gt;Learning objectives.&lt;/strong&gt; After this lesson you can:&lt;/p&gt;

  &lt;ul&gt;
    &lt;li&gt;find the market equilibrium, consumer surplus and producer surplus;&lt;/li&gt;
    &lt;li&gt;compute the present and future value of a continuous income stream;&lt;/li&gt;
    &lt;li&gt;compute total change from a rate of change (charge, water, population);&lt;/li&gt;
    &lt;li&gt;set up integrals for flow in a pipe and for cardiac output.&lt;/li&gt;
  &lt;/ul&gt;

&lt;/div&gt;

&lt;h2 id=&quot;why-this-lesson&quot;&gt;Why this lesson&lt;/h2&gt;

&lt;p&gt;The fundamental theorem (lesson 04_03) has a very practical reading: &lt;strong&gt;the integral of a rate of change is the total change&lt;/strong&gt;,&lt;/p&gt;

\[\int_a^bF&apos;(t)\,dt=F(b)-F(a).\]

&lt;p&gt;The rate may be a marginal cost, a cash flow, a current, a water flow or a growth rate. This lesson collects common applications outside geometry and mechanics.&lt;/p&gt;

&lt;h2 id=&quot;consumer-and-producer-surplus&quot;&gt;Consumer and producer surplus&lt;/h2&gt;

&lt;p&gt;The demand curve $p=D(q)$ gives the price buyers are willing to pay for the $q$-th unit; the supply curve $p=S(q)$ gives the price sellers accept for the $q$-th unit. At equilibrium $(q^*,p^*)$, $D(q^*)=S(q^*)=p^*$.&lt;/p&gt;

&lt;div class=&quot;textbook-definition&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Definition 1 (Surplus).&lt;/strong&gt;&lt;/p&gt;

\[CS=\int_0^{q^*}\bigl(D(q)-p^*\bigr)\,dq,\qquad PS=\int_0^{q^*}\bigl(p^*-S(q)\bigr)\,dq .\]

&lt;/div&gt;

&lt;p&gt;$CS$ is the total “saving” of buyers who would have paid more than $p^*$; $PS$ is the total “extra profit” of sellers who would have accepted less than $p^*$. On the graph they are the regions between the demand (supply) curve and the horizontal line $p=p^*$.&lt;/p&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Example 1.&lt;/strong&gt; $D(q)=100-0.5q$, $S(q)=20+0.3q$ (thousand VND). Equilibrium: $100-0.5q=20+0.3q$, so $q^*=100$, $p^*=50$.&lt;/p&gt;

\[CS=\int_0^{100}(50-0.5q)\,dq=5000-2500=2500,\qquad PS=\int_0^{100}(30-0.3q)\,dq=3000-1500=1500\]

  &lt;p&gt;(thousand VND). Total welfare is $4000$. A tax or a price ceiling moves $q$ away from $q^*$ and lowers this total; the loss is called deadweight loss.&lt;/p&gt;
&lt;/div&gt;

&lt;h2 id=&quot;continuous-income-streams&quot;&gt;Continuous income streams&lt;/h2&gt;

&lt;p&gt;A cash flow at rate $R(t)$ (VND/year) with continuous interest rate $r$. The small amount $R(t)\,dt$ received at time $t$ has present value $R(t)e^{-rt}\,dt$ and value $R(t)e^{r(T-t)}\,dt$ at time $T$.&lt;/p&gt;

&lt;div class=&quot;textbook-definition&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Definition 2.&lt;/strong&gt;&lt;/p&gt;

\[PV=\int_0^TR(t)e^{-rt}\,dt,\qquad FV=\int_0^TR(t)e^{r(T-t)}\,dt=e^{rT}PV .\]

&lt;/div&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Example 2.&lt;/strong&gt; Saving 10 million VND/year steadily for 5 years at 6% continuous interest:&lt;/p&gt;

\[FV=\int_0^510e^{0.06(5-t)}\,dt=\frac{10}{0.06}\left(e^{0.3}-1\right)\approx58.31\ \text{million VND},\]

  &lt;p&gt;compared with 50 million deposited.&lt;/p&gt;
&lt;/div&gt;

&lt;h2 id=&quot;total-change-from-a-rate&quot;&gt;Total change from a rate&lt;/h2&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Example 3.&lt;/strong&gt;&lt;/p&gt;

  &lt;ul&gt;
    &lt;li&gt;&lt;strong&gt;Water.&lt;/strong&gt; Water flows into a tank at $2+\sin t$ (litres/min). In the first $\pi$ minutes the inflow is $\int_0^\pi(2+\sin t)\,dt=2\pi+2\approx8.28$ litres.&lt;/li&gt;
    &lt;li&gt;&lt;strong&gt;Charge.&lt;/strong&gt; $Q=\int_{t_1}^{t_2}i(t)\,dt$ (lesson 05_02).&lt;/li&gt;
    &lt;li&gt;&lt;strong&gt;Population.&lt;/strong&gt; With birth rate $b(t)$ and death rate $d(t)$ (people/year), the change in population over $[0,T]$ is $\int_0^T\bigl(b(t)-d(t)\bigr)\,dt$.&lt;/li&gt;
  &lt;/ul&gt;
&lt;/div&gt;

&lt;h2 id=&quot;applications-in-biomedicine-and-machine-learning&quot;&gt;Applications in biomedicine and machine learning&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Blood flow (Poiseuille’s law).&lt;/strong&gt; In a vessel of radius $R$ and length $\ell$, with pressure difference $P$ and viscosity $\eta$, blood at distance $r$ from the axis moves at $v(r)=\dfrac{P}{4\eta\ell}(R^2-r^2)$. The ring of radius $r$ and width $dr$ has area $2\pi r\,dr$, so the flow is&lt;/p&gt;

\[F=\int_0^Rv(r)\,2\pi r\,dr=\frac{\pi P}{2\eta\ell}\int_0^R(R^2r-r^3)\,dr=\frac{\pi PR^4}{8\eta\ell}.\]

&lt;p&gt;Flow is proportional to $R^4$: a vessel narrowed by 10% carries about 34% less blood.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Cardiac output (dye dilution).&lt;/strong&gt; Inject $A$ mg of dye into a vein and measure the concentration $c(t)$ in an artery. The cardiac output $F$ (litres/second) satisfies $A=F\int_0^Tc(t)\,dt$. With $A=3$ mg and $c(t)=\tfrac{t(10-t)}5$ mg/L on $[0,10]$ seconds: $\int_0^{10}c\,dt=\tfrac{100}3$, so $F=\tfrac{3}{100/3}=0.09$ L/s, i.e. 5.4 L/min, within the normal range for an adult at rest.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Machine learning: integrated gradients.&lt;/strong&gt; To explain a model’s prediction $F(x)$, integrated gradients compares with a baseline $x&apos;$ and integrates the derivative along the segment between them: in one variable, $\text{IG}=(x-x&apos;)\int_0^1F&apos;\bigl(x&apos;+\alpha(x-x&apos;)\bigr)\,d\alpha=F(x)-F(x&apos;)$ (substitution and the fundamental theorem). The property “the contributions add up to the change in output” is the fundamental theorem.&lt;/p&gt;

&lt;h2 id=&quot;exercises&quot;&gt;Exercises&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Basic.&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;Demand $D(q)=50-q^2$, market price $p^*=25$. Find the consumer surplus.&lt;/li&gt;
  &lt;li&gt;Demand $D(q)=120-2q$, supply $S(q)=3q$. Find the equilibrium, $CS$ and $PS$.&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Answers&lt;/summary&gt;

  &lt;ol&gt;
    &lt;li&gt;$q^*=5$; $CS=\int_0^5(25-q^2)\,dq=125-\tfrac{125}3=\tfrac{250}3\approx83.3$.&lt;/li&gt;
    &lt;li&gt;$q^*=24$, $p^*=72$. $CS=\tfrac12\cdot24\cdot48=576$, $PS=\tfrac12\cdot24\cdot72=864$.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;p&gt;&lt;strong&gt;Intermediate.&lt;/strong&gt;&lt;/p&gt;

&lt;ol start=&quot;3&quot;&gt;
  &lt;li&gt;A factory emits pollutant at the rate $r(t)=50e^{-0.1t}$ (tonnes/year). Find the total emitted in the first 10 years, and the total if it continues for ever.&lt;/li&gt;
  &lt;li&gt;An income stream $R(t)=20e^{0.03t}$ (million VND/year) lasts 10 years, with continuous interest 8%. Find its present value.&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Answers&lt;/summary&gt;

  &lt;ol start=&quot;3&quot;&gt;
    &lt;li&gt;$\int_0^{10}50e^{-0.1t}\,dt=500(1-e^{-1})\approx316$ tonnes; for ever: $500$ tonnes.&lt;/li&gt;
    &lt;li&gt;$PV=\int_0^{10}20e^{-0.05t}\,dt=400(1-e^{-0.5})\approx157.4$ million VND.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;p&gt;&lt;strong&gt;Advanced.&lt;/strong&gt;&lt;/p&gt;

&lt;ol start=&quot;5&quot;&gt;
  &lt;li&gt;Lorenz curve $L(p)=p^2$. Find the Gini coefficient $G=1-2\int_0^1L$. What is the Gini coefficient for $L(p)=p^k$, and when is it 0?&lt;/li&gt;
  &lt;li&gt;By Poiseuille’s law, by what percentage must a vessel’s radius grow to double the flow (same pressure difference)?&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Hints&lt;/summary&gt;

  &lt;ol start=&quot;5&quot;&gt;
    &lt;li&gt;$G=1-\tfrac23=\tfrac13$. For $p^k$: $G=1-\tfrac2{k+1}=\tfrac{k-1}{k+1}$, which is 0 when $k=1$ (perfect equality).&lt;/li&gt;
    &lt;li&gt;$R^4$ doubles, so $R$ grows by a factor $2^{1/4}\approx1.189$, about 19%.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;h2 id=&quot;summary&quot;&gt;Summary&lt;/h2&gt;

&lt;div class=&quot;content-box summary-box textbook-block&quot;&gt;
  &lt;ul&gt;
    &lt;li&gt;The integral of a rate of change is the total change.&lt;/li&gt;
    &lt;li&gt;$CS=\int_0^{q^*}(D-p^*)$, $PS=\int_0^{q^*}(p^*-S)$.&lt;/li&gt;
    &lt;li&gt;Continuous cash flows: $PV=\int Re^{-rt}\,dt$, $FV=e^{rT}PV$.&lt;/li&gt;
    &lt;li&gt;Flow in a pipe: integrate the velocity over rings $2\pi r\,dr$; Poiseuille gives $F\propto R^4$.&lt;/li&gt;
    &lt;li&gt;Cardiac output: $F=A/\int c(t)\,dt$.&lt;/li&gt;
  &lt;/ul&gt;
&lt;/div&gt;
</content>
 </entry>
 
 <entry>
   <title>Average value and RMS value</title>
   <link href="https://calculus-self-learning.pages.dev/contents/en/chapter06/06_04_Average_value_and_RMS/"/>
   <updated>2026-12-01T00:00:00+00:00</updated>
   <id>https://calculus-self-learning.pages.dev/contents/en/chapter06/06_04_Average_value_and_RMS</id>
   <content type="html">&lt;div class=&quot;textbook-objectives&quot;&gt;

  &lt;p&gt;&lt;strong&gt;Learning objectives.&lt;/strong&gt; After this lesson you can:&lt;/p&gt;

  &lt;ul&gt;
    &lt;li&gt;compute the average value of a function on $[a,b]$;&lt;/li&gt;
    &lt;li&gt;state and prove the mean value theorem for integrals;&lt;/li&gt;
    &lt;li&gt;compute RMS values and explain why 220 V mains has a peak of about 311 V;&lt;/li&gt;
    &lt;li&gt;recognise MSE, RMSE and expectation as “averages” in the sense of this lesson.&lt;/li&gt;
  &lt;/ul&gt;

&lt;/div&gt;

&lt;h2 id=&quot;why-this-lesson&quot;&gt;Why this lesson&lt;/h2&gt;

&lt;p&gt;What is the average temperature of a day when the temperature changes continuously? For $n$ readings the average is $\tfrac1n\sum y_i$. If the readings are evenly spaced on $[a,b]$ with step $\Delta x=\tfrac{b-a}n$, then $\tfrac1n\sum f(x_i)=\tfrac1{b-a}\sum f(x_i)\Delta x$, a Riemann sum divided by the length of the interval. Letting $n\to\infty$ gives the definition below.&lt;/p&gt;

&lt;h2 id=&quot;average-value&quot;&gt;Average value&lt;/h2&gt;

&lt;div class=&quot;textbook-definition&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Definition 1 (Average value).&lt;/strong&gt; The average value of an integrable $f$ on $[a,b]$ is&lt;/p&gt;

\[\bar f=\frac1{b-a}\int_a^bf(x)\,dx .\]

&lt;/div&gt;

&lt;p&gt;Geometrically: the rectangle on $[a,b]$ with height $\bar f$ has the same (signed) area as the region under the graph.&lt;/p&gt;

&lt;div class=&quot;textbook-theorem&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Theorem 1 (Mean value theorem for integrals).&lt;/strong&gt; If $f$ is continuous on $[a,b]$, there is $c\in[a,b]$ with&lt;/p&gt;

\[f(c)=\frac1{b-a}\int_a^bf(x)\,dx .\]

&lt;/div&gt;

&lt;div class=&quot;textbook-proof&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Proof.&lt;/strong&gt; By Weierstrass, $f$ attains a minimum $m$ and a maximum $M$ on $[a,b]$. The bounds property (lesson 04_02) gives $m\le\bar f\le M$. By the intermediate value theorem (lesson 01_06), $f$ takes every value between $m$ and $M$, so there is $c$ with $f(c)=\bar f$.&lt;/p&gt;
&lt;/div&gt;

&lt;p&gt;Continuity is needed: the function equal to 0 on $[0,1)$ and 1 on $[1,2]$ has average $\tfrac12$ but never takes the value $\tfrac12$.&lt;/p&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Example 1.&lt;/strong&gt; The average of $x^2$ on $[0,3]$: $\tfrac13\int_0^3x^2\,dx=3$. The point with $c^2=3$ is $c=\sqrt3\approx1.73$.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Example 2 (Temperature).&lt;/strong&gt; Temperature $T(t)=25+5\sin\dfrac{\pi t}{12}$ (°C), with $t$ in hours from 6 a.m. Over the whole day ($0\le t\le24$) the sine part integrates to 0 over a period, so $\bar T=25$ °C. Over the 12 daytime hours:&lt;/p&gt;

\[\bar T=25+\frac1{12}\int_0^{12}5\sin\frac{\pi t}{12}\,dt=25+\frac1{12}\cdot\frac{120}\pi=25+\frac{10}\pi\approx28.2\ \text{°C}.\]

&lt;/div&gt;

&lt;h2 id=&quot;rms-value&quot;&gt;RMS value&lt;/h2&gt;

&lt;div class=&quot;textbook-definition&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Definition 2 (RMS value).&lt;/strong&gt; The root mean square value of $f$ on $[a,b]$ is&lt;/p&gt;

\[f_{\text{rms}}=\sqrt{\frac1{b-a}\int_a^bf(x)^2\,dx} .\]

&lt;/div&gt;

&lt;p&gt;Why squares: the power dissipated in a resistor $R$ is $P=\tfrac{v^2}R$, proportional to the square of the voltage. An alternating voltage averages to 0 yet still heats a stove; the RMS value is the direct voltage giving the same average power.&lt;/p&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Example 3 (Alternating current).&lt;/strong&gt; $v(t)=V_0\sin(\omega t)$ with period $T=\tfrac{2\pi}\omega$. Since $\sin^2$ averages $\tfrac12$ over a period (lesson 05_04),&lt;/p&gt;

\[v_{\text{rms}}=\sqrt{\frac1T\int_0^TV_0^2\sin^2(\omega t)\,dt}=\frac{V_0}{\sqrt2}.\]

  &lt;p&gt;Vietnamese mains labelled 220 V is the RMS value; the peak is $220\sqrt2\approx311$ V. A 100 W incandescent bulb on 220 V RMS has resistance $R=\tfrac{220^2}{100}=484\ \Omega$.&lt;/p&gt;
&lt;/div&gt;

&lt;h2 id=&quot;applications&quot;&gt;Applications&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Machine learning: MSE, RMSE and expectation.&lt;/strong&gt; The mean squared error $\text{MSE}=\tfrac1n\sum(y_i-\hat y_i)^2$ is the discrete version of $\tfrac1{b-a}\int(f-\hat f)^2$, and RMSE is the RMS value of the residuals. For a random variable with density $p$, $E[g(X)]=\int g(x)p(x)\,dx$ is a “weighted average”; the uniform distribution on $[a,b]$ ($p=\tfrac1{b-a}$) gives exactly definition 1.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Economics: average inventory.&lt;/strong&gt; A warehouse receives 600 items at the start of each 30-day month and sells them evenly, so the stock is $I(t)=600-20t$. The average stock is $\tfrac1{30}\int_0^{30}(600-20t)\,dt=300$ items; holding costs are charged on this number.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Physics: average velocity.&lt;/strong&gt; The average of the velocity over $[t_1,t_2]$ is $\tfrac{s(t_2)-s(t_1)}{t_2-t_1}$, the usual average velocity. Theorem 1 says that at some moment the instantaneous velocity equals the average velocity (the same conclusion as the mean value theorem in lesson 02_05).&lt;/p&gt;

&lt;h2 id=&quot;exercises&quot;&gt;Exercises&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Basic.&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;Find the average of $\sin x$ on $[0,\pi]$.&lt;/li&gt;
  &lt;li&gt;Find the average of $\tfrac1x$ on $[1,e]$.&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Answers&lt;/summary&gt;

  &lt;ol&gt;
    &lt;li&gt;$\tfrac1\pi\cdot2=\tfrac2\pi\approx0.637$.&lt;/li&gt;
    &lt;li&gt;$\tfrac1{e-1}\approx0.582$.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;p&gt;&lt;strong&gt;Intermediate.&lt;/strong&gt;&lt;/p&gt;

&lt;ol start=&quot;3&quot;&gt;
  &lt;li&gt;Find $c$ in theorem 1 for $f(x)=\sqrt x$ on $[0,4]$.&lt;/li&gt;
  &lt;li&gt;Find the RMS value of the sawtooth $f(t)=t$ on $[0,1]$ and of a square wave taking the values $\pm V$.&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Answers&lt;/summary&gt;

  &lt;ol start=&quot;3&quot;&gt;
    &lt;li&gt;$\bar f=\tfrac14\cdot\tfrac23\cdot8=\tfrac43$, so $\sqrt c=\tfrac43$, $c=\tfrac{16}9$.&lt;/li&gt;
    &lt;li&gt;$\sqrt{\int_0^1t^2\,dt}=\tfrac1{\sqrt3}\approx0.577$; the square wave has $f^2=V^2$, so its RMS value is $V$.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;p&gt;&lt;strong&gt;Advanced.&lt;/strong&gt;&lt;/p&gt;

&lt;ol start=&quot;5&quot;&gt;
  &lt;li&gt;Find the RMS value of $f(t)=1+2\sin t$ on $[0,2\pi]$. Why is it not $1+\tfrac2{\sqrt2}$?&lt;/li&gt;
  &lt;li&gt;Show $\lvert\bar f\rvert\le f_{\text{rms}}$ (hint: $\int(f-\bar f)^2\ge0$). When does equality hold (for continuous $f$)?&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Hints&lt;/summary&gt;

  &lt;ol start=&quot;5&quot;&gt;
    &lt;li&gt;$f^2=1+4\sin t+4\sin^2t$ averages $1+0+2=3$, so the RMS value is $\sqrt3\approx1.732$. RMS values do not add linearly: the DC and AC parts add in squares, $\sqrt{1^2+(\sqrt2)^2}$.&lt;/li&gt;
    &lt;li&gt;Expand $\tfrac1{b-a}\int(f-\bar f)^2=f_{\text{rms}}^2-\bar f^2\ge0$. Equality when $f$ is constant (exercise 6 of lesson 04_02). This is “variance = mean of the square − square of the mean”.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;h2 id=&quot;summary&quot;&gt;Summary&lt;/h2&gt;

&lt;div class=&quot;content-box summary-box textbook-block&quot;&gt;
  &lt;ul&gt;
    &lt;li&gt;Average value: $\bar f=\tfrac1{b-a}\int_a^bf$.&lt;/li&gt;
    &lt;li&gt;A continuous function takes its average value at some point $c$ at least once.&lt;/li&gt;
    &lt;li&gt;RMS value: $f_{\text{rms}}=\sqrt{\tfrac1{b-a}\int f^2}$; for a sine wave $V_0/\sqrt2$. 220 V mains peaks at about 311 V.&lt;/li&gt;
    &lt;li&gt;$f_{\text{rms}}^2-\bar f^2\ge0$ is the variance; MSE and RMSE are averages of this kind.&lt;/li&gt;
  &lt;/ul&gt;
&lt;/div&gt;
</content>
 </entry>
 
 <entry>
   <title>Work, mass and centroids</title>
   <link href="https://calculus-self-learning.pages.dev/contents/en/chapter06/06_03_Work_mass_and_centroids/"/>
   <updated>2026-12-01T00:00:00+00:00</updated>
   <id>https://calculus-self-learning.pages.dev/contents/en/chapter06/06_03_Work_mass_and_centroids</id>
   <content type="html">&lt;div class=&quot;textbook-objectives&quot;&gt;

  &lt;p&gt;&lt;strong&gt;Learning objectives.&lt;/strong&gt; After this lesson you can:&lt;/p&gt;

  &lt;ul&gt;
    &lt;li&gt;compute the work of a variable force, of lifting a cable and of pumping a liquid;&lt;/li&gt;
    &lt;li&gt;compute the mass and centre of mass of a rod with varying density;&lt;/li&gt;
    &lt;li&gt;compute the centroid of a plane region and use Pappus’s theorem for volumes;&lt;/li&gt;
    &lt;li&gt;relate the centre of mass to expectation in probability and to cluster centres in machine learning.&lt;/li&gt;
  &lt;/ul&gt;

&lt;/div&gt;

&lt;h2 id=&quot;why-this-lesson&quot;&gt;Why this lesson&lt;/h2&gt;

&lt;p&gt;Work is force times distance when the force is constant. When stretching a spring the force grows; when pumping water out of a tank each layer must be lifted a different height. The method is still that of lesson 06_01: cut into small pieces on which the quantity is nearly constant, then integrate.&lt;/p&gt;

&lt;h2 id=&quot;work&quot;&gt;Work&lt;/h2&gt;

&lt;div class=&quot;textbook-definition&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Definition 1 (Work of a variable force).&lt;/strong&gt; A continuous force $F(x)$ acting along the $x$-axis from $a$ to $b$ does work&lt;/p&gt;

\[W=\int_a^bF(x)\,dx .\]

&lt;/div&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Example 1 (Spring).&lt;/strong&gt; A force of 10 N stretches a spring 5 cm. By Hooke’s law $F=kx$, so $k=\tfrac{10}{0.05}=200$ N/m. The work to stretch it from 5 cm to 15 cm:&lt;/p&gt;

\[W=\int_{0.05}^{0.15}200x\,dx=100\,(0.15^2-0.05^2)=2\ \text{J}.\]

&lt;/div&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Example 2 (Lifting a cable).&lt;/strong&gt; A 20 m cable weighing 2 kg/m hangs straight down from a roof. Pull the whole cable up. A small piece of length $dy$ at $y$ metres below the roof weighs $2\cdot9.8\,dy$ and must be lifted $y$ metres:&lt;/p&gt;

\[W=\int_0^{20}19.6\,y\,dy=19.6\cdot200=3920\ \text{J}.\]

&lt;/div&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Example 3 (Pumping water).&lt;/strong&gt; A cylindrical tank of radius 1 m and height 3 m is full of water ($\rho=1000$ kg/m³). Pump all the water out over the top. The layer of thickness $dy$ at height $y$ has mass $\rho\pi\cdot1^2\,dy$ and must be lifted $3-y$ metres:&lt;/p&gt;

\[W=\int_0^3\rho g\pi(3-y)\,dy=1000\cdot9.8\cdot\pi\cdot4.5\approx1.39\cdot10^5\ \text{J}.\]

&lt;/div&gt;

&lt;h2 id=&quot;mass-and-centre-of-mass&quot;&gt;Mass and centre of mass&lt;/h2&gt;

&lt;p&gt;A rod lies on $[a,b]$ with density (kg/m) $\rho(x)$. A small piece $dx$ has mass $\rho(x)\,dx$.&lt;/p&gt;

&lt;div class=&quot;textbook-definition&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Definition 2 (Mass and centre of mass of a rod).&lt;/strong&gt;&lt;/p&gt;

\[m=\int_a^b\rho(x)\,dx,\qquad\bar x=\frac1m\int_a^bx\,\rho(x)\,dx .\]

&lt;/div&gt;

&lt;p&gt;$\bar x$ is the balance point: the total moment $\int(x-\bar x)\rho(x)\,dx$ is 0.&lt;/p&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Example 4.&lt;/strong&gt; A rod on $[0,2]$ with $\rho=1+x^2$. $m=\int_0^2(1+x^2)\,dx=\tfrac{14}3$, $\int_0^2x(1+x^2)\,dx=2+4=6$, so $\bar x=\tfrac{6}{14/3}=\tfrac97\approx1.29$, shifted towards the heavier end.&lt;/p&gt;
&lt;/div&gt;

&lt;h2 id=&quot;centroids-of-plane-regions-and-pappuss-theorem&quot;&gt;Centroids of plane regions and Pappus’s theorem&lt;/h2&gt;

&lt;p&gt;For a uniform plate occupying the region under $y=f(x)\ge0$, $a\le x\le b$, with area $A$: the thin strip at $x$ has area $f\,dx$ and its centroid at height $f/2$. Hence&lt;/p&gt;

\[\bar x=\frac1A\int_a^bx\,f(x)\,dx,\qquad\bar y=\frac1A\int_a^b\frac{f(x)^2}2\,dx .\]

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Example 5.&lt;/strong&gt; The region under $y=x^2$, $0\le x\le1$: $A=\tfrac13$, $\bar x=3\int_0^1x^3\,dx=\tfrac34$, $\bar y=3\int_0^1\tfrac{x^4}2\,dx=\tfrac3{10}$.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-theorem&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Theorem 1 (Pappus).&lt;/strong&gt; Rotating a plane region of area $A$ about an axis in its plane that does not cut it gives a solid whose volume is $A$ times the distance travelled by the centroid:&lt;/p&gt;

\[V=2\pi\bar r\,A,\]

  &lt;p&gt;where $\bar r$ is the distance from the centroid to the axis.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-proof&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Proof (about the $x$-axis, region under $y=f$).&lt;/strong&gt; By the disc method, $V=\pi\int_a^bf^2\,dx=2\pi\int_a^b\tfrac{f^2}2\,dx=2\pi\bar yA$.&lt;/p&gt;
&lt;/div&gt;

&lt;p&gt;Check with example 5: $2\pi\cdot\tfrac3{10}\cdot\tfrac13=\tfrac\pi5=\pi\int_0^1x^4\,dx$. For the torus (lesson 06_01, exercise 5): $V=2\pi R\cdot\pi r^2$, with no integration.&lt;/p&gt;

&lt;div class=&quot;interactive-frame&quot;&gt;
  &lt;div class=&quot;interactive-frame-head&quot;&gt;
    &lt;div class=&quot;interactive-frame-title&quot;&gt;Centroids and the theorem of Pappus&lt;/div&gt;
    &lt;div class=&quot;interactive-frame-desc&quot;&gt;Drag the fulcrum to find the balance point; drag the axis to check Pappus.&lt;/div&gt;
  &lt;/div&gt;
  &lt;iframe src=&quot;/interactives/chapter06/centroid-en.html&quot; title=&quot;Centroids and the theorem of Pappus&quot; loading=&quot;lazy&quot; style=&quot;height: 760px;&quot;&gt;&lt;/iframe&gt;
  &lt;div class=&quot;interactive-frame-foot&quot;&gt;
    &lt;a href=&quot;/interactives/chapter06/centroid-en.html&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;Open the interactive in a new window&lt;/a&gt;
  &lt;/div&gt;
&lt;/div&gt;

&lt;h2 id=&quot;applications&quot;&gt;Applications&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Civil engineering: force on a dam.&lt;/strong&gt; Pressure at depth $y$ is $\rho gy$. A rectangular gate 10 m wide submerged to 5 m feels the force $F=\int_0^5\rho g\,y\cdot10\,dy=1000\cdot9.8\cdot10\cdot12.5\approx1.23\cdot10^6$ N. The force grows with the square of the depth, which is why a dam is thicker at the bottom.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Probability: the centre of mass is the expectation.&lt;/strong&gt; If $\rho$ is a probability density ($m=1$), the centre of mass $\bar x=\int x\rho(x)\,dx$ is the expectation $E[X]$. The moment of inertia $\int(x-\bar x)^2\rho\,dx$ is the variance.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Machine learning: cluster centres.&lt;/strong&gt; In k-means, each cluster centre is the mean (centre of mass) of the points in the cluster, the discrete version of $\bar x=\tfrac1m\int x\rho$.&lt;/p&gt;

&lt;h2 id=&quot;exercises&quot;&gt;Exercises&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Basic.&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;A force of 6 N stretches a spring 3 cm. Find the work to stretch it from its natural length to 10 cm.&lt;/li&gt;
  &lt;li&gt;A rod on $[0,3]$ has density $\rho=3-x$. Find its mass and centre of mass.&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Answers&lt;/summary&gt;

  &lt;ol&gt;
    &lt;li&gt;$k=200$ N/m, $W=\int_0^{0.1}200x\,dx=1$ J.&lt;/li&gt;
    &lt;li&gt;$m=\tfrac92$, $\int_0^3x(3-x)\,dx=\tfrac92$, so $\bar x=1$.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;p&gt;&lt;strong&gt;Intermediate.&lt;/strong&gt;&lt;/p&gt;

&lt;ol start=&quot;3&quot;&gt;
  &lt;li&gt;Find the centroid of the triangle under $y=x$, $0\le x\le1$.&lt;/li&gt;
  &lt;li&gt;A hemispherical bowl of radius $R$ is full of water. Find the work to pump it all out over the rim.&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Answers&lt;/summary&gt;

  &lt;ol start=&quot;3&quot;&gt;
    &lt;li&gt;$A=\tfrac12$, $\bar x=2\int_0^1x^2\,dx=\tfrac23$, $\bar y=2\int_0^1\tfrac{x^2}2\,dx=\tfrac13$.&lt;/li&gt;
    &lt;li&gt;At depth $s$ below the rim the layer has radius $\sqrt{R^2-s^2}$ and is lifted $s$ metres: $W=\rho g\pi\int_0^R(R^2-s^2)s\,ds=\dfrac{\rho g\pi R^4}4$.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;p&gt;&lt;strong&gt;Advanced.&lt;/strong&gt;&lt;/p&gt;

&lt;ol start=&quot;5&quot;&gt;
  &lt;li&gt;Show that the centroid of a half disc of radius $R$ (the part $y\ge0$) has $\bar y=\dfrac{4R}{3\pi}$, then use Pappus to recover the volume of a ball.&lt;/li&gt;
  &lt;li&gt;Use Pappus to find the volume of the solid obtained by rotating a square of side 2 centred at $(5,0)$, with sides parallel to the axes, about the $y$-axis.&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Hints&lt;/summary&gt;

  &lt;ol start=&quot;5&quot;&gt;
    &lt;li&gt;$A=\tfrac{\pi R^2}2$, $\int_{-R}^R\tfrac{R^2-x^2}2\,dx=\tfrac{2R^3}3$, so $\bar y=\tfrac{4R}{3\pi}$. About the $x$-axis: $V=2\pi\cdot\tfrac{4R}{3\pi}\cdot\tfrac{\pi R^2}2=\tfrac43\pi R^3$.&lt;/li&gt;
    &lt;li&gt;$A=4$, $\bar r=5$: $V=2\pi\cdot5\cdot4=40\pi$.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;h2 id=&quot;summary&quot;&gt;Summary&lt;/h2&gt;

&lt;div class=&quot;content-box summary-box textbook-block&quot;&gt;
  &lt;ul&gt;
    &lt;li&gt;Work: $W=\int F(x)\,dx$. Pumping: integrate (weight of a thin layer) × (height it is lifted).&lt;/li&gt;
    &lt;li&gt;Rod: $m=\int\rho$, $\bar x=\tfrac1m\int x\rho$.&lt;/li&gt;
    &lt;li&gt;Region under $y=f$: $\bar x=\tfrac1A\int xf$, $\bar y=\tfrac1A\int\tfrac{f^2}2$.&lt;/li&gt;
    &lt;li&gt;Pappus: $V=2\pi\bar rA$.&lt;/li&gt;
    &lt;li&gt;The centre of mass of a probability density is the expectation; the moment of inertia is the variance.&lt;/li&gt;
  &lt;/ul&gt;
&lt;/div&gt;
</content>
 </entry>
 
 <entry>
   <title>Arc length and surface area of revolution</title>
   <link href="https://calculus-self-learning.pages.dev/contents/en/chapter06/06_02_Arc_length_and_surface_area/"/>
   <updated>2026-12-01T00:00:00+00:00</updated>
   <id>https://calculus-self-learning.pages.dev/contents/en/chapter06/06_02_Arc_length_and_surface_area</id>
   <content type="html">&lt;div class=&quot;textbook-objectives&quot;&gt;

  &lt;p&gt;&lt;strong&gt;Learning objectives.&lt;/strong&gt; After this lesson you can:&lt;/p&gt;

  &lt;ul&gt;
    &lt;li&gt;derive the arc length formula $\int_a^b\sqrt{1+f&apos;(x)^2}\,dx$ from polygonal paths;&lt;/li&gt;
    &lt;li&gt;compute the length of graphs and of parametric curves;&lt;/li&gt;
    &lt;li&gt;compute the area of a surface of revolution $2\pi\int f\sqrt{1+f&apos;^2}\,dx$;&lt;/li&gt;
    &lt;li&gt;recognise that many arc length integrals are not elementary and evaluate them numerically.&lt;/li&gt;
  &lt;/ul&gt;

&lt;/div&gt;

&lt;h2 id=&quot;why-this-lesson&quot;&gt;Why this lesson&lt;/h2&gt;

&lt;p&gt;How long is a power line hanging between two poles? How far does a thrown ball travel through the air? The length of a segment is easy; for a curve we approximate by a polygonal path and let the number of pieces grow.&lt;/p&gt;

&lt;h2 id=&quot;arc-length&quot;&gt;Arc length&lt;/h2&gt;

&lt;p&gt;Partition $[a,b]$ by $x_0&amp;lt;\dots&amp;lt;x_n$. The segment from $(x_{i-1},f(x_{i-1}))$ to $(x_i,f(x_i))$ has length&lt;/p&gt;

\[\sqrt{\Delta x_i^2+\Delta y_i^2}=\sqrt{1+\left(\frac{\Delta y_i}{\Delta x_i}\right)^2}\,\Delta x_i=\sqrt{1+f&apos;(\xi_i)^2}\,\Delta x_i,\]

&lt;p&gt;with $\xi_i\in(x_{i-1},x_i)$ by the mean value theorem. The total length of the segments is a Riemann sum of $\sqrt{1+f&apos;^2}$.&lt;/p&gt;

&lt;div class=&quot;textbook-theorem&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Theorem 1 (Arc length).&lt;/strong&gt; If $f$ has a continuous derivative on $[a,b]$, the length of its graph is&lt;/p&gt;

\[L=\int_a^b\sqrt{1+f&apos;(x)^2}\,dx .\]

  &lt;p&gt;For a parametric curve $x=x(t)$, $y=y(t)$, $t\in[\alpha,\beta]$, with continuous derivatives and no piece traced twice:&lt;/p&gt;

\[L=\int_\alpha^\beta\sqrt{x&apos;(t)^2+y&apos;(t)^2}\,dt .\]

&lt;/div&gt;

&lt;p&gt;The parametric formula has a physical meaning: $\sqrt{x&apos;^2+y&apos;^2}$ is the speed, and distance is the integral of speed.&lt;/p&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Example 1.&lt;/strong&gt; The length of $y=x^{3/2}$, $0\le x\le4$. $f&apos;=\tfrac32x^{1/2}$, so&lt;/p&gt;

\[L=\int_0^4\sqrt{1+\tfrac94x}\,dx=\frac8{27}\Big[\left(1+\tfrac94x\right)^{3/2}\Big]_0^4=\frac8{27}\left(10\sqrt{10}-1\right)\approx9.073 .\]

&lt;/div&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Example 2 (Catenary).&lt;/strong&gt; A freely hanging chain has the shape $y=\cosh x=\tfrac{e^x+e^{-x}}2$. Since $1+\sinh^2x=\cosh^2x$, the length over $[-1,1]$ is&lt;/p&gt;

\[L=\int_{-1}^1\cosh x\,dx=2\sinh1\approx2.350 .\]

&lt;/div&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Example 3 (Cycloid).&lt;/strong&gt; A point on the rim of a wheel of radius $r$ rolling on a road traces $x=r(t-\sin t)$, $y=r(1-\cos t)$. One arch is $t\in[0,2\pi]$:&lt;/p&gt;

\[x&apos;^2+y&apos;^2=r^2\bigl((1-\cos t)^2+\sin^2t\bigr)=2r^2(1-\cos t)=4r^2\sin^2\tfrac t2,\]

  &lt;p&gt;so $L=\int_0^{2\pi}2r\sin\tfrac t2\,dt=8r$. One arch is exactly 8 radii long.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;content-box warning-box textbook-block&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Arc length is often not elementary.&lt;/strong&gt; For $y=x^2$ on $[0,1]$ it still works (substitute $2x=\sinh u$): $L=\tfrac14\bigl(2\sqrt5+\ln(2+\sqrt5)\bigr)\approx1.479$. But the perimeter of the ellipse $x=2\cos t$, $y=\sin t$ is $\int_0^{2\pi}\sqrt{4\sin^2t+\cos^2t}\,dt$, an “elliptic integral” with no elementary antiderivative; Simpson gives $\approx9.688$.&lt;/p&gt;
&lt;/div&gt;

&lt;h2 id=&quot;surface-area-of-revolution&quot;&gt;Surface area of revolution&lt;/h2&gt;

&lt;p&gt;Rotating a small piece of length $ds=\sqrt{1+f&apos;^2}\,dx$ at height $f(x)$ about the $x$-axis gives a band of a cone with area about $2\pi f(x)\,ds$.&lt;/p&gt;

&lt;div class=&quot;textbook-theorem&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Theorem 2 (Surface area of revolution).&lt;/strong&gt; For $f\ge0$ with a continuous derivative, the surface obtained by rotating the graph of $f$ over $[a,b]$ about the $x$-axis has area&lt;/p&gt;

\[S=2\pi\int_a^bf(x)\sqrt{1+f&apos;(x)^2}\,dx .\]

&lt;/div&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Example 4 (Sphere).&lt;/strong&gt; $f=\sqrt{R^2-x^2}$, $f&apos;=-\dfrac x{\sqrt{R^2-x^2}}$, so $f\sqrt{1+f&apos;^2}=R$. Hence $S=2\pi\int_{-R}^RR\,dx=4\pi R^2$. Moreover, the zone between two planes a distance $h$ apart has area $2\pi Rh$, wherever it is (Archimedes).&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Example 5 (Gabriel’s horn).&lt;/strong&gt; Rotate $y=\tfrac1x$, $x\ge1$, about the $x$-axis. The volume is $\pi\int_1^\infty\tfrac{dx}{x^2}=\pi$, finite. The surface area is $2\pi\int_1^\infty\tfrac1x\sqrt{1+\tfrac1{x^4}}\,dx\ge2\pi\int_1^\infty\tfrac{dx}x=\infty$. A horn that holds a finite amount of paint but whose inside cannot be painted.&lt;/p&gt;
&lt;/div&gt;

&lt;h2 id=&quot;short-video&quot;&gt;Short video&lt;/h2&gt;

&lt;div class=&quot;reel-video&quot;&gt;
  &lt;video controls=&quot;&quot; playsinline=&quot;&quot; preload=&quot;metadata&quot; src=&quot;/public/videos/reels/arc-length-polyline.mp4&quot;&gt;&lt;/video&gt;
  &lt;p class=&quot;reel-caption&quot;&gt;Arc length by polygonal paths: a rolling wheel draws a cycloid, polygonal paths with 4, 16, 64 pieces hug the curve, and a small right triangle gives Δs = √(Δx² + Δy²) (silent video, about 1 minute 59 seconds).&lt;/p&gt;
&lt;/div&gt;

&lt;h2 id=&quot;applications&quot;&gt;Applications&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Physics: flight distance.&lt;/strong&gt; A ball flies along $y=x-\tfrac{x^2}{20}$ (m) from $x=0$ to $x=20$. With $u=1-\tfrac x{10}$:&lt;/p&gt;

\[L=\int_0^{20}\sqrt{1+\left(1-\tfrac x{10}\right)^2}\,dx=20\int_0^1\sqrt{1+u^2}\,du=10\bigl(\sqrt2+\ln(1+\sqrt2)\bigr)\approx22.96\ \text{m},\]

&lt;p&gt;about 15% longer than the 20 m range.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Engineering: power lines and suspension cables.&lt;/strong&gt; A cable hanging between two poles is a catenary $y=a\cosh\tfrac xa$. Its length between $x=-d$ and $x=d$ is $2a\sinh\tfrac da$; from the allowed sag an engineer computes how much cable to buy.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Machine learning.&lt;/strong&gt; The path length of the parameters during training, $\int\lVert\theta&apos;(t)\rVert\,dt$ (the many-dimensional version of the parametric formula), is used to compare optimisers: two algorithms reach the same point but one “takes the long way round”.&lt;/p&gt;

&lt;h2 id=&quot;exercises&quot;&gt;Exercises&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Basic.&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;Find the length of $y=2x+1$, $0\le x\le3$, by integration and check it with Pythagoras.&lt;/li&gt;
  &lt;li&gt;Find the circumference of a circle of radius $r$ using $x=r\cos t$, $y=r\sin t$.&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Answers&lt;/summary&gt;

  &lt;ol&gt;
    &lt;li&gt;$\int_0^3\sqrt5\,dx=3\sqrt5$; the segment from $(0,1)$ to $(3,7)$ has length $\sqrt{9+36}=3\sqrt5$.&lt;/li&gt;
    &lt;li&gt;$\int_0^{2\pi}r\,dt=2\pi r$.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;p&gt;&lt;strong&gt;Intermediate.&lt;/strong&gt;&lt;/p&gt;

&lt;ol start=&quot;3&quot;&gt;
  &lt;li&gt;Find the length of $y=\tfrac{x^2}4-\tfrac{\ln x}2$, $1\le x\le e$.&lt;/li&gt;
  &lt;li&gt;Find the total length of the astroid $x=\cos^3t$, $y=\sin^3t$.&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Answers&lt;/summary&gt;

  &lt;ol start=&quot;3&quot;&gt;
    &lt;li&gt;$1+f&apos;^2=\left(\tfrac x2+\tfrac1{2x}\right)^2$, so $L=\int_1^e\left(\tfrac x2+\tfrac1{2x}\right)dx=\dfrac{e^2+1}4\approx2.097$.&lt;/li&gt;
    &lt;li&gt;$\sqrt{x&apos;^2+y&apos;^2}=3\lvert\sin t\cos t\rvert$; four equal pieces: $4\int_0^{\pi/2}3\sin t\cos t\,dt=6$.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;p&gt;&lt;strong&gt;Advanced.&lt;/strong&gt;&lt;/p&gt;

&lt;ol start=&quot;5&quot;&gt;
  &lt;li&gt;Find the area of the surface obtained by rotating $y=\sqrt x$, $0\le x\le2$, about the $x$-axis.&lt;/li&gt;
  &lt;li&gt;Prove Archimedes’ claim in example 4: the zone between $x=c$ and $x=c+h$ ($-R\le c&amp;lt;c+h\le R$) has area $2\pi Rh$.&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Hints&lt;/summary&gt;

  &lt;ol start=&quot;5&quot;&gt;
    &lt;li&gt;$f\sqrt{1+f&apos;^2}=\sqrt{x+\tfrac14}$: $S=2\pi\cdot\tfrac23\Big[(x+\tfrac14)^{3/2}\Big]_0^2=\tfrac{4\pi}3\left(\tfrac{27}8-\tfrac18\right)=\tfrac{13\pi}3\approx13.61$.&lt;/li&gt;
    &lt;li&gt;As in example 4 the integrand is the constant $R$: $2\pi\int_c^{c+h}R\,dx=2\pi Rh$.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;h2 id=&quot;summary&quot;&gt;Summary&lt;/h2&gt;

&lt;div class=&quot;content-box summary-box textbook-block&quot;&gt;
  &lt;ul&gt;
    &lt;li&gt;Length of a graph: $L=\int_a^b\sqrt{1+f&apos;^2}\,dx$; parametric curve: $L=\int\sqrt{x&apos;^2+y&apos;^2}\,dt$ (the integral of speed).&lt;/li&gt;
    &lt;li&gt;Surface of revolution about the $x$-axis: $S=2\pi\int f\sqrt{1+f&apos;^2}\,dx$.&lt;/li&gt;
    &lt;li&gt;The catenary $\cosh x$ and the cycloid give nice integrals; the ellipse does not, so compute numerically.&lt;/li&gt;
    &lt;li&gt;Gabriel’s horn: finite volume, infinite surface area.&lt;/li&gt;
  &lt;/ul&gt;
&lt;/div&gt;
</content>
 </entry>
 
 <entry>
   <title>Areas between curves and volumes</title>
   <link href="https://calculus-self-learning.pages.dev/contents/en/chapter06/06_01_Areas_between_curves_and_volumes/"/>
   <updated>2026-12-01T00:00:00+00:00</updated>
   <id>https://calculus-self-learning.pages.dev/contents/en/chapter06/06_01_Areas_between_curves_and_volumes</id>
   <content type="html">&lt;div class=&quot;textbook-objectives&quot;&gt;

  &lt;p&gt;&lt;strong&gt;Learning objectives.&lt;/strong&gt; After this lesson you can:&lt;/p&gt;

  &lt;ul&gt;
    &lt;li&gt;compute the area between two curves, integrating in $x$ or in $y$;&lt;/li&gt;
    &lt;li&gt;compute the volume of a solid from its cross-sectional area $A(x)$;&lt;/li&gt;
    &lt;li&gt;compute volumes of revolution with the disc, washer and shell methods, and choose the convenient one;&lt;/li&gt;
    &lt;li&gt;compute the volume of a tank with curved walls.&lt;/li&gt;
  &lt;/ul&gt;

&lt;/div&gt;

&lt;h2 id=&quot;why-this-lesson&quot;&gt;Why this lesson&lt;/h2&gt;

&lt;p&gt;Every formula in this chapter comes from one idea: cut the quantity into many small pieces, approximate each piece by something simple (a rectangle, a thin disc, a thin cylindrical shell), add up, and take the limit. The result is a Riemann sum, so the limit is an integral. Once this “small element” way of thinking is familiar, you can set up the formulas yourself instead of memorising them.&lt;/p&gt;

&lt;h2 id=&quot;area-between-two-curves&quot;&gt;Area between two curves&lt;/h2&gt;

&lt;p&gt;If $f\ge g$ on $[a,b]$, the thin strip at $x$ has height $f(x)-g(x)$ and width $dx$. Adding up:&lt;/p&gt;

\[A=\int_a^b\bigl(f(x)-g(x)\bigr)\,dx .\]

&lt;p&gt;If the curves cross, find the intersection points and split the interval, or use $\int_a^b\lvert f-g\rvert\,dx$.&lt;/p&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Example 1.&lt;/strong&gt; Find the area enclosed by $y=x^2-2$ and $y=x$.&lt;/p&gt;

  &lt;p&gt;Intersections: $x^2-2=x$, so $x=-1$ or $x=2$. On $[-1,2]$, $x\ge x^2-2$. So&lt;/p&gt;

\[A=\int_{-1}^2\bigl(x-x^2+2\bigr)\,dx=\Big[\tfrac{x^2}2-\tfrac{x^3}3+2x\Big]_{-1}^2=\tfrac{10}3-\left(-\tfrac76\right)=\tfrac92 .\]

&lt;/div&gt;

&lt;p&gt;Sometimes integrating in $y$ is simpler: $A=\int_c^d\bigl(\text{right}-\text{left}\bigr)\,dy$.&lt;/p&gt;

&lt;h2 id=&quot;volume-by-slicing&quot;&gt;Volume by slicing&lt;/h2&gt;

&lt;p&gt;If the cross-section perpendicular to the $x$-axis at $x$ has area $A(x)$, a slice of thickness $dx$ has volume about $A(x)\,dx$:&lt;/p&gt;

\[V=\int_a^bA(x)\,dx .\]

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Example 2 (Pyramid).&lt;/strong&gt; A pyramid with a square base of side $a$ and height $h$. At depth $y$ below the apex the cross-section is a square of side $\tfrac{ay}h$. So&lt;/p&gt;

\[V=\int_0^h\frac{a^2y^2}{h^2}\,dy=\frac{a^2h}3,\]

  &lt;p&gt;the familiar “one third of base area times height”.&lt;/p&gt;
&lt;/div&gt;

&lt;h2 id=&quot;solids-of-revolution&quot;&gt;Solids of revolution&lt;/h2&gt;

&lt;div class=&quot;textbook-theorem&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Formulas (Discs, washers, shells).&lt;/strong&gt; Let $0\le g\le f$ on $[a,b]$.&lt;/p&gt;

  &lt;ul&gt;
    &lt;li&gt;Rotate the region under $y=f(x)$ about the $x$-axis (&lt;strong&gt;discs&lt;/strong&gt;): $V=\pi\displaystyle\int_a^bf(x)^2\,dx$.&lt;/li&gt;
    &lt;li&gt;Rotate the region between $g$ and $f$ about the $x$-axis (&lt;strong&gt;washers&lt;/strong&gt;): $V=\pi\displaystyle\int_a^b\bigl(f(x)^2-g(x)^2\bigr)\,dx$.&lt;/li&gt;
    &lt;li&gt;Rotate the region between $g$ and $f$, with $0\le a&amp;lt;b$, about the $y$-axis (&lt;strong&gt;shells&lt;/strong&gt;): $V=2\pi\displaystyle\int_a^bx\bigl(f(x)-g(x)\bigr)\,dx$.&lt;/li&gt;
  &lt;/ul&gt;
&lt;/div&gt;

&lt;p&gt;Reason: rotating the thin strip at $x$ about the $x$-axis gives a disc of radius $f(x)$ and thickness $dx$, volume $\pi f(x)^2dx$. Rotating the same strip about the $y$-axis gives a cylindrical shell of radius $x$, height $f(x)-g(x)$ and thickness $dx$; unrolled, it is nearly a slab of size $2\pi x\times(f-g)\times dx$.&lt;/p&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Example 3 (Sphere).&lt;/strong&gt; Rotate the half disc $y=\sqrt{R^2-x^2}$ about the $x$-axis:&lt;/p&gt;

\[V=\pi\int_{-R}^R(R^2-x^2)\,dx=\pi\Big[R^2x-\tfrac{x^3}3\Big]_{-R}^R=\frac43\pi R^3 .\]

&lt;/div&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Example 4 (Two methods, one region).&lt;/strong&gt; The region between $y=x$ and $y=x^2$, $0\le x\le1$.&lt;/p&gt;

  &lt;ul&gt;
    &lt;li&gt;About the $x$-axis (washers): $V=\pi\int_0^1(x^2-x^4)\,dx=\pi\left(\tfrac13-\tfrac15\right)=\tfrac{2\pi}{15}$.&lt;/li&gt;
    &lt;li&gt;About the $y$-axis (shells): $V=2\pi\int_0^1x(x-x^2)\,dx=2\pi\left(\tfrac13-\tfrac14\right)=\tfrac\pi6$.&lt;/li&gt;
  &lt;/ul&gt;

  &lt;p&gt;Check the second with washers in $y$: for $y\in[0,1]$ the outer radius is $\sqrt y$ and the inner radius $y$, so $V=\pi\int_0^1(y-y^2)\,dy=\tfrac\pi6$. It matches.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;interactive-frame&quot;&gt;
  &lt;div class=&quot;interactive-frame-head&quot;&gt;
    &lt;div class=&quot;interactive-frame-title&quot;&gt;Solids of revolution&lt;/div&gt;
    &lt;div class=&quot;interactive-frame-desc&quot;&gt;Build the solid from disks or shells and add slices until the sum approaches the volume.&lt;/div&gt;
  &lt;/div&gt;
  &lt;iframe src=&quot;/interactives/chapter06/solid-of-revolution-en.html&quot; title=&quot;Solids of revolution&quot; loading=&quot;lazy&quot; style=&quot;height: 720px;&quot;&gt;&lt;/iframe&gt;
  &lt;div class=&quot;interactive-frame-foot&quot;&gt;
    &lt;a href=&quot;/interactives/chapter06/solid-of-revolution-en.html&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;Open the interactive in a new window&lt;/a&gt;
  &lt;/div&gt;
&lt;/div&gt;

&lt;h2 id=&quot;short-video&quot;&gt;Short video&lt;/h2&gt;

&lt;div class=&quot;reel-video&quot;&gt;
  &lt;video controls=&quot;&quot; playsinline=&quot;&quot; preload=&quot;metadata&quot; src=&quot;/public/videos/reels/solids-of-revolution.mp4&quot;&gt;&lt;/video&gt;
  &lt;p class=&quot;reel-caption&quot;&gt;Solid of revolution of y = √x on [0, 4]: slicing into disks or rolling into shells both give 8π (silent video, about 2 minutes).&lt;/p&gt;
&lt;/div&gt;

&lt;h2 id=&quot;applications&quot;&gt;Applications&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Engineering: tank volume.&lt;/strong&gt; A paraboloid tank is made by rotating $y=x^2$ (metres) about the $y$-axis, 4 m high. The horizontal cross-section at height $y$ is a disc of radius $\sqrt y$, so $V=\pi\int_0^4y\,dy=8\pi\approx25.1$ m³. With water at height $h$ the volume is $\tfrac\pi2h^2$: a tank filled to half its height holds only a quarter of its volume.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Economics: the Gini coefficient.&lt;/strong&gt; The area between the equality line $y=p$ and the Lorenz curve $L(p)$ is $\int_0^1\bigl(p-L(p)\bigr)\,dp$; the Gini coefficient is twice this area (lesson 04_05).&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Machine learning.&lt;/strong&gt; The area between two densities, $\tfrac12\int\lvert p-q\rvert$, is the total variation distance, used to measure how different two distributions are, for example training data and real data.&lt;/p&gt;

&lt;h2 id=&quot;exercises&quot;&gt;Exercises&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Basic.&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;Find the area enclosed by $y=x^2$ and $y=2x$.&lt;/li&gt;
  &lt;li&gt;Rotate the region under $y=\sqrt x$, $0\le x\le4$, about the $x$-axis. Find the volume.&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Answers&lt;/summary&gt;

  &lt;ol&gt;
    &lt;li&gt;Intersections $x=0,2$: $\int_0^2(2x-x^2)\,dx=4-\tfrac83=\tfrac43$.&lt;/li&gt;
    &lt;li&gt;$\pi\int_0^4x\,dx=8\pi$.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;p&gt;&lt;strong&gt;Intermediate.&lt;/strong&gt;&lt;/p&gt;

&lt;ol start=&quot;3&quot;&gt;
  &lt;li&gt;Find the area between $y=\sin x$ and $y=\cos x$ for $\tfrac\pi4\le x\le\tfrac{5\pi}4$.&lt;/li&gt;
  &lt;li&gt;Rotate the region under $y=x^2$, $0\le x\le2$, about the $y$-axis. Find the volume with shells.&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Answers&lt;/summary&gt;

  &lt;ol start=&quot;3&quot;&gt;
    &lt;li&gt;$\int_{\pi/4}^{5\pi/4}(\sin x-\cos x)\,dx=\Big[-\cos x-\sin x\Big]_{\pi/4}^{5\pi/4}=2\sqrt2$.&lt;/li&gt;
    &lt;li&gt;$2\pi\int_0^2x\cdot x^2\,dx=8\pi$.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;p&gt;&lt;strong&gt;Advanced.&lt;/strong&gt;&lt;/p&gt;

&lt;ol start=&quot;5&quot;&gt;
  &lt;li&gt;Torus: rotate the disc $(x-R)^2+y^2\le r^2$ ($0&amp;lt;r&amp;lt;R$) about the $y$-axis. Show $V=2\pi^2Rr^2$.&lt;/li&gt;
  &lt;li&gt;A solid has the disc $x^2+y^2\le1$ as base, and every cross-section perpendicular to the $x$-axis is a square. Find its volume.&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Hints&lt;/summary&gt;

  &lt;ol start=&quot;5&quot;&gt;
    &lt;li&gt;Shells: $V=2\pi\int_{R-r}^{R+r}x\cdot2\sqrt{r^2-(x-R)^2}\,dx$. Put $u=x-R$: the part $\int u\sqrt{r^2-u^2}\,du=0$ (odd), and the rest is $2\pi R\cdot2\cdot\tfrac{\pi r^2}2$.&lt;/li&gt;
    &lt;li&gt;The square has side $2\sqrt{1-x^2}$: $V=\int_{-1}^14(1-x^2)\,dx=\tfrac{16}3$.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;h2 id=&quot;summary&quot;&gt;Summary&lt;/h2&gt;

&lt;div class=&quot;content-box summary-box textbook-block&quot;&gt;
  &lt;ul&gt;
    &lt;li&gt;Area between curves: $\int(\text{top}-\text{bottom})\,dx$ or $\int(\text{right}-\text{left})\,dy$; find the intersections first.&lt;/li&gt;
    &lt;li&gt;Volume by slicing: $V=\int A(x)\,dx$.&lt;/li&gt;
    &lt;li&gt;About the $x$-axis: discs $\pi\int f^2$, washers $\pi\int(f^2-g^2)$. About the $y$-axis: shells $2\pi\int x(f-g)$.&lt;/li&gt;
    &lt;li&gt;How to set up: choose a small element, write its volume (area), then integrate.&lt;/li&gt;
  &lt;/ul&gt;
&lt;/div&gt;
</content>
 </entry>
 
 <entry>
   <title>The Gaussian integral and the Gamma function</title>
   <link href="https://calculus-self-learning.pages.dev/contents/en/chapter05/05_06_The_Gaussian_integral_and_the_Gamma_function/"/>
   <updated>2026-12-01T00:00:00+00:00</updated>
   <id>https://calculus-self-learning.pages.dev/contents/en/chapter05/05_06_The_Gaussian_integral_and_the_Gamma_function</id>
   <content type="html">&lt;div class=&quot;textbook-objectives&quot;&gt;

  &lt;p&gt;&lt;strong&gt;Learning objectives.&lt;/strong&gt; After this lesson you can:&lt;/p&gt;

  &lt;ul&gt;
    &lt;li&gt;define the Gamma function and prove that it converges for $s&amp;gt;0$;&lt;/li&gt;
    &lt;li&gt;prove $\Gamma(s+1)=s\Gamma(s)$ and $\Gamma(n)=(n-1)!$;&lt;/li&gt;
    &lt;li&gt;use the Gaussian integral $\int_{-\infty}^\infty e^{-x^2}\,dx=\sqrt\pi$ (proved in chapter 13) to find $\Gamma(\tfrac12)$ and normalise the normal distribution;&lt;/li&gt;
    &lt;li&gt;reduce integrals such as $\int_0^\infty x^ne^{-ax}\,dx$ and $\int_0^\infty x^ne^{-x^2}\,dx$ to the Gamma function.&lt;/li&gt;
  &lt;/ul&gt;

&lt;/div&gt;

&lt;h2 id=&quot;why-this-lesson&quot;&gt;Why this lesson&lt;/h2&gt;

&lt;p&gt;The normal density is $\dfrac1{\sqrt{2\pi}}e^{-x^2/2}$. Where does $\sqrt{2\pi}$ come from? The function $e^{-x^2}$ has no elementary antiderivative (lesson 04_04), yet its integral over the whole line can be computed exactly. Similarly, $n!$ is defined only for integers, but statistics needs “$(\tfrac12)!$”. Both questions lead to the same family of improper integrals.&lt;/p&gt;

&lt;h2 id=&quot;the-gamma-function&quot;&gt;The Gamma function&lt;/h2&gt;

&lt;div class=&quot;textbook-definition&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Definition 1 (Gamma function).&lt;/strong&gt; For $s&amp;gt;0$,&lt;/p&gt;

\[\Gamma(s)=\int_0^\infty x^{s-1}e^{-x}\,dx .\]

&lt;/div&gt;

&lt;div class=&quot;textbook-theorem&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Theorem 1.&lt;/strong&gt; The integral $\Gamma(s)$ converges for every $s&amp;gt;0$.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-proof&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Proof.&lt;/strong&gt; Split at 1. On $(0,1]$: $0&amp;lt;x^{s-1}e^{-x}\le x^{s-1}=\dfrac1{x^{1-s}}$ with $1-s&amp;lt;1$, so it converges by theorem 1 of lesson 05_05. On $[1,\infty)$: $x^{s-1}e^{-x/2}\to0$ as $x\to\infty$ (exponentials beat powers, lesson 02_06), so there is $C$ with $x^{s-1}e^{-x/2}\le C$, i.e. $x^{s-1}e^{-x}\le Ce^{-x/2}$, and $\int_1^\infty Ce^{-x/2}$ converges. Apply the comparison test.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-theorem&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Theorem 2 (Gamma extends the factorial).&lt;/strong&gt; $\Gamma(1)=1$ and $\Gamma(s+1)=s\,\Gamma(s)$ for $s&amp;gt;0$. Hence $\Gamma(n)=(n-1)!$ for every positive integer $n$.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-proof&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Proof.&lt;/strong&gt; $\Gamma(1)=\int_0^\infty e^{-x}\,dx=1$. Integrate by parts with $u=x^s$, $dv=e^{-x}dx$ on $[c,b]$, then let $c\to0^+$, $b\to\infty$:&lt;/p&gt;

\[\Gamma(s+1)=\Big[-x^se^{-x}\Big]_0^\infty+s\int_0^\infty x^{s-1}e^{-x}\,dx=0+s\,\Gamma(s),\]

  &lt;p&gt;because $b^se^{-b}\to0$ and $c^s\to0$. By induction $\Gamma(n)=(n-1)\Gamma(n-1)=\dots=(n-1)!\,\Gamma(1)$.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Example 1.&lt;/strong&gt; For $a&amp;gt;0$, substitute $t=ax$:&lt;/p&gt;

\[\int_0^\infty x^ne^{-ax}\,dx=\frac1{a^{n+1}}\int_0^\infty t^ne^{-t}\,dt=\frac{\Gamma(n+1)}{a^{n+1}}=\frac{n!}{a^{n+1}} .\]

  &lt;p&gt;For example $\int_0^\infty x^3e^{-2x}\,dx=\dfrac{3!}{2^4}=\dfrac38$.&lt;/p&gt;
&lt;/div&gt;

&lt;h2 id=&quot;the-gaussian-integral&quot;&gt;The Gaussian integral&lt;/h2&gt;

&lt;div class=&quot;textbook-theorem&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Theorem 3 (Gaussian integral).&lt;/strong&gt;&lt;/p&gt;

\[\int_{-\infty}^\infty e^{-x^2}\,dx=\sqrt\pi,\qquad\int_0^\infty e^{-x^2}\,dx=\frac{\sqrt\pi}2 .\]

&lt;/div&gt;

&lt;p&gt;The integral converges (example 2 of lesson 05_05). The value $\sqrt\pi$ is proved in chapter 13 with a trick: square the integral into a double integral over the plane and switch to polar coordinates. Lesson 04_05 checked it numerically: $\int_0^1e^{-x^2}\,dx\approx0.7468$, and the rest $\int_1^\infty$ is about $0.1394$, total $0.8862\approx\sqrt\pi/2$.&lt;/p&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Example 2 ($\Gamma(\frac12)$).&lt;/strong&gt; Substitute $x=u^2$, $dx=2u\,du$:&lt;/p&gt;

\[\Gamma\left(\tfrac12\right)=\int_0^\infty x^{-1/2}e^{-x}\,dx=\int_0^\infty\frac1ue^{-u^2}\,2u\,du=2\int_0^\infty e^{-u^2}\,du=\sqrt\pi .\]

  &lt;p&gt;Hence $\Gamma(\tfrac32)=\tfrac12\sqrt\pi$ and $\Gamma(\tfrac52)=\tfrac32\cdot\tfrac12\sqrt\pi=\tfrac34\sqrt\pi$.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Example 3.&lt;/strong&gt; $\int_0^\infty x^2e^{-x^2}\,dx$. Put $t=x^2$, $x=\sqrt t$, $dx=\dfrac{dt}{2\sqrt t}$:&lt;/p&gt;

\[\int_0^\infty t\,e^{-t}\frac{dt}{2\sqrt t}=\frac12\int_0^\infty t^{1/2}e^{-t}\,dt=\frac12\Gamma\left(\tfrac32\right)=\frac{\sqrt\pi}4 .\]

  &lt;p&gt;In general: $\int_0^\infty x^ne^{-x^2}\,dx=\tfrac12\Gamma\left(\tfrac{n+1}2\right)$.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;content-box insight-box textbook-block&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Stirling’s formula.&lt;/strong&gt; For large $n$, $n!=\Gamma(n+1)\approx\sqrt{2\pi n}\left(\dfrac ne\right)^n$. For $n=10$: $3\,598\,696$ against $10!=3\,628\,800$, an error of 0.83%. This formula can also be proved from the Gamma and Gaussian integrals.&lt;/p&gt;
&lt;/div&gt;

&lt;h2 id=&quot;applications&quot;&gt;Applications&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Machine learning and probability: the normal distribution.&lt;/strong&gt; Substituting $x=\mu+\sigma\sqrt2\,u$ in theorem 3:&lt;/p&gt;

\[\int_{-\infty}^\infty e^{-(x-\mu)^2/(2\sigma^2)}\,dx=\sigma\sqrt{2\pi} .\]

&lt;p&gt;So $p(x)=\dfrac1{\sigma\sqrt{2\pi}}e^{-(x-\mu)^2/(2\sigma^2)}$ has total probability 1. This normalising constant appears in the log-likelihood loss of linear regression, in Gaussian mixture models, and in VAEs.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Statistics: the Gamma distribution.&lt;/strong&gt; The waiting time until the $k$-th event in a random stream of events has density $p(x)=\dfrac{x^{k-1}e^{-x/\theta}}{\Gamma(k)\,\theta^k}$, $x&amp;gt;0$. Example 1 gives $\int_0^\infty p=1$ and mean $k\theta$ (exercise 6). The chi-squared distribution is the special case $\theta=2$, $k=\tfrac\nu2$, which is why $\Gamma$ is needed at half-integers.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Physics: the Maxwell distribution.&lt;/strong&gt; The speed of gas molecules has density proportional to $v^2e^{-av^2}$. The normalising constant and the mean speed need $\int_0^\infty v^2e^{-av^2}\,dv=\dfrac{\sqrt\pi}{4a^{3/2}}$ and $\int_0^\infty v^3e^{-av^2}\,dv=\dfrac1{2a^2}$, both from example 3 by substitution.&lt;/p&gt;

&lt;h2 id=&quot;exercises&quot;&gt;Exercises&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Basic.&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;Compute $\Gamma(5)$ and $\Gamma(\tfrac72)$.&lt;/li&gt;
  &lt;li&gt;Compute $\int_0^\infty x^4e^{-x}\,dx$ and $\int_0^\infty\sqrt x\,e^{-x}\,dx$.&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Answers&lt;/summary&gt;

  &lt;ol&gt;
    &lt;li&gt;$4!=24$; $\tfrac52\cdot\tfrac32\cdot\tfrac12\sqrt\pi=\tfrac{15}8\sqrt\pi\approx3.323$.&lt;/li&gt;
    &lt;li&gt;$\Gamma(5)=24$; $\Gamma(\tfrac32)=\tfrac{\sqrt\pi}2\approx0.886$.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;p&gt;&lt;strong&gt;Intermediate.&lt;/strong&gt;&lt;/p&gt;

&lt;ol start=&quot;3&quot;&gt;
  &lt;li&gt;Compute $\int_0^\infty e^{-x^2/2}\,dx$ and $\int_0^\infty x^3e^{-x^2}\,dx$.&lt;/li&gt;
  &lt;li&gt;Show that $\int_0^1\left(\ln\dfrac1x\right)^n\,dx=n!$.&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Answers&lt;/summary&gt;

  &lt;ol start=&quot;3&quot;&gt;
    &lt;li&gt;$x=\sqrt2u$: $\sqrt2\cdot\tfrac{\sqrt\pi}2=\sqrt{\tfrac\pi2}\approx1.2533$. $\tfrac12\Gamma(2)=\tfrac12$.&lt;/li&gt;
    &lt;li&gt;Put $x=e^{-t}$, $dx=-e^{-t}dt$; $x:0\to1$ corresponds to $t:\infty\to0$, giving $\int_0^\infty t^ne^{-t}\,dt=\Gamma(n+1)=n!$.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;p&gt;&lt;strong&gt;Advanced.&lt;/strong&gt;&lt;/p&gt;

&lt;ol start=&quot;5&quot;&gt;
  &lt;li&gt;Show that a standard normal $Z$ has $E[Z^2]=\dfrac1{\sqrt{2\pi}}\int_{-\infty}^\infty x^2e^{-x^2/2}\,dx=1$.&lt;/li&gt;
  &lt;li&gt;Show that the Gamma distribution in the applications has total probability 1 and mean $k\theta$.&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Hints&lt;/summary&gt;

  &lt;ol start=&quot;5&quot;&gt;
    &lt;li&gt;Even integrand: $\tfrac2{\sqrt{2\pi}}\int_0^\infty x^2e^{-x^2/2}\,dx$. Put $x=\sqrt2u$ and use example 3: $\tfrac2{\sqrt{2\pi}}\cdot2\sqrt2\cdot\tfrac{\sqrt\pi}4=1$.&lt;/li&gt;
    &lt;li&gt;Put $t=x/\theta$: $\int_0^\infty p=\tfrac{\Gamma(k)}{\Gamma(k)}=1$ and $\int_0^\infty xp=\theta\tfrac{\Gamma(k+1)}{\Gamma(k)}=k\theta$.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;h2 id=&quot;summary&quot;&gt;Summary&lt;/h2&gt;

&lt;div class=&quot;content-box summary-box textbook-block&quot;&gt;
  &lt;ul&gt;
    &lt;li&gt;$\Gamma(s)=\int_0^\infty x^{s-1}e^{-x}\,dx$ converges for $s&amp;gt;0$, with $\Gamma(s+1)=s\Gamma(s)$ and $\Gamma(n)=(n-1)!$.&lt;/li&gt;
    &lt;li&gt;$\int_{-\infty}^\infty e^{-x^2}\,dx=\sqrt\pi$ (proved in chapter 13), and $\Gamma(\tfrac12)=\sqrt\pi$.&lt;/li&gt;
    &lt;li&gt;$\int_0^\infty x^ne^{-ax}\,dx=\dfrac{n!}{a^{n+1}}$, $\int_0^\infty x^ne^{-x^2}\,dx=\tfrac12\Gamma\left(\tfrac{n+1}2\right)$.&lt;/li&gt;
    &lt;li&gt;The constant $\sigma\sqrt{2\pi}$ of the normal distribution and $\Gamma(k)\theta^k$ of the Gamma distribution both come from these integrals.&lt;/li&gt;
  &lt;/ul&gt;
&lt;/div&gt;
</content>
 </entry>
 
 <entry>
   <title>Improper integrals</title>
   <link href="https://calculus-self-learning.pages.dev/contents/en/chapter05/05_05_Improper_integrals/"/>
   <updated>2026-12-01T00:00:00+00:00</updated>
   <id>https://calculus-self-learning.pages.dev/contents/en/chapter05/05_05_Improper_integrals</id>
   <content type="html">&lt;div class=&quot;textbook-objectives&quot;&gt;

  &lt;p&gt;&lt;strong&gt;Learning objectives.&lt;/strong&gt; After this lesson you can:&lt;/p&gt;

  &lt;ul&gt;
    &lt;li&gt;define improper integrals of type 1 (infinite limits) and type 2 (unbounded integrands) through limits;&lt;/li&gt;
    &lt;li&gt;know when $\int_1^\infty x^{-p}\,dx$ and $\int_0^1x^{-p}\,dx$ converge;&lt;/li&gt;
    &lt;li&gt;decide convergence with the comparison test, the limit comparison test and absolute convergence;&lt;/li&gt;
    &lt;li&gt;compute escape velocity, the present value of a perpetuity and the Laplace transforms of simple functions.&lt;/li&gt;
  &lt;/ul&gt;

&lt;/div&gt;

&lt;h2 id=&quot;why-this-lesson&quot;&gt;Why this lesson&lt;/h2&gt;

&lt;p&gt;The probability that a waiting time exceeds 10 minutes is the integral of the density from 10 to infinity. The work needed to send a satellite away from Earth for good is the integral of gravity out to infinity. In lesson 04_03 we saw that $\int_{-1}^1\frac{dx}{x^2}$ gives an absurd answer because the integrand is unbounded. The Riemann integral is defined only for bounded functions on finite intervals; this lesson extends it with limits.&lt;/p&gt;

&lt;h2 id=&quot;definition&quot;&gt;Definition&lt;/h2&gt;

&lt;div class=&quot;textbook-definition&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Definition 1 (Improper integrals).&lt;/strong&gt;&lt;/p&gt;

  &lt;p&gt;&lt;strong&gt;Type 1.&lt;/strong&gt; If $f$ is integrable on $[a,b]$ for every $b&amp;gt;a$:&lt;/p&gt;

\[\int_a^\infty f(x)\,dx=\lim_{b\to\infty}\int_a^bf(x)\,dx .\]

  &lt;p&gt;Similarly for $\int_{-\infty}^b$. For $\int_{-\infty}^\infty f$, pick any $c$ and require both $\int_{-\infty}^cf$ and $\int_c^\infty f$ to converge.&lt;/p&gt;

  &lt;p&gt;&lt;strong&gt;Type 2.&lt;/strong&gt; If $f$ is integrable on $[a,c]$ for every $c&amp;lt;b$ but unbounded near $b$:&lt;/p&gt;

\[\int_a^bf(x)\,dx=\lim_{c\to b^-}\int_a^cf(x)\,dx .\]

  &lt;p&gt;Similarly when $f$ is unbounded near $a$, or near an interior point (then split there).&lt;/p&gt;

  &lt;p&gt;If the limit exists and is finite, the integral &lt;strong&gt;converges&lt;/strong&gt;; otherwise it &lt;strong&gt;diverges&lt;/strong&gt;.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Example 1.&lt;/strong&gt;&lt;/p&gt;

  &lt;ul&gt;
    &lt;li&gt;$\int_0^\infty e^{-x}\,dx=\lim_{b\to\infty}\bigl(1-e^{-b}\bigr)=1$.&lt;/li&gt;
    &lt;li&gt;$\int_{-\infty}^\infty\dfrac{dx}{1+x^2}=\lim_{b\to\infty}\arctan b-\lim_{a\to-\infty}\arctan a=\dfrac\pi2+\dfrac\pi2=\pi$.&lt;/li&gt;
    &lt;li&gt;$\int_0^1\ln x\,dx=\lim_{c\to0^+}\Big[x\ln x-x\Big]_c^1=-1-\lim_{c\to0^+}(c\ln c-c)=-1$ (since $c\ln c\to0$, lesson 02_06).&lt;/li&gt;
    &lt;li&gt;$\int_{-1}^1\dfrac{dx}{x^2}$: split at 0; $\int_0^1\dfrac{dx}{x^2}=\lim_{c\to0^+}\left(\dfrac1c-1\right)=\infty$. Divergent.&lt;/li&gt;
  &lt;/ul&gt;
&lt;/div&gt;

&lt;div class=&quot;content-box warning-box textbook-block&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Both infinite ends separately.&lt;/strong&gt; $\int_{-b}^bx\,dx=0$ for every $b$, but $\int_0^\infty x\,dx=\infty$, so $\int_{-\infty}^\infty x\,dx$ diverges. The symmetric limit $\lim_{b\to\infty}\int_{-b}^b$ is called the Cauchy principal value; it is not the definition of the improper integral.&lt;/p&gt;
&lt;/div&gt;

&lt;h2 id=&quot;p-integrals&quot;&gt;p-integrals&lt;/h2&gt;

&lt;div class=&quot;textbook-theorem&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Theorem 1.&lt;/strong&gt;&lt;/p&gt;

  &lt;ul&gt;
    &lt;li&gt;$\displaystyle\int_1^\infty\frac{dx}{x^p}$ converges if and only if $p&amp;gt;1$, and then equals $\dfrac1{p-1}$.&lt;/li&gt;
    &lt;li&gt;$\displaystyle\int_0^1\frac{dx}{x^p}$ converges if and only if $p&amp;lt;1$, and then equals $\dfrac1{1-p}$.&lt;/li&gt;
  &lt;/ul&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-proof&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Proof.&lt;/strong&gt; For $p\ne1$: $\int_1^bx^{-p}\,dx=\dfrac{b^{1-p}-1}{1-p}$. As $b\to\infty$, $b^{1-p}\to0$ if $p&amp;gt;1$ and $\to\infty$ if $p&amp;lt;1$. For $p=1$: $\int_1^b\frac{dx}x=\ln b\to\infty$. The second part is similar with $\int_c^1x^{-p}\,dx=\dfrac{1-c^{1-p}}{1-p}$ as $c\to0^+$: $c^{1-p}\to0$ exactly when $p&amp;lt;1$; for $p=1$ we get $-\ln c\to\infty$.&lt;/p&gt;
&lt;/div&gt;

&lt;p&gt;Remember: at infinity the function must decay &lt;strong&gt;faster&lt;/strong&gt; than $1/x$; near 0 it must blow up &lt;strong&gt;slower&lt;/strong&gt; than $1/x$. The function $1/x$ diverges at both ends.&lt;/p&gt;

&lt;h2 id=&quot;comparison-tests&quot;&gt;Comparison tests&lt;/h2&gt;

&lt;div class=&quot;textbook-theorem&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Theorem 2 (Comparison).&lt;/strong&gt; Suppose $0\le f(x)\le g(x)$ for $x\ge a$, with $f,g$ integrable on every $[a,b]$.&lt;/p&gt;

  &lt;ul&gt;
    &lt;li&gt;If $\int_a^\infty g$ converges, so does $\int_a^\infty f$.&lt;/li&gt;
    &lt;li&gt;If $\int_a^\infty f$ diverges, so does $\int_a^\infty g$.&lt;/li&gt;
  &lt;/ul&gt;

  &lt;p&gt;&lt;strong&gt;Theorem 3 (Limit comparison).&lt;/strong&gt; If $f,g&amp;gt;0$ and $\displaystyle\lim_{x\to\infty}\frac{f(x)}{g(x)}=L\in(0,\infty)$, then $\int_a^\infty f$ and $\int_a^\infty g$ both converge or both diverge.&lt;/p&gt;

  &lt;p&gt;&lt;strong&gt;Theorem 4 (Absolute convergence).&lt;/strong&gt; If $\int_a^\infty\lvert f\rvert$ converges, so does $\int_a^\infty f$.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-proof&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Proof (theorem 2).&lt;/strong&gt; $F(b)=\int_a^bf$ is increasing in $b$ because $f\ge0$, and $F(b)\le\int_a^bg\le\int_a^\infty g$. An increasing function that is bounded above has a finite limit as $b\to\infty$ (completeness of $\mathbb R$, lesson 00_01). The second part is the contrapositive of the first.&lt;/p&gt;
&lt;/div&gt;

&lt;p&gt;Theorem 3 follows from theorem 2: for large $x$, $\tfrac L2g\le f\le2Lg$. Theorem 4: $0\le f+\lvert f\rvert\le2\lvert f\rvert$; apply theorem 2, then subtract $\int\lvert f\rvert$.&lt;/p&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Example 2.&lt;/strong&gt;&lt;/p&gt;

  &lt;ul&gt;
    &lt;li&gt;$\int_1^\infty e^{-x^2}\,dx$ converges: for $x\ge1$, $e^{-x^2}\le e^{-x}$ and $\int_1^\infty e^{-x}$ converges.&lt;/li&gt;
    &lt;li&gt;$\int_1^\infty\dfrac{1+\sin^2x}x\,dx$ diverges: the integrand is $\ge\dfrac1x$.&lt;/li&gt;
    &lt;li&gt;$\int_1^\infty\dfrac{dx}{\sqrt{x^3+1}}$ converges: limit comparison with $x^{-3/2}$ ($p=\tfrac32&amp;gt;1$), the ratio tends to 1.&lt;/li&gt;
    &lt;li&gt;$\int_1^\infty\dfrac{\sin x}{x^2}\,dx$ converges absolutely: $\left\lvert\dfrac{\sin x}{x^2}\right\rvert\le\dfrac1{x^2}$.&lt;/li&gt;
  &lt;/ul&gt;
&lt;/div&gt;

&lt;div class=&quot;interactive-frame&quot;&gt;
  &lt;div class=&quot;interactive-frame-head&quot;&gt;
    &lt;div class=&quot;interactive-frame-title&quot;&gt;Improper integrals of 1/xᵖ&lt;/div&gt;
    &lt;div class=&quot;interactive-frame-desc&quot;&gt;Push the limit outward and move p across 1.&lt;/div&gt;
  &lt;/div&gt;
  &lt;iframe src=&quot;/interactives/chapter05/improper-integral-en.html&quot; title=&quot;Improper integrals of 1/xᵖ&quot; loading=&quot;lazy&quot; style=&quot;height: 680px;&quot;&gt;&lt;/iframe&gt;
  &lt;div class=&quot;interactive-frame-foot&quot;&gt;
    &lt;a href=&quot;/interactives/chapter05/improper-integral-en.html&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;Open the interactive in a new window&lt;/a&gt;
  &lt;/div&gt;
&lt;/div&gt;

&lt;h2 id=&quot;short-video&quot;&gt;Short video&lt;/h2&gt;

&lt;div class=&quot;reel-video&quot;&gt;
  &lt;video controls=&quot;&quot; playsinline=&quot;&quot; preload=&quot;metadata&quot; src=&quot;/public/videos/reels/gabriel-horn.mp4&quot;&gt;&lt;/video&gt;
  &lt;p class=&quot;reel-caption&quot;&gt;Gabriel&apos;s horn: finite volume π but infinite surface area, plus the paint-thickness paradox resolved (silent video, about 2 minutes).&lt;/p&gt;
&lt;/div&gt;

&lt;h2 id=&quot;applications&quot;&gt;Applications&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Physics: escape velocity.&lt;/strong&gt; The work to move a mass $m$ from the Earth’s surface (radius $R$) to infinity is&lt;/p&gt;

\[W=\int_R^\infty\frac{GMm}{r^2}\,dr=\frac{GMm}R .\]

&lt;p&gt;Setting the kinetic energy $\tfrac12mv^2=W$ and using $g=GM/R^2$: $v=\sqrt{2gR}=\sqrt{2\cdot9.8\cdot6.37\cdot10^6}\approx11.2$ km/s.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Economics: a perpetuity.&lt;/strong&gt; A perpetual bond pays $R=100$ million VND/year, continuous interest $r=8\%$: $PV=\int_0^\infty Re^{-rt}\,dt=\dfrac Rr=1250$ million VND. Compare 688.3 million for 10 years (lesson 05_01).&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Engineering: the Laplace transform.&lt;/strong&gt; $\mathcal L\lbrace f\rbrace(s)=\int_0^\infty e^{-st}f(t)\,dt$. For example $\mathcal L\lbrace e^{at}\rbrace(s)=\int_0^\infty e^{-(s-a)t}\,dt=\dfrac1{s-a}$, convergent for $s&amp;gt;a$. The Differential equations course uses this transform to solve linear equations.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Machine learning and probability.&lt;/strong&gt; A density must satisfy $\int_{-\infty}^\infty p=1$, an improper integral. The Cauchy distribution $p(x)=\dfrac1{\pi(1+x^2)}$ satisfies it (example 1), but $\int_{-\infty}^\infty\lvert x\rvert p(x)\,dx$ diverges (limit comparison with $1/x$): the Cauchy distribution has no mean, so its sample averages do not converge.&lt;/p&gt;

&lt;h2 id=&quot;exercises&quot;&gt;Exercises&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Basic.&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;Compute $\int_1^\infty\dfrac{dx}{x^3}$ and $\int_0^1\dfrac{dx}{\sqrt x}$.&lt;/li&gt;
  &lt;li&gt;Compute $\int_0^\infty xe^{-x^2}\,dx$. Decide whether $\int_2^\infty\dfrac{dx}{x\ln x}$ converges.&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Answers&lt;/summary&gt;

  &lt;ol&gt;
    &lt;li&gt;$\tfrac12$; $2$.&lt;/li&gt;
    &lt;li&gt;$\Big[-\tfrac12e^{-x^2}\Big]_0^\infty=\tfrac12$. $\int_2^b\dfrac{dx}{x\ln x}=\ln\ln b-\ln\ln2\to\infty$: divergent.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;p&gt;&lt;strong&gt;Intermediate.&lt;/strong&gt;&lt;/p&gt;

&lt;ol start=&quot;3&quot;&gt;
  &lt;li&gt;Decide convergence: $\int_1^\infty\dfrac{dx}{x^2+\sqrt x}$ and $\int_1^\infty\dfrac{2+\cos x}{\sqrt x}\,dx$.&lt;/li&gt;
  &lt;li&gt;Compute $\displaystyle\int_0^\infty\frac{dx}{\sqrt x\,(1+x)}$ (improper at both ends).&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Answers&lt;/summary&gt;

  &lt;ol start=&quot;3&quot;&gt;
    &lt;li&gt;Converges, since the integrand is $\le\tfrac1{x^2}$. Diverges, since the integrand is $\ge\tfrac1{\sqrt x}$ ($p=\tfrac12$).&lt;/li&gt;
    &lt;li&gt;$u=\sqrt x$, $dx=2u\,du$: $\int_0^\infty\dfrac{2\,du}{1+u^2}=\pi$.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;p&gt;&lt;strong&gt;Advanced.&lt;/strong&gt;&lt;/p&gt;

&lt;ol start=&quot;5&quot;&gt;
  &lt;li&gt;For which $p$ does $\int_2^\infty\dfrac{dx}{x(\ln x)^p}$ converge?&lt;/li&gt;
  &lt;li&gt;Show that $\mathcal L\lbrace t\rbrace(s)=\int_0^\infty te^{-st}\,dt=\dfrac1{s^2}$ for $s&amp;gt;0$.&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Hints&lt;/summary&gt;

  &lt;ol start=&quot;5&quot;&gt;
    &lt;li&gt;$u=\ln x$ gives $\int_{\ln2}^\infty\dfrac{du}{u^p}$: convergent exactly when $p&amp;gt;1$.&lt;/li&gt;
    &lt;li&gt;By parts with $u=t$ (as for the mean of the exponential distribution in lesson 05_02), using $be^{-sb}\to0$.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;h2 id=&quot;summary&quot;&gt;Summary&lt;/h2&gt;

&lt;div class=&quot;content-box summary-box textbook-block&quot;&gt;
  &lt;ul&gt;
    &lt;li&gt;An improper integral is the limit of ordinary integrals as a limit of integration goes to infinity or to a point where the integrand is unbounded.&lt;/li&gt;
    &lt;li&gt;$\int_1^\infty x^{-p}$ converges for $p&amp;gt;1$; $\int_0^1x^{-p}$ converges for $p&amp;lt;1$.&lt;/li&gt;
    &lt;li&gt;Compare with $x^{-p}$ or $e^{-x}$; use limit comparison for functions “of the same size”; absolute convergence implies convergence.&lt;/li&gt;
    &lt;li&gt;$\int_{-\infty}^\infty$ needs both halves to converge; the symmetric limit is not enough.&lt;/li&gt;
    &lt;li&gt;Applications: escape velocity, perpetuities, the Laplace transform, normalising densities.&lt;/li&gt;
  &lt;/ul&gt;
&lt;/div&gt;
</content>
 </entry>
 
 <entry>
   <title>Trigonometric and irrational integrals</title>
   <link href="https://calculus-self-learning.pages.dev/contents/en/chapter05/05_04_Trigonometric_and_irrational_integrals/"/>
   <updated>2026-12-01T00:00:00+00:00</updated>
   <id>https://calculus-self-learning.pages.dev/contents/en/chapter05/05_04_Trigonometric_and_irrational_integrals</id>
   <content type="html">&lt;div class=&quot;textbook-objectives&quot;&gt;

  &lt;p&gt;&lt;strong&gt;Learning objectives.&lt;/strong&gt; After this lesson you can:&lt;/p&gt;

  &lt;ul&gt;
    &lt;li&gt;compute $\int\sin^mx\cos^nx\,dx$ by peeling off a factor (odd power) or reducing powers (even powers);&lt;/li&gt;
    &lt;li&gt;use product-to-sum formulas and the orthogonality of $\sin nx$, $\cos nx$;&lt;/li&gt;
    &lt;li&gt;choose a trigonometric substitution for $\sqrt{a^2-x^2}$, $\sqrt{a^2+x^2}$, $\sqrt{x^2-a^2}$;&lt;/li&gt;
    &lt;li&gt;use $t=\tan\frac x2$ to turn a rational function of $\sin x,\cos x$ into a rational function of $t$, watching for the discontinuity of the substitution.&lt;/li&gt;
  &lt;/ul&gt;

&lt;/div&gt;

&lt;h2 id=&quot;why-this-lesson&quot;&gt;Why this lesson&lt;/h2&gt;

&lt;p&gt;The area of a disc or an ellipse, the effective value of an alternating current, and the Fourier coefficients of a signal all lead to integrals of trigonometric functions or square roots. This lesson collects the standard substitutions that reduce them to the forms of lessons 05_01 and 05_03.&lt;/p&gt;

&lt;h2 id=&quot;powers-of-sine-and-cosine&quot;&gt;Powers of sine and cosine&lt;/h2&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;strong&gt;One odd power&lt;/strong&gt;, say $\sin^{2k+1}x$: peel off $\sin x\,dx$, write the rest in terms of $\cos x$ with $\sin^2x=1-\cos^2x$, and put $u=\cos x$.&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Both powers even&lt;/strong&gt;: reduce with $\sin^2x=\dfrac{1-\cos2x}2$, $\cos^2x=\dfrac{1+\cos2x}2$, $\sin x\cos x=\dfrac{\sin2x}2$.&lt;/li&gt;
&lt;/ul&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Example 1.&lt;/strong&gt;&lt;/p&gt;

  &lt;ul&gt;
    &lt;li&gt;$\int\sin^3x\,dx=\int(1-\cos^2x)\sin x\,dx$. With $u=\cos x$: $-\int(1-u^2)\,du=-\cos x+\dfrac{\cos^3x}3+C$.&lt;/li&gt;
    &lt;li&gt;$\int\sin^2x\cos^2x\,dx=\int\dfrac{\sin^22x}4\,dx=\int\dfrac{1-\cos4x}8\,dx=\dfrac x8-\dfrac{\sin4x}{32}+C$.&lt;/li&gt;
  &lt;/ul&gt;
&lt;/div&gt;

&lt;p&gt;&lt;strong&gt;Products with different frequencies.&lt;/strong&gt; Use product-to-sum formulas, e.g. $\sin mx\sin nx=\tfrac12\bigl(\cos(m-n)x-\cos(m+n)x\bigr)$.&lt;/p&gt;

&lt;div class=&quot;textbook-theorem&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Theorem 1 (Orthogonality).&lt;/strong&gt; For positive integers $m,n$:&lt;/p&gt;

\[\int_0^{2\pi}\sin mx\sin nx\,dx=\int_0^{2\pi}\cos mx\cos nx\,dx=\begin{cases}0,&amp;amp;m\ne n\\ \pi,&amp;amp;m=n\end{cases},\qquad\int_0^{2\pi}\sin mx\cos nx\,dx=0 .\]

&lt;/div&gt;

&lt;div class=&quot;textbook-proof&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Proof (sine product).&lt;/strong&gt; For $m\ne n$: $\int_0^{2\pi}\tfrac12\bigl(\cos(m-n)x-\cos(m+n)x\bigr)dx=0$ because $\int_0^{2\pi}\cos kx\,dx=\Big[\tfrac{\sin kx}k\Big]_0^{2\pi}=0$ for every integer $k\ne0$. For $m=n$: $\int_0^{2\pi}\tfrac12(1-\cos2nx)\,dx=\pi$. The other two identities follow the same way from $\cos mx\cos nx=\tfrac12(\cos(m-n)x+\cos(m+n)x)$ and $\sin mx\cos nx=\tfrac12(\sin(m+n)x+\sin(m-n)x)$.&lt;/p&gt;
&lt;/div&gt;

&lt;h2 id=&quot;trigonometric-substitution&quot;&gt;Trigonometric substitution&lt;/h2&gt;

&lt;table&gt;
  &lt;thead&gt;
    &lt;tr&gt;
      &lt;th&gt;Expression&lt;/th&gt;
      &lt;th&gt;Substitution&lt;/th&gt;
      &lt;th&gt;Identity used&lt;/th&gt;
    &lt;/tr&gt;
  &lt;/thead&gt;
  &lt;tbody&gt;
    &lt;tr&gt;
      &lt;td&gt;$\sqrt{a^2-x^2}$&lt;/td&gt;
      &lt;td&gt;$x=a\sin t$, $t\in[-\tfrac\pi2,\tfrac\pi2]$&lt;/td&gt;
      &lt;td&gt;$1-\sin^2t=\cos^2t$&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;$\sqrt{a^2+x^2}$&lt;/td&gt;
      &lt;td&gt;$x=a\tan t$, $t\in(-\tfrac\pi2,\tfrac\pi2)$&lt;/td&gt;
      &lt;td&gt;$1+\tan^2t=\dfrac1{\cos^2t}$&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;$\sqrt{x^2-a^2}$&lt;/td&gt;
      &lt;td&gt;$x=\dfrac a{\cos t}$&lt;/td&gt;
      &lt;td&gt;$\dfrac1{\cos^2t}-1=\tan^2t$&lt;/td&gt;
    &lt;/tr&gt;
  &lt;/tbody&gt;
&lt;/table&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Example 2 (Area of an ellipse).&lt;/strong&gt; The ellipse $\dfrac{x^2}{a^2}+\dfrac{y^2}{b^2}=1$ has area $4\displaystyle\int_0^a\frac ba\sqrt{a^2-x^2}\,dx$. Put $x=a\sin t$, $dx=a\cos t\,dt$, with $t$ from $0$ to $\tfrac\pi2$:&lt;/p&gt;

\[4\frac ba\int_0^{\pi/2}a^2\cos^2t\,dt=4ab\cdot\frac\pi4=\pi ab .\]

  &lt;p&gt;With $a=b=1$: $\int_0^1\sqrt{1-x^2}\,dx=\tfrac\pi4$, a quarter of the unit disc.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Example 3.&lt;/strong&gt; $\int\dfrac{dx}{\sqrt{x^2+a^2}}$. Put $x=a\tan t$: $dx=\dfrac{a\,dt}{\cos^2t}$, $\sqrt{x^2+a^2}=\dfrac a{\cos t}$, giving $\int\dfrac{dt}{\cos t}=\ln\left\lvert\dfrac1{\cos t}+\tan t\right\rvert+C$. Back in $x$:&lt;/p&gt;

\[\int\frac{dx}{\sqrt{x^2+a^2}}=\ln\left(x+\sqrt{x^2+a^2}\right)+C .\]

  &lt;p&gt;(Check by differentiating.)&lt;/p&gt;
&lt;/div&gt;

&lt;h2 id=&quot;the-substitution-ttanfrac-x2&quot;&gt;The substitution $t=\tan\frac x2$&lt;/h2&gt;

&lt;p&gt;With $t=\tan\dfrac x2$, $x\in(-\pi,\pi)$:&lt;/p&gt;

\[\sin x=\frac{2t}{1+t^2},\qquad\cos x=\frac{1-t^2}{1+t^2},\qquad dx=\frac{2\,dt}{1+t^2}.\]

&lt;p&gt;Every rational function of $\sin x,\cos x$ becomes a rational function of $t$ (lesson 05_03). The substitution always works but is often long; use it only when the methods above do not apply.&lt;/p&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Example 4.&lt;/strong&gt; $\int\dfrac{dx}{2+\cos x}$. Substituting: $\displaystyle\int\frac{2\,dt}{2(1+t^2)+1-t^2}=\int\frac{2\,dt}{t^2+3}=\frac2{\sqrt3}\arctan\frac t{\sqrt3}+C$. So&lt;/p&gt;

\[\int\frac{dx}{2+\cos x}=\frac2{\sqrt3}\arctan\left(\frac{\tan(x/2)}{\sqrt3}\right)+C\quad\text{on }(-\pi,\pi).\]

&lt;/div&gt;

&lt;div class=&quot;content-box warning-box textbook-block&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Watch the discontinuity.&lt;/strong&gt; Plugging the limits of $[0,2\pi]$ naively into example 4: $\tan\pi=\tan0=0$, so the result is 0. That is wrong, since the integrand is positive. The antiderivative above is valid only on $(-\pi,\pi)$; $\tan(x/2)$ jumps at $x=\pi$. Correct approach: by symmetry $\int_0^{2\pi}=2\int_0^\pi$, and $\tan(x/2)\to+\infty$ as $x\to\pi^-$:&lt;/p&gt;

\[\int_0^{2\pi}\frac{dx}{2+\cos x}=2\cdot\frac2{\sqrt3}\cdot\frac\pi2=\frac{2\pi}{\sqrt3}\approx3.628 .\]

&lt;/div&gt;

&lt;h2 id=&quot;applications&quot;&gt;Applications&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Signal processing and machine learning: Fourier series.&lt;/strong&gt; Theorem 1 says the functions $1,\cos x,\sin x,\cos2x,\dots$ are “perpendicular” on $[0,2\pi]$. That is why the coefficient of a signal $f$ at frequency $n$ can be computed on its own: $a_n=\tfrac1\pi\int_0^{2\pi}f(x)\cos nx\,dx$. Fourier features and audio spectra in machine learning rest on exactly this property.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Physics: the field of a charged wire.&lt;/strong&gt; A straight wire of length $2L$ with charge density $\lambda$, and a point at distance $a$ on its perpendicular bisector. The perpendicular field component is $E=k\lambda a\displaystyle\int_{-L}^{L}\frac{dx}{(x^2+a^2)^{3/2}}$. The substitution $x=a\tan t$ gives $\displaystyle\int\frac{dx}{(x^2+a^2)^{3/2}}=\frac{x}{a^2\sqrt{x^2+a^2}}$, so $E=\dfrac{2k\lambda L}{a\sqrt{L^2+a^2}}$; as $L\to\infty$, $E\to\dfrac{2k\lambda}a$.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Electrical engineering.&lt;/strong&gt; $\int_0^{2\pi}\sin^2t\,dt=\pi$ means the average of $\sin^2$ over one period is $\tfrac12$: the origin of the factor $\tfrac1{\sqrt2}$ in effective voltage (lesson 06_04).&lt;/p&gt;

&lt;h2 id=&quot;exercises&quot;&gt;Exercises&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Basic.&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;Compute $\int\cos^3x\,dx$ and $\int_0^\pi\sin^2x\,dx$.&lt;/li&gt;
  &lt;li&gt;Compute $\int\dfrac{dx}{\sqrt{4-x^2}}$.&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Answers&lt;/summary&gt;

  &lt;ol&gt;
    &lt;li&gt;$\sin x-\dfrac{\sin^3x}3+C$; $\dfrac\pi2$.&lt;/li&gt;
    &lt;li&gt;$x=2\sin t$: $\arcsin\dfrac x2+C$.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;p&gt;&lt;strong&gt;Intermediate.&lt;/strong&gt;&lt;/p&gt;

&lt;ol start=&quot;3&quot;&gt;
  &lt;li&gt;Compute $\int\dfrac{x^2}{\sqrt{1-x^2}}\,dx$.&lt;/li&gt;
  &lt;li&gt;Compute $\int\dfrac{dx}{1+\sin x}$ with $t=\tan\frac x2$.&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Answers&lt;/summary&gt;

  &lt;ol start=&quot;3&quot;&gt;
    &lt;li&gt;$x=\sin t$: $\int\sin^2t\,dt=\tfrac t2-\tfrac{\sin2t}4$, i.e. $\dfrac{\arcsin x-x\sqrt{1-x^2}}2+C$.&lt;/li&gt;
    &lt;li&gt;$\displaystyle\int\frac{2\,dt}{(1+t)^2}=-\frac2{1+\tan(x/2)}+C$.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;p&gt;&lt;strong&gt;Advanced.&lt;/strong&gt;&lt;/p&gt;

&lt;ol start=&quot;5&quot;&gt;
  &lt;li&gt;Show $\int_0^{2\pi}\cos mx\cos nx\,dx=0$ for $m\ne n$, and compute $\int_0^{2\pi}(3\sin x+4\cos2x)^2\,dx$.&lt;/li&gt;
  &lt;li&gt;Show $\displaystyle\int_0^{2\pi}\frac{dx}{a+b\cos x}=\frac{2\pi}{\sqrt{a^2-b^2}}$ for $a&amp;gt;\lvert b\rvert$, and apply it with $a=5$, $b=3$.&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Hints&lt;/summary&gt;

  &lt;ol start=&quot;5&quot;&gt;
    &lt;li&gt;Product to sum. Expanding the square, the cross term integrates to 0: $9\pi+16\pi=25\pi$.&lt;/li&gt;
    &lt;li&gt;As in example 4 and the warning: $t=\tan\frac x2$ gives $\displaystyle2\int_0^\infty\frac{2\,dt}{(a+b)+(a-b)t^2}=\frac{2\pi}{\sqrt{a^2-b^2}}$. With $a=5$, $b=3$: $\dfrac\pi2$.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;h2 id=&quot;summary&quot;&gt;Summary&lt;/h2&gt;

&lt;div class=&quot;content-box summary-box textbook-block&quot;&gt;
  &lt;ul&gt;
    &lt;li&gt;Odd power: peel off one factor and substitute; even powers: reduce.&lt;/li&gt;
    &lt;li&gt;Different frequencies: product to sum; on $[0,2\pi]$ the functions $\sin nx$, $\cos nx$ are orthogonal.&lt;/li&gt;
    &lt;li&gt;$\sqrt{a^2-x^2}$: $x=a\sin t$; $\sqrt{a^2+x^2}$: $x=a\tan t$; $\sqrt{x^2-a^2}$: $x=a/\cos t$.&lt;/li&gt;
    &lt;li&gt;$t=\tan\frac x2$ turns a rational function of $\sin,\cos$ into a rational function, but only on $(-\pi,\pi)$: split the interval at the discontinuity.&lt;/li&gt;
  &lt;/ul&gt;
&lt;/div&gt;
</content>
 </entry>
 
 <entry>
   <title>Integrals of rational functions</title>
   <link href="https://calculus-self-learning.pages.dev/contents/en/chapter05/05_03_Integrals_of_rational_functions/"/>
   <updated>2026-12-01T00:00:00+00:00</updated>
   <id>https://calculus-self-learning.pages.dev/contents/en/chapter05/05_03_Integrals_of_rational_functions</id>
   <content type="html">&lt;div class=&quot;textbook-objectives&quot;&gt;

  &lt;p&gt;&lt;strong&gt;Learning objectives.&lt;/strong&gt; After this lesson you can:&lt;/p&gt;

  &lt;ul&gt;
    &lt;li&gt;reduce a rational function to a proper one (numerator degree below denominator degree) by polynomial division;&lt;/li&gt;
    &lt;li&gt;decompose it into partial fractions and find the coefficients;&lt;/li&gt;
    &lt;li&gt;integrate partial fractions, including those with an irreducible quadratic denominator;&lt;/li&gt;
    &lt;li&gt;solve the logistic equation with partial fractions.&lt;/li&gt;
  &lt;/ul&gt;

&lt;/div&gt;

&lt;h2 id=&quot;why-this-lesson&quot;&gt;Why this lesson&lt;/h2&gt;

&lt;p&gt;Rational functions $\dfrac{P(x)}{Q(x)}$ appear when solving separable differential equations (the logistic model), in inverse Laplace transforms, and after many substitutions (lesson 05_04). Every rational function can be integrated in elementary terms by a fixed procedure.&lt;/p&gt;

&lt;h2 id=&quot;the-procedure&quot;&gt;The procedure&lt;/h2&gt;

&lt;ol&gt;
  &lt;li&gt;If $\deg P\ge\deg Q$, divide: $\dfrac PQ=S(x)+\dfrac{R(x)}{Q(x)}$ with $\deg R&amp;lt;\deg Q$.&lt;/li&gt;
  &lt;li&gt;Factor $Q$ into linear factors $(x-a)^k$ and irreducible quadratics $(x^2+px+q)^m$ ($p^2-4q&amp;lt;0$).&lt;/li&gt;
  &lt;li&gt;Write $\dfrac RQ$ as a sum of partial fractions (theorem 1) and find the coefficients.&lt;/li&gt;
  &lt;li&gt;Integrate term by term.&lt;/li&gt;
&lt;/ol&gt;

&lt;div class=&quot;textbook-theorem&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Theorem 1 (Partial fraction decomposition).&lt;/strong&gt; Let $\deg R&amp;lt;\deg Q$. Each factor $(x-a)^k$ of $Q$ contributes the terms&lt;/p&gt;

\[\frac{A_1}{x-a}+\frac{A_2}{(x-a)^2}+\dots+\frac{A_k}{(x-a)^k},\]

  &lt;p&gt;each irreducible factor $(x^2+px+q)^m$ contributes&lt;/p&gt;

\[\frac{B_1x+C_1}{x^2+px+q}+\dots+\frac{B_mx+C_m}{(x^2+px+q)^m},\]

  &lt;p&gt;and $\dfrac RQ$ equals the sum of all these terms for unique constants.&lt;/p&gt;
&lt;/div&gt;

&lt;p&gt;The proof uses linear algebra on spaces of polynomials; we accept the result. To find the coefficients, clear denominators, then substitute convenient values of $x$ (roots of the denominator) or compare coefficients.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Basic integrals.&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;$\int\dfrac{dx}{x-a}=\ln\lvert x-a\rvert+C$, $\int\dfrac{dx}{(x-a)^k}=-\dfrac{1}{(k-1)(x-a)^{k-1}}+C$ ($k\ge2$).&lt;/li&gt;
  &lt;li&gt;For an irreducible quadratic denominator, split the numerator into (constant) × derivative of the denominator + constant, then complete the square: $\int\dfrac{dx}{(x+\alpha)^2+\beta^2}=\dfrac1\beta\arctan\dfrac{x+\alpha}\beta+C$.&lt;/li&gt;
&lt;/ul&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Example 1 (Simple roots).&lt;/strong&gt; $\displaystyle\int\frac{x+5}{x^2+x-2}\,dx$. The denominator is $(x-1)(x+2)$. Write $\dfrac{x+5}{(x-1)(x+2)}=\dfrac A{x-1}+\dfrac B{x+2}$, i.e. $x+5=A(x+2)+B(x-1)$. At $x=1$: $6=3A$, $A=2$. At $x=-2$: $3=-3B$, $B=-1$. So&lt;/p&gt;

\[\int\frac{x+5}{x^2+x-2}\,dx=2\ln\lvert x-1\rvert-\ln\lvert x+2\rvert+C .\]

&lt;/div&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Example 2 (Repeated root).&lt;/strong&gt; $\displaystyle\int\frac{x^2+1}{x(x-1)^2}\,dx$. Write $\dfrac Ax+\dfrac B{x-1}+\dfrac C{(x-1)^2}$: $x^2+1=A(x-1)^2+Bx(x-1)+Cx$. $x=0$: $A=1$. $x=1$: $C=2$. Coefficient of $x^2$: $1=A+B$, $B=0$. So&lt;/p&gt;

\[\int\frac{x^2+1}{x(x-1)^2}\,dx=\ln\lvert x\rvert-\frac2{x-1}+C .\]

&lt;/div&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Example 3 (Irreducible quadratic and division).&lt;/strong&gt;&lt;/p&gt;

  &lt;ul&gt;
    &lt;li&gt;$\displaystyle\int\frac{dx}{x^2+2x+5}=\int\frac{dx}{(x+1)^2+4}=\frac12\arctan\frac{x+1}2+C$.&lt;/li&gt;
    &lt;li&gt;$\displaystyle\int\frac{x^3}{x^2+1}\,dx$: division gives $x-\dfrac x{x^2+1}$, so the integral is $\dfrac{x^2}2-\dfrac12\ln(x^2+1)+C$.&lt;/li&gt;
  &lt;/ul&gt;
&lt;/div&gt;

&lt;div class=&quot;interactive-frame&quot;&gt;
  &lt;div class=&quot;interactive-frame-head&quot;&gt;
    &lt;div class=&quot;interactive-frame-title&quot;&gt;Partial fraction decomposition&lt;/div&gt;
    &lt;div class=&quot;interactive-frame-desc&quot;&gt;Change the numerator and the roots of the denominator and follow each step.&lt;/div&gt;
  &lt;/div&gt;
  &lt;iframe src=&quot;/interactives/chapter05/partial-fractions-en.html&quot; title=&quot;Partial fraction decomposition&quot; loading=&quot;lazy&quot; style=&quot;height: 760px;&quot;&gt;&lt;/iframe&gt;
  &lt;div class=&quot;interactive-frame-foot&quot;&gt;
    &lt;a href=&quot;/interactives/chapter05/partial-fractions-en.html&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;Open the interactive in a new window&lt;/a&gt;
  &lt;/div&gt;
&lt;/div&gt;

&lt;h2 id=&quot;applications&quot;&gt;Applications&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Biology and economics: the logistic model.&lt;/strong&gt; A quantity $P(t)$ (a population, the users of a product) grows by $\dfrac{dP}{dt}=kP\left(1-\dfrac PM\right)$ with carrying capacity $M$. Separating variables: $\displaystyle\int\frac{M\,dP}{P(M-P)}=\int k\,dt$. With $\dfrac M{P(M-P)}=\dfrac1P+\dfrac1{M-P}$ we get $\ln\dfrac P{M-P}=kt+c$, i.e.&lt;/p&gt;

\[P(t)=\frac{M}{1+Ae^{-kt}},\qquad A=\frac{M-P(0)}{P(0)} .\]

&lt;p&gt;&lt;strong&gt;Machine learning.&lt;/strong&gt; With $M=1$, $A=1$, $k=1$ this is the sigmoid $\sigma(t)=\dfrac1{1+e^{-t}}$ used in logistic regression. Its derivative $\sigma&apos;=\sigma(1-\sigma)$ is exactly the logistic equation.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Engineering: inverse Laplace transforms.&lt;/strong&gt; In circuits and control systems a solution often looks like $Y(s)=\dfrac{1}{(s+1)(s+2)}=\dfrac1{s+1}-\dfrac1{s+2}$; each term $\dfrac1{s+a}$ corresponds to $e^{-at}$, so $y(t)=e^{-t}-e^{-2t}$ (Differential equations course).&lt;/p&gt;

&lt;h2 id=&quot;exercises&quot;&gt;Exercises&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Basic.&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;Compute $\int\dfrac{dx}{x(x+1)}$.&lt;/li&gt;
  &lt;li&gt;Compute $\displaystyle\int_2^3\frac{dx}{x^2-1}$.&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Answers&lt;/summary&gt;

  &lt;ol&gt;
    &lt;li&gt;$\dfrac1x-\dfrac1{x+1}$: $\ln\left\lvert\dfrac x{x+1}\right\rvert+C$.&lt;/li&gt;
    &lt;li&gt;$\dfrac12\Big[\ln\dfrac{x-1}{x+1}\Big]_2^3=\dfrac12\left(\ln\dfrac12-\ln\dfrac13\right)=\dfrac12\ln\dfrac32\approx0.2027$.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;p&gt;&lt;strong&gt;Intermediate.&lt;/strong&gt;&lt;/p&gt;

&lt;ol start=&quot;3&quot;&gt;
  &lt;li&gt;Compute $\int\dfrac{2x+3}{x^2+2x+2}\,dx$.&lt;/li&gt;
  &lt;li&gt;Compute $\int\dfrac{dx}{x^3+x}$.&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Answers&lt;/summary&gt;

  &lt;ol start=&quot;3&quot;&gt;
    &lt;li&gt;$2x+3=(2x+2)+1$: $\ln(x^2+2x+2)+\arctan(x+1)+C$.&lt;/li&gt;
    &lt;li&gt;$\dfrac1{x(x^2+1)}=\dfrac1x-\dfrac x{x^2+1}$: $\ln\lvert x\rvert-\tfrac12\ln(x^2+1)+C$.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;p&gt;&lt;strong&gt;Advanced.&lt;/strong&gt;&lt;/p&gt;

&lt;ol start=&quot;5&quot;&gt;
  &lt;li&gt;Compute $\int\dfrac{dx}{x^4-1}$.&lt;/li&gt;
  &lt;li&gt;In the logistic model with $M=1000$, $P(0)=100$, $P(5)=500$, find $k$ and the time when $P=900$.&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Hints&lt;/summary&gt;

  &lt;ol start=&quot;5&quot;&gt;
    &lt;li&gt;$x^4-1=(x-1)(x+1)(x^2+1)$ and $\dfrac1{x^4-1}=\dfrac14\cdot\dfrac1{x-1}-\dfrac14\cdot\dfrac1{x+1}-\dfrac12\cdot\dfrac1{x^2+1}$. Answer $\dfrac14\ln\left\lvert\dfrac{x-1}{x+1}\right\rvert-\dfrac12\arctan x+C$.&lt;/li&gt;
    &lt;li&gt;$A=9$. $P(5)=500$ gives $9e^{-5k}=1$, $k=\tfrac{\ln9}5\approx0.439$. $P=900$ when $9e^{-kt}=\tfrac19$, i.e. $t=\tfrac{\ln81}k=10$.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;h2 id=&quot;summary&quot;&gt;Summary&lt;/h2&gt;

&lt;div class=&quot;content-box summary-box textbook-block&quot;&gt;
  &lt;ul&gt;
    &lt;li&gt;Divide first if the numerator degree is not below the denominator degree.&lt;/li&gt;
    &lt;li&gt;Simple root $a$: a term $\tfrac A{x-a}$; root of multiplicity $k$: $\tfrac{A_1}{x-a}+\dots+\tfrac{A_k}{(x-a)^k}$; irreducible quadratic: $\tfrac{Bx+C}{x^2+px+q}$.&lt;/li&gt;
    &lt;li&gt;Find coefficients by substituting the roots of the denominator, then compare the remaining coefficients.&lt;/li&gt;
    &lt;li&gt;The integrals give $\ln$, rational terms and $\arctan$.&lt;/li&gt;
    &lt;li&gt;The logistic equation is solved by partial fractions; the solution is the sigmoid.&lt;/li&gt;
  &lt;/ul&gt;
&lt;/div&gt;
</content>
 </entry>
 
 <entry>
   <title>Integration by parts</title>
   <link href="https://calculus-self-learning.pages.dev/contents/en/chapter05/05_02_Integration_by_parts/"/>
   <updated>2026-12-01T00:00:00+00:00</updated>
   <id>https://calculus-self-learning.pages.dev/contents/en/chapter05/05_02_Integration_by_parts</id>
   <content type="html">&lt;div class=&quot;textbook-objectives&quot;&gt;

  &lt;p&gt;&lt;strong&gt;Learning objectives.&lt;/strong&gt; After this lesson you can:&lt;/p&gt;

  &lt;ul&gt;
    &lt;li&gt;derive $\int u\,dv=uv-\int v\,du$ from the product rule;&lt;/li&gt;
    &lt;li&gt;choose $u$ and $dv$ sensibly (priority for $u$: logarithms, inverse trig, polynomials, trig, exponentials);&lt;/li&gt;
    &lt;li&gt;handle “looping” integrals such as $\int e^x\sin x\,dx$;&lt;/li&gt;
    &lt;li&gt;set up and use reduction formulas such as $\int_0^{\pi/2}\sin^nx\,dx$.&lt;/li&gt;
  &lt;/ul&gt;

&lt;/div&gt;

&lt;h2 id=&quot;why-this-lesson&quot;&gt;Why this lesson&lt;/h2&gt;

&lt;p&gt;Substitution handles composite functions, but not products of two different kinds of function such as $xe^x$, $x\sin x$, or $\ln x$ (seen as $1\cdot\ln x$). The product rule $(uv)&apos;=u&apos;v+uv&apos;$, once integrated, gives a way to move the derivative from one factor to the other.&lt;/p&gt;

&lt;h2 id=&quot;the-formula&quot;&gt;The formula&lt;/h2&gt;

&lt;div class=&quot;textbook-theorem&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Theorem 1 (Integration by parts).&lt;/strong&gt; Let $u,v$ have continuous derivatives. Then&lt;/p&gt;

\[\int u\,dv=uv-\int v\,du,\qquad \int_a^bu(x)v&apos;(x)\,dx=\Big[u(x)v(x)\Big]_a^b-\int_a^bv(x)u&apos;(x)\,dx .\]

&lt;/div&gt;

&lt;div class=&quot;textbook-proof&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Proof.&lt;/strong&gt; $(uv)&apos;=u&apos;v+uv&apos;$, so $uv$ is an antiderivative of $u&apos;v+uv&apos;$. Integrate both sides and move $\int u&apos;v$ to the right. For definite integrals apply Newton–Leibniz to $(uv)&apos;$ on $[a,b]$.&lt;/p&gt;
&lt;/div&gt;

&lt;p&gt;&lt;strong&gt;Choosing $u$.&lt;/strong&gt; Take $u$ to be the factor that gets simpler when differentiated, and $dv$ the part you can integrate. A common priority for $u$: logarithms, inverse trig, polynomials, trig, exponentials.&lt;/p&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Example 1.&lt;/strong&gt;&lt;/p&gt;

  &lt;ul&gt;
    &lt;li&gt;$\int xe^x\,dx$: $u=x$, $dv=e^x\,dx$, so $du=dx$, $v=e^x$. This gives $xe^x-\int e^x\,dx=(x-1)e^x+C$.&lt;/li&gt;
    &lt;li&gt;$\int\ln x\,dx$: $u=\ln x$, $dv=dx$, so $du=\tfrac{dx}x$, $v=x$. This gives $x\ln x-\int1\,dx=x\ln x-x+C$.&lt;/li&gt;
  &lt;/ul&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Example 2 (Twice).&lt;/strong&gt; $\int x^2\sin x\,dx$. First: $u=x^2$, $dv=\sin x\,dx$:&lt;/p&gt;

\[\int x^2\sin x\,dx=-x^2\cos x+\int2x\cos x\,dx .\]

  &lt;p&gt;Second: $u=2x$, $dv=\cos x\,dx$: $\int2x\cos x\,dx=2x\sin x-\int2\sin x\,dx=2x\sin x+2\cos x$. So&lt;/p&gt;

\[\int x^2\sin x\,dx=-x^2\cos x+2x\sin x+2\cos x+C .\]

&lt;/div&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Example 3 (Looping).&lt;/strong&gt; $I=\int e^x\sin x\,dx$. By parts with $u=\sin x$, $dv=e^x\,dx$: $I=e^x\sin x-\int e^x\cos x\,dx$. Again with $u=\cos x$: $\int e^x\cos x\,dx=e^x\cos x+I$. So $I=e^x\sin x-e^x\cos x-I$, and&lt;/p&gt;

\[I=\frac{e^x(\sin x-\cos x)}2+C .\]

&lt;/div&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Example 4 (Reduction formula).&lt;/strong&gt; Let $I_n=\int_0^{\pi/2}\sin^nx\,dx$. For $n\ge2$, with $u=\sin^{n-1}x$, $dv=\sin x\,dx$:&lt;/p&gt;

\[I_n=\Big[-\sin^{n-1}x\cos x\Big]_0^{\pi/2}+(n-1)\int_0^{\pi/2}\sin^{n-2}x\cos^2x\,dx=(n-1)(I_{n-2}-I_n),\]

  &lt;p&gt;using $\cos^2x=1-\sin^2x$. Hence $I_n=\dfrac{n-1}nI_{n-2}$. With $I_0=\tfrac\pi2$, $I_1=1$: $I_4=\tfrac34\cdot\tfrac12\cdot\tfrac\pi2=\tfrac{3\pi}{16}$, $I_5=\tfrac45\cdot\tfrac23\cdot1=\tfrac8{15}$.&lt;/p&gt;
&lt;/div&gt;

&lt;h2 id=&quot;short-video&quot;&gt;Short video&lt;/h2&gt;

&lt;div class=&quot;reel-video&quot;&gt;
  &lt;video controls=&quot;&quot; playsinline=&quot;&quot; preload=&quot;metadata&quot; src=&quot;/public/videos/reels/integration-by-parts-picture.mp4&quot;&gt;&lt;/video&gt;
  &lt;p class=&quot;reel-caption&quot;&gt;Integration by parts as a picture: in the (u, v) plane, the areas ∫u dv plus ∫v du equal the difference of the two uv rectangles; the examples ∫x cos x, ∫x²eˣ (applied twice), the loop ∫eˣ sin x, choosing u with LIATE, and ∫ln x (silent video, about 3 minutes 6 seconds).&lt;/p&gt;
&lt;/div&gt;

&lt;h2 id=&quot;applications&quot;&gt;Applications&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Physics: charge.&lt;/strong&gt; Current $i(t)=te^{-t}$ (A). Charge passing in the first second: $Q=\int_0^1te^{-t}\,dt=\Big[-(t+1)e^{-t}\Big]_0^1=1-\tfrac2e\approx0.264$ C.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Economics: a growing cash flow.&lt;/strong&gt; Cash flow $R(t)=t$ (million VND/year) for 10 years, continuous interest rate $r=0.08$. By parts with $u=t$, $dv=e^{-rt}dt$:&lt;/p&gt;

\[PV=\int_0^{10}te^{-rt}\,dt=\frac{1-e^{-rT}(1+rT)}{r^2}=\frac{1-1.8e^{-0.8}}{0.0064}\approx29.88\ \text{million VND}.\]

&lt;p&gt;&lt;strong&gt;Machine learning and probability: expectation.&lt;/strong&gt; The mean of the exponential distribution is $E[X]=\int_0^\infty t\lambda e^{-\lambda t}\,dt$. By parts with $u=t$, $\int_0^bt\lambda e^{-\lambda t}\,dt=\dfrac1\lambda-\Bigl(b+\dfrac1\lambda\Bigr)e^{-\lambda b}$, and letting $b\to\infty$ gives $E[X]=\dfrac1\lambda$ (an improper integral, lesson 05_05). The mean waiting time is the reciprocal of the rate.&lt;/p&gt;

&lt;h2 id=&quot;exercises&quot;&gt;Exercises&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Basic.&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;Compute $\int x\cos x\,dx$ and $\int\arctan x\,dx$.&lt;/li&gt;
  &lt;li&gt;Compute $\int_1^ex\ln x\,dx$.&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Answers&lt;/summary&gt;

  &lt;ol&gt;
    &lt;li&gt;$x\sin x+\cos x+C$; $x\arctan x-\tfrac12\ln(1+x^2)+C$.&lt;/li&gt;
    &lt;li&gt;$u=\ln x$, $v=\tfrac{x^2}2$: $\Big[\tfrac{x^2}2\ln x-\tfrac{x^2}4\Big]_1^e=\dfrac{e^2+1}4\approx2.097$.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;p&gt;&lt;strong&gt;Intermediate.&lt;/strong&gt;&lt;/p&gt;

&lt;ol start=&quot;3&quot;&gt;
  &lt;li&gt;Compute $\int e^{2x}\cos x\,dx$.&lt;/li&gt;
  &lt;li&gt;Compute $\int(\ln x)^2\,dx$.&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Answers&lt;/summary&gt;

  &lt;ol start=&quot;3&quot;&gt;
    &lt;li&gt;Loop as in example 3: $\dfrac{e^{2x}(2\cos x+\sin x)}5+C$.&lt;/li&gt;
    &lt;li&gt;$u=(\ln x)^2$, $dv=dx$, then use example 1: $x(\ln x)^2-2x\ln x+2x+C$.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;p&gt;&lt;strong&gt;Advanced.&lt;/strong&gt;&lt;/p&gt;

&lt;ol start=&quot;5&quot;&gt;
  &lt;li&gt;For $J_n=\int_0^1x^ne^x\,dx$, show $J_n=e-nJ_{n-1}$ and compute $J_3$.&lt;/li&gt;
  &lt;li&gt;Use $I_{2n+1}\le I_{2n}\le I_{2n-1}$ (since $0\le\sin x\le1$) and example 4 to prove Wallis’s formula $\dfrac\pi2=\displaystyle\lim_{n\to\infty}\frac{2\cdot2\cdot4\cdot4\cdots2n\cdot2n}{1\cdot3\cdot3\cdot5\cdots(2n-1)(2n+1)}$.&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Hints&lt;/summary&gt;

  &lt;ol start=&quot;5&quot;&gt;
    &lt;li&gt;$u=x^n$, $dv=e^xdx$. $J_0=e-1$, $J_1=1$, $J_2=e-2$, $J_3=6-2e\approx0.563$.&lt;/li&gt;
    &lt;li&gt;Divide by $I_{2n+1}$: $1\le\dfrac{I_{2n}}{I_{2n+1}}\le\dfrac{I_{2n-1}}{I_{2n+1}}=\dfrac{2n+1}{2n}\to1$. Write $I_{2n}$ and $I_{2n+1}$ as products using the reduction formula.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;h2 id=&quot;summary&quot;&gt;Summary&lt;/h2&gt;

&lt;div class=&quot;content-box summary-box textbook-block&quot;&gt;
  &lt;ul&gt;
    &lt;li&gt;$\int u\,dv=uv-\int v\,du$ is the product rule read backwards.&lt;/li&gt;
    &lt;li&gt;Choose $u$ to simplify on differentiation (logarithms, inverse trig, polynomials first) and $dv$ integrable.&lt;/li&gt;
    &lt;li&gt;Polynomial times exponential or trig: repeat until the polynomial is gone.&lt;/li&gt;
    &lt;li&gt;Exponential times trig: integrate by parts twice, then solve for $I$.&lt;/li&gt;
    &lt;li&gt;Reduction formulas lower the exponent, e.g. $I_n=\tfrac{n-1}nI_{n-2}$.&lt;/li&gt;
  &lt;/ul&gt;
&lt;/div&gt;
</content>
 </entry>
 
 <entry>
   <title>Substitution</title>
   <link href="https://calculus-self-learning.pages.dev/contents/en/chapter05/05_01_Substitution/"/>
   <updated>2026-12-01T00:00:00+00:00</updated>
   <id>https://calculus-self-learning.pages.dev/contents/en/chapter05/05_01_Substitution</id>
   <content type="html">&lt;div class=&quot;textbook-objectives&quot;&gt;

  &lt;p&gt;&lt;strong&gt;Learning objectives.&lt;/strong&gt; After this lesson you can:&lt;/p&gt;

  &lt;ul&gt;
    &lt;li&gt;state and prove the substitution rule for indefinite and definite integrals;&lt;/li&gt;
    &lt;li&gt;recognise the pattern $f(g(x))\,g&apos;(x)$ and choose a suitable $u=g(x)$;&lt;/li&gt;
    &lt;li&gt;change the limits correctly when substituting in a definite integral;&lt;/li&gt;
    &lt;li&gt;use substitution to prove integral identities (symmetry, shifts).&lt;/li&gt;
  &lt;/ul&gt;

&lt;/div&gt;

&lt;h2 id=&quot;why-this-lesson&quot;&gt;Why this lesson&lt;/h2&gt;

&lt;p&gt;The table of antiderivatives (lesson 04_04) does not contain $\int2x\cos(x^2)\,dx$. But $\bigl(\sin(x^2)\bigr)&apos;=\cos(x^2)\cdot2x$ by the chain rule, so the answer is $\sin(x^2)+C$. Substitution is the systematic way to do this: spot “a composite function times the derivative of its inside”.&lt;/p&gt;

&lt;h2 id=&quot;the-substitution-rule&quot;&gt;The substitution rule&lt;/h2&gt;

&lt;div class=&quot;textbook-theorem&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Theorem 1 (Substitution).&lt;/strong&gt; Let $g$ have a continuous derivative on $[a,b]$ and let $f$ be continuous on the range of $g$. Then&lt;/p&gt;

\[\int f\bigl(g(x)\bigr)g&apos;(x)\,dx=\int f(u)\,du\Big\vert_{u=g(x)},\qquad \int_a^bf\bigl(g(x)\bigr)g&apos;(x)\,dx=\int_{g(a)}^{g(b)}f(u)\,du .\]

&lt;/div&gt;

&lt;div class=&quot;textbook-proof&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Proof.&lt;/strong&gt; Let $F$ be an antiderivative of $f$. By the chain rule $\bigl(F(g(x))\bigr)&apos;=f(g(x))g&apos;(x)$, so $F(g(x))$ is an antiderivative of the left side: that is the first formula. Apply Newton–Leibniz to both sides of the second formula: the left side is $F(g(b))-F(g(a))$, the right side is $F(u)\big\vert_{g(a)}^{g(b)}$, and these are equal.&lt;/p&gt;
&lt;/div&gt;

&lt;p&gt;In practice: set $u=g(x)$, so $du=g&apos;(x)\,dx$. Replace every $x$ by $u$. For a definite integral change the limits too: $x=a\mapsto u=g(a)$, $x=b\mapsto u=g(b)$, and there is no need to go back to $x$.&lt;/p&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Example 1 (Indefinite integrals).&lt;/strong&gt;&lt;/p&gt;

  &lt;ul&gt;
    &lt;li&gt;$\int2x\cos(x^2)\,dx$: $u=x^2$, $du=2x\,dx$, giving $\int\cos u\,du=\sin(x^2)+C$.&lt;/li&gt;
    &lt;li&gt;$\int\tan x\,dx=\int\dfrac{\sin x}{\cos x}\,dx$: $u=\cos x$, $du=-\sin x\,dx$, giving $-\int\dfrac{du}u=-\ln\lvert\cos x\rvert+C$.&lt;/li&gt;
    &lt;li&gt;$\int\dfrac{dx}{x\ln x}$: $u=\ln x$, $du=\dfrac{dx}x$, giving $\int\dfrac{du}u=\ln\lvert\ln x\rvert+C$.&lt;/li&gt;
  &lt;/ul&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Example 2 (Changing the limits).&lt;/strong&gt; Compute $\displaystyle\int_0^2\frac{x}{(1+x^2)^2}\,dx$.&lt;/p&gt;

  &lt;p&gt;$u=1+x^2$, $du=2x\,dx$; $x=0\mapsto u=1$, $x=2\mapsto u=5$:&lt;/p&gt;

\[\int_1^5\frac{1}{2u^2}\,du=\frac12\Big[-\frac1u\Big]_1^5=\frac12\left(1-\frac15\right)=\frac25 .\]

&lt;/div&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Example 3 (Substitution in a proof).&lt;/strong&gt; For $f$ continuous on $[0,a]$: $\int_0^af(x)\,dx=\int_0^af(a-x)\,dx$ (put $u=a-x$). Apply it to $I=\displaystyle\int_0^{\pi/2}\frac{\sin x}{\sin x+\cos x}\,dx$: replacing $x$ by $\tfrac\pi2-x$ gives $I=\displaystyle\int_0^{\pi/2}\frac{\cos x}{\cos x+\sin x}\,dx$. Adding the two expressions: $2I=\int_0^{\pi/2}1\,dx=\tfrac\pi2$, so $I=\tfrac\pi4$.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;content-box warning-box textbook-block&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Common mistakes.&lt;/strong&gt; (1) Forgetting to change the limits, or changing them and then substituting $x$ back. (2) Leaving an $x$ in an integral in $u$: every $x$ must be written in terms of $u$. (3) Losing a constant: $du=2x\,dx$ means $x\,dx=\tfrac12du$.&lt;/p&gt;
&lt;/div&gt;

&lt;h2 id=&quot;applications&quot;&gt;Applications&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Economics: present value of a continuous cash flow.&lt;/strong&gt; A project produces a steady cash flow of $R=100$ million VND/year for $T=10$ years, with continuous interest rate $r=8\%$. Present value:&lt;/p&gt;

\[PV=\int_0^{T}Re^{-rt}\,dt=\frac Rr\left(1-e^{-rT}\right)=1250\,(1-e^{-0.8})\approx688.3\ \text{million VND}\]

&lt;p&gt;(substitute $u=-rt$).&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Machine learning and probability.&lt;/strong&gt; For the standard normal density $\varphi(x)=\tfrac1{\sqrt{2\pi}}e^{-x^2/2}$, the substitution $u=x^2/2$ gives $\int_0^ax\varphi(x)\,dx=\tfrac1{\sqrt{2\pi}}\bigl(1-e^{-a^2/2}\bigr)$. The substitution $z=(x-\mu)/\sigma$ turns any normal distribution into the standard one: this is “standardising” data in machine learning.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Physics.&lt;/strong&gt; The work done by a nonlinear spring force $F(x)=kx\sqrt{1+x^2}$ stretching from $0$ to $1$: $W=\int_0^1kx\sqrt{1+x^2}\,dx=\tfrac k3\bigl(2\sqrt2-1\bigr)$ (put $u=1+x^2$).&lt;/p&gt;

&lt;h2 id=&quot;exercises&quot;&gt;Exercises&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Basic.&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;Compute $\int(3x+2)^5\,dx$ and $\int\sin x\cos^3x\,dx$.&lt;/li&gt;
  &lt;li&gt;Compute $\int_0^{\pi/2}\sin x\cos x\,dx$.&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Answers&lt;/summary&gt;

  &lt;ol&gt;
    &lt;li&gt;$\dfrac{(3x+2)^6}{18}+C$; $-\dfrac{\cos^4x}4+C$.&lt;/li&gt;
    &lt;li&gt;$u=\sin x$: $\int_0^1u\,du=\tfrac12$.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;p&gt;&lt;strong&gt;Intermediate.&lt;/strong&gt;&lt;/p&gt;

&lt;ol start=&quot;3&quot;&gt;
  &lt;li&gt;Compute $\int\dfrac{e^x}{1+e^{2x}}\,dx$ and $\displaystyle\int_0^3\frac{x}{\sqrt{16-x^2}}\,dx$.&lt;/li&gt;
  &lt;li&gt;Compute $\displaystyle\int_e^{e^2}\frac{dx}{x\ln x}$.&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Answers&lt;/summary&gt;

  &lt;ol start=&quot;3&quot;&gt;
    &lt;li&gt;$u=e^x$: $\arctan(e^x)+C$. $u=16-x^2$: $\Big[-\sqrt{16-x^2}\Big]_0^3=4-\sqrt7\approx1.354$.&lt;/li&gt;
    &lt;li&gt;$\Big[\ln\ln x\Big]_e^{e^2}=\ln2-\ln1=\ln2$.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;p&gt;&lt;strong&gt;Advanced.&lt;/strong&gt;&lt;/p&gt;

&lt;ol start=&quot;5&quot;&gt;
  &lt;li&gt;Prove by substitution: if $f$ is odd and continuous on $[-a,a]$ then $\int_{-a}^af=0$.&lt;/li&gt;
  &lt;li&gt;Let $f$ be continuous and periodic with period $T$. Prove that $\int_a^{a+T}f=\int_0^Tf$ for every $a$.&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Hints&lt;/summary&gt;

  &lt;ol start=&quot;5&quot;&gt;
    &lt;li&gt;Split into $\int_{-a}^0+\int_0^a$; in the first put $u=-x$ to get $\int_0^af(-u)\,du=-\int_0^af$.&lt;/li&gt;
    &lt;li&gt;Write $\int_a^{a+T}=\int_a^T+\int_T^{a+T}$; in the second put $u=x-T$ and use $f(u+T)=f(u)$ to get $\int_0^af$.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;h2 id=&quot;summary&quot;&gt;Summary&lt;/h2&gt;

&lt;div class=&quot;content-box summary-box textbook-block&quot;&gt;
  &lt;ul&gt;
    &lt;li&gt;Substitution is the chain rule backwards: $\int f(g(x))g&apos;(x)\,dx=\int f(u)\,du$ with $u=g(x)$.&lt;/li&gt;
    &lt;li&gt;Look for an “inside function” whose derivative appears (up to a constant) in the integrand.&lt;/li&gt;
    &lt;li&gt;Definite integrals: change the limits to $u$ and do not go back to $x$.&lt;/li&gt;
    &lt;li&gt;Substitution also proves properties: symmetry, shifts, periodicity.&lt;/li&gt;
  &lt;/ul&gt;
&lt;/div&gt;
</content>
 </entry>
 
 <entry>
   <title>Numerical integration</title>
   <link href="https://calculus-self-learning.pages.dev/contents/en/chapter04/04_05_Numerical_integration/"/>
   <updated>2026-12-01T00:00:00+00:00</updated>
   <id>https://calculus-self-learning.pages.dev/contents/en/chapter04/04_05_Numerical_integration</id>
   <content type="html">&lt;div class=&quot;textbook-objectives&quot;&gt;

  &lt;p&gt;&lt;strong&gt;Learning objectives.&lt;/strong&gt; After this lesson you can:&lt;/p&gt;

  &lt;ul&gt;
    &lt;li&gt;approximate integrals with the midpoint, trapezoidal and Simpson rules;&lt;/li&gt;
    &lt;li&gt;use the error bounds to choose the number of subintervals $n$;&lt;/li&gt;
    &lt;li&gt;explain why the trapezoidal error shrinks like $h^2$ and Simpson’s like $h^4$;&lt;/li&gt;
    &lt;li&gt;compute the AUC of an ROC curve and the Gini coefficient from discrete data.&lt;/li&gt;
  &lt;/ul&gt;

&lt;/div&gt;

&lt;h2 id=&quot;why-this-lesson&quot;&gt;Why this lesson&lt;/h2&gt;

&lt;p&gt;$\int_0^1e^{-x^2}\,dx$ appears in probability (the normal distribution) but has no elementary antiderivative (lesson 04_04). Often a function is known only through a table of measurements. In both cases we need approximation formulas and to know how large the error can be.&lt;/p&gt;

&lt;h2 id=&quot;three-rules&quot;&gt;Three rules&lt;/h2&gt;

&lt;p&gt;Split $[a,b]$ into $n$ equal pieces with step $h=\dfrac{b-a}n$, $x_i=a+ih$, $y_i=f(x_i)$.&lt;/p&gt;

&lt;div class=&quot;textbook-definition&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Definition 1 (Quadrature rules).&lt;/strong&gt;&lt;/p&gt;

  &lt;ul&gt;
    &lt;li&gt;Midpoint: $M_n=h\sum_{i=1}^nf\!\left(\dfrac{x_{i-1}+x_i}2\right)$.&lt;/li&gt;
    &lt;li&gt;Trapezoidal: $T_n=h\left(\dfrac{y_0}2+y_1+y_2+\dots+y_{n-1}+\dfrac{y_n}2\right)=\dfrac{L_n+R_n}2$.&lt;/li&gt;
    &lt;li&gt;Simpson ($n$ even): $S_n=\dfrac h3\bigl(y_0+4y_1+2y_2+4y_3+\dots+2y_{n-2}+4y_{n-1}+y_n\bigr)$.&lt;/li&gt;
  &lt;/ul&gt;
&lt;/div&gt;

&lt;p&gt;The trapezoidal rule replaces the graph on each piece by a line segment. Simpson’s rule replaces the graph on each pair of pieces $[x_{2k},x_{2k+2}]$ by the parabola through three points.&lt;/p&gt;

&lt;div class=&quot;textbook-theorem&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Theorem 1 (Simpson is exact for cubics).&lt;/strong&gt; For every polynomial $p$ of degree at most 3,&lt;/p&gt;

\[\int_{-h}^{h}p(x)\,dx=\frac h3\bigl(p(-h)+4p(0)+p(h)\bigr).\]

&lt;/div&gt;

&lt;div class=&quot;textbook-proof&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Proof.&lt;/strong&gt; Both sides are linear in $p$, so it suffices to check $p=1,x,x^2,x^3$. For $p=1$ both sides equal $2h$. For $p=x$ and $p=x^3$ (odd functions) both sides are 0. For $p=x^2$ the left side is $\tfrac{2h^3}3$ and the right side is $\tfrac h3(h^2+0+h^2)=\tfrac{2h^3}3$.&lt;/p&gt;
&lt;/div&gt;

&lt;p&gt;Simpson’s rule is built to be exact for parabolas, but by symmetry it is exact for cubics too. That is why its error is so much smaller.&lt;/p&gt;

&lt;h2 id=&quot;error-bounds&quot;&gt;Error bounds&lt;/h2&gt;

&lt;div class=&quot;textbook-theorem&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Theorem 2 (Errors).&lt;/strong&gt; Suppose $\lvert f&apos;&apos;\rvert\le K_2$ and $\lvert f^{(4)}\rvert\le K_4$ on $[a,b]$. Then&lt;/p&gt;

\[\lvert E_T\rvert\le\frac{K_2(b-a)h^2}{12},\qquad\lvert E_M\rvert\le\frac{K_2(b-a)h^2}{24},\qquad\lvert E_S\rvert\le\frac{K_4(b-a)h^4}{180},\]

  &lt;p&gt;where $E$ is the difference between the exact and the approximate value.&lt;/p&gt;
&lt;/div&gt;

&lt;p&gt;The proof uses Taylor expansion (chapter 8); we accept the result. Practical consequence: doubling $n$ cuts the trapezoidal and midpoint errors by about 4, and Simpson’s error by about 16.&lt;/p&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Example 1.&lt;/strong&gt; Approximate $\int_0^1e^{-x^2}\,dx$ with $n=4$, $h=0.25$.&lt;/p&gt;

  &lt;table&gt;
    &lt;thead&gt;
      &lt;tr&gt;
        &lt;th&gt;$x_i$&lt;/th&gt;
        &lt;th&gt;0&lt;/th&gt;
        &lt;th&gt;0.25&lt;/th&gt;
        &lt;th&gt;0.5&lt;/th&gt;
        &lt;th&gt;0.75&lt;/th&gt;
        &lt;th&gt;1&lt;/th&gt;
      &lt;/tr&gt;
    &lt;/thead&gt;
    &lt;tbody&gt;
      &lt;tr&gt;
        &lt;td&gt;$y_i=e^{-x_i^2}$&lt;/td&gt;
        &lt;td&gt;1&lt;/td&gt;
        &lt;td&gt;0.93941&lt;/td&gt;
        &lt;td&gt;0.77880&lt;/td&gt;
        &lt;td&gt;0.56978&lt;/td&gt;
        &lt;td&gt;0.36788&lt;/td&gt;
      &lt;/tr&gt;
    &lt;/tbody&gt;
  &lt;/table&gt;

  &lt;ul&gt;
    &lt;li&gt;$T_4=0.25\,(0.5+0.93941+0.77880+0.56978+0.18394)\approx0.742983$.&lt;/li&gt;
    &lt;li&gt;$S_4=\dfrac{0.25}3\bigl(1+4\cdot0.93941+2\cdot0.77880+4\cdot0.56978+0.36788\bigr)\approx0.746853$.&lt;/li&gt;
  &lt;/ul&gt;

  &lt;p&gt;The exact value is $0.746824$. Errors:&lt;/p&gt;

  &lt;table&gt;
    &lt;thead&gt;
      &lt;tr&gt;
        &lt;th&gt;$n$&lt;/th&gt;
        &lt;th&gt;$T_n$&lt;/th&gt;
        &lt;th&gt;$M_n$&lt;/th&gt;
        &lt;th&gt;$S_n$&lt;/th&gt;
      &lt;/tr&gt;
    &lt;/thead&gt;
    &lt;tbody&gt;
      &lt;tr&gt;
        &lt;td&gt;4&lt;/td&gt;
        &lt;td&gt;$-3.8\cdot10^{-3}$&lt;/td&gt;
        &lt;td&gt;$+1.9\cdot10^{-3}$&lt;/td&gt;
        &lt;td&gt;$+3.1\cdot10^{-5}$&lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr&gt;
        &lt;td&gt;8&lt;/td&gt;
        &lt;td&gt;$-9.6\cdot10^{-4}$&lt;/td&gt;
        &lt;td&gt;$+4.8\cdot10^{-4}$&lt;/td&gt;
        &lt;td&gt;$+2.0\cdot10^{-6}$&lt;/td&gt;
      &lt;/tr&gt;
    &lt;/tbody&gt;
  &lt;/table&gt;

  &lt;p&gt;(The table lists approximation minus exact value.) Doubling $n$: the trapezoidal error drops by 4, Simpson’s by 16. The midpoint error is about half the trapezoidal error, with the opposite sign.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Example 2 (Choosing $n$).&lt;/strong&gt; How many subintervals are needed to compute $\ln2=\int_1^2\dfrac{dx}x$ with error below $10^{-4}$?&lt;/p&gt;

  &lt;p&gt;$f&apos;&apos;=\dfrac2{x^3}\le2$ on $[1,2]$. Trapezoidal: $\lvert E_T\rvert\le\dfrac{2\cdot1\cdot h^2}{12}=\dfrac1{6n^2}&amp;lt;10^{-4}$ when $n^2&amp;gt;1667$, i.e. $n\ge41$.&lt;/p&gt;

  &lt;p&gt;$f^{(4)}=\dfrac{24}{x^5}\le24$. Simpson: $\lvert E_S\rvert\le\dfrac{24}{180n^4}=\dfrac2{15n^4}&amp;lt;10^{-4}$ when $n^4&amp;gt;1334$, i.e. $n\ge7$; $n$ must be even, so $n=8$.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;interactive-frame&quot;&gt;
  &lt;div class=&quot;interactive-frame-head&quot;&gt;
    &lt;div class=&quot;interactive-frame-title&quot;&gt;Comparing the numerical rules&lt;/div&gt;
    &lt;div class=&quot;interactive-frame-desc&quot;&gt;Left, midpoint, trapezoid and Simpson, with the error against n on log–log axes.&lt;/div&gt;
  &lt;/div&gt;
  &lt;iframe src=&quot;/interactives/chapter04/numerical-integration-en.html&quot; title=&quot;Comparing the numerical rules&quot; loading=&quot;lazy&quot; style=&quot;height: 680px;&quot;&gt;&lt;/iframe&gt;
  &lt;div class=&quot;interactive-frame-foot&quot;&gt;
    &lt;a href=&quot;/interactives/chapter04/numerical-integration-en.html&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;Open the interactive in a new window&lt;/a&gt;
  &lt;/div&gt;
&lt;/div&gt;

&lt;h2 id=&quot;applications&quot;&gt;Applications&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Machine learning: the AUC of an ROC curve.&lt;/strong&gt; A classifier gives the points (false positive rate, true positive rate): $(0,0)$, $(0.1,0.5)$, $(0.3,0.75)$, $(0.6,0.9)$, $(1,1)$. The steps are uneven, so apply the trapezoid on each piece:&lt;/p&gt;

\[\text{AUC}=0.1\cdot\tfrac{0+0.5}2+0.2\cdot\tfrac{0.5+0.75}2+0.3\cdot\tfrac{0.75+0.9}2+0.4\cdot\tfrac{0.9+1}2=0.7775 .\]

&lt;p&gt;A random classifier has AUC $0.5$ and a perfect one has AUC $1$. This is also how &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;sklearn.metrics.auc&lt;/code&gt; computes it.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Economics: the Gini coefficient.&lt;/strong&gt; The Lorenz curve $L(p)$ gives the share of income held by the poorest fraction $p$ of the population. The Gini coefficient is $G=1-2\int_0^1L(p)\,dp$. With data $L(0)=0$, $L(0.2)=0.05$, $L(0.4)=0.15$, $L(0.6)=0.30$, $L(0.8)=0.52$, $L(1)=1$, the trapezoidal rule with $h=0.2$ gives&lt;/p&gt;

\[\int_0^1L\approx0.2\left(\tfrac{0+1}2+0.05+0.15+0.30+0.52\right)=0.304,\qquad G\approx1-0.608=0.392 .\]

&lt;p&gt;&lt;strong&gt;Physics.&lt;/strong&gt; For the velocity table in lesson 04_01, the trapezoidal rule gives distance $T_5=\dfrac{L_5+R_5}2=520$ m.&lt;/p&gt;

&lt;h2 id=&quot;exercises&quot;&gt;Exercises&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Basic.&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;Compute $T_4$ and $S_4$ for $\int_0^2x^3\,dx$. Compare with the exact value 4.&lt;/li&gt;
  &lt;li&gt;Compute $T_4$ and $S_4$ for $\int_0^\pi\sin x\,dx$. Compare with the exact value 2.&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Answers&lt;/summary&gt;

  &lt;ol&gt;
    &lt;li&gt;$h=0.5$, $y=0,\ 0.125,\ 1,\ 3.375,\ 8$. $T_4=0.5(0+0.125+1+3.375+4)=4.25$. $S_4=\tfrac{0.5}3(0+0.5+2+13.5+8)=4$: exact, by theorem 1.&lt;/li&gt;
    &lt;li&gt;$T_4\approx1.8961$, $S_4\approx2.0046$.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;p&gt;&lt;strong&gt;Intermediate.&lt;/strong&gt;&lt;/p&gt;

&lt;ol start=&quot;3&quot;&gt;
  &lt;li&gt;How large must $n$ be for the trapezoidal rule to compute $\int_0^1e^{-x^2}\,dx$ with error below $10^{-6}$? (Use $\lvert f&apos;&apos;\rvert=\lvert(4x^2-2)e^{-x^2}\rvert\le2$ on $[0,1]$.)&lt;/li&gt;
  &lt;li&gt;Show that $T_n=\dfrac{L_n+R_n}2$.&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Answers&lt;/summary&gt;

  &lt;ol start=&quot;3&quot;&gt;
    &lt;li&gt;$\dfrac{2h^2}{12}=\dfrac1{6n^2}&amp;lt;10^{-6}$ when $n\ge409$.&lt;/li&gt;
    &lt;li&gt;$L_n=h(y_0+\dots+y_{n-1})$, $R_n=h(y_1+\dots+y_n)$. Their average is $h\bigl(\tfrac{y_0}2+y_1+\dots+y_{n-1}+\tfrac{y_n}2\bigr)$.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;p&gt;&lt;strong&gt;Advanced.&lt;/strong&gt;&lt;/p&gt;

&lt;ol start=&quot;5&quot;&gt;
  &lt;li&gt;Show that if $f$ is convex on $[a,b]$ then $T_n\ge\int_a^bf$ (the trapezoidal rule overestimates).&lt;/li&gt;
  &lt;li&gt;Show that $S_{2n}=\dfrac{T_n+2M_n}3$ and check it numerically for $\int_0^1e^{-x^2}\,dx$, $n=4$.&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Hints&lt;/summary&gt;

  &lt;ol start=&quot;5&quot;&gt;
    &lt;li&gt;A convex function lies below its chords (lesson 03_02), so on each piece the area under the graph is at most the area of the trapezoid.&lt;/li&gt;
    &lt;li&gt;On $[x_{i-1},x_i]$ with midpoint $m_i$, $S_{2n}$ uses step $h/2$: $\tfrac{h}{6}\bigl(y_{i-1}+4f(m_i)+y_i\bigr)=\tfrac13\cdot\tfrac h2(y_{i-1}+y_i)+\tfrac23\cdot hf(m_i)$. Add up. Numerically: $\tfrac{0.742984+2\cdot0.748747}3\approx0.746826=S_8$.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;h2 id=&quot;summary&quot;&gt;Summary&lt;/h2&gt;

&lt;div class=&quot;content-box summary-box textbook-block&quot;&gt;
  &lt;ul&gt;
    &lt;li&gt;Trapezoidal: $T_n=h\bigl(\tfrac{y_0}2+y_1+\dots+\tfrac{y_n}2\bigr)$; midpoint: $M_n$; Simpson ($n$ even): weights $1,4,2,4,\dots,4,1$ times $h/3$.&lt;/li&gt;
    &lt;li&gt;Errors: $T$ and $M$ are of order $h^2$ (need a bound on $f&apos;&apos;$); Simpson is of order $h^4$ (needs a bound on $f^{(4)}$) and is exact for cubics.&lt;/li&gt;
    &lt;li&gt;Doubling $n$: the $T$ and $M$ errors drop by 4, Simpson’s by 16.&lt;/li&gt;
    &lt;li&gt;Discrete data with uneven steps (ROC, Lorenz): use the trapezoid on each piece.&lt;/li&gt;
  &lt;/ul&gt;
&lt;/div&gt;
</content>
 </entry>
 
 <entry>
   <title>Antiderivatives and indefinite integrals</title>
   <link href="https://calculus-self-learning.pages.dev/contents/en/chapter04/04_04_Antiderivatives_and_indefinite_integrals/"/>
   <updated>2026-12-01T00:00:00+00:00</updated>
   <id>https://calculus-self-learning.pages.dev/contents/en/chapter04/04_04_Antiderivatives_and_indefinite_integrals</id>
   <content type="html">&lt;div class=&quot;textbook-objectives&quot;&gt;

  &lt;p&gt;&lt;strong&gt;Learning objectives.&lt;/strong&gt; After this lesson you can:&lt;/p&gt;

  &lt;ul&gt;
    &lt;li&gt;define an antiderivative and prove that two antiderivatives on an interval differ by a constant;&lt;/li&gt;
    &lt;li&gt;use the table of basic antiderivatives, linearity and the rule for $\int f(ax+b)\,dx$;&lt;/li&gt;
    &lt;li&gt;check an answer by differentiating it;&lt;/li&gt;
    &lt;li&gt;solve initial value problems: position from acceleration, revenue from marginal revenue.&lt;/li&gt;
  &lt;/ul&gt;

&lt;/div&gt;

&lt;h2 id=&quot;why-this-lesson&quot;&gt;Why this lesson&lt;/h2&gt;

&lt;p&gt;The Newton–Leibniz formula (lesson 04_03) turns a definite integral into the search for an antiderivative. This lesson builds the “lookup table” and the simplest rules. Stronger techniques (substitution, integration by parts) come in chapter 5.&lt;/p&gt;

&lt;h2 id=&quot;antiderivatives&quot;&gt;Antiderivatives&lt;/h2&gt;

&lt;div class=&quot;textbook-definition&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Definition 1 (Antiderivative, indefinite integral).&lt;/strong&gt; $F$ is an antiderivative of $f$ on an interval $I$ if $F&apos;(x)=f(x)$ for every $x\in I$. The set of all antiderivatives of $f$ on $I$ is written&lt;/p&gt;

\[\int f(x)\,dx=F(x)+C,\]

  &lt;p&gt;the indefinite integral of $f$; $C$ is an arbitrary constant.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-theorem&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Theorem 1.&lt;/strong&gt; If $F$ and $G$ are both antiderivatives of $f$ on an interval $I$, then $G=F+C$ for some constant $C$.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-proof&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Proof.&lt;/strong&gt; $(G-F)&apos;=f-f=0$ on $I$. For $x_1&amp;lt;x_2$ in $I$, the mean value theorem (lesson 02_05) gives $(G-F)(x_2)-(G-F)(x_1)=0\cdot(x_2-x_1)=0$. So $G-F$ is constant on $I$.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;content-box warning-box textbook-block&quot;&gt;
  &lt;p&gt;&lt;strong&gt;$I$ must be an interval.&lt;/strong&gt; On $\mathbb R\setminus\lbrace0\rbrace$, the function $F(x)=\ln\lvert x\rvert$ for $x&amp;gt;0$ and $F(x)=\ln\lvert x\rvert+5$ for $x&amp;lt;0$ still has $F&apos;=1/x$, but it is not of the form $\ln\lvert x\rvert+C$ with one common constant. When we write $\int\frac{dx}x=\ln\lvert x\rvert+C$, we mean on each of $(0,\infty)$ and $(-\infty,0)$ separately.&lt;/p&gt;
&lt;/div&gt;

&lt;h2 id=&quot;table-of-basic-antiderivatives&quot;&gt;Table of basic antiderivatives&lt;/h2&gt;

&lt;p&gt;Check each row by differentiating the right-hand side.&lt;/p&gt;

&lt;table&gt;
  &lt;thead&gt;
    &lt;tr&gt;
      &lt;th&gt;$f(x)$&lt;/th&gt;
      &lt;th&gt;$\int f(x)\,dx$&lt;/th&gt;
    &lt;/tr&gt;
  &lt;/thead&gt;
  &lt;tbody&gt;
    &lt;tr&gt;
      &lt;td&gt;$x^\alpha$ ($\alpha\ne-1$)&lt;/td&gt;
      &lt;td&gt;$\dfrac{x^{\alpha+1}}{\alpha+1}+C$&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;$\dfrac1x$&lt;/td&gt;
      &lt;td&gt;$\ln\lvert x\rvert+C$&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;$e^x$&lt;/td&gt;
      &lt;td&gt;$e^x+C$&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;$a^x$ ($a&amp;gt;0$, $a\ne1$)&lt;/td&gt;
      &lt;td&gt;$\dfrac{a^x}{\ln a}+C$&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;$\sin x$&lt;/td&gt;
      &lt;td&gt;$-\cos x+C$&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;$\cos x$&lt;/td&gt;
      &lt;td&gt;$\sin x+C$&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;$\dfrac1{\cos^2x}$&lt;/td&gt;
      &lt;td&gt;$\tan x+C$&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;$\dfrac1{\sin^2x}$&lt;/td&gt;
      &lt;td&gt;$-\cot x+C$&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;$\dfrac1{\sqrt{1-x^2}}$&lt;/td&gt;
      &lt;td&gt;$\arcsin x+C$&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;$\dfrac1{1+x^2}$&lt;/td&gt;
      &lt;td&gt;$\arctan x+C$&lt;/td&gt;
    &lt;/tr&gt;
  &lt;/tbody&gt;
&lt;/table&gt;

&lt;div class=&quot;textbook-theorem&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Theorem 2 (Simple rules).&lt;/strong&gt;&lt;/p&gt;

  &lt;ol&gt;
    &lt;li&gt;Linearity: $\int\bigl(\alpha f+\beta g\bigr)\,dx=\alpha\int f\,dx+\beta\int g\,dx$.&lt;/li&gt;
    &lt;li&gt;If $\int f(x)\,dx=F(x)+C$ and $a\ne0$, then $\int f(ax+b)\,dx=\dfrac1aF(ax+b)+C$.&lt;/li&gt;
  &lt;/ol&gt;
&lt;/div&gt;

&lt;p&gt;Both follow directly from the differentiation rules: $\bigl(\tfrac1aF(ax+b)\bigr)&apos;=\tfrac1aF&apos;(ax+b)\cdot a=f(ax+b)$.&lt;/p&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Example 1.&lt;/strong&gt;&lt;/p&gt;

  &lt;ul&gt;
    &lt;li&gt;$\int\left(3x^2-\dfrac4x+e^x\right)dx=x^3-4\ln\lvert x\rvert+e^x+C$.&lt;/li&gt;
    &lt;li&gt;$\int\dfrac{(x+1)^2}{\sqrt x}\,dx=\int\bigl(x^{3/2}+2x^{1/2}+x^{-1/2}\bigr)dx=\tfrac25x^{5/2}+\tfrac43x^{3/2}+2x^{1/2}+C$.&lt;/li&gt;
    &lt;li&gt;$\int\tan^2x\,dx=\int\left(\dfrac1{\cos^2x}-1\right)dx=\tan x-x+C$.&lt;/li&gt;
    &lt;li&gt;$\int\cos(3x+1)\,dx=\tfrac13\sin(3x+1)+C$ and $\int e^{-2x}\,dx=-\tfrac12e^{-2x}+C$.&lt;/li&gt;
  &lt;/ul&gt;
&lt;/div&gt;

&lt;h2 id=&quot;initial-value-problems&quot;&gt;Initial value problems&lt;/h2&gt;

&lt;p&gt;Knowing the derivative and one value of a function determines the function: the constant $C$ is chosen to match the condition.&lt;/p&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Example 2.&lt;/strong&gt; Find $f$ with $f&apos;(x)=6x-2$ and $f(1)=4$.&lt;/p&gt;

  &lt;p&gt;$f(x)=3x^2-2x+C$. From $f(1)=3-2+C=4$ we get $C=3$. So $f(x)=3x^2-2x+3$.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Example 3 (Vertical throw).&lt;/strong&gt; A ball is thrown up from the ground at 20 m/s; the acceleration is $a(t)=-9.8$ m/s².&lt;/p&gt;

  &lt;p&gt;$v(t)=\int a\,dt=-9.8t+C_1$, and $v(0)=20$ gives $v(t)=20-9.8t$. $s(t)=\int v\,dt=20t-4.9t^2+C_2$, and $s(0)=0$ gives $C_2=0$.&lt;/p&gt;

  &lt;p&gt;The ball is highest when $v=0$, at $t=\tfrac{20}{9.8}\approx2.04$ s, with height $s=\tfrac{20^2}{2\cdot9.8}\approx20.4$ m.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;content-box insight-box textbook-block&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Not every function has an elementary antiderivative.&lt;/strong&gt; $e^{-x^2}$, $\dfrac{\sin x}x$, $\sin(x^2)$, $\dfrac1{\ln x}$ are continuous, so they have antiderivatives (theorem 1 of lesson 04_03), but these cannot be written with finitely many operations on elementary functions. Then we use numerical integration (lesson 04_05) or series (chapter 8).&lt;/p&gt;
&lt;/div&gt;

&lt;h2 id=&quot;applications&quot;&gt;Applications&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Economics: from marginal revenue to demand.&lt;/strong&gt; Marginal revenue $R&apos;(q)=100-0.4q$ (thousand VND) and $R(0)=0$. Then $R(q)=100q-0.2q^2$, and the corresponding price is $p=R/q=100-0.2q$: integrating marginal revenue recovers the demand curve.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Machine learning: softplus is an antiderivative of the sigmoid.&lt;/strong&gt; The sigmoid is $\sigma(x)=\dfrac{1}{1+e^{-x}}=\dfrac{e^x}{1+e^x}$. Since $\bigl(\ln(1+e^x)\bigr)&apos;=\dfrac{e^x}{1+e^x}$,&lt;/p&gt;

\[\int\sigma(x)\,dx=\ln(1+e^x)+C .\]

&lt;p&gt;The function $\ln(1+e^x)$ is called softplus, a smooth activation function close to ReLU $\max(0,x)$.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Physics.&lt;/strong&gt; Example 3: acceleration → velocity → position, each step an antiderivative with an initial condition.&lt;/p&gt;

&lt;h2 id=&quot;exercises&quot;&gt;Exercises&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Basic.&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;Compute $\int\left(5x^4-3\sqrt x+\dfrac2x\right)dx$.&lt;/li&gt;
  &lt;li&gt;Compute $\int(2\sin x+3\cos x)\,dx$ and $\int\dfrac{dx}{2x+5}$.&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Answers&lt;/summary&gt;

  &lt;ol&gt;
    &lt;li&gt;$x^5-2x^{3/2}+2\ln\lvert x\rvert+C$.&lt;/li&gt;
    &lt;li&gt;$-2\cos x+3\sin x+C$; $\tfrac12\ln\lvert2x+5\rvert+C$.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;p&gt;&lt;strong&gt;Intermediate.&lt;/strong&gt;&lt;/p&gt;

&lt;ol start=&quot;3&quot;&gt;
  &lt;li&gt;Compute $\int\dfrac{dx}{x^2(1+x^2)}$ (hint: $\dfrac1{x^2(1+x^2)}=\dfrac1{x^2}-\dfrac1{1+x^2}$).&lt;/li&gt;
  &lt;li&gt;Compute $\int\sin^2x\,dx$ with the power-reduction formula.&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Answers&lt;/summary&gt;

  &lt;ol start=&quot;3&quot;&gt;
    &lt;li&gt;$-\dfrac1x-\arctan x+C$.&lt;/li&gt;
    &lt;li&gt;$\sin^2x=\dfrac{1-\cos2x}2$, so $\int\sin^2x\,dx=\dfrac x2-\dfrac{\sin2x}4+C$.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;p&gt;&lt;strong&gt;Advanced.&lt;/strong&gt;&lt;/p&gt;

&lt;ol start=&quot;5&quot;&gt;
  &lt;li&gt;Find $f$ with $f&apos;&apos;(x)=12x$, $f&apos;(0)=-2$, $f(0)=1$.&lt;/li&gt;
  &lt;li&gt;Find $F$ on $\mathbb R\setminus\lbrace0\rbrace$ with $F&apos;(x)=\dfrac1x$, $F(1)=0$ and $F(-1)=5$. Why does this not contradict theorem 1?&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Hints&lt;/summary&gt;

  &lt;ol start=&quot;5&quot;&gt;
    &lt;li&gt;$f&apos;(x)=6x^2-2$, $f(x)=2x^3-2x+1$.&lt;/li&gt;
    &lt;li&gt;$F(x)=\ln x$ for $x&amp;gt;0$ and $F(x)=\ln(-x)+5$ for $x&amp;lt;0$. Theorem 1 applies only on an interval; this domain consists of two disjoint intervals, each with its own constant.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;h2 id=&quot;summary&quot;&gt;Summary&lt;/h2&gt;

&lt;div class=&quot;content-box summary-box textbook-block&quot;&gt;
  &lt;ul&gt;
    &lt;li&gt;$F$ is an antiderivative of $f$ if $F&apos;=f$; on an interval every antiderivative has the form $F+C$.&lt;/li&gt;
    &lt;li&gt;Learn the table of basic antiderivatives and always check by differentiating.&lt;/li&gt;
    &lt;li&gt;$\int f(ax+b)\,dx=\tfrac1aF(ax+b)+C$.&lt;/li&gt;
    &lt;li&gt;Initial value problems: take an antiderivative, then use the initial condition to find $C$.&lt;/li&gt;
    &lt;li&gt;Some continuous functions, such as $e^{-x^2}$, have no elementary antiderivative.&lt;/li&gt;
  &lt;/ul&gt;
&lt;/div&gt;
</content>
 </entry>
 
 <entry>
   <title>The fundamental theorem of calculus</title>
   <link href="https://calculus-self-learning.pages.dev/contents/en/chapter04/04_03_The_fundamental_theorem_of_calculus/"/>
   <updated>2026-12-01T00:00:00+00:00</updated>
   <id>https://calculus-self-learning.pages.dev/contents/en/chapter04/04_03_The_fundamental_theorem_of_calculus</id>
   <content type="html">&lt;div class=&quot;textbook-objectives&quot;&gt;

  &lt;p&gt;&lt;strong&gt;Learning objectives.&lt;/strong&gt; After this lesson you can:&lt;/p&gt;

  &lt;ul&gt;
    &lt;li&gt;state and prove both parts of the fundamental theorem of calculus;&lt;/li&gt;
    &lt;li&gt;evaluate definite integrals with the Newton–Leibniz formula;&lt;/li&gt;
    &lt;li&gt;differentiate functions of the form $\int_{u(x)}^{v(x)}f(t)\,dt$;&lt;/li&gt;
    &lt;li&gt;recognise when Newton–Leibniz may not be used (an integrand that is not continuous on the interval).&lt;/li&gt;
  &lt;/ul&gt;

&lt;/div&gt;

&lt;h2 id=&quot;why-this-lesson&quot;&gt;Why this lesson&lt;/h2&gt;

&lt;p&gt;Computing $\int_0^1x^2\,dx$ with Riemann sums needs the formula for $\sum i^2$ and a limit. For $\int_0^\pi\sin x\,dx$ that route is painful. Newton and Leibniz saw that integration and differentiation are inverse operations. If we can find a function whose derivative is $f$, the integral is just a subtraction.&lt;/p&gt;

&lt;p&gt;Picture it: $v(t)$ is velocity, $s(t)$ is position. We know $s&apos;=v$, and the displacement over $[a,b]$ is $\int_a^bv\,dt$, which also equals $s(b)-s(a)$. The fundamental theorem turns this observation into a theorem for every continuous function.&lt;/p&gt;

&lt;h2 id=&quot;the-area-function&quot;&gt;The area function&lt;/h2&gt;

&lt;p&gt;Let $f$ be continuous on $[a,b]$ and put&lt;/p&gt;

\[F(x)=\int_a^xf(t)\,dt,\qquad a\le x\le b .\]

&lt;p&gt;$F(x)$ is the signed area under the graph from $a$ to $x$. When $x$ grows by a small $h$, the area gains a thin strip that is almost a rectangle of height $f(x)$ and width $h$. So $F(x+h)-F(x)\approx f(x)h$, that is, $F&apos;(x)=f(x)$.&lt;/p&gt;

&lt;div class=&quot;textbook-theorem&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Theorem 1 (Fundamental theorem, part 1).&lt;/strong&gt; If $f$ is continuous on $[a,b]$, then $F(x)=\int_a^xf(t)\,dt$ is differentiable on $(a,b)$ (one-sided at the endpoints) and&lt;/p&gt;

\[F&apos;(x)=f(x).\]

&lt;/div&gt;

&lt;div class=&quot;textbook-proof&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Proof.&lt;/strong&gt; Take $h&amp;gt;0$ (the case $h&amp;lt;0$ is similar). By additivity,&lt;/p&gt;

\[\frac{F(x+h)-F(x)}h=\frac1h\int_x^{x+h}f(t)\,dt .\]

  &lt;p&gt;Let $m_h$, $M_h$ be the minimum and maximum of $f$ on $[x,x+h]$ (they exist by Weierstrass). The bounds property gives $m_h\le\dfrac1h\int_x^{x+h}f\le M_h$. As $h\to0^+$, continuity of $f$ at $x$ makes both $m_h$ and $M_h$ tend to $f(x)$. By the squeeze theorem the difference quotient tends to $f(x)$.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-theorem&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Theorem 2 (Fundamental theorem, part 2: the Newton–Leibniz formula).&lt;/strong&gt; If $f$ is continuous on $[a,b]$ and $G$ is an antiderivative of $f$, i.e. $G&apos;=f$ on $[a,b]$, then&lt;/p&gt;

\[\int_a^bf(x)\,dx=G(b)-G(a)=\Big[G(x)\Big]_a^b .\]

&lt;/div&gt;

&lt;div class=&quot;textbook-proof&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Proof.&lt;/strong&gt; By theorem 1, $F(x)=\int_a^xf$ also satisfies $F&apos;=f$. So $(F-G)&apos;=0$ on $[a,b]$ and $F-G$ is a constant $C$ (a corollary of the mean value theorem, lesson 02_05). At $x=a$: $C=F(a)-G(a)=-G(a)$. At $x=b$: $\int_a^bf=F(b)=G(b)+C=G(b)-G(a)$.&lt;/p&gt;
&lt;/div&gt;

&lt;h2 id=&quot;examples&quot;&gt;Examples&lt;/h2&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Example 1.&lt;/strong&gt; Using familiar antiderivatives (lesson 04_04 lists them):&lt;/p&gt;

  &lt;ul&gt;
    &lt;li&gt;$\int_0^1x^2\,dx=\Big[\tfrac{x^3}3\Big]_0^1=\tfrac13$, matching lesson 04_01.&lt;/li&gt;
    &lt;li&gt;$\int_0^\pi\sin x\,dx=\Big[-\cos x\Big]_0^\pi=1-(-1)=2$.&lt;/li&gt;
    &lt;li&gt;$\int_0^1\sqrt x\,dx=\Big[\tfrac23x^{3/2}\Big]_0^1=\tfrac23$.&lt;/li&gt;
    &lt;li&gt;$\int_0^1\dfrac{dx}{1+x^2}=\Big[\arctan x\Big]_0^1=\dfrac\pi4$. Together with exercise 6 of lesson 04_01: $\displaystyle\lim_{n\to\infty}\sum_{i=1}^n\frac n{n^2+i^2}=\frac\pi4$.&lt;/li&gt;
  &lt;/ul&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Example 2 (Variable limits).&lt;/strong&gt; Find $\dfrac{d}{dx}\displaystyle\int_0^{x^2}\sin(t^2)\,dt$.&lt;/p&gt;

  &lt;p&gt;Let $F(u)=\int_0^u\sin(t^2)\,dt$; the expression is $F(x^2)$. By theorem 1 and the chain rule: $\dfrac{d}{dx}F(x^2)=F&apos;(x^2)\cdot2x=2x\sin(x^4)$.&lt;/p&gt;

  &lt;p&gt;In general, for continuous $f$ and differentiable $u,v$:&lt;/p&gt;

\[\frac{d}{dx}\int_{u(x)}^{v(x)}f(t)\,dt=f\bigl(v(x)\bigr)v&apos;(x)-f\bigl(u(x)\bigr)u&apos;(x).\]

&lt;/div&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Example 3 (Not continuous, not allowed).&lt;/strong&gt; A naive computation: $\int_{-1}^1\dfrac{dx}{x^2}=\Big[-\dfrac1x\Big]_{-1}^1=-1-1=-2$. A negative answer for a positive function: wrong. The reason is that $1/x^2$ is unbounded near $0$, so it is not integrable on $[-1,1]$, and theorem 2 needs $f$ continuous on the whole interval. This is an improper integral, and it diverges (lesson 05_05).&lt;/p&gt;
&lt;/div&gt;

&lt;h2 id=&quot;short-video&quot;&gt;Short video&lt;/h2&gt;

&lt;div class=&quot;reel-video&quot;&gt;
  &lt;video controls=&quot;&quot; playsinline=&quot;&quot; preload=&quot;metadata&quot; src=&quot;/public/videos/reels/fundamental-theorem.mp4&quot;&gt;&lt;/video&gt;
  &lt;p class=&quot;reel-caption&quot;&gt;The fundamental theorem of calculus: a velocity graph; the accumulated area is drawn as the distance graph, whose slope equals the height of the velocity graph (silent video, about 1 minute 55 seconds).&lt;/p&gt;
&lt;/div&gt;

&lt;h2 id=&quot;applications&quot;&gt;Applications&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Physics: free fall.&lt;/strong&gt; Velocity $v(t)=9.8t$ (m/s). Distance fallen in the first 3 seconds: $\int_0^39.8t\,dt=\Big[4.9t^2\Big]_0^3=44.1$ m.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Economics: marginal cost.&lt;/strong&gt; With $C&apos;(q)=50-0.2q$, the extra cost of going from 0 to 100 items is $C(100)-C(0)=\int_0^{100}(50-0.2q)\,dq=\Big[50q-0.1q^2\Big]_0^{100}=4000$ thousand VND, as the midpoint sum in lesson 04_01 found.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Machine learning and probability: the distribution function.&lt;/strong&gt; If $X$ has density $p$, the distribution function $F(x)=P(X\le x)=\int_{-\infty}^xp(t)\,dt$ satisfies $F&apos;=p$ (theorem 1). The exponential distribution (waiting times) has $p(t)=\lambda e^{-\lambda t}$ for $t\ge0$, so&lt;/p&gt;

\[P(X\le x)=\int_0^x\lambda e^{-\lambda t}\,dt=\Big[-e^{-\lambda t}\Big]_0^x=1-e^{-\lambda x}.\]

&lt;h2 id=&quot;exercises&quot;&gt;Exercises&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Basic.&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;Compute $\int_1^4\left(2x-\dfrac1{\sqrt x}\right)dx$ and $\int_0^{\pi/2}\cos x\,dx$.&lt;/li&gt;
  &lt;li&gt;Find $\dfrac{d}{dx}\displaystyle\int_1^x\sqrt{1+t^3}\,dt$.&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Answers&lt;/summary&gt;

  &lt;ol&gt;
    &lt;li&gt;$\Big[x^2-2\sqrt x\Big]_1^4=(16-4)-(1-2)=13$; $\Big[\sin x\Big]_0^{\pi/2}=1$.&lt;/li&gt;
    &lt;li&gt;$\sqrt{1+x^3}$.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;p&gt;&lt;strong&gt;Intermediate.&lt;/strong&gt;&lt;/p&gt;

&lt;ol start=&quot;3&quot;&gt;
  &lt;li&gt;Find $\dfrac{d}{dx}\displaystyle\int_x^{x^3}e^{t^2}\,dt$.&lt;/li&gt;
  &lt;li&gt;Find a continuous $f$ with $\int_0^xf(t)\,dt=x^2+\sin x$ for all $x$.&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Answers&lt;/summary&gt;

  &lt;ol start=&quot;3&quot;&gt;
    &lt;li&gt;$3x^2e^{x^6}-e^{x^2}$.&lt;/li&gt;
    &lt;li&gt;Differentiate both sides: $f(x)=2x+\cos x$. (Check at $x=0$: both sides are 0.)&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;p&gt;&lt;strong&gt;Advanced.&lt;/strong&gt;&lt;/p&gt;

&lt;ol start=&quot;5&quot;&gt;
  &lt;li&gt;Find $\displaystyle\lim_{x\to0}\frac1x\int_0^x\cos(t^2)\,dt$.&lt;/li&gt;
  &lt;li&gt;Find $\displaystyle\lim_{x\to0}\frac{\int_0^x\sin(t^2)\,dt}{x^3}$.&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Hints&lt;/summary&gt;

  &lt;ol start=&quot;5&quot;&gt;
    &lt;li&gt;It is the difference quotient of $F(x)=\int_0^x\cos(t^2)\,dt$ at 0, so the limit is $F&apos;(0)=\cos0=1$.&lt;/li&gt;
    &lt;li&gt;A $0/0$ form; L’Hôpital and theorem 1 give $\displaystyle\lim\frac{\sin(x^2)}{3x^2}=\frac13$.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;h2 id=&quot;summary&quot;&gt;Summary&lt;/h2&gt;

&lt;div class=&quot;content-box summary-box textbook-block&quot;&gt;
  &lt;ul&gt;
    &lt;li&gt;Part 1: for continuous $f$, $\dfrac{d}{dx}\int_a^xf(t)\,dt=f(x)$. The integral with a variable upper limit is an antiderivative.&lt;/li&gt;
    &lt;li&gt;Part 2: $\int_a^bf=G(b)-G(a)$ for any antiderivative $G$ of a continuous $f$.&lt;/li&gt;
    &lt;li&gt;Variable limits: $\frac{d}{dx}\int_{u}^{v}f=f(v)v&apos;-f(u)u&apos;$.&lt;/li&gt;
    &lt;li&gt;Newton–Leibniz needs $f$ continuous on the whole interval; otherwise the result can be completely wrong.&lt;/li&gt;
    &lt;li&gt;Distance is a difference of positions; total cost a difference of costs; probability a difference of the distribution function.&lt;/li&gt;
  &lt;/ul&gt;
&lt;/div&gt;
</content>
 </entry>
 
 <entry>
   <title>The definite integral and its properties</title>
   <link href="https://calculus-self-learning.pages.dev/contents/en/chapter04/04_02_The_definite_integral_and_its_properties/"/>
   <updated>2026-12-01T00:00:00+00:00</updated>
   <id>https://calculus-self-learning.pages.dev/contents/en/chapter04/04_02_The_definite_integral_and_its_properties</id>
   <content type="html">&lt;div class=&quot;textbook-objectives&quot;&gt;

  &lt;p&gt;&lt;strong&gt;Learning objectives.&lt;/strong&gt; After this lesson you can:&lt;/p&gt;

  &lt;ul&gt;
    &lt;li&gt;state the definition of the definite integral through Riemann sums;&lt;/li&gt;
    &lt;li&gt;know that continuous and monotone functions on a closed interval are integrable, and that some bounded functions are not;&lt;/li&gt;
    &lt;li&gt;use linearity, additivity over intervals, comparison and symmetry to compute or estimate integrals;&lt;/li&gt;
    &lt;li&gt;tell displacement apart from distance travelled.&lt;/li&gt;
  &lt;/ul&gt;

&lt;/div&gt;

&lt;h2 id=&quot;why-this-lesson&quot;&gt;Why this lesson&lt;/h2&gt;

&lt;p&gt;In lesson 04_01 the Riemann sums of $x^2$ on $[0,1]$ approached $1/3$ for all three sample-point rules. We want a definition that does not depend on how we partition or pick sample points, and rules of computation so that we do not have to take a limit of sums every time.&lt;/p&gt;

&lt;h2 id=&quot;definition&quot;&gt;Definition&lt;/h2&gt;

&lt;p&gt;For a partition $P$, let $\lVert P\rVert=\max_i\Delta x_i$ be its mesh (the largest step).&lt;/p&gt;

&lt;div class=&quot;textbook-definition&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Definition 1 (Definite integral).&lt;/strong&gt; A function $f$ on $[a,b]$ is (Riemann) integrable if there is a number $I$ such that for every $\varepsilon&amp;gt;0$ there is $\delta&amp;gt;0$ with $\left\lvert\sum f(\xi_i)\Delta x_i-I\right\rvert&amp;lt;\varepsilon$ for every Riemann sum with $\lVert P\rVert&amp;lt;\delta$, whatever the sample points. Then&lt;/p&gt;

\[\int_a^b f(x)\,dx=I=\lim_{\lVert P\rVert\to0}\sum_{i=1}^n f(\xi_i)\,\Delta x_i .\]

&lt;/div&gt;

&lt;p&gt;The sign $\int$ is an elongated S (sum), and $dx$ recalls $\Delta x$. The variable $x$ is a dummy variable: $\int_a^bf(x)\,dx=\int_a^bf(t)\,dt$.&lt;/p&gt;

&lt;p&gt;Conventions: $\int_a^af=0$ and $\int_b^af=-\int_a^bf$.&lt;/p&gt;

&lt;div class=&quot;textbook-theorem&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Theorem 1 (Integrable functions).&lt;/strong&gt; On a closed interval $[a,b]$:&lt;/p&gt;

  &lt;ol&gt;
    &lt;li&gt;continuous functions are integrable;&lt;/li&gt;
    &lt;li&gt;monotone functions are integrable;&lt;/li&gt;
    &lt;li&gt;bounded functions with finitely many discontinuities are integrable, and changing the values at finitely many points does not change the integral.&lt;/li&gt;
  &lt;/ol&gt;

  &lt;p&gt;Integrable functions are bounded.&lt;/p&gt;
&lt;/div&gt;

&lt;p&gt;The proof of part 1 uses uniform continuity (lesson 01_06) and is left as further reading. Part 2 for uniform partitions follows from theorem 1 of lesson 04_01: every Riemann sum lies between $L_n$ and $R_n$, which differ by $\lvert f(b)-f(a)\rvert(b-a)/n\to0$.&lt;/p&gt;

&lt;div class=&quot;content-box warning-box textbook-block&quot;&gt;
  &lt;p&gt;&lt;strong&gt;A bounded function that is not integrable.&lt;/strong&gt; The Dirichlet function is $D(x)=1$ for rational $x$ and $D(x)=0$ for irrational $x$. On $[0,1]$ every subinterval contains both rationals and irrationals. Choosing all $\xi_i$ rational gives Riemann sum 1; choosing all $\xi_i$ irrational gives 0. There is no common limit, so $D$ is not Riemann integrable.&lt;/p&gt;
&lt;/div&gt;

&lt;h2 id=&quot;properties&quot;&gt;Properties&lt;/h2&gt;

&lt;div class=&quot;textbook-theorem&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Theorem 2 (Properties of the integral).&lt;/strong&gt; Let $f,g$ be integrable on the relevant intervals and $c$ a constant.&lt;/p&gt;

  &lt;ol&gt;
    &lt;li&gt;Linearity: $\int_a^b(f+g)=\int_a^bf+\int_a^bg$ and $\int_a^bcf=c\int_a^bf$.&lt;/li&gt;
    &lt;li&gt;Additivity: $\int_a^bf=\int_a^cf+\int_c^bf$ for all $a,b,c$ (when the integrals exist).&lt;/li&gt;
    &lt;li&gt;Comparison: if $f\le g$ on $[a,b]$ ($a&amp;lt;b$) then $\int_a^bf\le\int_a^bg$.&lt;/li&gt;
    &lt;li&gt;Bounds: if $m\le f\le M$ on $[a,b]$ then $m(b-a)\le\int_a^bf\le M(b-a)$.&lt;/li&gt;
    &lt;li&gt;$\left\lvert\int_a^bf\right\rvert\le\int_a^b\lvert f\rvert$.&lt;/li&gt;
  &lt;/ol&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-proof&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Proof (1, 3, 4).&lt;/strong&gt; For the same partition and sample points, $\sum(f+g)(\xi_i)\Delta x_i=\sum f(\xi_i)\Delta x_i+\sum g(\xi_i)\Delta x_i$ and $\sum cf(\xi_i)\Delta x_i=c\sum f(\xi_i)\Delta x_i$. Letting $\lVert P\rVert\to0$ gives (1). If $f\le g$, each Riemann sum of $f$ is at most the corresponding sum of $g$, and limits preserve $\le$, giving (3). Applying (3) to $m\le f\le M$ and using $\int_a^bm\,dx=m(b-a)$ gives (4).&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-theorem&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Theorem 3 (Symmetry).&lt;/strong&gt; Let $f$ be integrable on $[-a,a]$.&lt;/p&gt;

  &lt;ul&gt;
    &lt;li&gt;If $f$ is odd, $\int_{-a}^af=0$.&lt;/li&gt;
    &lt;li&gt;If $f$ is even, $\int_{-a}^af=2\int_0^af$.&lt;/li&gt;
  &lt;/ul&gt;
&lt;/div&gt;

&lt;p&gt;Reason: with a partition symmetric about 0 and symmetric sample points, the terms of the Riemann sum on the two sides cancel (odd) or are equal (even).&lt;/p&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Example 1 (Geometry).&lt;/strong&gt;&lt;/p&gt;

  &lt;ul&gt;
    &lt;li&gt;$\int_0^2(2x+1)\,dx$ is the area of a trapezoid with parallel sides $f(0)=1$, $f(2)=5$ and height 2: $\dfrac{1+5}2\cdot2=6$.&lt;/li&gt;
    &lt;li&gt;$\int_{-2}^2\sqrt{4-x^2}\,dx$ is the area of a half disc of radius 2: $2\pi$.&lt;/li&gt;
    &lt;li&gt;$\int_{-1}^1x^3\,dx=0$ because $x^3$ is odd.&lt;/li&gt;
  &lt;/ul&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Example 2 (Linearity).&lt;/strong&gt; We know $\int_0^1x^2\,dx=\tfrac13$ and $\int_0^1x\,dx=\tfrac12$ (lesson 04_01). So&lt;/p&gt;

\[\int_0^1(3x^2-2x+5)\,dx=3\cdot\tfrac13-2\cdot\tfrac12+5\cdot1=5 .\]

&lt;/div&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Example 3 (Estimation).&lt;/strong&gt; On $[0,1]$, $e^{-1}\le e^{-x^2}\le1$, so&lt;/p&gt;

\[0.367\approx e^{-1}\le\int_0^1e^{-x^2}\,dx\le1 .\]

  &lt;p&gt;This integral has no elementary antiderivative; its value is about $0.7468$ (lesson 04_05).&lt;/p&gt;
&lt;/div&gt;

&lt;h2 id=&quot;applications&quot;&gt;Applications&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Physics: displacement and distance.&lt;/strong&gt; A particle moves on a line with velocity $v(t)=t-2$ (m/s), $0\le t\le4$. The displacement is $\int_0^4v\,dt$: two triangles of area $2$ (below the axis for $0\le t\le2$) and $2$ (above), so the displacement is $-2+2=0$ and the particle returns to its start. The distance travelled is $\int_0^4\lvert v\rvert\,dt=4$ m.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Machine learning and probability: densities.&lt;/strong&gt; A continuous random variable $X$ has a density $p(x)\ge0$ with $\int_{-\infty}^{\infty}p=1$, and $P(a\le X\le b)=\int_a^bp(x)\,dx$. If $X$ is uniform on $[0,10]$, then $p=0.1$ on $[0,10]$ and $P(2\le X\le5)=0.1\cdot3=0.3$. Additivity over intervals corresponds to adding probabilities of disjoint intervals.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Economics.&lt;/strong&gt; Total revenue from time $t=a$ to $t=b$, given the revenue rate $r(t)$ (VND/day), is $\int_a^br(t)\,dt$; additivity lets us add up revenue quarter by quarter.&lt;/p&gt;

&lt;h2 id=&quot;exercises&quot;&gt;Exercises&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Basic.&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;Compute $\int_0^3\lvert x-1\rvert\,dx$ geometrically.&lt;/li&gt;
  &lt;li&gt;Given $\int_0^2f=3$ and $\int_0^5f=7$, find $\int_2^5f$ and $\int_5^22f$.&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Answers&lt;/summary&gt;

  &lt;ol&gt;
    &lt;li&gt;Two triangles: $\tfrac12\cdot1\cdot1+\tfrac12\cdot2\cdot2=2.5$.&lt;/li&gt;
    &lt;li&gt;$\int_2^5f=7-3=4$; $\int_5^22f=-2\cdot4=-8$.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;p&gt;&lt;strong&gt;Intermediate.&lt;/strong&gt;&lt;/p&gt;

&lt;ol start=&quot;3&quot;&gt;
  &lt;li&gt;Show that $\dfrac12\le\int_1^2\dfrac{dx}x\le1$.&lt;/li&gt;
  &lt;li&gt;Find $\int_{-\pi}^{\pi}x^2\sin x\,dx$ and $\int_{-1}^1(x^5+3)\,dx$ without antiderivatives.&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Answers&lt;/summary&gt;

  &lt;ol start=&quot;3&quot;&gt;
    &lt;li&gt;On $[1,2]$, $\tfrac12\le\tfrac1x\le1$; use the bounds property with $b-a=1$. (The true value is $\ln2\approx0.693$.)&lt;/li&gt;
    &lt;li&gt;$x^2\sin x$ is odd, so the integral is 0. $\int_{-1}^1x^5=0$ and $\int_{-1}^13=6$, total 6.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;p&gt;&lt;strong&gt;Advanced.&lt;/strong&gt;&lt;/p&gt;

&lt;ol start=&quot;5&quot;&gt;
  &lt;li&gt;Prove $\left\lvert\int_a^bf\right\rvert\le\int_a^b\lvert f\rvert$ (assume $f$ and $\lvert f\rvert$ are integrable).&lt;/li&gt;
  &lt;li&gt;Let $f$ be continuous with $f\ge0$ on $[a,b]$ and $\int_a^bf=0$. Show $f\equiv0$ on $[a,b]$. Is this still true without continuity?&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Hints&lt;/summary&gt;

  &lt;ol start=&quot;5&quot;&gt;
    &lt;li&gt;$-\lvert f\rvert\le f\le\lvert f\rvert$; use comparison.&lt;/li&gt;
    &lt;li&gt;If $f(c)&amp;gt;0$, continuity gives an interval $[c-\delta,c+\delta]\cap[a,b]$ (length $\ell&amp;gt;0$) on which $f\ge f(c)/2$; additivity and comparison give $\int_a^bf\ge\ell f(c)/2&amp;gt;0$. Without continuity it fails: a function equal to 1 at one point and 0 elsewhere has integral 0.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;h2 id=&quot;summary&quot;&gt;Summary&lt;/h2&gt;

&lt;div class=&quot;content-box summary-box textbook-block&quot;&gt;
  &lt;ul&gt;
    &lt;li&gt;$\int_a^bf=\lim_{\lVert P\rVert\to0}\sum f(\xi_i)\Delta x_i$, a limit independent of the sample points.&lt;/li&gt;
    &lt;li&gt;Continuous functions, monotone functions and bounded functions with finitely many discontinuities are integrable. The Dirichlet function is not.&lt;/li&gt;
    &lt;li&gt;Properties: linearity, additivity, comparison, bounds $m(b-a)\le\int\le M(b-a)$, $\lvert\int f\rvert\le\int\lvert f\rvert$.&lt;/li&gt;
    &lt;li&gt;Odd functions on $[-a,a]$ integrate to 0; even functions give twice the integral over $[0,a]$.&lt;/li&gt;
    &lt;li&gt;The integral of velocity is displacement; the integral of speed $\lvert v\rvert$ is distance.&lt;/li&gt;
  &lt;/ul&gt;
&lt;/div&gt;
</content>
 </entry>
 
 <entry>
   <title>Area and Riemann sums</title>
   <link href="https://calculus-self-learning.pages.dev/contents/en/chapter04/04_01_Area_and_Riemann_sums/"/>
   <updated>2026-12-01T00:00:00+00:00</updated>
   <id>https://calculus-self-learning.pages.dev/contents/en/chapter04/04_01_Area_and_Riemann_sums</id>
   <content type="html">&lt;div class=&quot;textbook-objectives&quot;&gt;

  &lt;p&gt;&lt;strong&gt;Learning objectives.&lt;/strong&gt; After this lesson you can:&lt;/p&gt;

  &lt;ul&gt;
    &lt;li&gt;partition $[a,b]$ and form the left, right and midpoint Riemann sums of a function;&lt;/li&gt;
    &lt;li&gt;evaluate Riemann sums with the formulas for $\sum i$, $\sum i^2$ and take the limit as $n\to\infty$;&lt;/li&gt;
    &lt;li&gt;bound the area for a monotone function between the left and right sums, and choose $n$ for a given accuracy;&lt;/li&gt;
    &lt;li&gt;estimate distance from a velocity table and total cost from marginal cost.&lt;/li&gt;
  &lt;/ul&gt;

&lt;/div&gt;

&lt;h2 id=&quot;why-this-lesson&quot;&gt;Why this lesson&lt;/h2&gt;

&lt;p&gt;A car’s speedometer is read every 10 seconds. How far does the car travel in 50 seconds? At constant speed the distance is speed times time. The speed changes, so we cut time into short intervals, treat the speed as nearly constant on each, and add up. On the velocity graph each product “speed × time” is the area of a rectangle. The distance is the area under the graph.&lt;/p&gt;

&lt;p&gt;The derivative answers “how fast does it change”. The integral answers the reverse question: “how much accumulates”.&lt;/p&gt;

&lt;h2 id=&quot;partitions-and-riemann-sums&quot;&gt;Partitions and Riemann sums&lt;/h2&gt;

&lt;div class=&quot;textbook-definition&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Definition 1 (Partition, Riemann sum).&lt;/strong&gt; A partition of $[a,b]$ is a list of points $a=x_0&amp;lt;x_1&amp;lt;\dots&amp;lt;x_n=b$. Put $\Delta x_i=x_i-x_{i-1}$ and choose sample points $\xi_i\in[x_{i-1},x_i]$. The sum&lt;/p&gt;

\[S=\sum_{i=1}^n f(\xi_i)\,\Delta x_i\]

  &lt;p&gt;is the Riemann sum of $f$ for this partition and these sample points.&lt;/p&gt;
&lt;/div&gt;

&lt;p&gt;We usually take a uniform partition: $\Delta x=\dfrac{b-a}n$, $x_i=a+i\Delta x$. Three common choices of sample point:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;left sum $L_n$: $\xi_i=x_{i-1}$;&lt;/li&gt;
  &lt;li&gt;right sum $R_n$: $\xi_i=x_i$;&lt;/li&gt;
  &lt;li&gt;midpoint sum $M_n$: $\xi_i=\dfrac{x_{i-1}+x_i}2$.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;When $f\ge0$, each term $f(\xi_i)\Delta x_i$ is the area of a rectangle of height $f(\xi_i)$ and width $\Delta x_i$. Where $f$ is negative the terms are negative: a Riemann sum measures “signed area”.&lt;/p&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Example 1.&lt;/strong&gt; Approximate the area under $y=x^2$ on $[0,1]$ with $n=4$.&lt;/p&gt;

  &lt;p&gt;$\Delta x=0.25$, partition points $0,\ 0.25,\ 0.5,\ 0.75,\ 1$.&lt;/p&gt;

  &lt;ul&gt;
    &lt;li&gt;$L_4=0.25\,(0^2+0.25^2+0.5^2+0.75^2)=\dfrac{0+1+4+9}{64}=0.21875$.&lt;/li&gt;
    &lt;li&gt;$R_4=0.25\,(0.25^2+0.5^2+0.75^2+1^2)=\dfrac{1+4+9+16}{64}=0.46875$.&lt;/li&gt;
    &lt;li&gt;$M_4=0.25\,(0.125^2+0.375^2+0.625^2+0.875^2)=\dfrac{1+9+25+49}{256}=0.328125$.&lt;/li&gt;
  &lt;/ul&gt;

  &lt;p&gt;Increasing $n$:&lt;/p&gt;

  &lt;table&gt;
    &lt;thead&gt;
      &lt;tr&gt;
        &lt;th&gt;$n$&lt;/th&gt;
        &lt;th&gt;$L_n$&lt;/th&gt;
        &lt;th&gt;$R_n$&lt;/th&gt;
        &lt;th&gt;$M_n$&lt;/th&gt;
      &lt;/tr&gt;
    &lt;/thead&gt;
    &lt;tbody&gt;
      &lt;tr&gt;
        &lt;td&gt;4&lt;/td&gt;
        &lt;td&gt;0.21875&lt;/td&gt;
        &lt;td&gt;0.46875&lt;/td&gt;
        &lt;td&gt;0.328125&lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr&gt;
        &lt;td&gt;10&lt;/td&gt;
        &lt;td&gt;0.285&lt;/td&gt;
        &lt;td&gt;0.385&lt;/td&gt;
        &lt;td&gt;0.3325&lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr&gt;
        &lt;td&gt;100&lt;/td&gt;
        &lt;td&gt;0.32835&lt;/td&gt;
        &lt;td&gt;0.33835&lt;/td&gt;
        &lt;td&gt;0.333325&lt;/td&gt;
      &lt;/tr&gt;
    &lt;/tbody&gt;
  &lt;/table&gt;

  &lt;p&gt;All three columns approach $1/3$. For the same $n$ the midpoint sum is far more accurate.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;interactive-frame&quot;&gt;
  &lt;div class=&quot;interactive-frame-head&quot;&gt;
    &lt;div class=&quot;interactive-frame-title&quot;&gt;Riemann sums&lt;/div&gt;
    &lt;div class=&quot;interactive-frame-desc&quot;&gt;Pick a function, n and the sample points; compare the sum with the exact integral.&lt;/div&gt;
  &lt;/div&gt;
  &lt;iframe src=&quot;/interactives/chapter04/riemann-sum-en.html&quot; title=&quot;Riemann sums&quot; loading=&quot;lazy&quot; style=&quot;height: 720px;&quot;&gt;&lt;/iframe&gt;
  &lt;div class=&quot;interactive-frame-foot&quot;&gt;
    &lt;a href=&quot;/interactives/chapter04/riemann-sum-en.html&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;Open the interactive in a new window&lt;/a&gt;
  &lt;/div&gt;
&lt;/div&gt;

&lt;h2 id=&quot;limits-from-summation-formulas&quot;&gt;Limits from summation formulas&lt;/h2&gt;

&lt;p&gt;We need two formulas (proved by induction, lesson 00_04):&lt;/p&gt;

\[\sum_{i=1}^n i=\frac{n(n+1)}2,\qquad \sum_{i=1}^n i^2=\frac{n(n+1)(2n+1)}6 .\]

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Example 2.&lt;/strong&gt; Find the exact area under $y=x^2$ on $[0,1]$.&lt;/p&gt;

  &lt;p&gt;With $x_i=i/n$:&lt;/p&gt;

\[R_n=\sum_{i=1}^n\left(\frac in\right)^2\frac1n=\frac1{n^3}\cdot\frac{n(n+1)(2n+1)}6=\frac{(n+1)(2n+1)}{6n^2}\ \longrightarrow\ \frac26=\frac13 .\]

  &lt;p&gt;Similarly $L_n=\dfrac{(n-1)(2n-1)}{6n^2}\to\dfrac13$. The area is $\dfrac13$.&lt;/p&gt;
&lt;/div&gt;

&lt;h2 id=&quot;monotone-functions-upper-and-lower-bounds&quot;&gt;Monotone functions: upper and lower bounds&lt;/h2&gt;

&lt;div class=&quot;textbook-theorem&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Theorem 1.&lt;/strong&gt; Let $f$ be increasing on $[a,b]$ and let $A$ be the signed area under its graph. For the uniform partition into $n$ pieces,&lt;/p&gt;

\[L_n\le A\le R_n,\qquad R_n-L_n=\frac{\bigl(f(b)-f(a)\bigr)(b-a)}n .\]

  &lt;p&gt;For decreasing $f$, swap the roles of $L_n$ and $R_n$.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-proof&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Proof.&lt;/strong&gt; On $[x_{i-1},x_i]$ we have $f(x_{i-1})\le f(x)\le f(x_i)$, so the region under the graph there contains the rectangle of height $f(x_{i-1})$ and lies inside the rectangle of height $f(x_i)$. Adding gives $L_n\le A\le R_n$. The difference is&lt;/p&gt;

\[R_n-L_n=\Delta x\sum_{i=1}^n\bigl(f(x_i)-f(x_{i-1})\bigr)=\Delta x\,\bigl(f(x_n)-f(x_0)\bigr)=\frac{b-a}n\bigl(f(b)-f(a)\bigr)\]

  &lt;p&gt;since the sum telescopes.&lt;/p&gt;
&lt;/div&gt;

&lt;p&gt;Consequence: for a monotone function the error of $L_n$ or $R_n$ is at most $\dfrac{\lvert f(b)-f(a)\rvert(b-a)}n$, which shrinks like $1/n$.&lt;/p&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Example 3 (Distance from a velocity table).&lt;/strong&gt; A car’s velocity (m/s):&lt;/p&gt;

  &lt;table&gt;
    &lt;thead&gt;
      &lt;tr&gt;
        &lt;th&gt;$t$ (s)&lt;/th&gt;
        &lt;th&gt;0&lt;/th&gt;
        &lt;th&gt;10&lt;/th&gt;
        &lt;th&gt;20&lt;/th&gt;
        &lt;th&gt;30&lt;/th&gt;
        &lt;th&gt;40&lt;/th&gt;
        &lt;th&gt;50&lt;/th&gt;
      &lt;/tr&gt;
    &lt;/thead&gt;
    &lt;tbody&gt;
      &lt;tr&gt;
        &lt;td&gt;$v$ (m/s)&lt;/td&gt;
        &lt;td&gt;0&lt;/td&gt;
        &lt;td&gt;6&lt;/td&gt;
        &lt;td&gt;10&lt;/td&gt;
        &lt;td&gt;13&lt;/td&gt;
        &lt;td&gt;15&lt;/td&gt;
        &lt;td&gt;16&lt;/td&gt;
      &lt;/tr&gt;
    &lt;/tbody&gt;
  &lt;/table&gt;

  &lt;p&gt;With $\Delta t=10$: $L_5=10(0+6+10+13+15)=440$ m, $R_5=10(6+10+13+15+16)=600$ m. The car accelerates throughout (assume $v$ is increasing), so by theorem 1 the true distance is between 440 m and 600 m. The average of the two sums, 520 m, is a better estimate (the trapezoidal rule, lesson 04_05).&lt;/p&gt;
&lt;/div&gt;

&lt;h2 id=&quot;short-video&quot;&gt;Short video&lt;/h2&gt;

&lt;div class=&quot;reel-video&quot;&gt;
  &lt;video controls=&quot;&quot; playsinline=&quot;&quot; preload=&quot;metadata&quot; src=&quot;/public/videos/reels/riemann-sums.mp4&quot;&gt;&lt;/video&gt;
  &lt;p class=&quot;reel-caption&quot;&gt;Left, right and midpoint Riemann sums of x² on [0, 2] for n from 4 to 2048, converging to 8/3 (silent video, about 2 minutes).&lt;/p&gt;
&lt;/div&gt;

&lt;h2 id=&quot;applications&quot;&gt;Applications&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Physics.&lt;/strong&gt; Example 3: distance is the “area” under the velocity graph. In the same way, charge is the area under the current graph, and work is the area under the force–distance graph.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Economics: total cost from marginal cost.&lt;/strong&gt; A workshop’s marginal cost is $C&apos;(q)=50-0.2q$ (thousand VND per item) for $0\le q\le100$. The extra cost of going from 0 to 100 items is approximately the midpoint sum with $n=4$, $\Delta q=25$: midpoints $12.5,\ 37.5,\ 62.5,\ 87.5$ give&lt;/p&gt;

\[M_4=25\,(47.5+42.5+37.5+32.5)=4000\ \text{thousand VND}.\]

&lt;p&gt;For a linear function the midpoint sum is exact (exercise 5).&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Machine learning.&lt;/strong&gt; The area under the ROC curve (AUC) measures the quality of a classifier. The curve is known only at a few points, so AUC is computed with a Riemann-type sum (the trapezoidal rule, lesson 04_05).&lt;/p&gt;

&lt;h2 id=&quot;exercises&quot;&gt;Exercises&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Basic.&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;Compute $L_4$, $R_4$ for $f(x)=x^3$ on $[0,2]$. The true area is 4; is it between the two sums?&lt;/li&gt;
  &lt;li&gt;Compute $R_n$ for $f(x)=x$ on $[0,1]$ and take the limit.&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Answers&lt;/summary&gt;

  &lt;ol&gt;
    &lt;li&gt;$\Delta x=0.5$. $L_4=0.5(0+0.125+1+3.375)=2.25$, $R_4=0.5(0.125+1+3.375+8)=6.25$. Yes, $2.25\le4\le6.25$, because $x^3$ is increasing.&lt;/li&gt;
    &lt;li&gt;$R_n=\dfrac1{n^2}\cdot\dfrac{n(n+1)}2=\dfrac{n+1}{2n}\to\dfrac12$ (the area of a triangle).&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;p&gt;&lt;strong&gt;Intermediate.&lt;/strong&gt;&lt;/p&gt;

&lt;ol start=&quot;3&quot;&gt;
  &lt;li&gt;For $f(x)=x^2$ on $[0,1]$, how large must $n$ be for $R_n-L_n&amp;lt;0.01$?&lt;/li&gt;
  &lt;li&gt;Write $\displaystyle\lim_{n\to\infty}\sum_{i=1}^n\frac1n\sqrt{\frac in}$ as the area under a graph and guess its value (computed in lesson 04_03).&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Answers&lt;/summary&gt;

  &lt;ol start=&quot;3&quot;&gt;
    &lt;li&gt;$R_n-L_n=\dfrac{(1-0)(1-0)}n=\dfrac1n&amp;lt;0.01$ when $n\ge101$.&lt;/li&gt;
    &lt;li&gt;It is $R_n$ for $f(x)=\sqrt x$ on $[0,1]$. Value $\tfrac23$.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;p&gt;&lt;strong&gt;Advanced.&lt;/strong&gt;&lt;/p&gt;

&lt;ol start=&quot;5&quot;&gt;
  &lt;li&gt;Show that for $f(x)=px+q$ the midpoint sum $M_n$ equals the true area for every $n$.&lt;/li&gt;
  &lt;li&gt;Show that $\displaystyle\lim_{n\to\infty}\sum_{i=1}^n\frac{n}{n^2+i^2}$ is the area under $y=\dfrac1{1+x^2}$ on $[0,1]$. (The value is $\pi/4$, lesson 04_03.)&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Hints&lt;/summary&gt;

  &lt;ol start=&quot;5&quot;&gt;
    &lt;li&gt;On each subinterval the trapezoid under the line has area $\Delta x\cdot\dfrac{f(x_{i-1})+f(x_i)}2=\Delta x\,f(\text{midpoint})$ because $f$ is linear.&lt;/li&gt;
    &lt;li&gt;$\dfrac{n}{n^2+i^2}=\dfrac1n\cdot\dfrac1{1+(i/n)^2}$: this is $R_n$ for $\dfrac1{1+x^2}$.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;h2 id=&quot;summary&quot;&gt;Summary&lt;/h2&gt;

&lt;div class=&quot;content-box summary-box textbook-block&quot;&gt;
  &lt;ul&gt;
    &lt;li&gt;A Riemann sum $\sum f(\xi_i)\Delta x_i$ approximates the signed area under a graph.&lt;/li&gt;
    &lt;li&gt;Left, right and midpoint sums correspond to three choices of sample point; the midpoint sum is usually more accurate.&lt;/li&gt;
    &lt;li&gt;For a uniform partition the formulas for $\sum i$, $\sum i^2$ let us compute $R_n$ and take the limit.&lt;/li&gt;
    &lt;li&gt;For a monotone function the area lies between $L_n$ and $R_n$, which differ by $\lvert f(b)-f(a)\rvert(b-a)/n$.&lt;/li&gt;
    &lt;li&gt;Distance, charge and total cost are all “areas” under a rate-of-change graph.&lt;/li&gt;
  &lt;/ul&gt;
&lt;/div&gt;
</content>
 </entry>
 
 <entry>
   <title>Newton's method and related rates</title>
   <link href="https://calculus-self-learning.pages.dev/contents/en/chapter03/03_05_Newtons_method_and_related_rates/"/>
   <updated>2026-12-01T00:00:00+00:00</updated>
   <id>https://calculus-self-learning.pages.dev/contents/en/chapter03/03_05_Newtons_method_and_related_rates</id>
   <content type="html">&lt;div class=&quot;textbook-objectives&quot;&gt;

  &lt;p&gt;&lt;strong&gt;Learning objectives.&lt;/strong&gt; After this lesson you can:&lt;/p&gt;

  &lt;ul&gt;
    &lt;li&gt;write Newton’s iteration for an equation $f(x)=0$ and compute a few steps;&lt;/li&gt;
    &lt;li&gt;explain why Newton’s method converges quadratically near a simple root, and recognise when it fails;&lt;/li&gt;
    &lt;li&gt;solve related rates problems: write the relation, differentiate in time, substitute;&lt;/li&gt;
    &lt;li&gt;use Newton’s method to minimise a function (the Newton step in optimisation).&lt;/li&gt;
  &lt;/ul&gt;

&lt;/div&gt;

&lt;h2 id=&quot;why-this-lesson&quot;&gt;Why this lesson&lt;/h2&gt;

&lt;p&gt;The equation $x^3-2x-5=0$ has a root between 2 and 3 (intermediate value theorem, lesson 01_06), but no simple formula. How does a computer find it? Idea: replace the graph by its tangent line (linear approximation, lesson 02_04), solve the linear equation, and repeat.&lt;/p&gt;

&lt;p&gt;The second idea of the lesson: when quantities are related and change over time, the chain rule tells us how their rates are related. Example: the foot of a ladder slides away from a wall at a known speed; how fast does the top slide down?&lt;/p&gt;

&lt;h2 id=&quot;newtons-method&quot;&gt;Newton’s method&lt;/h2&gt;

&lt;p&gt;At $x_n$ the tangent line is $y=f(x_n)+f&apos;(x_n)(x-x_n)$. Setting $y=0$ gives the next point.&lt;/p&gt;

&lt;div class=&quot;textbook-definition&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Definition 1 (Newton iteration).&lt;/strong&gt; Given a differentiable $f$ and a starting point $x_0$, the Newton sequence is&lt;/p&gt;

\[x_{n+1}=x_n-\frac{f(x_n)}{f&apos;(x_n)},\qquad n=0,1,2,\dots\]

  &lt;p&gt;provided $f&apos;(x_n)\ne0$.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Example 1 (Computing $\sqrt2$).&lt;/strong&gt; With $f(x)=x^2-2$: $x_{n+1}=x_n-\dfrac{x_n^2-2}{2x_n}=\dfrac12\left(x_n+\dfrac2{x_n}\right)$. From $x_0=1$:&lt;/p&gt;

  &lt;table&gt;
    &lt;thead&gt;
      &lt;tr&gt;
        &lt;th&gt;$n$&lt;/th&gt;
        &lt;th&gt;$x_n$&lt;/th&gt;
        &lt;th&gt;error $\lvert x_n-\sqrt2\rvert$&lt;/th&gt;
      &lt;/tr&gt;
    &lt;/thead&gt;
    &lt;tbody&gt;
      &lt;tr&gt;
        &lt;td&gt;0&lt;/td&gt;
        &lt;td&gt;1&lt;/td&gt;
        &lt;td&gt;$4.1\cdot10^{-1}$&lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr&gt;
        &lt;td&gt;1&lt;/td&gt;
        &lt;td&gt;1.5&lt;/td&gt;
        &lt;td&gt;$8.6\cdot10^{-2}$&lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr&gt;
        &lt;td&gt;2&lt;/td&gt;
        &lt;td&gt;1.416667&lt;/td&gt;
        &lt;td&gt;$2.5\cdot10^{-3}$&lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr&gt;
        &lt;td&gt;3&lt;/td&gt;
        &lt;td&gt;1.4142157&lt;/td&gt;
        &lt;td&gt;$2.1\cdot10^{-6}$&lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr&gt;
        &lt;td&gt;4&lt;/td&gt;
        &lt;td&gt;1.41421356237&lt;/td&gt;
        &lt;td&gt;$1.6\cdot10^{-12}$&lt;/td&gt;
      &lt;/tr&gt;
    &lt;/tbody&gt;
  &lt;/table&gt;

  &lt;p&gt;The number of correct digits roughly doubles at each step. This is the “Babylonian” square-root method.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-theorem&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Theorem 1 (Quadratic convergence).&lt;/strong&gt; Suppose $f&apos;&apos;$ is continuous near $r$, $f(r)=0$ and $f&apos;(r)\ne0$. Then for $x_n$ close enough to $r$,&lt;/p&gt;

\[x_{n+1}-r=\frac{f&apos;&apos;(\xi_n)}{2f&apos;(x_n)}(x_n-r)^2\]

  &lt;p&gt;for some $\xi_n$ between $x_n$ and $r$. Hence there are $\delta&amp;gt;0$ and $M$ such that if $\lvert x_0-r\rvert&amp;lt;\delta$, the sequence converges to $r$ and $\lvert x_{n+1}-r\rvert\le M\lvert x_n-r\rvert^2$.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-proof&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Proof.&lt;/strong&gt; First-order Taylor expansion with Lagrange remainder (chapter 4) about $x_n$:&lt;/p&gt;

\[0=f(r)=f(x_n)+f&apos;(x_n)(r-x_n)+\tfrac12f&apos;&apos;(\xi_n)(r-x_n)^2 .\]

  &lt;p&gt;Divide by $f&apos;(x_n)$ and rearrange: $x_n-\dfrac{f(x_n)}{f&apos;(x_n)}-r=\dfrac{f&apos;&apos;(\xi_n)}{2f&apos;(x_n)}(x_n-r)^2$, and the left side is $x_{n+1}-r$.&lt;/p&gt;

  &lt;p&gt;Since $f&apos;(r)\ne0$ and $f&apos;,f&apos;&apos;$ are continuous, there is $\delta&amp;gt;0$ with $\lvert f&apos;\rvert\ge m&amp;gt;0$ and $\lvert f&apos;&apos;\rvert\le K$ on $[r-\delta,r+\delta]$. Put $M=K/(2m)$ and shrink $\delta$ so that $M\delta&amp;lt;1$. If $\lvert x_n-r\rvert&amp;lt;\delta$, then $\lvert x_{n+1}-r\rvert\le M\lvert x_n-r\rvert^2\le (M\delta)\lvert x_n-r\rvert&amp;lt;\delta$. By induction the error shrinks at least geometrically with ratio $M\delta&amp;lt;1$, so the sequence converges to $r$.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;content-box warning-box textbook-block&quot;&gt;
  &lt;p&gt;&lt;strong&gt;When Newton fails.&lt;/strong&gt;&lt;/p&gt;

  &lt;ul&gt;
    &lt;li&gt;$f&apos;(x_n)=0$ or very small: the tangent is nearly horizontal and the step is huge.&lt;/li&gt;
    &lt;li&gt;Starting too far from the root: the sequence can oscillate or run to another root.&lt;/li&gt;
    &lt;li&gt;$f&apos;(r)$ does not exist: for $f(x)=x^{1/3}$, $x_{n+1}=x_n-\dfrac{x_n^{1/3}}{\tfrac13x_n^{-2/3}}=-2x_n$, which diverges for every $x_0\ne0$.&lt;/li&gt;
    &lt;li&gt;Multiple root ($f&apos;(r)=0$): still converges, but only linearly (exercise 6).&lt;/li&gt;
  &lt;/ul&gt;
&lt;/div&gt;

&lt;div class=&quot;interactive-frame&quot;&gt;
  &lt;div class=&quot;interactive-frame-head&quot;&gt;
    &lt;div class=&quot;interactive-frame-title&quot;&gt;Newton&apos;s method&lt;/div&gt;
    &lt;div class=&quot;interactive-frame-desc&quot;&gt;Drag x₀, add steps and watch the error shrink.&lt;/div&gt;
  &lt;/div&gt;
  &lt;iframe src=&quot;/interactives/chapter03/newton-method-en.html&quot; title=&quot;Newton&amp;#39;s method&quot; loading=&quot;lazy&quot; style=&quot;height: 700px;&quot;&gt;&lt;/iframe&gt;
  &lt;div class=&quot;interactive-frame-foot&quot;&gt;
    &lt;a href=&quot;/interactives/chapter03/newton-method-en.html&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;Open the interactive in a new window&lt;/a&gt;
  &lt;/div&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Example 2.&lt;/strong&gt; Solve $x^3-2x-5=0$ from $x_0=2$, with $f&apos;(x)=3x^2-2$.&lt;/p&gt;

  &lt;p&gt;$x_1=2-\dfrac{-1}{10}=2.1$, $x_2=2.1-\dfrac{0.061}{11.23}\approx2.094568$, $x_3\approx2.0945515$. The root is $r\approx2.0945515$ (7 correct digits after 3 steps).&lt;/p&gt;
&lt;/div&gt;

&lt;h2 id=&quot;short-video&quot;&gt;Short video&lt;/h2&gt;

&lt;div class=&quot;reel-video&quot;&gt;
  &lt;video controls=&quot;&quot; playsinline=&quot;&quot; preload=&quot;metadata&quot; src=&quot;/public/videos/reels/newton-method.mp4&quot;&gt;&lt;/video&gt;
  &lt;p class=&quot;reel-caption&quot;&gt;Newton&apos;s method for √2 from x₀ = 3: the number of correct digits roughly doubles each step, compared with bisection (silent video, about 2 minutes).&lt;/p&gt;
&lt;/div&gt;

&lt;h2 id=&quot;related-rates&quot;&gt;Related rates&lt;/h2&gt;

&lt;p&gt;If quantities $x(t),y(t)$ satisfy a relation $F(x,y)=0$ for all $t$, differentiating both sides in $t$ (chain rule, implicit differentiation in lesson 02_03) gives a relation between $\dfrac{dx}{dt}$ and $\dfrac{dy}{dt}$.&lt;/p&gt;

&lt;p&gt;Procedure:&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;Draw a picture and name the quantities that change over time.&lt;/li&gt;
  &lt;li&gt;Write the relation between them (valid at all times; do not substitute numbers yet).&lt;/li&gt;
  &lt;li&gt;Differentiate with respect to $t$.&lt;/li&gt;
  &lt;li&gt;Only now substitute the values at the moment of interest.&lt;/li&gt;
&lt;/ol&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Example 3 (The ladder).&lt;/strong&gt; A 5 m ladder leans against a wall. Its foot slides away from the wall at 0.5 m/s. When the foot is 3 m from the wall, how fast is the top sliding down?&lt;/p&gt;

  &lt;p&gt;Let $x$ be the distance of the foot from the wall and $y$ the height of the top. $x^2+y^2=25$. Differentiate in $t$: $2x\dfrac{dx}{dt}+2y\dfrac{dy}{dt}=0$. When $x=3$, $y=4$, so&lt;/p&gt;

\[\frac{dy}{dt}=-\frac xy\frac{dx}{dt}=-\frac34\cdot0.5=-0.375\ \text{m/s}.\]

  &lt;p&gt;The top moves down at 0.375 m/s. As $y\to0$, $\lvert dy/dt\rvert\to\infty$: the model breaks down once the top leaves the wall.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;interactive-frame&quot;&gt;
  &lt;div class=&quot;interactive-frame-head&quot;&gt;
    &lt;div class=&quot;interactive-frame-title&quot;&gt;The sliding ladder&lt;/div&gt;
    &lt;div class=&quot;interactive-frame-desc&quot;&gt;Press Run or drag the foot of the ladder; compare dx/dt with dy/dt.&lt;/div&gt;
  &lt;/div&gt;
  &lt;iframe src=&quot;/interactives/chapter03/ladder-related-rates-en.html&quot; title=&quot;The sliding ladder&quot; loading=&quot;lazy&quot; style=&quot;height: 700px;&quot;&gt;&lt;/iframe&gt;
  &lt;div class=&quot;interactive-frame-foot&quot;&gt;
    &lt;a href=&quot;/interactives/chapter03/ladder-related-rates-en.html&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;Open the interactive in a new window&lt;/a&gt;
  &lt;/div&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Example 4 (Conical tank).&lt;/strong&gt; An inverted conical tank has top radius 2 m and height 4 m. Water flows in at 2 m³/min. How fast is the water level rising when it is 3 m deep?&lt;/p&gt;

  &lt;p&gt;At depth $h$ the surface radius is $r=h/2$ (similar triangles). Volume $V=\tfrac13\pi r^2h=\dfrac{\pi h^3}{12}$. Differentiate: $\dfrac{dV}{dt}=\dfrac{\pi h^2}{4}\dfrac{dh}{dt}$. At $h=3$:&lt;/p&gt;

\[\frac{dh}{dt}=\frac{4\cdot2}{9\pi}=\frac{8}{9\pi}\approx0.283\ \text{m/min}.\]

&lt;/div&gt;

&lt;h2 id=&quot;applications&quot;&gt;Applications&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Machine learning: the Newton step in optimisation.&lt;/strong&gt; Minimising $f$ means solving $f&apos;(x)=0$. Newton applied to $f&apos;$:&lt;/p&gt;

\[x_{n+1}=x_n-\frac{f&apos;(x_n)}{f&apos;&apos;(x_n)} .\]

&lt;p&gt;Example $f(x)=x-\ln x$ on $(0,\infty)$: $f&apos;=1-\tfrac1x$, $f&apos;&apos;=\tfrac1{x^2}$, so $x_{n+1}=2x_n-x_n^2$ and $1-x_{n+1}=(1-x_n)^2$. From $x_0=0.5$: $0.75,\ 0.9375,\ 0.99609,\dots\to1$, the error squaring at each step. Compared with gradient descent $x_{n+1}=x_n-\eta f&apos;(x_n)$, the Newton step picks its own “learning rate” $\eta=1/f&apos;&apos;(x_n)$. In several variables $f&apos;&apos;$ becomes the Hessian matrix (chapter 12).&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Economics: cost changing over time.&lt;/strong&gt; Cost $C(q)=0.01q^2+5q+200$ and output rises by $10$ units/week. At $q=100$: $\dfrac{dC}{dt}=C&apos;(q)\dfrac{dq}{dt}=(0.02\cdot100+5)\cdot10=70$ (thousand VND/week).&lt;/p&gt;

&lt;h2 id=&quot;exercises&quot;&gt;Exercises&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Basic.&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;Write Newton’s iteration for $\sqrt[3]{5}$ and compute $x_1,x_2$ from $x_0=2$.&lt;/li&gt;
  &lt;li&gt;A spherical balloon is inflated at 100 cm³/s. How fast is the radius increasing when $r=5$ cm?&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Answers&lt;/summary&gt;

  &lt;ol&gt;
    &lt;li&gt;$f(x)=x^3-5$: $x_{n+1}=x_n-\dfrac{x_n^3-5}{3x_n^2}=\dfrac{2x_n^3+5}{3x_n^2}$. $x_1=\tfrac{21}{12}=1.75$, $x_2\approx1.7109$ (true value $1.70998$).&lt;/li&gt;
    &lt;li&gt;$V=\tfrac43\pi r^3$, $\dfrac{dV}{dt}=4\pi r^2\dfrac{dr}{dt}$, so $\dfrac{dr}{dt}=\dfrac{100}{100\pi}=\dfrac1\pi\approx0.318$ cm/s.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;p&gt;&lt;strong&gt;Intermediate.&lt;/strong&gt;&lt;/p&gt;

&lt;ol start=&quot;3&quot;&gt;
  &lt;li&gt;Show that Newton’s iteration for $f(x)=\tfrac1x-a$ ($a&amp;gt;0$) is $x_{n+1}=x_n(2-ax_n)$, which computes $1/a$ using only multiplication and subtraction.&lt;/li&gt;
  &lt;li&gt;A 1.8 m tall person walks away from a 6 m lamp post at 1.2 m/s. How fast is the shadow lengthening? How fast does the tip of the shadow move?&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Answers&lt;/summary&gt;

  &lt;ol start=&quot;3&quot;&gt;
    &lt;li&gt;$f&apos;(x)=-\tfrac1{x^2}$, $x_{n+1}=x_n+x_n^2\left(\tfrac1{x_n}-a\right)=2x_n-ax_n^2$.&lt;/li&gt;
    &lt;li&gt;Let $x$ be the distance to the post and $s$ the shadow length. Similar triangles: $\dfrac{s}{1.8}=\dfrac{x+s}{6}$, so $s=\tfrac37x$. $\dfrac{ds}{dt}=\tfrac37\cdot1.2\approx0.514$ m/s. The tip is at $x+s$ and moves at $1.2+0.514\approx1.714$ m/s, independent of $x$.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;p&gt;&lt;strong&gt;Advanced.&lt;/strong&gt;&lt;/p&gt;

&lt;ol start=&quot;5&quot;&gt;
  &lt;li&gt;For $f(x)=\arctan x$, run Newton from $x_0=1$ and from $x_0=1.5$. What happens?&lt;/li&gt;
  &lt;li&gt;Apply Newton to $f(x)=x^2$ (double root $r=0$). Show $x_{n+1}=x_n/2$. Why does theorem 1 not apply? Suggest a fix for a root of multiplicity $m$.&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Hints&lt;/summary&gt;

  &lt;ol start=&quot;5&quot;&gt;
    &lt;li&gt;$x_{n+1}=x_n-(1+x_n^2)\arctan x_n$. From $x_0=1$: $x_1\approx-0.571$, $x_2\approx0.117$, $x_3\approx-0.001$, converging to 0. From $x_0=1.5$: $x_1\approx-1.694$, $x_2\approx2.321$; the signs alternate and $\lvert x_n\rvert$ grows, so it diverges. The threshold is $x_0\approx1.39$.&lt;/li&gt;
    &lt;li&gt;$x_n-\dfrac{x_n^2}{2x_n}=\dfrac{x_n}2$: linear convergence. Theorem 1 needs $f&apos;(r)\ne0$. For a root of multiplicity $m$ use $x_{n+1}=x_n-m\dfrac{f(x_n)}{f&apos;(x_n)}$ (for $f=x^2$, $m=2$ gives the exact root in one step).&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;h2 id=&quot;summary&quot;&gt;Summary&lt;/h2&gt;

&lt;div class=&quot;content-box summary-box textbook-block&quot;&gt;
  &lt;ul&gt;
    &lt;li&gt;Newton: $x_{n+1}=x_n-f(x_n)/f&apos;(x_n)$, the root of the tangent line.&lt;/li&gt;
    &lt;li&gt;Near a simple root the new error is proportional to the square of the old one: correct digits roughly double each step.&lt;/li&gt;
    &lt;li&gt;Newton can fail when $f&apos;$ is near 0, when the start is far from the root, or when $f&apos;(r)$ does not exist; multiple roots converge only linearly.&lt;/li&gt;
    &lt;li&gt;Related rates: write a relation valid at all times, differentiate in $t$, then substitute.&lt;/li&gt;
    &lt;li&gt;Optimisation: Newton for $f&apos;$ is $x_{n+1}=x_n-f&apos;(x_n)/f&apos;&apos;(x_n)$.&lt;/li&gt;
  &lt;/ul&gt;
&lt;/div&gt;
</content>
 </entry>
 
 <entry>
   <title>One-variable optimisation problems</title>
   <link href="https://calculus-self-learning.pages.dev/contents/en/chapter03/03_04_One_variable_optimisation/"/>
   <updated>2026-12-01T00:00:00+00:00</updated>
   <id>https://calculus-self-learning.pages.dev/contents/en/chapter03/03_04_One_variable_optimisation</id>
   <content type="html">&lt;div class=&quot;textbook-objectives&quot;&gt;

  &lt;p&gt;&lt;strong&gt;Learning objectives.&lt;/strong&gt; After this lesson you can:&lt;/p&gt;

  &lt;ul&gt;
    &lt;li&gt;turn a practical problem into finding the maximum or minimum of a one-variable function on a clearly stated domain;&lt;/li&gt;
    &lt;li&gt;find the optimum and check that it is a global maximum or minimum, including at the boundary;&lt;/li&gt;
    &lt;li&gt;derive Snell’s law of refraction from the principle of least time;&lt;/li&gt;
    &lt;li&gt;solve a one-parameter least squares problem, the first step of linear regression.&lt;/li&gt;
  &lt;/ul&gt;

&lt;/div&gt;

&lt;h2 id=&quot;why-this-lesson&quot;&gt;Why this lesson&lt;/h2&gt;

&lt;p&gt;A soft-drink can holds 330 ml. The manufacturer wants to use as little aluminium as possible. Short and wide, or tall and thin? The problem: among all cylinders of volume 330 cm³, find the one with the smallest surface area. Most “best possible” problems in engineering and economics follow the same procedure.&lt;/p&gt;

&lt;h2 id=&quot;the-procedure&quot;&gt;The procedure&lt;/h2&gt;

&lt;ol&gt;
  &lt;li&gt;Name the variables, with units. Write the quantity to optimise in terms of them.&lt;/li&gt;
  &lt;li&gt;Use the constraint to reduce to one variable. State the domain of that variable (usually an interval).&lt;/li&gt;
  &lt;li&gt;Find the critical points. On a closed interval, compare with the endpoint values.&lt;/li&gt;
  &lt;li&gt;Show it is a global maximum or minimum: compare values, use the sign of $f&apos;$, or use convexity (lesson 03_02).&lt;/li&gt;
  &lt;li&gt;Answer the original question, with units, and check it makes sense.&lt;/li&gt;
&lt;/ol&gt;

&lt;div class=&quot;textbook-theorem&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Theorem 1 (A single critical point).&lt;/strong&gt; Let $f$ be differentiable on an interval $I$ with exactly one critical point $c$ in $I$. If $c$ is a local minimum, it is the global minimum on $I$ (similarly for maxima).&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-proof&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Proof.&lt;/strong&gt; Suppose some $d\in I$, say $d&amp;gt;c$, has $f(d)&amp;lt;f(c)$. Since $c$ is a local minimum, there is $\delta&amp;gt;0$ with $f(x)\ge f(c)$ on $[c,c+\delta]$. On $[c,d]$, $f$ attains its maximum at some $e$, and $f(e)\ge f(c)&amp;gt;f(d)$, so $e\ne d$. If $e\in(c,d)$, Fermat gives $f&apos;(e)=0$: a second critical point. If $e=c$, then $f\le f(c)$ on $[c,d]$, which with the above makes $f$ constant on $[c,c+\delta]$, so every point of $(c,c+\delta)$ is critical. Both cases are contradictions.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Example 1 (Fencing by a river).&lt;/strong&gt; 100 m of fence encloses a rectangular plot along a river (the side on the river needs no fence). What is the largest area?&lt;/p&gt;

  &lt;p&gt;Let $x$ be the side perpendicular to the river. The parallel side is $100-2x$. Area $A(x)=x(100-2x)$, $x\in[0,50]$. $A&apos;(x)=100-4x=0$ at $x=25$. $A(0)=A(50)=0$, $A(25)=1250$. The largest area is $1250$ m², with dimensions $25\times50$.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Example 2 (The can).&lt;/strong&gt; A cylinder of radius $r$ and height $h$ has volume $V=\pi r^2h=330$. Its total surface area is&lt;/p&gt;

\[S=2\pi r^2+2\pi rh=2\pi r^2+\frac{2V}r,\qquad r&amp;gt;0 .\]

  &lt;p&gt;$S&apos;(r)=4\pi r-\dfrac{2V}{r^2}=0$ when $r^3=\dfrac V{2\pi}$, i.e. $r=\left(\tfrac{330}{2\pi}\right)^{1/3}\approx3.745$ cm. Then $h=\dfrac V{\pi r^2}=2r\approx7.49$ cm and $S\approx264.4$ cm². $S&apos;&apos;=4\pi+\dfrac{4V}{r^3}&amp;gt;0$, so $S$ is convex on $(0,\infty)$ and this is the global minimum.&lt;/p&gt;

  &lt;p&gt;Conclusion: the can using least material has height equal to its diameter. With $r=3.3$ cm, close to a real can, $S\approx268.4$ cm², only 1.5% above the optimum. Real cans are taller because the lid and base are thicker than the wall, and a slimmer can is easier to hold.&lt;/p&gt;
&lt;/div&gt;

&lt;h2 id=&quot;short-video&quot;&gt;Short video&lt;/h2&gt;

&lt;div class=&quot;reel-video&quot;&gt;
  &lt;video controls=&quot;&quot; playsinline=&quot;&quot; preload=&quot;metadata&quot; src=&quot;/public/videos/reels/optimal-can.mp4&quot;&gt;&lt;/video&gt;
  &lt;p class=&quot;reel-caption&quot;&gt;The most economical can: a cylinder of volume 330 cm³ with changing radius; the surface area is smallest when the height equals the diameter, where A′(r) = 0 (silent video, about 2 minutes).&lt;/p&gt;
&lt;/div&gt;

&lt;h2 id=&quot;applications&quot;&gt;Applications&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Physics: Snell’s law from Fermat’s principle.&lt;/strong&gt; Light travels from a point $A$ (height $a$ above the water) to a point $B$ (depth $b$ below it), horizontally $d$ apart; its speed is $v_1$ in air and $v_2$ in water. If the ray meets the surface at abscissa $x$, the travel time is&lt;/p&gt;

\[T(x)=\frac{\sqrt{a^2+x^2}}{v_1}+\frac{\sqrt{b^2+(d-x)^2}}{v_2} .\]

&lt;p&gt;$T&apos;(x)=\dfrac{x}{v_1\sqrt{a^2+x^2}}-\dfrac{d-x}{v_2\sqrt{b^2+(d-x)^2}}=\dfrac{\sin\theta_1}{v_1}-\dfrac{\sin\theta_2}{v_2}$, where $\theta_1,\theta_2$ are the angles of incidence and refraction. $T&apos;=0$ gives $\dfrac{\sin\theta_1}{v_1}=\dfrac{\sin\theta_2}{v_2}$: Snell’s law. Both terms of $T$ are convex, so the stationary point is the global minimum.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Economics: the best price.&lt;/strong&gt; Demand $p=100-0.5q$ (thousand VND), cost $C=20q+500$. Profit $P(q)=(100-0.5q)q-20q-500=80q-0.5q^2-500$, $P&apos;=80-q=0$ at $q=80$, price $p=60$, profit $2700$. $P&apos;&apos;=-1&amp;lt;0$, so it is a maximum.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Machine learning: one-parameter least squares.&lt;/strong&gt; Find $w$ so that the line $y=wx$ best fits the data $(1,2),(2,3),(3,7)$, in the sense of minimising $L(w)=\sum(y_i-wx_i)^2$. $L&apos;(w)=-2\sum x_i(y_i-wx_i)=0$ gives&lt;/p&gt;

\[w=\frac{\sum x_iy_i}{\sum x_i^2}=\frac{2+6+21}{1+4+9}=\frac{29}{14}\approx2.071 .\]

&lt;p&gt;$L&apos;&apos;=2\sum x_i^2&amp;gt;0$, so this is the global minimum. Multivariable linear regression (chapter 12) does the same with gradients.&lt;/p&gt;

&lt;h2 id=&quot;exercises&quot;&gt;Exercises&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Basic.&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;Two positive numbers add up to 20. What is their largest possible product?&lt;/li&gt;
  &lt;li&gt;Find the point on the parabola $y=x^2$ closest to $(0,2)$.&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Answers&lt;/summary&gt;

  &lt;ol&gt;
    &lt;li&gt;$x(20-x)$ is largest at $x=10$: product $100$.&lt;/li&gt;
    &lt;li&gt;Minimise $D(x)=x^2+(x^2-2)^2$: $D&apos;=2x(2x^2-3)=0$, $x=\pm\sqrt{3/2}$. Points $(\pm\sqrt{1.5},\ 1.5)$, distance $\tfrac{\sqrt7}2\approx1.32$.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;p&gt;&lt;strong&gt;Intermediate.&lt;/strong&gt;&lt;/p&gt;

&lt;ol start=&quot;3&quot;&gt;
  &lt;li&gt;From a 12 cm square card, cut squares of side $x$ from the corners and fold into an open box. Which $x$ maximises the volume?&lt;/li&gt;
  &lt;li&gt;A window is a rectangle topped by a semicircle, with perimeter 6 m. Which radius gives the largest area?&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Answers&lt;/summary&gt;

  &lt;ol start=&quot;3&quot;&gt;
    &lt;li&gt;$V=x(12-2x)^2$, $x\in[0,6]$. $V&apos;=(12-2x)(12-6x)=0$ at $x=2$. $V=128$ cm³.&lt;/li&gt;
    &lt;li&gt;Width $2r$, height $h$: $2r+2h+\pi r=6$. $A=2rh+\tfrac12\pi r^2=r(6-2r-\pi r)+\tfrac12\pi r^2$. $A&apos;=6-4r-\pi r=0$, $r=\tfrac6{4+\pi}\approx0.84$ m.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;p&gt;&lt;strong&gt;Advanced.&lt;/strong&gt;&lt;/p&gt;

&lt;ol start=&quot;5&quot;&gt;
  &lt;li&gt;Show that for a can of volume $V$ whose lid and base are $k$ times as thick as the wall, material is minimised when $h=2kr$.&lt;/li&gt;
  &lt;li&gt;Generalise least squares: find $b$ minimising $\sum(y_i-b)^2$. What about $\sum\lvert y_i-b\rvert$?&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Hints&lt;/summary&gt;

  &lt;ol start=&quot;5&quot;&gt;
    &lt;li&gt;Material is proportional to $M=2k\pi r^2+2\pi rh=2k\pi r^2+\tfrac{2V}r$. $M&apos;=0$ gives $r^3=\tfrac V{2k\pi}$, i.e. $\pi r^2h=V=2k\pi r^3$, $h=2kr$.&lt;/li&gt;
    &lt;li&gt;$b=\bar y$ (the mean). With absolute values, the derivative (where it exists) is the number of $y_i&amp;lt;b$ minus the number of $y_i&amp;gt;b$; the minimum is at the median.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;h2 id=&quot;summary&quot;&gt;Summary&lt;/h2&gt;

&lt;div class=&quot;content-box summary-box textbook-block&quot;&gt;
  &lt;ul&gt;
    &lt;li&gt;Procedure: name variables, write the objective, reduce to one variable with the constraint, state the domain, find critical points, compare with the boundary, answer with units.&lt;/li&gt;
    &lt;li&gt;A unique critical point that is a local minimum is the global minimum. For convex functions a stationary point is the global minimum.&lt;/li&gt;
    &lt;li&gt;The optimal can has $h=2r$; Snell’s law is the condition $T&apos;=0$; least squares gives $w=\sum x_iy_i/\sum x_i^2$.&lt;/li&gt;
  &lt;/ul&gt;
&lt;/div&gt;
</content>
 </entry>
 
 <entry>
   <title>Curve sketching</title>
   <link href="https://calculus-self-learning.pages.dev/contents/en/chapter03/03_03_Curve_sketching/"/>
   <updated>2026-12-01T00:00:00+00:00</updated>
   <id>https://calculus-self-learning.pages.dev/contents/en/chapter03/03_03_Curve_sketching</id>
   <content type="html">&lt;div class=&quot;textbook-objectives&quot;&gt;

  &lt;p&gt;&lt;strong&gt;Learning objectives.&lt;/strong&gt; After this lesson you can:&lt;/p&gt;

  &lt;ul&gt;
    &lt;li&gt;find an oblique asymptote $y=ax+b$ with two limits;&lt;/li&gt;
    &lt;li&gt;study a function completely and sketch its graph with the right shape, without a computer;&lt;/li&gt;
    &lt;li&gt;read physical information off a graph: equilibrium position, binding energy, point of fastest growth.&lt;/li&gt;
  &lt;/ul&gt;

&lt;/div&gt;

&lt;h2 id=&quot;why-this-lesson&quot;&gt;Why this lesson&lt;/h2&gt;

&lt;p&gt;Plotting software only draws the window you choose. The graph of $f(x)=\dfrac{x^2}{x-1}$ on $[-100,100]$ looks like two straight lines; on $[0.9,1.1]$ it looks like two vertical columns. Neither view shows where the extrema are. Studying the function with derivatives tells you the important points first, so you can choose the right window and understand what the graph says.&lt;/p&gt;

&lt;h2 id=&quot;oblique-asymptotes&quot;&gt;Oblique asymptotes&lt;/h2&gt;

&lt;div class=&quot;textbook-definition&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Definition 1 (Oblique asymptote).&lt;/strong&gt; The line $y=ax+b$ is an &lt;em&gt;oblique asymptote&lt;/em&gt; of $f$ as $x\to+\infty$ if $\lim_{x\to+\infty}\big(f(x)-ax-b\big)=0$. Similarly for $x\to-\infty$.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-theorem&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Theorem 1.&lt;/strong&gt; $y=ax+b$ is an oblique asymptote as $x\to+\infty$ if and only if&lt;/p&gt;

\[a=\lim_{x\to+\infty}\frac{f(x)}x,\qquad b=\lim_{x\to+\infty}\big(f(x)-ax\big)\]

  &lt;p&gt;and both limits are finite.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-proof&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Proof.&lt;/strong&gt; If $f(x)-ax-b\to0$, divide by $x$: $\dfrac{f(x)}x-a-\dfrac bx\to0$, so $\dfrac{f(x)}x\to a$; and $f(x)-ax\to b$. Conversely, if both limits exist then $f(x)-ax-b\to b-b=0$.&lt;/p&gt;
&lt;/div&gt;

&lt;h2 id=&quot;the-procedure&quot;&gt;The procedure&lt;/h2&gt;

&lt;ol&gt;
  &lt;li&gt;Domain, symmetry, periodicity (if any), intercepts.&lt;/li&gt;
  &lt;li&gt;Vertical asymptotes (at boundary points of the domain), horizontal or oblique asymptotes.&lt;/li&gt;
  &lt;li&gt;$f&apos;$: intervals of increase and decrease, extrema. Make a variation table.&lt;/li&gt;
  &lt;li&gt;$f&apos;&apos;$: convexity, inflection points.&lt;/li&gt;
  &lt;li&gt;Compute a few values, draw the asymptotes first, then draw the graph following the table.&lt;/li&gt;
&lt;/ol&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Example 1.&lt;/strong&gt; Study $f(x)=\dfrac{x^2}{x-1}$.&lt;/p&gt;

  &lt;p&gt;&lt;em&gt;Domain:&lt;/em&gt; $x\ne1$. Intercept: $(0,0)$.&lt;/p&gt;

  &lt;p&gt;&lt;em&gt;Asymptotes:&lt;/em&gt; as $x\to1^\pm$, $f\to\pm\infty$, so $x=1$ is a vertical asymptote. Polynomial division gives $f(x)=x+1+\dfrac1{x-1}$, so $y=x+1$ is an oblique asymptote on both sides (Theorem 1 gives $a=1$, $b=1$).&lt;/p&gt;

  &lt;p&gt;&lt;em&gt;Derivative:&lt;/em&gt; $f&apos;(x)=1-\dfrac1{(x-1)^2}=\dfrac{x(x-2)}{(x-1)^2}$.&lt;/p&gt;

  &lt;table&gt;
    &lt;thead&gt;
      &lt;tr&gt;
        &lt;th&gt;$x$&lt;/th&gt;
        &lt;th&gt;$(-\infty,0)$&lt;/th&gt;
        &lt;th&gt;$0$&lt;/th&gt;
        &lt;th&gt;$(0,1)$&lt;/th&gt;
        &lt;th&gt;$1$&lt;/th&gt;
        &lt;th&gt;$(1,2)$&lt;/th&gt;
        &lt;th&gt;$2$&lt;/th&gt;
        &lt;th&gt;$(2,\infty)$&lt;/th&gt;
      &lt;/tr&gt;
    &lt;/thead&gt;
    &lt;tbody&gt;
      &lt;tr&gt;
        &lt;td&gt;$f&apos;$&lt;/td&gt;
        &lt;td&gt;$+$&lt;/td&gt;
        &lt;td&gt;$0$&lt;/td&gt;
        &lt;td&gt;$-$&lt;/td&gt;
        &lt;td&gt;undef.&lt;/td&gt;
        &lt;td&gt;$-$&lt;/td&gt;
        &lt;td&gt;$0$&lt;/td&gt;
        &lt;td&gt;$+$&lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr&gt;
        &lt;td&gt;$f$&lt;/td&gt;
        &lt;td&gt;incr.&lt;/td&gt;
        &lt;td&gt;max $0$&lt;/td&gt;
        &lt;td&gt;decr.&lt;/td&gt;
        &lt;td&gt; &lt;/td&gt;
        &lt;td&gt;decr.&lt;/td&gt;
        &lt;td&gt;min $4$&lt;/td&gt;
        &lt;td&gt;incr.&lt;/td&gt;
      &lt;/tr&gt;
    &lt;/tbody&gt;
  &lt;/table&gt;

  &lt;p&gt;&lt;em&gt;Convexity:&lt;/em&gt; $f&apos;&apos;(x)=\dfrac2{(x-1)^3}$: concave for $x&amp;lt;1$, convex for $x&amp;gt;1$. No inflection point ($x=1$ is not in the domain).&lt;/p&gt;

  &lt;p&gt;The graph has two branches: the left one below the oblique asymptote with a peak at $(0,0)$, the right one above it with a bottom at $(2,4)$. Note that the local maximum $0$ is smaller than the local minimum $4$: local extrema on different branches are not comparable.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Example 2.&lt;/strong&gt; Study $f(x)=xe^{-x^2/2}$.&lt;/p&gt;

  &lt;p&gt;Odd, defined on $\mathbb{R}$, $f(x)\to0$ as $x\to\pm\infty$ (horizontal asymptote $y=0$).&lt;/p&gt;

  &lt;p&gt;$f&apos;(x)=(1-x^2)e^{-x^2/2}$: increasing on $(-1,1)$, decreasing outside. Maximum $f(1)=e^{-1/2}\approx0.607$, minimum $f(-1)\approx-0.607$.&lt;/p&gt;

  &lt;p&gt;$f&apos;&apos;(x)=(x^3-3x)e^{-x^2/2}=x(x^2-3)e^{-x^2/2}$: sign changes at $0$, $\pm\sqrt3$. Three inflection points: $(0,0)$ and $(\pm\sqrt3,\pm\sqrt3e^{-3/2})\approx(\pm1.732,\ \pm0.386)$.&lt;/p&gt;
&lt;/div&gt;

&lt;h2 id=&quot;interactive&quot;&gt;Interactive&lt;/h2&gt;

&lt;div class=&quot;interactive-frame&quot;&gt;
  &lt;div class=&quot;interactive-frame-head&quot;&gt;
    &lt;div class=&quot;interactive-frame-title&quot;&gt;Variation table and graph&lt;/div&gt;
    &lt;div class=&quot;interactive-frame-desc&quot;&gt;Drag k to create or remove extrema; the variation table follows.&lt;/div&gt;
  &lt;/div&gt;
  &lt;iframe src=&quot;/interactives/chapter03/curve-sketch-en.html&quot; title=&quot;Variation table and graph&quot; loading=&quot;lazy&quot; style=&quot;height: 760px;&quot;&gt;&lt;/iframe&gt;
  &lt;div class=&quot;interactive-frame-foot&quot;&gt;
    &lt;a href=&quot;/interactives/chapter03/curve-sketch-en.html&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;Open the interactive in a new window&lt;/a&gt;
  &lt;/div&gt;
&lt;/div&gt;

&lt;h2 id=&quot;applications&quot;&gt;Applications&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Physics: the Lennard-Jones potential.&lt;/strong&gt; The interaction of two noble-gas atoms is modelled by $V(r)=4\varepsilon\left[\left(\tfrac\sigma r\right)^{12}-\left(\tfrac\sigma r\right)^6\right]$, $r&amp;gt;0$. Quick study: $V\to+\infty$ as $r\to0^+$ (strong repulsion), $V\to0^-$ as $r\to\infty$. $V&apos;(r)=\dfrac{4\varepsilon}{r}\left[-12\left(\tfrac\sigma r\right)^{12}+6\left(\tfrac\sigma r\right)^6\right]=0$ when $\left(\tfrac\sigma r\right)^6=\tfrac12$, i.e. $r^*=2^{1/6}\sigma\approx1.122\sigma$. There $V(r^*)=4\varepsilon\left(\tfrac14-\tfrac12\right)=-\varepsilon$. The graph shows the equilibrium distance $r^*$ and the binding energy $\varepsilon$ at once.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Economics: the logistic curve.&lt;/strong&gt; Adoption of a new product often follows $P(t)=\dfrac{K}{1+Ae^{-rt}}$. Then $P&apos;=rP\left(1-\tfrac PK\right)&amp;gt;0$ and $P&apos;&apos;=rP&apos;\left(1-\tfrac{2P}K\right)$. The inflection point is at $P=\tfrac K2$: at half the market, growth is fastest and then slows. Firms use the inflection point to estimate the market size $K$ from early data.&lt;/p&gt;

&lt;h2 id=&quot;exercises&quot;&gt;Exercises&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Basic.&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;Find the asymptotes of $f(x)=\dfrac{2x^2+3x}{x+1}$.&lt;/li&gt;
  &lt;li&gt;Make the variation table of $f(x)=x^3-3x+2$.&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Answers&lt;/summary&gt;

  &lt;ol&gt;
    &lt;li&gt;Vertical asymptote $x=-1$; $f=2x+1-\dfrac1{x+1}$, oblique asymptote $y=2x+1$.&lt;/li&gt;
    &lt;li&gt;$f&apos;=3(x^2-1)$. Increasing on $(-\infty,-1)$, decreasing on $(-1,1)$, increasing on $(1,\infty)$. Max $f(-1)=4$, min $f(1)=0$.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;p&gt;&lt;strong&gt;Intermediate.&lt;/strong&gt;&lt;/p&gt;

&lt;ol start=&quot;3&quot;&gt;
  &lt;li&gt;Study $f(x)=\dfrac{\ln x}{x}$.&lt;/li&gt;
  &lt;li&gt;Find the oblique asymptotes of $f(x)=\sqrt{x^2+2x}$ as $x\to+\infty$ and $x\to-\infty$.&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Answers&lt;/summary&gt;

  &lt;ol start=&quot;3&quot;&gt;
    &lt;li&gt;Domain $x&amp;gt;0$. $x\to0^+$: $f\to-\infty$ (vertical asymptote $x=0$). $x\to\infty$: $f\to0$. $f&apos;=\dfrac{1-\ln x}{x^2}$: maximum $\tfrac1e$ at $x=e$. $f&apos;&apos;=\dfrac{2\ln x-3}{x^3}$: inflection at $x=e^{3/2}$.&lt;/li&gt;
    &lt;li&gt;$x\to+\infty$: $y=x+1$. $x\to-\infty$: $a=\lim\tfrac{f}{x}=-1$, $b=\lim(f+x)=-1$, so $y=-x-1$.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;p&gt;&lt;strong&gt;Advanced.&lt;/strong&gt;&lt;/p&gt;

&lt;ol start=&quot;5&quot;&gt;
  &lt;li&gt;Study $f(x)=x^x$ on $(0,\infty)$, including the limit as $x\to0^+$.&lt;/li&gt;
  &lt;li&gt;Prove that the graph of a cubic polynomial has exactly one inflection point and is symmetric about it.&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Hints&lt;/summary&gt;

  &lt;ol start=&quot;5&quot;&gt;
    &lt;li&gt;$x^x\to1$ as $x\to0^+$ (lesson 02_06). Minimum at $x=\tfrac1e$, value $e^{-1/e}\approx0.692$. $f&apos;&apos;=x^x\left[(\ln x+1)^2+\tfrac1x\right]&amp;gt;0$: convex everywhere.&lt;/li&gt;
    &lt;li&gt;$f&apos;&apos;=6ax+2b$ has exactly one root $x_0=-\tfrac b{3a}$. Moving the origin to $(x_0,f(x_0))$ removes the quadratic term, leaving $aX^3+pX$, an odd function.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;h2 id=&quot;summary&quot;&gt;Summary&lt;/h2&gt;

&lt;div class=&quot;content-box summary-box textbook-block&quot;&gt;
  &lt;ul&gt;
    &lt;li&gt;Oblique asymptote: $a=\lim\tfrac{f(x)}x$, $b=\lim(f(x)-ax)$.&lt;/li&gt;
    &lt;li&gt;Procedure: domain and asymptotes, then $f&apos;$ (variation table), then $f&apos;&apos;$ (convexity, inflection), then draw.&lt;/li&gt;
    &lt;li&gt;The graph shows meaningful quantities directly: equilibrium is a potential minimum, fastest growth is an inflection point.&lt;/li&gt;
  &lt;/ul&gt;
&lt;/div&gt;
</content>
 </entry>
 
 <entry>
   <title>Convex and concave functions, inflection points</title>
   <link href="https://calculus-self-learning.pages.dev/contents/en/chapter03/03_02_Convexity_and_inflection_points/"/>
   <updated>2026-12-01T00:00:00+00:00</updated>
   <id>https://calculus-self-learning.pages.dev/contents/en/chapter03/03_02_Convexity_and_inflection_points</id>
   <content type="html">&lt;div class=&quot;textbook-objectives&quot;&gt;

  &lt;p&gt;&lt;strong&gt;Learning objectives.&lt;/strong&gt; After this lesson you can:&lt;/p&gt;

  &lt;ul&gt;
    &lt;li&gt;state the chord definition of convex and concave functions;&lt;/li&gt;
    &lt;li&gt;prove that $f&apos;&apos;\ge0$ on an interval makes $f$ convex, and use it to find intervals of convexity and inflection points;&lt;/li&gt;
    &lt;li&gt;state Jensen’s inequality and derive the AM–GM inequality;&lt;/li&gt;
    &lt;li&gt;explain why convex loss functions are easy to optimise and why concave functions model risk aversion.&lt;/li&gt;
  &lt;/ul&gt;

&lt;/div&gt;

&lt;h2 id=&quot;why-this-lesson&quot;&gt;Why this lesson&lt;/h2&gt;

&lt;p&gt;Someone with 100 million VND is offered a game: toss a coin; tails leaves 50 million, heads gives 150 million. The expected value is still 100 million, yet most people refuse. Economics explains this with a &lt;em&gt;utility&lt;/em&gt; $u(w)=\ln w$, a concave function: losing 50 million hurts more than gaining 50 million pleases. The curvature of a graph, measured by $f&apos;&apos;$, is the subject of this lesson.&lt;/p&gt;

&lt;h2 id=&quot;definitions&quot;&gt;Definitions&lt;/h2&gt;

&lt;div class=&quot;textbook-definition&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Definition 1 (Convex, concave).&lt;/strong&gt; $f$ is &lt;em&gt;convex&lt;/em&gt; on an interval $I$ if for all $x,y\in I$ and $t\in[0,1]$,&lt;/p&gt;

\[f\big(tx+(1-t)y\big)\le t f(x)+(1-t)f(y).\]

  &lt;p&gt;That is, the chord joining two points of the graph lies above the graph. $f$ is &lt;em&gt;concave&lt;/em&gt; if $-f$ is convex (the inequality reverses).&lt;/p&gt;
&lt;/div&gt;

&lt;p&gt;A note on terms: some school texts use the opposite convention. In this course &lt;em&gt;convex&lt;/em&gt; means Definition 1, as in optimisation and machine learning: $x^2$ and $e^x$ are convex.&lt;/p&gt;

&lt;div class=&quot;textbook-theorem&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Theorem 1.&lt;/strong&gt; Let $f$ be twice differentiable on an interval $I$. If $f&apos;&apos;\ge0$ on $I$ then $f$ is convex; if $f&apos;&apos;\le0$ then $f$ is concave.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-proof&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Proof.&lt;/strong&gt; Take $x&amp;lt;z&amp;lt;y$ in $I$ with $z=tx+(1-t)y$. By the mean value theorem there are $\xi_1\in(x,z)$, $\xi_2\in(z,y)$ with&lt;/p&gt;

\[\frac{f(z)-f(x)}{z-x}=f&apos;(\xi_1),\qquad\frac{f(y)-f(z)}{y-z}=f&apos;(\xi_2).\]

  &lt;p&gt;Since $f&apos;&apos;\ge0$, $f&apos;$ is increasing, so $f&apos;(\xi_1)\le f&apos;(\xi_2)$. The slope inequality $\dfrac{f(z)-f(x)}{z-x}\le\dfrac{f(y)-f(z)}{y-z}$, after cross-multiplying with $z-x=(1-t)(y-x)$ and $y-z=t(y-x)$, becomes $f(z)\le tf(x)+(1-t)f(y)$.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-definition&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Definition 2 (Inflection point).&lt;/strong&gt; A point $c$ where $f$ is continuous and changes from convex to concave (or back) is an &lt;em&gt;inflection point&lt;/em&gt;. If $f&apos;&apos;(c)$ exists at an inflection point, then $f&apos;&apos;(c)=0$.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Example 1.&lt;/strong&gt; $f(x)=x^4-4x^3$. $f&apos;&apos;(x)=12x^2-24x=12x(x-2)$.&lt;/p&gt;

  &lt;table&gt;
    &lt;thead&gt;
      &lt;tr&gt;
        &lt;th&gt;$x$&lt;/th&gt;
        &lt;th&gt;$(-\infty,0)$&lt;/th&gt;
        &lt;th&gt;$(0,2)$&lt;/th&gt;
        &lt;th&gt;$(2,\infty)$&lt;/th&gt;
      &lt;/tr&gt;
    &lt;/thead&gt;
    &lt;tbody&gt;
      &lt;tr&gt;
        &lt;td&gt;$f&apos;&apos;$&lt;/td&gt;
        &lt;td&gt;$+$&lt;/td&gt;
        &lt;td&gt;$-$&lt;/td&gt;
        &lt;td&gt;$+$&lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr&gt;
        &lt;td&gt;$f$&lt;/td&gt;
        &lt;td&gt;convex&lt;/td&gt;
        &lt;td&gt;concave&lt;/td&gt;
        &lt;td&gt;convex&lt;/td&gt;
      &lt;/tr&gt;
    &lt;/tbody&gt;
  &lt;/table&gt;

  &lt;p&gt;Inflection points $(0,0)$ and $(2,-16)$. Note that $f&apos;&apos;(c)=0$ is not enough: $x^4$ has $f&apos;&apos;(0)=0$ but is convex on all of $\mathbb{R}$, with no inflection point.&lt;/p&gt;
&lt;/div&gt;

&lt;h2 id=&quot;jensens-inequality&quot;&gt;Jensen’s inequality&lt;/h2&gt;

&lt;div class=&quot;textbook-theorem&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Theorem 2 (Jensen).&lt;/strong&gt; If $f$ is convex on $I$, $x_1,\dots,x_n\in I$ and $\lambda_i\ge0$ with $\lambda_1+\dots+\lambda_n=1$, then&lt;/p&gt;

\[f\Big(\sum_{i=1}^n\lambda_ix_i\Big)\le\sum_{i=1}^n\lambda_if(x_i).\]

  &lt;p&gt;For concave $f$ the inequality reverses.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-proof&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Proof.&lt;/strong&gt; Induction on $n$. For $n=2$ this is Definition 1. Assume it for $n$ and take $n+1$ points with $\lambda_{n+1}&amp;lt;1$. Let $s=1-\lambda_{n+1}=\lambda_1+\dots+\lambda_n$ and $y=\sum_{i\le n}\tfrac{\lambda_i}{s}x_i\in I$. Then $\sum_{i\le n+1}\lambda_ix_i=sy+\lambda_{n+1}x_{n+1}$, and&lt;/p&gt;

\[f(sy+\lambda_{n+1}x_{n+1})\le sf(y)+\lambda_{n+1}f(x_{n+1})\le s\sum_{i\le n}\tfrac{\lambda_i}{s}f(x_i)+\lambda_{n+1}f(x_{n+1}).\]

&lt;/div&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Example 2 (AM–GM).&lt;/strong&gt; $\ln$ is concave since $(\ln x)&apos;&apos;=-\tfrac1{x^2}&amp;lt;0$. Jensen with $\lambda_i=\tfrac1n$ gives&lt;/p&gt;

\[\ln\frac{x_1+\dots+x_n}n\ge\frac{\ln x_1+\dots+\ln x_n}n=\ln\sqrt[n]{x_1\cdots x_n}.\]

  &lt;p&gt;Since $\ln$ is increasing: $\dfrac{x_1+\dots+x_n}n\ge\sqrt[n]{x_1\cdots x_n}$. For $2,8$: arithmetic mean $5\ge$ geometric mean $4$.&lt;/p&gt;
&lt;/div&gt;

&lt;h2 id=&quot;applications&quot;&gt;Applications&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Economics: risk aversion.&lt;/strong&gt; With $u(w)=\ln w$, the game above has expected utility $\tfrac12\ln50+\tfrac12\ln150=\ln\sqrt{7500}\approx\ln86.6$, less than $\ln100$. By Jensen this holds for every concave utility. The player values the game like a sure 86.6 million, so would pay up to 13.4 million in insurance to avoid the risk.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Machine learning: convex losses.&lt;/strong&gt; The squared loss $L(w)=\sum_i(y_i-wx_i)^2$ has $L&apos;&apos;=2\sum x_i^2\ge0$, so it is convex. For a differentiable convex function every point with $L&apos;=0$ is a global minimum (exercise 6). That is why linear and logistic regression always have a best solution reachable by gradient descent, while deep neural networks (non-convex) have no such guarantee.&lt;/p&gt;

&lt;h2 id=&quot;exercises&quot;&gt;Exercises&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Basic.&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;Find the intervals of convexity and the inflection points of $f(x)=x^3-6x^2+5$.&lt;/li&gt;
  &lt;li&gt;On which intervals is $f(x)=e^{-x^2}$ convex?&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Answers&lt;/summary&gt;

  &lt;ol&gt;
    &lt;li&gt;$f&apos;&apos;=6x-12$. Concave on $(-\infty,2)$, convex on $(2,\infty)$, inflection point $(2,-11)$.&lt;/li&gt;
    &lt;li&gt;$f&apos;&apos;=(4x^2-2)e^{-x^2}\ge0$ when $\lvert x\rvert\ge\tfrac1{\sqrt2}$. Convex on $(-\infty,-\tfrac1{\sqrt2})$ and $(\tfrac1{\sqrt2},\infty)$.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;p&gt;&lt;strong&gt;Intermediate.&lt;/strong&gt;&lt;/p&gt;

&lt;ol start=&quot;3&quot;&gt;
  &lt;li&gt;Use Jensen for $f(x)=x^2$ to prove $\left(\dfrac{a+b+c}3\right)^2\le\dfrac{a^2+b^2+c^2}3$.&lt;/li&gt;
  &lt;li&gt;Prove that the sigmoid $\sigma$ is convex on $(-\infty,0)$ and concave on $(0,\infty)$.&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Answers&lt;/summary&gt;

  &lt;ol start=&quot;3&quot;&gt;
    &lt;li&gt;$x^2$ is convex; apply Jensen with $\lambda_i=\tfrac13$.&lt;/li&gt;
    &lt;li&gt;$\sigma&apos;&apos;=\sigma(1-\sigma)(1-2\sigma)$. The sign of $1-2\sigma$ is positive for $x&amp;lt;0$ ($\sigma&amp;lt;\tfrac12$) and negative for $x&amp;gt;0$. Inflection point $(0,\tfrac12)$.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;p&gt;&lt;strong&gt;Advanced.&lt;/strong&gt;&lt;/p&gt;

&lt;ol start=&quot;5&quot;&gt;
  &lt;li&gt;Prove: a differentiable convex function lies above each of its tangent lines, $f(y)\ge f(x)+f&apos;(x)(y-x)$.&lt;/li&gt;
  &lt;li&gt;Deduce from exercise 5: if $f$ is convex and differentiable and $f&apos;(x^*)=0$, then $x^*$ is a global minimum.&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Hints&lt;/summary&gt;

  &lt;ol start=&quot;5&quot;&gt;
    &lt;li&gt;From the definition: $\dfrac{f(x+t(y-x))-f(x)}{t}\le f(y)-f(x)$ for $t\in(0,1]$; let $t\to0^+$.&lt;/li&gt;
    &lt;li&gt;Put $x=x^*$ in exercise 5: $f(y)\ge f(x^*)$ for all $y$.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;h2 id=&quot;summary&quot;&gt;Summary&lt;/h2&gt;

&lt;div class=&quot;content-box summary-box textbook-block&quot;&gt;
  &lt;ul&gt;
    &lt;li&gt;Convex: chords lie above the graph. $f&apos;&apos;\ge0$ means convex, $f&apos;&apos;\le0$ concave.&lt;/li&gt;
    &lt;li&gt;Inflection point: where convexity changes; there $f&apos;&apos;=0$ if it exists, but $f&apos;&apos;=0$ is not sufficient.&lt;/li&gt;
    &lt;li&gt;Jensen: $f(\sum\lambda_ix_i)\le\sum\lambda_if(x_i)$ for convex $f$. Consequence: AM–GM from the concavity of $\ln$.&lt;/li&gt;
    &lt;li&gt;For differentiable convex functions a stationary point is a global minimum: the basis of convex optimisation.&lt;/li&gt;
  &lt;/ul&gt;
&lt;/div&gt;
</content>
 </entry>
 
 <entry>
   <title>Monotonicity and extrema</title>
   <link href="https://calculus-self-learning.pages.dev/contents/en/chapter03/03_01_Monotonicity_and_extrema/"/>
   <updated>2026-12-01T00:00:00+00:00</updated>
   <id>https://calculus-self-learning.pages.dev/contents/en/chapter03/03_01_Monotonicity_and_extrema</id>
   <content type="html">&lt;div class=&quot;textbook-objectives&quot;&gt;

  &lt;p&gt;&lt;strong&gt;Learning objectives.&lt;/strong&gt; After this lesson you can:&lt;/p&gt;

  &lt;ul&gt;
    &lt;li&gt;find where a function increases and decreases from the sign of $f&apos;$;&lt;/li&gt;
    &lt;li&gt;find critical points and classify maxima and minima with the first or second derivative test;&lt;/li&gt;
    &lt;li&gt;find the largest and smallest values of a continuous function on a closed interval;&lt;/li&gt;
    &lt;li&gt;apply this to drug concentration in the blood and to profit.&lt;/li&gt;
  &lt;/ul&gt;

&lt;/div&gt;

&lt;h2 id=&quot;why-this-lesson&quot;&gt;Why this lesson&lt;/h2&gt;

&lt;p&gt;After a dose, the drug concentration in the blood over time (hours) is modelled by $C(t)=5te^{-0.5t}$ (mg/L). It rises, then falls. A doctor needs to know when the concentration peaks and how high, to stay below the toxic threshold. The sign of the derivative answers this.&lt;/p&gt;

&lt;h2 id=&quot;monotonicity&quot;&gt;Monotonicity&lt;/h2&gt;

&lt;p&gt;Corollary 1 of lesson 02_05: on an interval, $f&apos;&amp;gt;0$ means $f$ is strictly increasing and $f&apos;&amp;lt;0$ means strictly decreasing. So to see where a function rises or falls, study the sign of $f&apos;$.&lt;/p&gt;

&lt;div class=&quot;textbook-definition&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Definition 1 (Extrema, critical points).&lt;/strong&gt; $f$ has a &lt;em&gt;local maximum&lt;/em&gt; at $c$ if $f(c)\ge f(x)$ for all $x$ near $c$, a &lt;em&gt;local minimum&lt;/em&gt; if $f(c)\le f(x)$. An interior point $c$ of the domain is a &lt;em&gt;critical point&lt;/em&gt; if $f&apos;(c)=0$ or $f&apos;(c)$ does not exist.&lt;/p&gt;
&lt;/div&gt;

&lt;p&gt;By Fermat’s theorem (lesson 02_05), interior local extrema occur only at critical points. The converse fails: $f(x)=x^3$ has $f&apos;(0)=0$ but is increasing on all of $\mathbb{R}$, with no extremum.&lt;/p&gt;

&lt;div class=&quot;textbook-theorem&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Theorem 1 (First derivative test).&lt;/strong&gt; Let $f$ be continuous at a critical point $c$ and differentiable near $c$ (except possibly at $c$).&lt;/p&gt;

  &lt;ul&gt;
    &lt;li&gt;If $f&apos;$ changes from $+$ to $-$ at $c$, $f$ has a local maximum at $c$.&lt;/li&gt;
    &lt;li&gt;If $f&apos;$ changes from $-$ to $+$, $f$ has a local minimum.&lt;/li&gt;
    &lt;li&gt;If $f&apos;$ does not change sign, $c$ is not an extremum.&lt;/li&gt;
  &lt;/ul&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-proof&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Proof (first case).&lt;/strong&gt; There is $\delta&amp;gt;0$ with $f&apos;&amp;gt;0$ on $(c-\delta,c)$ and $f&apos;&amp;lt;0$ on $(c,c+\delta)$. For $x\in(c-\delta,c)$, the mean value theorem gives $f(c)-f(x)=f&apos;(\xi)(c-x)&amp;gt;0$. For $x\in(c,c+\delta)$, $f(x)-f(c)=f&apos;(\xi)(x-c)&amp;lt;0$. So $f(x)&amp;lt;f(c)$ for all $x\ne c$ near $c$.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-theorem&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Theorem 2 (Second derivative test).&lt;/strong&gt; If $f&apos;(c)=0$ and $f&apos;&apos;(c)$ exists: $f&apos;&apos;(c)&amp;lt;0$ gives a local maximum; $f&apos;&apos;(c)&amp;gt;0$ gives a local minimum. If $f&apos;&apos;(c)=0$ the test is inconclusive.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-proof&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Proof.&lt;/strong&gt; Suppose $f&apos;&apos;(c)&amp;lt;0$. Since $f&apos;&apos;(c)=\lim_{h\to0}\dfrac{f&apos;(c+h)-f&apos;(c)}h=\lim_{h\to0}\dfrac{f&apos;(c+h)}h&amp;lt;0$, sign preservation gives $\dfrac{f&apos;(c+h)}h&amp;lt;0$ for small nonzero $h$. So $f&apos;(c+h)&amp;lt;0$ for $h&amp;gt;0$ and $&amp;gt;0$ for $h&amp;lt;0$: $f&apos;$ changes from $+$ to $-$. Apply Theorem 1.&lt;/p&gt;
&lt;/div&gt;

&lt;p&gt;The functions $x^4$, $-x^4$, $x^3$ all have $f&apos;(0)=f&apos;&apos;(0)=0$ but give a minimum, a maximum and no extremum. When $f&apos;&apos;(c)=0$, go back to the first derivative test.&lt;/p&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Example 1.&lt;/strong&gt; Study $f(x)=x^3-3x^2-9x+5$.&lt;/p&gt;

  &lt;p&gt;$f&apos;(x)=3x^2-6x-9=3(x+1)(x-3)$. Sign table:&lt;/p&gt;

  &lt;table&gt;
    &lt;thead&gt;
      &lt;tr&gt;
        &lt;th&gt;$x$&lt;/th&gt;
        &lt;th&gt;$(-\infty,-1)$&lt;/th&gt;
        &lt;th&gt;$-1$&lt;/th&gt;
        &lt;th&gt;$(-1,3)$&lt;/th&gt;
        &lt;th&gt;$3$&lt;/th&gt;
        &lt;th&gt;$(3,\infty)$&lt;/th&gt;
      &lt;/tr&gt;
    &lt;/thead&gt;
    &lt;tbody&gt;
      &lt;tr&gt;
        &lt;td&gt;$f&apos;$&lt;/td&gt;
        &lt;td&gt;$+$&lt;/td&gt;
        &lt;td&gt;$0$&lt;/td&gt;
        &lt;td&gt;$-$&lt;/td&gt;
        &lt;td&gt;$0$&lt;/td&gt;
        &lt;td&gt;$+$&lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr&gt;
        &lt;td&gt;$f$&lt;/td&gt;
        &lt;td&gt;increasing&lt;/td&gt;
        &lt;td&gt;max $10$&lt;/td&gt;
        &lt;td&gt;decreasing&lt;/td&gt;
        &lt;td&gt;min $-22$&lt;/td&gt;
        &lt;td&gt;increasing&lt;/td&gt;
      &lt;/tr&gt;
    &lt;/tbody&gt;
  &lt;/table&gt;

  &lt;p&gt;Check with the second derivative test: $f&apos;&apos;(x)=6x-6$, $f&apos;&apos;(-1)=-12&amp;lt;0$ (maximum), $f&apos;&apos;(3)=12&amp;gt;0$ (minimum).&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Example 2.&lt;/strong&gt; $f(x)=\lvert x^2-1\rvert$ has critical points at $x=\pm1$ (not differentiable) and $x=0$ ($f&apos;(0)=0$). It has minima 0 at $\pm1$ and a local maximum 1 at $0$. Points of non-differentiability must be checked too.&lt;/p&gt;
&lt;/div&gt;

&lt;h2 id=&quot;maximum-and-minimum-on-a-closed-interval&quot;&gt;Maximum and minimum on a closed interval&lt;/h2&gt;

&lt;p&gt;By the Weierstrass theorem, a continuous function on $[a,b]$ has a maximum and a minimum. They occur at critical points in $(a,b)$ or at the endpoints. Method: evaluate $f$ at all of these and compare.&lt;/p&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Example 3.&lt;/strong&gt; Maximum and minimum of $f(x)=x^3-3x^2-9x+5$ on $[-2,4]$.&lt;/p&gt;

  &lt;p&gt;Critical points in the interval: $-1$, $3$. Values: $f(-2)=3$, $f(-1)=10$, $f(3)=-22$, $f(4)=-15$. So the maximum is $10$ at $x=-1$ and the minimum $-22$ at $x=3$. On $[-2,0]$: compare $f(-2)=3$, $f(-1)=10$, $f(0)=5$, so the minimum is $3$ at the endpoint $x=-2$. Endpoints can carry the global extremum.&lt;/p&gt;
&lt;/div&gt;

&lt;h2 id=&quot;applications&quot;&gt;Applications&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Medicine: peak concentration.&lt;/strong&gt; $C&apos;(t)=5e^{-0.5t}(1-0.5t)$ vanishes at $t=2$; $C&apos;&amp;gt;0$ for $t&amp;lt;2$ and $&amp;lt;0$ for $t&amp;gt;2$. The peak is at 2 hours, with $C(2)=10e^{-1}\approx3.68$ mg/L.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Economics: maximum profit.&lt;/strong&gt; Profit $P(q)=-0.5q^2+80q-500$ (million VND, $q$ in thousands of units) has $P&apos;(q)=-q+80$, changing from $+$ to $-$ at $q=80$. Maximum profit $P(80)=2700$. There marginal revenue equals marginal cost: the “MR = MC” rule of economics.&lt;/p&gt;

&lt;h2 id=&quot;exercises&quot;&gt;Exercises&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Basic.&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;Find the intervals of monotonicity and the extrema of $f(x)=x^4-2x^2$.&lt;/li&gt;
  &lt;li&gt;Find the maximum and minimum of $f(x)=x^2-4x+1$ on $[0,5]$.&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Answers&lt;/summary&gt;

  &lt;ol&gt;
    &lt;li&gt;$f&apos;=4x(x-1)(x+1)$. Decreasing on $(-\infty,-1)$ and $(0,1)$, increasing on $(-1,0)$ and $(1,\infty)$. Minimum $-1$ at $\pm1$, maximum $0$ at $0$.&lt;/li&gt;
    &lt;li&gt;$f(0)=1$, $f(2)=-3$, $f(5)=6$. Maximum $6$, minimum $-3$.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;p&gt;&lt;strong&gt;Intermediate.&lt;/strong&gt;&lt;/p&gt;

&lt;ol start=&quot;3&quot;&gt;
  &lt;li&gt;Find the extrema of $f(x)=x^{2/3}(x-5)$.&lt;/li&gt;
  &lt;li&gt;Find the extrema of $f(x)=x\ln x$ on $(0,\infty)$.&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Answers&lt;/summary&gt;

  &lt;ol start=&quot;3&quot;&gt;
    &lt;li&gt;$f&apos;=\dfrac{5(x-2)}{3x^{1/3}}$. Critical points $0$ (not differentiable) and $2$. Maximum $0$ at $x=0$; minimum $f(2)=-3\cdot2^{2/3}\approx-4.76$.&lt;/li&gt;
    &lt;li&gt;$f&apos;=\ln x+1=0$ at $x=\tfrac1e$; minimum $-\tfrac1e$.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;p&gt;&lt;strong&gt;Advanced.&lt;/strong&gt;&lt;/p&gt;

&lt;ol start=&quot;5&quot;&gt;
  &lt;li&gt;Prove $e^x&amp;gt;1+x+\dfrac{x^2}2$ for all $x&amp;gt;0$ using monotonicity.&lt;/li&gt;
  &lt;li&gt;Find $a$ such that $f(x)=x^3+ax^2+3x$ is increasing on all of $\mathbb{R}$.&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Hints&lt;/summary&gt;

  &lt;ol start=&quot;5&quot;&gt;
    &lt;li&gt;$g(x)=e^x-1-x-\tfrac{x^2}2$ has $g(0)=0$ and $g&apos;(x)=e^x-1-x&amp;gt;0$ for $x&amp;gt;0$ (lesson 02_05).&lt;/li&gt;
    &lt;li&gt;Need $f&apos;=3x^2+2ax+3\ge0$ for all $x$: $a^2-9\le0$, i.e. $\lvert a\rvert\le3$.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;h2 id=&quot;summary&quot;&gt;Summary&lt;/h2&gt;

&lt;div class=&quot;content-box summary-box textbook-block&quot;&gt;
  &lt;ul&gt;
    &lt;li&gt;The sign of $f&apos;$ gives the intervals of increase and decrease. Interior local extrema occur only at critical points ($f&apos;=0$ or undefined).&lt;/li&gt;
    &lt;li&gt;First derivative test: $+\to-$ is a maximum, $-\to+$ a minimum. Second: $f&apos;&apos;(c)&amp;lt;0$ maximum, $&amp;gt;0$ minimum, $=0$ inconclusive.&lt;/li&gt;
    &lt;li&gt;Extremes on a closed interval: compare values at critical points and both endpoints.&lt;/li&gt;
  &lt;/ul&gt;
&lt;/div&gt;
</content>
 </entry>
 
 <entry>
   <title>L'Hôpital's rule and indeterminate forms</title>
   <link href="https://calculus-self-learning.pages.dev/contents/en/chapter02/02_06_LHopitals_rule/"/>
   <updated>2026-12-01T00:00:00+00:00</updated>
   <id>https://calculus-self-learning.pages.dev/contents/en/chapter02/02_06_LHopitals_rule</id>
   <content type="html">&lt;div class=&quot;textbook-objectives&quot;&gt;

  &lt;p&gt;&lt;strong&gt;Learning objectives.&lt;/strong&gt; After this lesson you can:&lt;/p&gt;

  &lt;ul&gt;
    &lt;li&gt;state L’Hôpital’s rule and prove the $\tfrac00$ case with Cauchy’s theorem;&lt;/li&gt;
    &lt;li&gt;resolve the forms $\tfrac00$, $\tfrac\infty\infty$, $0\cdot\infty$, $\infty-\infty$, $1^\infty$, $0^0$, $\infty^0$;&lt;/li&gt;
    &lt;li&gt;compare growth rates $\ln x\ll x^a\ll e^x$;&lt;/li&gt;
    &lt;li&gt;recognise when the rule does not apply or leads to circular reasoning.&lt;/li&gt;
  &lt;/ul&gt;

&lt;/div&gt;

&lt;h2 id=&quot;why-this-lesson&quot;&gt;Why this lesson&lt;/h2&gt;

&lt;p&gt;Relativistic kinetic energy is $K=mc^2\left(\dfrac1{\sqrt{1-v^2/c^2}}-1\right)$. When the speed $v$ is small compared with the speed of light $c$, this should be close to Newton’s $\tfrac12mv^2$. Checking that means computing a $\tfrac00$ limit. Equivalent infinitesimals (lesson 01_04) can do it, but L’Hôpital’s rule is more mechanical and covers more forms.&lt;/p&gt;

&lt;h2 id=&quot;lhôpitals-rule&quot;&gt;L’Hôpital’s rule&lt;/h2&gt;

&lt;div class=&quot;textbook-theorem&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Theorem 1 (L’Hôpital).&lt;/strong&gt; Let $f,g$ be differentiable on an interval around $a$ (except possibly at $a$), with $g&apos;(x)\ne0$ there. Suppose $\lim_{x\to a}f(x)=\lim_{x\to a}g(x)=0$, or both tend to $\pm\infty$. If $\lim_{x\to a}\dfrac{f&apos;(x)}{g&apos;(x)}=L$ (finite or $\pm\infty$), then&lt;/p&gt;

\[\lim_{x\to a}\frac{f(x)}{g(x)}=L .\]

  &lt;p&gt;The result also holds for one-sided limits and for $x\to\pm\infty$.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-proof&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Proof ($\tfrac00$, $x\to a^+$, finite $L$).&lt;/strong&gt; Set $f(a)=g(a)=0$; then $f,g$ are continuous on $[a,x]$ for $x$ near $a$. By Cauchy’s theorem (lesson 02_05) there is $c\in(a,x)$ with&lt;/p&gt;

\[\frac{f(x)}{g(x)}=\frac{f(x)-f(a)}{g(x)-g(a)}=\frac{f&apos;(c)}{g&apos;(c)} .\]

  &lt;p&gt;As $x\to a^+$, $c\to a^+$, so the right side tends to $L$. The left limit is similar.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Example 1 ($\tfrac00$).&lt;/strong&gt;&lt;/p&gt;

  &lt;ul&gt;
    &lt;li&gt;$\lim_{x\to0}\dfrac{e^x-1-x}{x^2}=\lim_{x\to0}\dfrac{e^x-1}{2x}=\lim_{x\to0}\dfrac{e^x}{2}=\dfrac12$. The rule is used twice; each time check that the form is still $\tfrac00$.&lt;/li&gt;
    &lt;li&gt;$\lim_{x\to0}\dfrac{x-\sin x}{x^3}=\lim\dfrac{1-\cos x}{3x^2}=\lim\dfrac{\sin x}{6x}=\dfrac16$. This agrees with exercise 5 of lesson 01_04.&lt;/li&gt;
  &lt;/ul&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Example 2 ($\tfrac\infty\infty$: comparing growth).&lt;/strong&gt;&lt;/p&gt;

  &lt;ul&gt;
    &lt;li&gt;$\lim_{x\to\infty}\dfrac{x^2}{e^x}=\lim\dfrac{2x}{e^x}=\lim\dfrac2{e^x}=0$. In general $\dfrac{x^n}{e^x}\to0$ for every $n$.&lt;/li&gt;
    &lt;li&gt;$\lim_{x\to\infty}\dfrac{\ln x}{x^a}=\lim\dfrac{1/x}{ax^{a-1}}=\lim\dfrac1{ax^a}=0$ for every $a&amp;gt;0$.&lt;/li&gt;
  &lt;/ul&gt;

  &lt;p&gt;So as $x\to\infty$: $\ln x\ll x^a\ll e^x$ (every positive power beats the logarithm, the exponential beats every power).&lt;/p&gt;
&lt;/div&gt;

&lt;h2 id=&quot;other-indeterminate-forms&quot;&gt;Other indeterminate forms&lt;/h2&gt;

&lt;p&gt;Reduce to $\tfrac00$ or $\tfrac\infty\infty$:&lt;/p&gt;

&lt;table&gt;
  &lt;thead&gt;
    &lt;tr&gt;
      &lt;th&gt;form&lt;/th&gt;
      &lt;th&gt;transformation&lt;/th&gt;
    &lt;/tr&gt;
  &lt;/thead&gt;
  &lt;tbody&gt;
    &lt;tr&gt;
      &lt;td&gt;$0\cdot\infty$&lt;/td&gt;
      &lt;td&gt;$fg=\dfrac{f}{1/g}$ or $\dfrac{g}{1/f}$&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;$\infty-\infty$&lt;/td&gt;
      &lt;td&gt;common denominator or conjugate&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;$1^\infty$, $0^0$, $\infty^0$&lt;/td&gt;
      &lt;td&gt;$f^g=e^{g\ln f}$; find the limit of $g\ln f$&lt;/td&gt;
    &lt;/tr&gt;
  &lt;/tbody&gt;
&lt;/table&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Example 3.&lt;/strong&gt;&lt;/p&gt;

  &lt;ul&gt;
    &lt;li&gt;$0\cdot\infty$: $\lim_{x\to0^+}x\ln x=\lim\dfrac{\ln x}{1/x}=\lim\dfrac{1/x}{-1/x^2}=\lim(-x)=0$.&lt;/li&gt;
    &lt;li&gt;$0^0$: $\lim_{x\to0^+}x^x=e^{\lim x\ln x}=e^0=1$. With $x=0.01$: $0.01^{0.01}\approx0.955$.&lt;/li&gt;
    &lt;li&gt;$\infty-\infty$: $\lim_{x\to0}\left(\dfrac1x-\dfrac1{\sin x}\right)=\lim\dfrac{\sin x-x}{x\sin x}=\lim\dfrac{\cos x-1}{\sin x+x\cos x}=\lim\dfrac{-\sin x}{2\cos x-x\sin x}=0$.&lt;/li&gt;
    &lt;li&gt;$1^\infty$: $\lim_{x\to0}(1+2x)^{1/x}$. The logarithm is $\dfrac{\ln(1+2x)}x\to\lim\dfrac{2/(1+2x)}1=2$, so the limit is $e^2$.&lt;/li&gt;
  &lt;/ul&gt;
&lt;/div&gt;

&lt;h2 id=&quot;when-the-rule-does-not-apply&quot;&gt;When the rule does not apply&lt;/h2&gt;

&lt;div class=&quot;content-box warning-box textbook-block&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Caution.&lt;/strong&gt;&lt;/p&gt;

  &lt;ol&gt;
    &lt;li&gt;&lt;em&gt;The form must be indeterminate.&lt;/em&gt; $\lim_{x\to0}\dfrac{x+1}{x+2}=\dfrac12$, but differentiating numerator and denominator would give $1$, which is wrong.&lt;/li&gt;
    &lt;li&gt;&lt;em&gt;The limit of $f&apos;/g&apos;$ may fail to exist while the limit of $f/g$ exists.&lt;/em&gt; $\lim_{x\to\infty}\dfrac{x+\sin x}{x}=1$ (divide by $x$), but $\dfrac{1+\cos x}{1}$ oscillates. The rule is only a sufficient condition.&lt;/li&gt;
    &lt;li&gt;&lt;em&gt;Circular reasoning.&lt;/em&gt; Using L’Hôpital on $\lim\dfrac{\sin x}x$ needs $(\sin x)&apos;=\cos x$, whose proof (lesson 02_02) uses $\lim\dfrac{\sin x}x=1$. For the standard limits, use the direct proofs of lesson 01_04.&lt;/li&gt;
  &lt;/ol&gt;
&lt;/div&gt;

&lt;h2 id=&quot;interactive&quot;&gt;Interactive&lt;/h2&gt;

&lt;div class=&quot;interactive-frame&quot;&gt;
  &lt;div class=&quot;interactive-frame-head&quot;&gt;
    &lt;div class=&quot;interactive-frame-title&quot;&gt;f/g and f′/g′ near a&lt;/div&gt;
    &lt;div class=&quot;interactive-frame-desc&quot;&gt;Zoom in at a: f and g look like two lines.&lt;/div&gt;
  &lt;/div&gt;
  &lt;iframe src=&quot;/interactives/chapter02/lhopital-limit-en.html&quot; title=&quot;f/g and f′/g′ near a&quot; loading=&quot;lazy&quot; style=&quot;height: 700px;&quot;&gt;&lt;/iframe&gt;
  &lt;div class=&quot;interactive-frame-foot&quot;&gt;
    &lt;a href=&quot;/interactives/chapter02/lhopital-limit-en.html&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;Open the interactive in a new window&lt;/a&gt;
  &lt;/div&gt;
&lt;/div&gt;

&lt;h2 id=&quot;applications&quot;&gt;Applications&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Physics: relativity reduces to Newton.&lt;/strong&gt; Let $u=\tfrac{v^2}{c^2}$. Then $\dfrac{K}{\tfrac12mv^2}=\dfrac{(1-u)^{-1/2}-1}{u/2}$. As $u\to0$ this is $\tfrac00$, and L’Hôpital gives $\dfrac{\tfrac12(1-u)^{-3/2}}{1/2}\to1$. So $K\approx\tfrac12mv^2$ when $v\ll c$. For a satellite at $8$ km/s, $u\approx7\cdot10^{-10}$ and the two formulas practically coincide.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Computer science: algorithm complexity.&lt;/strong&gt; From Example 2: $\dfrac{n\log n}{n^2}=\dfrac{\log n}{n}\to0$, so an $O(n\log n)$ sort eventually beats an $O(n^2)$ one. But “eventually” can be far away: $x^{0.1}$ overtakes $\ln x$ only for $x&amp;gt;3.4\cdot10^{15}$; at $x=10^6$ we still have $\ln x\approx13.8&amp;gt;x^{0.1}\approx3.98$. A limit only describes behaviour for very large $x$.&lt;/p&gt;

&lt;h2 id=&quot;exercises&quot;&gt;Exercises&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Basic.&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;Compute $\lim_{x\to0}\dfrac{\tan x-x}{x^3}$.&lt;/li&gt;
  &lt;li&gt;Compute $\lim_{x\to\infty}\dfrac{\ln(x^2+1)}{x}$.&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Answers&lt;/summary&gt;

  &lt;ol&gt;
    &lt;li&gt;$\dfrac{1/\cos^2x-1}{3x^2}=\dfrac{\tan^2x}{3x^2}\to\dfrac13$.&lt;/li&gt;
    &lt;li&gt;$\dfrac{2x/(x^2+1)}{1}\to0$.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;p&gt;&lt;strong&gt;Intermediate.&lt;/strong&gt;&lt;/p&gt;

&lt;ol start=&quot;3&quot;&gt;
  &lt;li&gt;Compute $\lim_{x\to0^+}x^{\sin x}$.&lt;/li&gt;
  &lt;li&gt;Compute $\lim_{x\to1}\left(\dfrac{x}{x-1}-\dfrac1{\ln x}\right)$.&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Answers&lt;/summary&gt;

  &lt;ol start=&quot;3&quot;&gt;
    &lt;li&gt;$\sin x\ln x\sim x\ln x\to0$, so the limit is $1$.&lt;/li&gt;
    &lt;li&gt;Common denominator: $\dfrac{x\ln x-x+1}{(x-1)\ln x}$. L’Hôpital twice: $\dfrac{\ln x}{\ln x+1-1/x}\to\dfrac{1/x}{1/x+1/x^2}\to\dfrac12$.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;p&gt;&lt;strong&gt;Advanced.&lt;/strong&gt;&lt;/p&gt;

&lt;ol start=&quot;5&quot;&gt;
  &lt;li&gt;Compute $\lim_{x\to0}\left(\dfrac{\sin x}x\right)^{1/x^2}$.&lt;/li&gt;
  &lt;li&gt;Prove L’Hôpital’s rule for $x\to\infty$ (form $\tfrac00$) by substituting $x=\tfrac1t$.&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Hints&lt;/summary&gt;

  &lt;ol start=&quot;5&quot;&gt;
    &lt;li&gt;The logarithm is $\dfrac{\ln(\sin x/x)}{x^2}$. Use $\ln(1+u)\sim u$ with $u=\tfrac{\sin x}x-1\sim-\tfrac{x^2}6$: you get $-\tfrac16$, so the limit is $e^{-1/6}\approx0.846$.&lt;/li&gt;
    &lt;li&gt;$F(t)=f(1/t)$, $G(t)=g(1/t)$, $t\to0^+$. $\dfrac{F&apos;(t)}{G&apos;(t)}=\dfrac{-f&apos;(1/t)/t^2}{-g&apos;(1/t)/t^2}=\dfrac{f&apos;(x)}{g&apos;(x)}$.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;h2 id=&quot;summary&quot;&gt;Summary&lt;/h2&gt;

&lt;div class=&quot;content-box summary-box textbook-block&quot;&gt;
  &lt;ul&gt;
    &lt;li&gt;$\tfrac00$ or $\tfrac\infty\infty$: $\lim\tfrac fg=\lim\tfrac{f&apos;}{g&apos;}$ if the right side exists. Proved with Cauchy’s theorem.&lt;/li&gt;
    &lt;li&gt;$0\cdot\infty$: rewrite as a quotient. $\infty-\infty$: common denominator. $1^\infty$, $0^0$, $\infty^0$: write $f^g=e^{g\ln f}$.&lt;/li&gt;
    &lt;li&gt;$\ln x\ll x^a\ll e^x$ as $x\to\infty$.&lt;/li&gt;
    &lt;li&gt;Check the form before each use; the rule is only sufficient; avoid circular arguments with the standard limits.&lt;/li&gt;
  &lt;/ul&gt;
&lt;/div&gt;
</content>
 </entry>
 
 <entry>
   <title>The mean value theorems</title>
   <link href="https://calculus-self-learning.pages.dev/contents/en/chapter02/02_05_The_mean_value_theorems/"/>
   <updated>2026-12-01T00:00:00+00:00</updated>
   <id>https://calculus-self-learning.pages.dev/contents/en/chapter02/02_05_The_mean_value_theorems</id>
   <content type="html">&lt;div class=&quot;textbook-objectives&quot;&gt;

  &lt;p&gt;&lt;strong&gt;Learning objectives.&lt;/strong&gt; After this lesson you can:&lt;/p&gt;

  &lt;ul&gt;
    &lt;li&gt;state and prove the theorems of Fermat, Rolle, Lagrange and Cauchy;&lt;/li&gt;
    &lt;li&gt;find the point $c$ of the mean value theorem for a given function;&lt;/li&gt;
    &lt;li&gt;deduce: $f&apos;=0$ on an interval means $f$ is constant, $f&apos;&amp;gt;0$ means $f$ is increasing;&lt;/li&gt;
    &lt;li&gt;prove inequalities such as $\lvert\sin a-\sin b\rvert\le\lvert a-b\rvert$ and $\ln(1+x)&amp;lt;x$ with the mean value theorem.&lt;/li&gt;
  &lt;/ul&gt;

&lt;/div&gt;

&lt;h2 id=&quot;why-this-lesson&quot;&gt;Why this lesson&lt;/h2&gt;

&lt;p&gt;A 15 km stretch of expressway has average-speed cameras at both ends. A car covers it in 9 minutes, an average of 100 km/h, where the limit is 90 km/h. The driver argues he was doing only 80 km/h when passing each camera. The mean value theorem says: if position changes continuously and has a velocity at every moment, then at some moment the instantaneous velocity was exactly 100 km/h. The car broke the limit at least once.&lt;/p&gt;

&lt;h2 id=&quot;fermats-and-rolles-theorems&quot;&gt;Fermat’s and Rolle’s theorems&lt;/h2&gt;

&lt;div class=&quot;textbook-theorem&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Theorem 1 (Fermat).&lt;/strong&gt; If $f$ has a local maximum or minimum at an interior point $c$ and $f$ is differentiable at $c$, then $f&apos;(c)=0$.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-proof&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Proof.&lt;/strong&gt; Suppose $f$ has a local maximum at $c$: $f(c+h)\le f(c)$ for small $\lvert h\rvert$. For $h&amp;gt;0$, $\dfrac{f(c+h)-f(c)}h\le0$, so $f&apos;(c)=f&apos;_+(c)\le0$. For $h&amp;lt;0$ the quotient is $\ge0$, so $f&apos;(c)=f&apos;_-(c)\ge0$. Hence $f&apos;(c)=0$. Minima are similar.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-theorem&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Theorem 2 (Rolle).&lt;/strong&gt; If $f$ is continuous on $[a,b]$, differentiable on $(a,b)$, and $f(a)=f(b)$, then there is $c\in(a,b)$ with $f&apos;(c)=0$.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-proof&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Proof.&lt;/strong&gt; By the Weierstrass theorem (lesson 01_06), $f$ attains a maximum $M$ and minimum $m$ on $[a,b]$. If $M=m$, $f$ is constant and $f&apos;=0$ everywhere. If $M&amp;gt;m$, at least one of them differs from $f(a)=f(b)$ and is attained at an interior point $c\in(a,b)$. By Theorem 1, $f&apos;(c)=0$.&lt;/p&gt;
&lt;/div&gt;

&lt;h2 id=&quot;lagranges-mean-value-theorem&quot;&gt;Lagrange’s mean value theorem&lt;/h2&gt;

&lt;div class=&quot;textbook-theorem&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Theorem 3 (Mean value theorem).&lt;/strong&gt; If $f$ is continuous on $[a,b]$ and differentiable on $(a,b)$, there is $c\in(a,b)$ with&lt;/p&gt;

\[f&apos;(c)=\frac{f(b)-f(a)}{b-a} .\]

&lt;/div&gt;

&lt;div class=&quot;textbook-proof&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Proof.&lt;/strong&gt; Subtract the chord: let $g(x)=f(x)-f(a)-\dfrac{f(b)-f(a)}{b-a}(x-a)$. Then $g$ is continuous on $[a,b]$, differentiable on $(a,b)$, and $g(a)=g(b)=0$. Rolle gives $c$ with $g&apos;(c)=0$, i.e. $f&apos;(c)=\dfrac{f(b)-f(a)}{b-a}$.&lt;/p&gt;
&lt;/div&gt;

&lt;p&gt;Geometrically: some tangent is parallel to the chord joining the endpoints. Common form: $f(b)-f(a)=f&apos;(c)(b-a)$.&lt;/p&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Example 1.&lt;/strong&gt; For $f(x)=x^3$ on $[0,2]$: chord slope $\tfrac{8-0}{2}=4$. Solve $3c^2=4$: $c=\tfrac2{\sqrt3}\approx1.1547\in(0,2)$.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-theorem&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Corollary 1.&lt;/strong&gt; Let $f$ be differentiable on an interval $I$.&lt;/p&gt;

  &lt;ol&gt;
    &lt;li&gt;If $f&apos;(x)=0$ for all $x\in I$, then $f$ is constant on $I$.&lt;/li&gt;
    &lt;li&gt;If $f&apos;(x)&amp;gt;0$ for all $x\in I$, then $f$ is strictly increasing on $I$ (similarly $f&apos;&amp;lt;0$ gives strictly decreasing).&lt;/li&gt;
    &lt;li&gt;If $\lvert f&apos;(x)\rvert\le K$ on $I$, then $\lvert f(x)-f(y)\rvert\le K\lvert x-y\rvert$ for all $x,y\in I$.&lt;/li&gt;
  &lt;/ol&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-proof&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Proof.&lt;/strong&gt; For $x&amp;lt;y$ in $I$, Theorem 3 gives $f(y)-f(x)=f&apos;(c)(y-x)$ with $c\in(x,y)$. If $f&apos;=0$ then $f(y)=f(x)$. If $f&apos;&amp;gt;0$ then $f(y)&amp;gt;f(x)$. If $\lvert f&apos;\rvert\le K$ then $\lvert f(y)-f(x)\rvert\le K(y-x)$.&lt;/p&gt;
&lt;/div&gt;

&lt;p&gt;Corollary 1.1 is why two antiderivatives of the same function differ by a constant (chapter 4).&lt;/p&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Example 2 (Inequalities).&lt;/strong&gt;&lt;/p&gt;

  &lt;ul&gt;
    &lt;li&gt;$\lvert\sin a-\sin b\rvert\le\lvert a-b\rvert$: since $\lvert(\sin)&apos;\rvert=\lvert\cos\rvert\le1$, by Corollary 1.3.&lt;/li&gt;
    &lt;li&gt;For $x&amp;gt;0$: $\dfrac x{1+x}&amp;lt;\ln(1+x)&amp;lt;x$. Apply the mean value theorem to $\ln$ on $[1,1+x]$: $\ln(1+x)-\ln1=\dfrac1c\cdot x$ with $1&amp;lt;c&amp;lt;1+x$. Since $\dfrac1{1+x}&amp;lt;\dfrac1c&amp;lt;1$, the inequality follows. For $x=0.5$: $0.333&amp;lt;0.405&amp;lt;0.5$.&lt;/li&gt;
    &lt;li&gt;$e^x\ge1+x$ for all $x$: for $x&amp;gt;0$, $e^x-1=e^cx&amp;gt;x$; for $x&amp;lt;0$, $e^x-1=e^cx$ with $c\in(x,0)$, $e^c&amp;lt;1$ and $x&amp;lt;0$, so $e^cx&amp;gt;x$.&lt;/li&gt;
  &lt;/ul&gt;
&lt;/div&gt;

&lt;h2 id=&quot;cauchys-mean-value-theorem&quot;&gt;Cauchy’s mean value theorem&lt;/h2&gt;

&lt;div class=&quot;textbook-theorem&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Theorem 4 (Cauchy).&lt;/strong&gt; If $f,g$ are continuous on $[a,b]$, differentiable on $(a,b)$, and $g&apos;(x)\ne0$ on $(a,b)$, then there is $c\in(a,b)$ with&lt;/p&gt;

\[\frac{f(b)-f(a)}{g(b)-g(a)}=\frac{f&apos;(c)}{g&apos;(c)} .\]

&lt;/div&gt;

&lt;div class=&quot;textbook-proof&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Proof.&lt;/strong&gt; $g(b)\ne g(a)$, otherwise Rolle would give a zero of $g&apos;$. Let $h(x)=\big(f(b)-f(a)\big)g(x)-\big(g(b)-g(a)\big)f(x)$. Directly, $h(a)=f(b)g(a)-g(b)f(a)=h(b)$. Rolle gives $c$ with $h&apos;(c)=0$, i.e. $\big(f(b)-f(a)\big)g&apos;(c)=\big(g(b)-g(a)\big)f&apos;(c)$. Divide by $g&apos;(c)\big(g(b)-g(a)\big)$.&lt;/p&gt;
&lt;/div&gt;

&lt;p&gt;Lagrange is the special case $g(x)=x$. Cauchy is the key to proving L’Hôpital’s rule in the next lesson.&lt;/p&gt;

&lt;h2 id=&quot;short-video&quot;&gt;Short video&lt;/h2&gt;

&lt;div class=&quot;reel-video&quot;&gt;
  &lt;video controls=&quot;&quot; playsinline=&quot;&quot; preload=&quot;metadata&quot; src=&quot;/public/videos/reels/mean-value-theorem.mp4&quot;&gt;&lt;/video&gt;
  &lt;p class=&quot;reel-caption&quot;&gt;The mean value theorem: a car covers 120 km in 2 hours, so at some moment the speedometer reads exactly 60 km/h, where the tangent is parallel to the secant (silent video, about 1 minute 52 seconds).&lt;/p&gt;
&lt;/div&gt;

&lt;h2 id=&quot;applications&quot;&gt;Applications&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Traffic: average-speed cameras.&lt;/strong&gt; As at the start: position $s(t)$ is differentiable, $s(9\text{ min})-s(0)=15$ km, so some $c$ has $s&apos;(c)=\tfrac{15}{0.15}=100$ km/h.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Machine learning: Lipschitz constants from derivatives.&lt;/strong&gt; Corollary 1.3 gives the Lipschitz constant used in lesson 01_02: $K=\sup\lvert f&apos;\rvert$. For example $\lvert\sigma&apos;\rvert\le\tfrac14$, so $\lvert\sigma(x)-\sigma(y)\rvert\le\tfrac14\lvert x-y\rvert$. A multilayer network has Lipschitz constant at most the product of the layers’ constants; “spectral normalization” keeps this product small to stabilise training.&lt;/p&gt;

&lt;h2 id=&quot;exercises&quot;&gt;Exercises&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Basic.&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;Find $c$ in the mean value theorem for $f(x)=x^2-3x$ on $[1,4]$.&lt;/li&gt;
  &lt;li&gt;Check the hypotheses of Rolle’s theorem for $f(x)=\lvert x\rvert$ on $[-1,1]$. Does the conclusion hold?&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Answers&lt;/summary&gt;

  &lt;ol&gt;
    &lt;li&gt;Chord: $\tfrac{4-(-2)}{3}=2$. $2c-3=2$, $c=2.5$.&lt;/li&gt;
    &lt;li&gt;$f$ is not differentiable at 0; there is no $c$ with $f&apos;(c)=0$. Differentiability is needed.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;p&gt;&lt;strong&gt;Intermediate.&lt;/strong&gt;&lt;/p&gt;

&lt;ol start=&quot;3&quot;&gt;
  &lt;li&gt;Prove $\lvert\arctan a-\arctan b\rvert\le\lvert a-b\rvert$.&lt;/li&gt;
  &lt;li&gt;Prove that $x^5+x-1=0$ has exactly one real root.&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Answers&lt;/summary&gt;

  &lt;ol start=&quot;3&quot;&gt;
    &lt;li&gt;$\lvert(\arctan x)&apos;\rvert=\tfrac1{1+x^2}\le1$.&lt;/li&gt;
    &lt;li&gt;A root exists by the intermediate value theorem ($f(0)=-1$, $f(1)=1$). Two roots would give, by Rolle, $f&apos;(c)=5c^4+1=0$, impossible.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;p&gt;&lt;strong&gt;Advanced.&lt;/strong&gt;&lt;/p&gt;

&lt;ol start=&quot;5&quot;&gt;
  &lt;li&gt;Prove $\sqrt{1+x}&amp;lt;1+\dfrac x2$ for $x&amp;gt;0$.&lt;/li&gt;
  &lt;li&gt;Let $f$ be differentiable on $\mathbb{R}$ with $f&apos;(x)=f(x)$ for all $x$. Prove $f(x)=Ce^x$.&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Hints&lt;/summary&gt;

  &lt;ol start=&quot;5&quot;&gt;
    &lt;li&gt;Mean value theorem for $\sqrt t$ on $[1,1+x]$: $\sqrt{1+x}-1=\dfrac{x}{2\sqrt c}&amp;lt;\dfrac x2$.&lt;/li&gt;
    &lt;li&gt;Let $g(x)=f(x)e^{-x}$: $g&apos;=f&apos;e^{-x}-fe^{-x}=0$, so $g$ is constant.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;h2 id=&quot;summary&quot;&gt;Summary&lt;/h2&gt;

&lt;div class=&quot;content-box summary-box textbook-block&quot;&gt;
  &lt;ul&gt;
    &lt;li&gt;Fermat: an interior extremum where $f$ is differentiable has $f&apos;=0$.&lt;/li&gt;
    &lt;li&gt;Rolle: $f(a)=f(b)$ gives $c$ with $f&apos;(c)=0$. Lagrange: $f(b)-f(a)=f&apos;(c)(b-a)$. Cauchy: $\dfrac{f(b)-f(a)}{g(b)-g(a)}=\dfrac{f&apos;(c)}{g&apos;(c)}$.&lt;/li&gt;
    &lt;li&gt;Consequences: $f&apos;=0$ means constant; $f&apos;&amp;gt;0$ means strictly increasing; $\lvert f&apos;\rvert\le K$ means $\lvert f(x)-f(y)\rvert\le K\lvert x-y\rvert$.&lt;/li&gt;
    &lt;li&gt;To prove an inequality: apply the mean value theorem, then bound $f&apos;(c)$.&lt;/li&gt;
  &lt;/ul&gt;
&lt;/div&gt;
</content>
 </entry>
 
 <entry>
   <title>Higher derivatives, differentials and linear approximation</title>
   <link href="https://calculus-self-learning.pages.dev/contents/en/chapter02/02_04_Higher_derivatives_differentials_linear_approximation/"/>
   <updated>2026-12-01T00:00:00+00:00</updated>
   <id>https://calculus-self-learning.pages.dev/contents/en/chapter02/02_04_Higher_derivatives_differentials_linear_approximation</id>
   <content type="html">&lt;div class=&quot;textbook-objectives&quot;&gt;

  &lt;p&gt;&lt;strong&gt;Learning objectives.&lt;/strong&gt; After this lesson you can:&lt;/p&gt;

  &lt;ul&gt;
    &lt;li&gt;compute second and $n$-th derivatives of common functions and use the Leibniz formula for products;&lt;/li&gt;
    &lt;li&gt;state and prove: $f$ is differentiable at $a$ iff $f(a+h)=f(a)+Ah+o(h)$;&lt;/li&gt;
    &lt;li&gt;use linear approximation to estimate values and their errors;&lt;/li&gt;
    &lt;li&gt;use differentials to propagate measurement errors in physics.&lt;/li&gt;
  &lt;/ul&gt;

&lt;/div&gt;

&lt;h2 id=&quot;why-this-lesson&quot;&gt;Why this lesson&lt;/h2&gt;

&lt;p&gt;A sphere’s radius is measured as $r=10$ cm with error $\pm0.05$ cm. How wrong can the volume $V=\tfrac43\pi r^3\approx4189$ cm³ be? You could compute $V(10.05)-V(10)$, but with a more complicated formula and several measured quantities that is impractical. The differential answers in one line: $dV=4\pi r^2\,dr\approx62.8$ cm³, about $1.5\%$.&lt;/p&gt;

&lt;h2 id=&quot;higher-derivatives&quot;&gt;Higher derivatives&lt;/h2&gt;

&lt;div class=&quot;textbook-definition&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Definition 1.&lt;/strong&gt; If $f&apos;$ is differentiable, its derivative is the &lt;em&gt;second derivative&lt;/em&gt; $f&apos;&apos;=(f&apos;)&apos;$. In general $f^{(n)}=(f^{(n-1)})&apos;$. Leibniz notation: $\dfrac{d^ny}{dx^n}$.&lt;/p&gt;
&lt;/div&gt;

&lt;p&gt;In physics $s&apos;&apos;$ is acceleration. In geometry (chapter 3) the sign of $f&apos;&apos;$ tells whether the graph is convex or concave.&lt;/p&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Example 1.&lt;/strong&gt;&lt;/p&gt;

  &lt;ul&gt;
    &lt;li&gt;$(\sin x)^{(n)}=\sin\left(x+\tfrac{n\pi}2\right)$: each derivative shifts the graph left by $\tfrac\pi2$. Check $n=1$: $\sin(x+\tfrac\pi2)=\cos x$.&lt;/li&gt;
    &lt;li&gt;$\left(\dfrac1{1+x}\right)^{(n)}=\dfrac{(-1)^nn!}{(1+x)^{n+1}}$. Check $n=2$: $\left(-\tfrac1{(1+x)^2}\right)&apos;=\tfrac{2}{(1+x)^3}$.&lt;/li&gt;
    &lt;li&gt;$(e^{ax})^{(n)}=a^ne^{ax}$.&lt;/li&gt;
  &lt;/ul&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-theorem&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Theorem 1 (Leibniz formula).&lt;/strong&gt; If $u,v$ have derivatives up to order $n$ then&lt;/p&gt;

\[(uv)^{(n)}=\sum_{k=0}^n\binom nk u^{(k)}v^{(n-k)} .\]

&lt;/div&gt;

&lt;p&gt;The proof is by induction on $n$, like the binomial theorem, using $\binom nk+\binom n{k-1}=\binom{n+1}k$.&lt;/p&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Example 2.&lt;/strong&gt; Compute $(x^2e^x)^{(10)}$. With $u=x^2$ only three derivatives are nonzero: $u=x^2$, $u&apos;=2x$, $u&apos;&apos;=2$. So&lt;/p&gt;

\[(x^2e^x)^{(10)}=x^2e^x+10\cdot2x\,e^x+45\cdot2\,e^x=(x^2+20x+90)e^x .\]

&lt;/div&gt;

&lt;h2 id=&quot;linear-approximation-and-differentials&quot;&gt;Linear approximation and differentials&lt;/h2&gt;

&lt;div class=&quot;textbook-theorem&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Theorem 2.&lt;/strong&gt; $f$ is differentiable at $a$ if and only if there is a number $A$ with&lt;/p&gt;

\[f(a+h)=f(a)+Ah+o(h)\quad(h\to0),\]

  &lt;p&gt;and then $A=f&apos;(a)$.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-proof&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Proof.&lt;/strong&gt; If $f$ is differentiable, let $r(h)=f(a+h)-f(a)-f&apos;(a)h$. Then $\dfrac{r(h)}h=\dfrac{f(a+h)-f(a)}h-f&apos;(a)\to0$, i.e. $r(h)=o(h)$. Conversely, if $f(a+h)=f(a)+Ah+r(h)$ with $r(h)/h\to0$, then $\dfrac{f(a+h)-f(a)}h=A+\dfrac{r(h)}h\to A$, so $f&apos;(a)=A$.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-definition&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Definition 2 (Differential, linear approximation).&lt;/strong&gt; The &lt;em&gt;differential&lt;/em&gt; of $f$ at $x$ for an increment $dx$ is $dy=f&apos;(x)\,dx$. The function $L(x)=f(a)+f&apos;(a)(x-a)$ is the &lt;em&gt;linear approximation&lt;/em&gt; of $f$ at $a$; its graph is the tangent line.&lt;/p&gt;
&lt;/div&gt;

&lt;p&gt;Theorem 2 says: the true increment $\Delta y=f(a+h)-f(a)$ and the differential $dy=f&apos;(a)h$ differ by an infinitesimal of higher order than $h$. Chapter 8 gives the error explicitly: if $f&apos;&apos;$ exists, the error is about $\tfrac12f&apos;&apos;(\xi)h^2$.&lt;/p&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Example 3.&lt;/strong&gt; Estimate $\sqrt{4.1}$.&lt;/p&gt;

  &lt;p&gt;$f(x)=\sqrt x$, $a=4$, $h=0.1$, $f&apos;(4)=\tfrac14$. So $\sqrt{4.1}\approx2+\tfrac{0.1}4=2.025$. The true value is $2.024846$, error $0.000154$. Predicted error: $\tfrac12\lvert f&apos;&apos;(4)\rvert h^2=\tfrac12\cdot\tfrac1{32}\cdot0.01\approx0.000156$, a close match.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Example 4.&lt;/strong&gt; Estimate $\sin31^\circ$.&lt;/p&gt;

  &lt;p&gt;$31^\circ=\tfrac\pi6+\tfrac{\pi}{180}$. With $f=\sin$, $a=\tfrac\pi6$, $h=\tfrac\pi{180}\approx0.017453$: $\sin31^\circ\approx\tfrac12+\tfrac{\sqrt3}2\cdot0.017453\approx0.51511$. True value $0.51504$.&lt;/p&gt;
&lt;/div&gt;

&lt;h2 id=&quot;applications&quot;&gt;Applications&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Physics: error propagation.&lt;/strong&gt; For $V=\tfrac43\pi r^3$: $dV=4\pi r^2dr=4\pi\cdot100\cdot0.05\approx62.8$ cm³. Relative error $\dfrac{dV}V=3\dfrac{dr}r=3\cdot0.5\%=1.5\%$. General rule: for $y=Cx^n$ the relative error of $y$ is $\lvert n\rvert$ times that of $x$. When measuring $g$ with a pendulum, $g=\tfrac{4\pi^2L}{T^2}$, so a 1% error in the period $T$ gives a 2% error in $g$: measure $T$ more carefully than $L$.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Machine learning: why gradient descent goes down.&lt;/strong&gt; By linear approximation, $f(x-\eta f&apos;(x))\approx f(x)-\eta f&apos;(x)^2$. If $f&apos;(x)\ne0$ and $\eta&amp;gt;0$ is small enough, the right side is below $f(x)$: each step lowers the loss. “Small enough” ensures the neglected $o(h)$ term does not dominate, exactly as in the counterexample $\eta=1.5$ of lesson 00_04.&lt;/p&gt;

&lt;h2 id=&quot;exercises&quot;&gt;Exercises&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Basic.&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;Find $f&apos;&apos;$ for $f(x)=x\ln x$ and $f(x)=e^{-x^2}$.&lt;/li&gt;
  &lt;li&gt;Estimate $\sqrt[3]{8.06}$ and $\ln(1.02)$.&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Answers&lt;/summary&gt;

  &lt;ol&gt;
    &lt;li&gt;$\tfrac1x$; $(4x^2-2)e^{-x^2}$.&lt;/li&gt;
    &lt;li&gt;$2+\tfrac{0.06}{12}=2.005$; $\ln(1.02)\approx0.02$ (true $0.0198$).&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;p&gt;&lt;strong&gt;Intermediate.&lt;/strong&gt;&lt;/p&gt;

&lt;ol start=&quot;3&quot;&gt;
  &lt;li&gt;Find a formula for $(\ln x)^{(n)}$.&lt;/li&gt;
  &lt;li&gt;A cube’s edge is measured as 5 cm with error 0.1 mm. Estimate the absolute and relative error of its volume.&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Answers&lt;/summary&gt;

  &lt;ol start=&quot;3&quot;&gt;
    &lt;li&gt;$\dfrac{(-1)^{n-1}(n-1)!}{x^n}$.&lt;/li&gt;
    &lt;li&gt;$dV=3\cdot25\cdot0.01=0.75$ cm³; relative $3\cdot0.2\%=0.6\%$.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;p&gt;&lt;strong&gt;Advanced.&lt;/strong&gt;&lt;/p&gt;

&lt;ol start=&quot;5&quot;&gt;
  &lt;li&gt;Use the Leibniz formula to compute $(x^3\sin x)^{(20)}$ at $x=0$.&lt;/li&gt;
  &lt;li&gt;Prove that if $f&apos;&apos;$ is continuous near $a$ then $\lim_{h\to0}\dfrac{f(a+h)-2f(a)+f(a-h)}{h^2}=f&apos;&apos;(a)$. This formula is used to compute second derivatives numerically.&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Hints&lt;/summary&gt;

  &lt;ol start=&quot;5&quot;&gt;
    &lt;li&gt;Only the term $k=3$ is nonzero at $x=0$: $\binom{20}{3}\cdot6\cdot(\sin)^{(17)}(0)=1140\cdot6\cdot\sin\tfrac{17\pi}2=6840$.&lt;/li&gt;
    &lt;li&gt;Apply L’Hôpital’s rule (lesson 02_06) twice in $h$, or use Taylor expansion from chapter 8.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;h2 id=&quot;summary&quot;&gt;Summary&lt;/h2&gt;

&lt;div class=&quot;content-box summary-box textbook-block&quot;&gt;
  &lt;ul&gt;
    &lt;li&gt;$f&apos;&apos;=(f&apos;)&apos;$; $(\sin x)^{(n)}=\sin(x+\tfrac{n\pi}2)$; the Leibniz formula for $(uv)^{(n)}$.&lt;/li&gt;
    &lt;li&gt;Differentiable at $a$ iff $f(a+h)=f(a)+f&apos;(a)h+o(h)$.&lt;/li&gt;
    &lt;li&gt;Differential $dy=f&apos;(x)dx$; approximation $f(a+h)\approx f(a)+f&apos;(a)h$, error about $\tfrac12f&apos;&apos;h^2$.&lt;/li&gt;
    &lt;li&gt;For $y=Cx^n$: the relative error of $y$ is $\lvert n\rvert$ times the relative error of $x$.&lt;/li&gt;
  &lt;/ul&gt;
&lt;/div&gt;
</content>
 </entry>
 
 <entry>
   <title>Derivatives of inverse, implicit and parametric functions</title>
   <link href="https://calculus-self-learning.pages.dev/contents/en/chapter02/02_03_Derivatives_of_inverse_implicit_and_parametric_functions/"/>
   <updated>2026-12-01T00:00:00+00:00</updated>
   <id>https://calculus-self-learning.pages.dev/contents/en/chapter02/02_03_Derivatives_of_inverse_implicit_and_parametric_functions</id>
   <content type="html">&lt;div class=&quot;textbook-objectives&quot;&gt;

  &lt;p&gt;&lt;strong&gt;Learning objectives.&lt;/strong&gt; After this lesson you can:&lt;/p&gt;

  &lt;ul&gt;
    &lt;li&gt;use $(f^{-1})&apos;(y)=\dfrac1{f&apos;(x)}$ to derive the derivatives of $\ln x$, $\arcsin x$, $\arctan x$;&lt;/li&gt;
    &lt;li&gt;find $y&apos;$ when $y$ is given implicitly by an equation $F(x,y)=0$;&lt;/li&gt;
    &lt;li&gt;find the slope of a parametric curve $x=x(t)$, $y=y(t)$;&lt;/li&gt;
    &lt;li&gt;use logarithmic differentiation for functions $u(x)^{v(x)}$ and compute elasticities in economics.&lt;/li&gt;
  &lt;/ul&gt;

&lt;/div&gt;

&lt;h2 id=&quot;why-this-lesson&quot;&gt;Why this lesson&lt;/h2&gt;

&lt;p&gt;The circle $x^2+y^2=25$ is not the graph of a function $y=f(x)$, yet it has a tangent line at $(3,4)$. The path of a thrown ball is given in time: $x(t)$, $y(t)$. The function $\arctan x$ is defined as an inverse, with no explicit formula to feed into last lesson’s rules. All three need a way to differentiate without an explicit formula $y=f(x)$.&lt;/p&gt;

&lt;h2 id=&quot;derivative-of-an-inverse-function&quot;&gt;Derivative of an inverse function&lt;/h2&gt;

&lt;div class=&quot;textbook-theorem&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Theorem 1.&lt;/strong&gt; Let $f$ be continuous and strictly monotone on an interval, differentiable at $x$ with $f&apos;(x)\ne0$. Then $f^{-1}$ is differentiable at $y=f(x)$ and&lt;/p&gt;

\[(f^{-1})&apos;(y)=\frac1{f&apos;(x)}=\frac{1}{f&apos;(f^{-1}(y))}.\]

&lt;/div&gt;

&lt;div class=&quot;textbook-proof&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Proof.&lt;/strong&gt; Let $g=f^{-1}$; $g$ is continuous (the inverse of a continuous monotone function). For $k\ne0$ let $h=g(y+k)-g(y)$; since $g$ is injective, $h\ne0$, and $h\to0$ as $k\to0$. We have $f(x+h)=y+k$, so&lt;/p&gt;

\[\frac{g(y+k)-g(y)}k=\frac{h}{f(x+h)-f(x)}=\frac1{\dfrac{f(x+h)-f(x)}h}\to\frac1{f&apos;(x)} .\]

&lt;/div&gt;

&lt;p&gt;Geometrically: the graph of $f^{-1}$ is the reflection of the graph of $f$ in $y=x$ (lesson 00_02), so slopes become reciprocals.&lt;/p&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Example 1.&lt;/strong&gt;&lt;/p&gt;

  &lt;ul&gt;
    &lt;li&gt;$y=\ln x$ is the inverse of $x=e^y$. So $(\ln x)&apos;=\dfrac1{e^y}=\dfrac1x$.&lt;/li&gt;
    &lt;li&gt;$y=\arcsin x$, $x=\sin y$ with $y\in(-\tfrac\pi2,\tfrac\pi2)$. So $(\arcsin x)&apos;=\dfrac1{\cos y}=\dfrac1{\sqrt{1-x^2}}$ (positive root since $\cos y&amp;gt;0$).&lt;/li&gt;
    &lt;li&gt;$y=\arctan x$, $x=\tan y$. So $(\arctan x)&apos;=\cos^2y=\dfrac1{1+\tan^2y}=\dfrac1{1+x^2}$.&lt;/li&gt;
    &lt;li&gt;$a^x=e^{x\ln a}$, so $(a^x)&apos;=a^x\ln a$. With $x^\alpha=e^{\alpha\ln x}$ ($x&amp;gt;0$): $(x^\alpha)&apos;=x^\alpha\cdot\tfrac\alpha x=\alpha x^{\alpha-1}$.&lt;/li&gt;
  &lt;/ul&gt;
&lt;/div&gt;

&lt;h2 id=&quot;implicit-differentiation&quot;&gt;Implicit differentiation&lt;/h2&gt;

&lt;p&gt;When $y$ is a function of $x$ given by $F(x,y)=0$, differentiate both sides with respect to $x$, treating $y=y(x)$ and using the chain rule on every expression containing $y$, then solve for $y&apos;$.&lt;/p&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Example 2.&lt;/strong&gt; Tangent to the circle $x^2+y^2=25$ at $(3,4)$.&lt;/p&gt;

  &lt;p&gt;Differentiate: $2x+2y\,y&apos;=0$, so $y&apos;=-\dfrac xy$. At $(3,4)$: $y&apos;=-\tfrac34$. Tangent $y=4-\tfrac34(x-3)$. Geometric check: the radius to $(3,4)$ has slope $\tfrac43$, perpendicular to the tangent since $\tfrac43\cdot\left(-\tfrac34\right)=-1$.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Example 3.&lt;/strong&gt; Folium of Descartes $x^3+y^3=6xy$. Find $y&apos;$ at $(3,3)$.&lt;/p&gt;

  &lt;p&gt;Differentiate: $3x^2+3y^2y&apos;=6y+6xy&apos;$. Solve: $y&apos;(3y^2-6x)=6y-3x^2$, $y&apos;=\dfrac{2y-x^2}{y^2-2x}$. At $(3,3)$: $y&apos;=\dfrac{6-9}{9-6}=-1$.&lt;/p&gt;
&lt;/div&gt;

&lt;h2 id=&quot;parametric-curves&quot;&gt;Parametric curves&lt;/h2&gt;

&lt;div class=&quot;textbook-theorem&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Theorem 2.&lt;/strong&gt; For a curve $x=x(t)$, $y=y(t)$ with $x,y$ differentiable and $x&apos;(t)\ne0$,&lt;/p&gt;

\[\frac{dy}{dx}=\frac{y&apos;(t)}{x&apos;(t)} .\]

&lt;/div&gt;

&lt;div class=&quot;textbook-proof&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Proof.&lt;/strong&gt; Since $x&apos;(t)\ne0$ and $x&apos;$ is continuous near $t$ (an extra assumption), $x(t)$ is strictly monotone near $t$ and has an inverse $t=t(x)$. Then $y=y(t(x))$, and by the chain rule and Theorem 1, $\dfrac{dy}{dx}=y&apos;(t)\cdot\dfrac1{x&apos;(t)}$.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Example 4.&lt;/strong&gt; The cycloid $x=t-\sin t$, $y=1-\cos t$ is traced by a point on the rim of a wheel of radius 1. Then $\dfrac{dy}{dx}=\dfrac{\sin t}{1-\cos t}$. At $t=\tfrac\pi2$: $\dfrac{dy}{dx}=1$. As $t\to0^+$, $\dfrac{\sin t}{1-\cos t}\sim\dfrac{t}{t^2/2}\to+\infty$: the tangent is vertical where the point touches the ground.&lt;/p&gt;
&lt;/div&gt;

&lt;h2 id=&quot;logarithmic-differentiation&quot;&gt;Logarithmic differentiation&lt;/h2&gt;

&lt;p&gt;For $y=u(x)^{v(x)}$ with $u&amp;gt;0$: take $\ln$, $\ln y=v\ln u$, and differentiate:&lt;/p&gt;

\[\frac{y&apos;}y=v&apos;\ln u+v\frac{u&apos;}u .\]

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Example 5.&lt;/strong&gt; $y=x^x$, $x&amp;gt;0$: $\ln y=x\ln x$, $\dfrac{y&apos;}y=\ln x+1$, so $y&apos;=x^x(\ln x+1)$. The derivative vanishes at $x=\tfrac1e$, where $x^x$ is smallest, with value $e^{-1/e}\approx0.692$.&lt;/p&gt;
&lt;/div&gt;

&lt;h2 id=&quot;applications&quot;&gt;Applications&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Economics: price elasticity of demand.&lt;/strong&gt; The elasticity $E=\dfrac{dQ/Q}{dp/p}=\dfrac{d\ln Q}{d\ln p}$ is the percentage change in quantity demanded when price rises 1%. For $Q=1000p^{-1.5}$: $\ln Q=\ln1000-1.5\ln p$, so $E=-1.5$. A 1% price rise cuts demand by about 1.5%, and revenue $pQ$ falls. Logarithmic differentiation gives this at once, without computing $Q&apos;$ and dividing.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Physics: direction of a projectile.&lt;/strong&gt; $x=v_0\cos\theta\,t$, $y=v_0\sin\theta\,t-\tfrac12gt^2$. The slope $\dfrac{dy}{dx}=\dfrac{v_0\sin\theta-gt}{v_0\cos\theta}$ is 0 at $t=\dfrac{v_0\sin\theta}{g}$: the top of the path. With $v_0=20$ m/s, $\theta=30^\circ$, $g=9.8$: the top is reached after about $1.02$ s.&lt;/p&gt;

&lt;h2 id=&quot;exercises&quot;&gt;Exercises&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Basic.&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;Differentiate $\arctan(2x)$ and $\ln(\cos x)$.&lt;/li&gt;
  &lt;li&gt;Find $y&apos;$ if $xy+y^2=6$, and evaluate it at $(1,2)$.&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Answers&lt;/summary&gt;

  &lt;ol&gt;
    &lt;li&gt;$\dfrac{2}{1+4x^2}$; $-\tan x$.&lt;/li&gt;
    &lt;li&gt;$y+xy&apos;+2yy&apos;=0$, $y&apos;=-\dfrac{y}{x+2y}$. At $(1,2)$: $-\tfrac25$.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;p&gt;&lt;strong&gt;Intermediate.&lt;/strong&gt;&lt;/p&gt;

&lt;ol start=&quot;3&quot;&gt;
  &lt;li&gt;For the curve $x=\cos^3t$, $y=\sin^3t$, find $\dfrac{dy}{dx}$.&lt;/li&gt;
  &lt;li&gt;Differentiate $y=(\sin x)^{x}$ on $(0,\pi)$.&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Answers&lt;/summary&gt;

  &lt;ol start=&quot;3&quot;&gt;
    &lt;li&gt;$\dfrac{3\sin^2t\cos t}{-3\cos^2t\sin t}=-\tan t$.&lt;/li&gt;
    &lt;li&gt;$y&apos;=(\sin x)^x\left(\ln\sin x+x\cot x\right)$.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;p&gt;&lt;strong&gt;Advanced.&lt;/strong&gt;&lt;/p&gt;

&lt;ol start=&quot;5&quot;&gt;
  &lt;li&gt;Prove $(\arccos x)&apos;=-\dfrac1{\sqrt{1-x^2}}$ in two ways: with Theorem 1, and from $\arcsin x+\arccos x=\tfrac\pi2$.&lt;/li&gt;
  &lt;li&gt;Let $f(x)=x^3+x$. Find $(f^{-1})&apos;(2)$ without finding a formula for $f^{-1}$.&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Hints&lt;/summary&gt;

  &lt;ol start=&quot;5&quot;&gt;
    &lt;li&gt;$y=\arccos x$, $x=\cos y$, $y\in(0,\pi)$, $\sin y&amp;gt;0$: $(\arccos x)&apos;=-\tfrac1{\sin y}$. Second way: differentiate the identity.&lt;/li&gt;
    &lt;li&gt;$f(1)=2$, $f&apos;(1)=4$, so $(f^{-1})&apos;(2)=\tfrac14$.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;h2 id=&quot;summary&quot;&gt;Summary&lt;/h2&gt;

&lt;div class=&quot;content-box summary-box textbook-block&quot;&gt;
  &lt;ul&gt;
    &lt;li&gt;Inverse functions: $(f^{-1})&apos;(y)=1/f&apos;(x)$. Hence $(\ln x)&apos;=\tfrac1x$, $(\arcsin x)&apos;=\tfrac1{\sqrt{1-x^2}}$, $(\arctan x)&apos;=\tfrac1{1+x^2}$.&lt;/li&gt;
    &lt;li&gt;Implicit: differentiate both sides in $x$ treating $y=y(x)$, then solve for $y&apos;$.&lt;/li&gt;
    &lt;li&gt;Parametric: $\dfrac{dy}{dx}=\dfrac{y&apos;(t)}{x&apos;(t)}$.&lt;/li&gt;
    &lt;li&gt;Logarithmic differentiation handles $u^v$ and elasticities $E=\dfrac{d\ln Q}{d\ln p}$.&lt;/li&gt;
  &lt;/ul&gt;
&lt;/div&gt;
</content>
 </entry>
 
 <entry>
   <title>Differentiation rules</title>
   <link href="https://calculus-self-learning.pages.dev/contents/en/chapter02/02_02_Differentiation_rules/"/>
   <updated>2026-12-01T00:00:00+00:00</updated>
   <id>https://calculus-self-learning.pages.dev/contents/en/chapter02/02_02_Differentiation_rules</id>
   <content type="html">&lt;div class=&quot;textbook-objectives&quot;&gt;

  &lt;p&gt;&lt;strong&gt;Learning objectives.&lt;/strong&gt; After this lesson you can:&lt;/p&gt;

  &lt;ul&gt;
    &lt;li&gt;prove the product rule and the chain rule;&lt;/li&gt;
    &lt;li&gt;prove $(\sin x)&apos;=\cos x$ and $(e^x)&apos;=e^x$ from the standard limits;&lt;/li&gt;
    &lt;li&gt;differentiate any elementary function quickly with a table and four rules;&lt;/li&gt;
    &lt;li&gt;see the chain rule as the basis of backpropagation in neural networks.&lt;/li&gt;
  &lt;/ul&gt;

&lt;/div&gt;

&lt;h2 id=&quot;why-this-lesson&quot;&gt;Why this lesson&lt;/h2&gt;

&lt;p&gt;Differentiating $f(x)=x^2\sin x$ from the definition means handling $\dfrac{(x+h)^2\sin(x+h)-x^2\sin x}h$, which is long. For $e^{-x^2/2}\sin(3x)$ it is nearly hopeless. Engineers and computers don’t do it that way: they use a short table of derivatives and four rules for combining them. Deep learning software such as PyTorch does exactly that, automatically.&lt;/p&gt;

&lt;h2 id=&quot;the-four-rules&quot;&gt;The four rules&lt;/h2&gt;

&lt;div class=&quot;textbook-theorem&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Theorem 1.&lt;/strong&gt; If $f,g$ are differentiable at $x$ then&lt;/p&gt;

  &lt;ol&gt;
    &lt;li&gt;$(f\pm g)&apos;=f&apos;\pm g&apos;$, $(cf)&apos;=cf&apos;$;&lt;/li&gt;
    &lt;li&gt;$(fg)&apos;=f&apos;g+fg&apos;$ (product rule);&lt;/li&gt;
    &lt;li&gt;$\left(\dfrac fg\right)&apos;=\dfrac{f&apos;g-fg&apos;}{g^2}$ if $g(x)\ne0$ (quotient rule).&lt;/li&gt;
  &lt;/ol&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-proof&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Proof (product rule).&lt;/strong&gt; Add and subtract $f(x+h)g(x)$:&lt;/p&gt;

\[\frac{f(x+h)g(x+h)-f(x)g(x)}h=f(x+h)\frac{g(x+h)-g(x)}h+g(x)\frac{f(x+h)-f(x)}h .\]

  &lt;p&gt;As $h\to0$: $f(x+h)\to f(x)$ (differentiable implies continuous, Theorem 1 of lesson 02_01), and the two difference quotients tend to $g&apos;(x)$ and $f&apos;(x)$. So the limit is $f(x)g&apos;(x)+g(x)f&apos;(x)$.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-theorem&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Theorem 2 (Chain rule).&lt;/strong&gt; If $g$ is differentiable at $x$ and $f$ is differentiable at $g(x)$ then&lt;/p&gt;

\[(f\circ g)&apos;(x)=f&apos;(g(x))\,g&apos;(x).\]

  &lt;p&gt;In Leibniz notation with $y=f(u)$, $u=g(x)$: $\dfrac{dy}{dx}=\dfrac{dy}{du}\cdot\dfrac{du}{dx}$.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-proof&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Proof.&lt;/strong&gt; Let $b=g(x)$ and define $\varphi(k)=\dfrac{f(b+k)-f(b)}k$ for $k\ne0$, $\varphi(0)=f&apos;(b)$. Then $\varphi$ is continuous at 0 and $f(b+k)-f(b)=\varphi(k)\,k$ for all $k$, including $k=0$. Put $k=g(x+h)-g(x)$:&lt;/p&gt;

\[\frac{f(g(x+h))-f(g(x))}h=\varphi(k)\cdot\frac{g(x+h)-g(x)}h .\]

  &lt;p&gt;As $h\to0$, $k\to0$ (since $g$ is continuous), so $\varphi(k)\to f&apos;(b)$, while the second factor tends to $g&apos;(x)$.&lt;/p&gt;
&lt;/div&gt;

&lt;p&gt;The helper $\varphi$ is needed because $g(x+h)-g(x)$ may be 0 for some nonzero $h$, and then we could not divide by it.&lt;/p&gt;

&lt;h2 id=&quot;derivatives-of-the-basic-functions&quot;&gt;Derivatives of the basic functions&lt;/h2&gt;

&lt;div class=&quot;textbook-theorem&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Theorem 3.&lt;/strong&gt; $(\sin x)&apos;=\cos x$, $(\cos x)&apos;=-\sin x$, $(e^x)&apos;=e^x$, and $(x^n)&apos;=nx^{n-1}$ for positive integers $n$.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-proof&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Proof.&lt;/strong&gt; By the addition formula,&lt;/p&gt;

\[\frac{\sin(x+h)-\sin x}h=\sin x\cdot\frac{\cos h-1}h+\cos x\cdot\frac{\sin h}h\to\sin x\cdot0+\cos x\cdot1 .\]

  &lt;p&gt;Here $\dfrac{\cos h-1}h=-h\cdot\dfrac{1-\cos h}{h^2}\to0\cdot\tfrac12=0$ and $\dfrac{\sin h}h\to1$ (lesson 01_04). Cosine is similar. For $e^x$: $\dfrac{e^{x+h}-e^x}h=e^x\dfrac{e^h-1}h\to e^x$. For $x^n$: induction with the product rule, $(x^{n+1})&apos;=(x\cdot x^n)&apos;=x^n+x\cdot nx^{n-1}=(n+1)x^n$.&lt;/p&gt;
&lt;/div&gt;

&lt;p&gt;Table of derivatives (the remaining rows are proved in lesson 02_03):&lt;/p&gt;

&lt;table&gt;
  &lt;thead&gt;
    &lt;tr&gt;
      &lt;th&gt;$f(x)$&lt;/th&gt;
      &lt;th&gt;$f&apos;(x)$&lt;/th&gt;
      &lt;th&gt;$f(x)$&lt;/th&gt;
      &lt;th&gt;$f&apos;(x)$&lt;/th&gt;
    &lt;/tr&gt;
  &lt;/thead&gt;
  &lt;tbody&gt;
    &lt;tr&gt;
      &lt;td&gt;$x^\alpha$&lt;/td&gt;
      &lt;td&gt;$\alpha x^{\alpha-1}$&lt;/td&gt;
      &lt;td&gt;$\ln x$&lt;/td&gt;
      &lt;td&gt;$\tfrac1x$&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;$e^x$&lt;/td&gt;
      &lt;td&gt;$e^x$&lt;/td&gt;
      &lt;td&gt;$a^x$&lt;/td&gt;
      &lt;td&gt;$a^x\ln a$&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;$\sin x$&lt;/td&gt;
      &lt;td&gt;$\cos x$&lt;/td&gt;
      &lt;td&gt;$\cos x$&lt;/td&gt;
      &lt;td&gt;$-\sin x$&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;$\tan x$&lt;/td&gt;
      &lt;td&gt;$\tfrac1{\cos^2x}$&lt;/td&gt;
      &lt;td&gt;$\arctan x$&lt;/td&gt;
      &lt;td&gt;$\tfrac1{1+x^2}$&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;$\arcsin x$&lt;/td&gt;
      &lt;td&gt;$\tfrac1{\sqrt{1-x^2}}$&lt;/td&gt;
      &lt;td&gt;$\arccos x$&lt;/td&gt;
      &lt;td&gt;$-\tfrac1{\sqrt{1-x^2}}$&lt;/td&gt;
    &lt;/tr&gt;
  &lt;/tbody&gt;
&lt;/table&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Example 1.&lt;/strong&gt;&lt;/p&gt;

  &lt;ul&gt;
    &lt;li&gt;$(x^2\sin x)&apos;=2x\sin x+x^2\cos x$.&lt;/li&gt;
    &lt;li&gt;$\left(\dfrac{x}{x^2+1}\right)&apos;=\dfrac{(x^2+1)-x\cdot2x}{(x^2+1)^2}=\dfrac{1-x^2}{(x^2+1)^2}$. The derivative vanishes at $x=\pm1$, where the graph has its maximum and minimum (chapter 3).&lt;/li&gt;
    &lt;li&gt;$(\tan x)&apos;=\left(\dfrac{\sin x}{\cos x}\right)&apos;=\dfrac{\cos^2x+\sin^2x}{\cos^2x}=\dfrac1{\cos^2x}$.&lt;/li&gt;
  &lt;/ul&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Example 2 (Chain rule).&lt;/strong&gt; Peel off the outer and inner layers, then multiply.&lt;/p&gt;

  &lt;ul&gt;
    &lt;li&gt;$\left((3x+1)^5\right)&apos;=5(3x+1)^4\cdot3=15(3x+1)^4$.&lt;/li&gt;
    &lt;li&gt;$\left(\sin(x^2)\right)&apos;=\cos(x^2)\cdot2x$.&lt;/li&gt;
    &lt;li&gt;$\left(e^{-x^2/2}\sin3x\right)&apos;=-x\,e^{-x^2/2}\sin3x+3e^{-x^2/2}\cos3x$.&lt;/li&gt;
    &lt;li&gt;$\left(\sqrt{1+\cos^2x}\right)&apos;=\dfrac{1}{2\sqrt{1+\cos^2x}}\cdot2\cos x\cdot(-\sin x)=-\dfrac{\sin x\cos x}{\sqrt{1+\cos^2x}}$.&lt;/li&gt;
  &lt;/ul&gt;
&lt;/div&gt;

&lt;h2 id=&quot;short-video&quot;&gt;Short video&lt;/h2&gt;

&lt;div class=&quot;reel-video&quot;&gt;
  &lt;video controls=&quot;&quot; playsinline=&quot;&quot; preload=&quot;metadata&quot; src=&quot;/public/videos/reels/why-sin-prime-is-cos.mp4&quot;&gt;&lt;/video&gt;
  &lt;p class=&quot;reel-caption&quot;&gt;Why the derivative of sin is cos: the velocity of a point in uniform circular motion; its vertical part is cos t (silent video, about 2 minutes).&lt;/p&gt;
&lt;/div&gt;

&lt;h2 id=&quot;applications&quot;&gt;Applications&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Physics: oscillation.&lt;/strong&gt; A body oscillates as $s(t)=5\sin2t$ (cm). Velocity $v=s&apos;=10\cos2t$, acceleration $a=v&apos;=-20\sin2t=-4s$. Acceleration is proportional to displacement with opposite sign: exactly the simple harmonic equation $s&apos;&apos;=-\omega^2s$ with $\omega=2$.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Machine learning: the sigmoid’s derivative and backpropagation.&lt;/strong&gt; For $\sigma(x)=(1+e^{-x})^{-1}$ the chain rule gives&lt;/p&gt;

\[\sigma&apos;(x)=\frac{e^{-x}}{(1+e^{-x})^2}=\sigma(x)\big(1-\sigma(x)\big).\]

&lt;p&gt;At $x=0$: $\sigma&apos;(0)=\tfrac14$. A neuron $y=\sigma(wx+b)$ has $\dfrac{\partial y}{\partial w}=\sigma&apos;(wx+b)\cdot x$: the chain rule again. A multilayer network is a composition of many functions, and &lt;em&gt;backpropagation&lt;/em&gt; is just the chain rule applied from the last layer back to the first, storing intermediate products so nothing is computed twice.&lt;/p&gt;

&lt;h2 id=&quot;exercises&quot;&gt;Exercises&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Basic.&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;Differentiate $x^3e^x$ and $\dfrac{x^2-1}{x^2+1}$.&lt;/li&gt;
  &lt;li&gt;Differentiate $\cos(5x-2)$ and $(1-x^2)^{10}$.&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Answers&lt;/summary&gt;

  &lt;ol&gt;
    &lt;li&gt;$(3x^2+x^3)e^x$; $\dfrac{4x}{(x^2+1)^2}$.&lt;/li&gt;
    &lt;li&gt;$-5\sin(5x-2)$; $-20x(1-x^2)^9$.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;p&gt;&lt;strong&gt;Intermediate.&lt;/strong&gt;&lt;/p&gt;

&lt;ol start=&quot;3&quot;&gt;
  &lt;li&gt;Differentiate $e^{\sin x}\cos x$ and $\ln(x^2+1)$ (use $(\ln u)&apos;=\tfrac{u&apos;}u$).&lt;/li&gt;
  &lt;li&gt;Find the points on $y=x^3-3x$ where the tangent is horizontal.&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Answers&lt;/summary&gt;

  &lt;ol start=&quot;3&quot;&gt;
    &lt;li&gt;$e^{\sin x}(\cos^2x-\sin x)$; $\dfrac{2x}{x^2+1}$.&lt;/li&gt;
    &lt;li&gt;$3x^2-3=0$, $x=\pm1$: the points $(1,-2)$ and $(-1,2)$.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;p&gt;&lt;strong&gt;Advanced.&lt;/strong&gt;&lt;/p&gt;

&lt;ol start=&quot;5&quot;&gt;
  &lt;li&gt;Derive the quotient rule from the product rule and $(1/g)&apos;=-g&apos;/g^2$.&lt;/li&gt;
  &lt;li&gt;Prove $(\tanh x)&apos;=1-\tanh^2x$ and explain why the $\tanh$ activation “saturates” (gradient near 0) for large $\lvert x\rvert$.&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Hints&lt;/summary&gt;

  &lt;ol start=&quot;5&quot;&gt;
    &lt;li&gt;$(1/g)&apos;$: chain rule for $u\mapsto1/u$ composed with $g$. Then $(f\cdot\tfrac1g)&apos;=\tfrac{f&apos;}g-\tfrac{fg&apos;}{g^2}$.&lt;/li&gt;
    &lt;li&gt;Quotient rule with $\sinh&apos;=\cosh$, $\cosh&apos;=\sinh$ and $\cosh^2-\sinh^2=1$. For large $\lvert x\rvert$, $\tanh x\to\pm1$, so the derivative $\to0$.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;h2 id=&quot;summary&quot;&gt;Summary&lt;/h2&gt;

&lt;div class=&quot;content-box summary-box textbook-block&quot;&gt;
  &lt;ul&gt;
    &lt;li&gt;$(fg)&apos;=f&apos;g+fg&apos;$, $\left(\tfrac fg\right)&apos;=\tfrac{f&apos;g-fg&apos;}{g^2}$, $(f\circ g)&apos;=f&apos;(g)\,g&apos;$.&lt;/li&gt;
    &lt;li&gt;$(\sin x)&apos;=\cos x$ and $(e^x)&apos;=e^x$ come from $\tfrac{\sin h}h\to1$ and $\tfrac{e^h-1}h\to1$.&lt;/li&gt;
    &lt;li&gt;For a complicated function: split into layers, use the table on each, multiply.&lt;/li&gt;
    &lt;li&gt;$\sigma&apos;=\sigma(1-\sigma)$; backpropagation is the chain rule applied systematically.&lt;/li&gt;
  &lt;/ul&gt;
&lt;/div&gt;
</content>
 </entry>
 
 <entry>
   <title>Definition of the derivative</title>
   <link href="https://calculus-self-learning.pages.dev/contents/en/chapter02/02_01_Definition_of_the_derivative/"/>
   <updated>2026-12-01T00:00:00+00:00</updated>
   <id>https://calculus-self-learning.pages.dev/contents/en/chapter02/02_01_Definition_of_the_derivative</id>
   <content type="html">&lt;div class=&quot;textbook-objectives&quot;&gt;

  &lt;p&gt;&lt;strong&gt;Learning objectives.&lt;/strong&gt; After this lesson you can:&lt;/p&gt;

  &lt;ul&gt;
    &lt;li&gt;compute the derivatives of $x^2$, $\tfrac1x$, $\sqrt x$ directly from the definition;&lt;/li&gt;
    &lt;li&gt;write the equation of the tangent line to a graph at a point;&lt;/li&gt;
    &lt;li&gt;explain the derivative as an instantaneous rate of change in physics and economics;&lt;/li&gt;
    &lt;li&gt;prove that differentiable functions are continuous, and give a continuous function that is not differentiable.&lt;/li&gt;
  &lt;/ul&gt;

&lt;/div&gt;

&lt;h2 id=&quot;why-this-lesson&quot;&gt;Why this lesson&lt;/h2&gt;

&lt;p&gt;Lesson 01_01 computed the instantaneous velocity of a falling ball: take the average velocity on $[2,2+h]$ and let $h\to0$, giving 19.6 m/s. The same computation gives the slope of a tangent line, a factory’s marginal cost, the rate of a chemical reaction. The derivative is the common name for it.&lt;/p&gt;

&lt;h2 id=&quot;the-definition&quot;&gt;The definition&lt;/h2&gt;

&lt;div class=&quot;textbook-definition&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Definition 1 (Derivative).&lt;/strong&gt; Let $f$ be defined on an open interval containing $a$. If the limit&lt;/p&gt;

\[f&apos;(a)=\lim_{h\to0}\frac{f(a+h)-f(a)}{h}\]

  &lt;p&gt;exists (and is finite), $f$ is &lt;em&gt;differentiable&lt;/em&gt; at $a$ and $f&apos;(a)$ is the &lt;em&gt;derivative&lt;/em&gt; of $f$ at $a$. The ratio $\dfrac{f(a+h)-f(a)}h$ is the &lt;em&gt;difference quotient&lt;/em&gt;. Taking only $h\to0^+$ (or $h\to0^-$) gives the &lt;em&gt;right derivative&lt;/em&gt; $f&apos;_+(a)$ (or &lt;em&gt;left derivative&lt;/em&gt; $f&apos;_-(a)$).&lt;/p&gt;
&lt;/div&gt;

&lt;p&gt;With $x=a+h$ we get the equivalent form $f&apos;(a)=\lim_{x\to a}\dfrac{f(x)-f(a)}{x-a}$. Other notation: $\dfrac{df}{dx}(a)$, $\dfrac{dy}{dx}\Big\vert_{x=a}$.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Geometric meaning.&lt;/strong&gt; The difference quotient is the slope of the secant through $(a,f(a))$ and $(a+h,f(a+h))$. As $h\to0$ the secant turns into the &lt;em&gt;tangent line&lt;/em&gt;&lt;/p&gt;

\[y=f(a)+f&apos;(a)(x-a).\]

&lt;p&gt;&lt;strong&gt;Physical meaning.&lt;/strong&gt; If $s(t)$ is position, $s&apos;(t)$ is instantaneous velocity.&lt;/p&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Example 1.&lt;/strong&gt; Differentiate $f(x)=x^2$ at an arbitrary point $x$.&lt;/p&gt;

\[\frac{(x+h)^2-x^2}{h}=\frac{2xh+h^2}{h}=2x+h\ \xrightarrow{h\to0}\ 2x .\]

  &lt;p&gt;So $(x^2)&apos;=2x$. Tangent at $(3,9)$: $y=9+6(x-3)=6x-9$.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Example 2.&lt;/strong&gt;&lt;/p&gt;

  &lt;ul&gt;
    &lt;li&gt;$f(x)=\dfrac1x$, $x\ne0$: $\dfrac{\frac1{x+h}-\frac1x}{h}=\dfrac{-h}{h\,x(x+h)}=\dfrac{-1}{x(x+h)}\to-\dfrac1{x^2}$.&lt;/li&gt;
    &lt;li&gt;$f(x)=\sqrt x$, $x&amp;gt;0$: multiply by the conjugate, $\dfrac{\sqrt{x+h}-\sqrt x}{h}=\dfrac{1}{\sqrt{x+h}+\sqrt x}\to\dfrac1{2\sqrt x}$.&lt;/li&gt;
  &lt;/ul&gt;

  &lt;p&gt;All three results for $x^2$, $x^{-1}$, $x^{1/2}$ match the rule $(x^n)&apos;=nx^{n-1}$ proved in the next lesson.&lt;/p&gt;
&lt;/div&gt;

&lt;h2 id=&quot;differentiability-and-continuity&quot;&gt;Differentiability and continuity&lt;/h2&gt;

&lt;div class=&quot;textbook-theorem&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Theorem 1.&lt;/strong&gt; If $f$ is differentiable at $a$ then $f$ is continuous at $a$.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-proof&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Proof.&lt;/strong&gt; For $h\ne0$, $f(a+h)-f(a)=\dfrac{f(a+h)-f(a)}h\cdot h$. As $h\to0$ the first factor tends to $f&apos;(a)$ and the second to $0$. By the product rule $f(a+h)-f(a)\to f&apos;(a)\cdot0=0$, i.e. $\lim_{h\to0}f(a+h)=f(a)$.&lt;/p&gt;
&lt;/div&gt;

&lt;p&gt;The converse is false.&lt;/p&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Example 3.&lt;/strong&gt; $f(x)=\lvert x\rvert$ is continuous at 0 but not differentiable there. The difference quotient is $\dfrac{\lvert h\rvert}h$, which is $1$ for $h&amp;gt;0$ and $-1$ for $h&amp;lt;0$. So $f&apos;_+(0)=1\ne f&apos;_-(0)=-1$. The graph has a corner at the origin and no single tangent line.&lt;/p&gt;
&lt;/div&gt;

&lt;h2 id=&quot;interactive&quot;&gt;Interactive&lt;/h2&gt;

&lt;div class=&quot;interactive-frame&quot;&gt;
  &lt;div class=&quot;interactive-frame-head&quot;&gt;
    &lt;div class=&quot;interactive-frame-title&quot;&gt;Secant, tangent and the graph of f′&lt;/div&gt;
    &lt;div class=&quot;interactive-frame-desc&quot;&gt;Drag h to 0 to turn the secant into the tangent; the lower graph is f′.&lt;/div&gt;
  &lt;/div&gt;
  &lt;iframe src=&quot;/interactives/chapter02/derivative-tangent-en.html&quot; title=&quot;Secant, tangent and the graph of f′&quot; loading=&quot;lazy&quot; style=&quot;height: 800px;&quot;&gt;&lt;/iframe&gt;
  &lt;div class=&quot;interactive-frame-foot&quot;&gt;
    &lt;a href=&quot;/interactives/chapter02/derivative-tangent-en.html&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;Open the interactive in a new window&lt;/a&gt;
  &lt;/div&gt;
&lt;/div&gt;

&lt;h2 id=&quot;short-video&quot;&gt;Short video&lt;/h2&gt;

&lt;div class=&quot;reel-video&quot;&gt;
  &lt;video controls=&quot;&quot; playsinline=&quot;&quot; preload=&quot;metadata&quot; src=&quot;/public/videos/reels/secant-to-tangent.mp4&quot;&gt;&lt;/video&gt;
  &lt;p class=&quot;reel-caption&quot;&gt;The secant turns into the tangent as h → 0, alongside the speedometer of a car with s = 1.5t² (silent video, about 2 minutes).&lt;/p&gt;
&lt;/div&gt;

&lt;h2 id=&quot;applications&quot;&gt;Applications&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Economics: marginal cost.&lt;/strong&gt; The cost of producing $q$ units is $C(q)=0.01q^2+5q+100$ (thousand VND). Marginal cost is $C&apos;(q)=0.02q+5$. At $q=100$: $C&apos;(100)=7$. The true cost of the 101st unit is $C(101)-C(100)=7.01$. The derivative gives a very close estimate without computing two values.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Machine learning: numerical derivatives.&lt;/strong&gt; Without a formula, $f&apos;(a)$ is approximated by differences. For $f(x)=e^x$, $a=0$, $h=0.1$ (true derivative 1):&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;forward difference $\dfrac{f(h)-f(0)}h\approx1.05171$, error about $0.05$, of order $h$;&lt;/li&gt;
  &lt;li&gt;central difference $\dfrac{f(h)-f(-h)}{2h}\approx1.001668$, error about $0.0017$, of order $h^2$.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Deep learning libraries use central differences to double-check gradients computed by backpropagation (gradient checking).&lt;/p&gt;

&lt;h2 id=&quot;exercises&quot;&gt;Exercises&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Basic.&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;Use the definition to differentiate $f(x)=3x^2-x$.&lt;/li&gt;
  &lt;li&gt;Write the tangent line to $y=x^3$ at $x=1$ (use $(x^3)&apos;=3x^2$).&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Answers&lt;/summary&gt;

  &lt;ol&gt;
    &lt;li&gt;$\dfrac{3(x+h)^2-(x+h)-3x^2+x}{h}=6x+3h-1\to6x-1$.&lt;/li&gt;
    &lt;li&gt;$y=1+3(x-1)=3x-2$.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;p&gt;&lt;strong&gt;Intermediate.&lt;/strong&gt;&lt;/p&gt;

&lt;ol start=&quot;3&quot;&gt;
  &lt;li&gt;Use the definition to differentiate $f(x)=\dfrac1{x+2}$.&lt;/li&gt;
  &lt;li&gt;Is $f(x)=x\lvert x\rvert$ differentiable at 0?&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Answers&lt;/summary&gt;

  &lt;ol start=&quot;3&quot;&gt;
    &lt;li&gt;$-\dfrac1{(x+2)^2}$.&lt;/li&gt;
    &lt;li&gt;Yes: $\dfrac{h\lvert h\rvert}{h}=\lvert h\rvert\to0$, so $f&apos;(0)=0$.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;p&gt;&lt;strong&gt;Advanced.&lt;/strong&gt;&lt;/p&gt;

&lt;ol start=&quot;5&quot;&gt;
  &lt;li&gt;Let $f(x)=x^2\sin\tfrac1x$ for $x\ne0$, $f(0)=0$. Prove $f&apos;(0)=0$ but $f&apos;$ is not continuous at 0.&lt;/li&gt;
  &lt;li&gt;Prove: if $f$ is differentiable at $a$ then $\lim_{h\to0}\dfrac{f(a+h)-f(a-h)}{2h}=f&apos;(a)$. Is the converse true?&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Hints&lt;/summary&gt;

  &lt;ol start=&quot;5&quot;&gt;
    &lt;li&gt;$\dfrac{f(h)}h=h\sin\tfrac1h\to0$ (squeeze). For $x\ne0$: $f&apos;(x)=2x\sin\tfrac1x-\cos\tfrac1x$, and $\cos\tfrac1x$ has no limit.&lt;/li&gt;
    &lt;li&gt;Write it as the average of $\dfrac{f(a+h)-f(a)}h$ and $\dfrac{f(a-h)-f(a)}{-h}$. The converse is false: $\lvert x\rvert$ at 0 gives limit 0 but is not differentiable.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;h2 id=&quot;summary&quot;&gt;Summary&lt;/h2&gt;

&lt;div class=&quot;content-box summary-box textbook-block&quot;&gt;
  &lt;ul&gt;
    &lt;li&gt;$f&apos;(a)=\lim_{h\to0}\dfrac{f(a+h)-f(a)}h$: slope of the tangent, instantaneous rate of change.&lt;/li&gt;
    &lt;li&gt;Tangent line: $y=f(a)+f&apos;(a)(x-a)$.&lt;/li&gt;
    &lt;li&gt;So far: $(x^2)&apos;=2x$, $\left(\tfrac1x\right)&apos;=-\tfrac1{x^2}$, $(\sqrt x)&apos;=\tfrac1{2\sqrt x}$.&lt;/li&gt;
    &lt;li&gt;Differentiable implies continuous; $\lvert x\rvert$ shows the converse fails.&lt;/li&gt;
  &lt;/ul&gt;
&lt;/div&gt;
</content>
 </entry>
 
 <entry>
   <title>The intermediate value theorem and the Weierstrass theorem</title>
   <link href="https://calculus-self-learning.pages.dev/contents/en/chapter01/01_06_Intermediate_value_and_Weierstrass_theorems/"/>
   <updated>2026-12-01T00:00:00+00:00</updated>
   <id>https://calculus-self-learning.pages.dev/contents/en/chapter01/01_06_Intermediate_value_and_Weierstrass_theorems</id>
   <content type="html">&lt;div class=&quot;textbook-objectives&quot;&gt;

  &lt;p&gt;&lt;strong&gt;Learning objectives.&lt;/strong&gt; After this lesson you can:&lt;/p&gt;

  &lt;ul&gt;
    &lt;li&gt;state the intermediate value theorem and prove it using the supremum;&lt;/li&gt;
    &lt;li&gt;use it to show that an equation has a root and locate the root by bisection;&lt;/li&gt;
    &lt;li&gt;state the Weierstrass theorem and show why a closed, bounded interval is needed;&lt;/li&gt;
    &lt;li&gt;tell continuity from uniform continuity using $x^2$ on $[0,1]$ and $\tfrac1x$ on $(0,1]$.&lt;/li&gt;
  &lt;/ul&gt;

&lt;/div&gt;

&lt;h2 id=&quot;why-this-lesson&quot;&gt;Why this lesson&lt;/h2&gt;

&lt;p&gt;The equation $x^3+x-1=0$ has no easy formula for its root. But $f(0)=-1&amp;lt;0$ and $f(1)=1&amp;gt;0$. The graph of a continuous function going from below the $x$-axis to above it must cross the axis somewhere. The intermediate value theorem turns this intuition into a certainty, and also gives an algorithm that finds the root to any accuracy.&lt;/p&gt;

&lt;h2 id=&quot;the-intermediate-value-theorem&quot;&gt;The intermediate value theorem&lt;/h2&gt;

&lt;div class=&quot;textbook-theorem&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Theorem 1 (Intermediate value theorem).&lt;/strong&gt; Let $f$ be continuous on $[a,b]$ and let $y$ lie between $f(a)$ and $f(b)$. Then there is $c\in[a,b]$ with $f(c)=y$.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-proof&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Proof.&lt;/strong&gt; Consider $f(a)&amp;lt;y&amp;lt;f(b)$ (the other cases are similar or trivial). Let $S=\lbrace x\in[a,b]\mid f(x)&amp;lt;y\rbrace$. $S$ is nonempty (it contains $a$) and bounded above by $b$, so by completeness $c=\sup S\in[a,b]$ exists.&lt;/p&gt;

  &lt;ul&gt;
    &lt;li&gt;Suppose $f(c)&amp;lt;y$. Then $c\ne b$. By continuity at $c$ there is $\delta&amp;gt;0$ with $f(x)&amp;lt;y$ for all $x\in[c,c+\delta)\cap[a,b]$. These points lie in $S$ and exceed $c$, contradicting $c=\sup S$.&lt;/li&gt;
    &lt;li&gt;Suppose $f(c)&amp;gt;y$. Then $c\ne a$. By continuity there is $\delta&amp;gt;0$ with $f(x)&amp;gt;y$ for all $x\in(c-\delta,c]$. So no point of $S$ lies in $(c-\delta,c]$, and every point of $S$ is $\le c$; hence $c-\delta$ is an upper bound of $S$ smaller than $c$. Contradiction.&lt;/li&gt;
  &lt;/ul&gt;

  &lt;p&gt;So $f(c)=y$.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-theorem&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Corollary 1 (Bolzano).&lt;/strong&gt; If $f$ is continuous on $[a,b]$ and $f(a)f(b)&amp;lt;0$, then $f(x)=0$ has a root in $(a,b)$.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Example 1 (Bisection).&lt;/strong&gt; Locate the root of $f(x)=x^3+x-1$ on $[0,1]$.&lt;/p&gt;

  &lt;p&gt;At each step take the midpoint $c$ and keep the half on which $f$ changes sign.&lt;/p&gt;

  &lt;table&gt;
    &lt;thead&gt;
      &lt;tr&gt;
        &lt;th&gt;step&lt;/th&gt;
        &lt;th&gt;interval&lt;/th&gt;
        &lt;th&gt;$c$&lt;/th&gt;
        &lt;th&gt;$f(c)$&lt;/th&gt;
      &lt;/tr&gt;
    &lt;/thead&gt;
    &lt;tbody&gt;
      &lt;tr&gt;
        &lt;td&gt;1&lt;/td&gt;
        &lt;td&gt;$[0,\,1]$&lt;/td&gt;
        &lt;td&gt;0.5&lt;/td&gt;
        &lt;td&gt;$-0.375$&lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr&gt;
        &lt;td&gt;2&lt;/td&gt;
        &lt;td&gt;$[0.5,\,1]$&lt;/td&gt;
        &lt;td&gt;0.75&lt;/td&gt;
        &lt;td&gt;$0.171875$&lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr&gt;
        &lt;td&gt;3&lt;/td&gt;
        &lt;td&gt;$[0.5,\,0.75]$&lt;/td&gt;
        &lt;td&gt;0.625&lt;/td&gt;
        &lt;td&gt;$-0.130859$&lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr&gt;
        &lt;td&gt;4&lt;/td&gt;
        &lt;td&gt;$[0.625,\,0.75]$&lt;/td&gt;
        &lt;td&gt;0.6875&lt;/td&gt;
        &lt;td&gt;$0.012451$&lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr&gt;
        &lt;td&gt;5&lt;/td&gt;
        &lt;td&gt;$[0.625,\,0.6875]$&lt;/td&gt;
        &lt;td&gt;0.65625&lt;/td&gt;
        &lt;td&gt;$-0.061127$&lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr&gt;
        &lt;td&gt;6&lt;/td&gt;
        &lt;td&gt;$[0.65625,\,0.6875]$&lt;/td&gt;
        &lt;td&gt;0.671875&lt;/td&gt;
        &lt;td&gt;$-0.024830$&lt;/td&gt;
      &lt;/tr&gt;
    &lt;/tbody&gt;
  &lt;/table&gt;

  &lt;p&gt;After 6 steps the root lies in $[0.671875,\,0.6875]$, of length $2^{-6}\approx0.0156$. After $n$ steps the error is at most $2^{-n}$; an error below $10^{-6}$ needs $n=20$ steps. The true root is $x\approx0.682328$. Since $f$ is strictly increasing, it is the only root.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Example 2.&lt;/strong&gt; Show that $\cos x=x$ has a root in $(0,1)$.&lt;/p&gt;

  &lt;p&gt;Let $g(x)=\cos x-x$, which is continuous. $g(0)=1&amp;gt;0$, $g(1)=\cos1-1\approx-0.4597&amp;lt;0$. By Corollary 1 there is a root.&lt;/p&gt;
&lt;/div&gt;

&lt;h2 id=&quot;the-weierstrass-theorem&quot;&gt;The Weierstrass theorem&lt;/h2&gt;

&lt;div class=&quot;textbook-theorem&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Theorem 2 (Weierstrass extreme value theorem).&lt;/strong&gt; If $f$ is continuous on $[a,b]$, then $f$ is bounded and attains a maximum and a minimum there: there are $x_1,x_2\in[a,b]$ with $f(x_1)\le f(x)\le f(x_2)$ for all $x\in[a,b]$.&lt;/p&gt;
&lt;/div&gt;

&lt;p&gt;The proof needs the Bolzano–Weierstrass theorem on convergent subsequences, so it waits until chapter 7. What matters here is that each hypothesis is needed:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;em&gt;Open interval:&lt;/em&gt; $f(x)=x$ on $(0,1)$ is continuous but has no maximum or minimum.&lt;/li&gt;
  &lt;li&gt;&lt;em&gt;Unbounded interval:&lt;/em&gt; $f(x)=x$ on $[0,\infty)$ has no maximum.&lt;/li&gt;
  &lt;li&gt;&lt;em&gt;Not continuous:&lt;/em&gt; $f(x)=\tfrac1x$ for $x\in(0,1]$, $f(0)=0$, is defined on $[0,1]$ but unbounded.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Together the two theorems say: a continuous function maps $[a,b]$ onto an interval $[m,M]$, where $m,M$ are its minimum and maximum.&lt;/p&gt;

&lt;h2 id=&quot;uniform-continuity&quot;&gt;Uniform continuity&lt;/h2&gt;

&lt;p&gt;In the definition of continuity at $a$, $\delta$ may depend on both $\varepsilon$ and $a$. For $f(x)=\tfrac1x$ on $(0,1]$ the graph gets steeper near 0, so $\delta$ must shrink there. Uniform continuity asks for one $\delta$ that works at every point.&lt;/p&gt;

&lt;div class=&quot;textbook-definition&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Definition 1 (Uniform continuity).&lt;/strong&gt; $f$ is &lt;em&gt;uniformly continuous&lt;/em&gt; on a set $I$ if&lt;/p&gt;

\[\forall\varepsilon&amp;gt;0\ \exists\delta&amp;gt;0\ \forall x,y\in I:\ \lvert x-y\rvert&amp;lt;\delta\Rightarrow\lvert f(x)-f(y)\rvert&amp;lt;\varepsilon .\]

&lt;/div&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Example 3.&lt;/strong&gt;&lt;/p&gt;

  &lt;ul&gt;
    &lt;li&gt;$f(x)=x^2$ on $[0,1]$: $\lvert x^2-y^2\rvert=\lvert x+y\rvert\,\lvert x-y\rvert\le2\lvert x-y\rvert$. Choose $\delta=\tfrac\varepsilon2$, independent of the point. Uniformly continuous.&lt;/li&gt;
    &lt;li&gt;$f(x)=\tfrac1x$ on $(0,1]$: take $x=\tfrac1n$, $y=\tfrac1{n+1}$. Then $\lvert x-y\rvert=\tfrac1{n(n+1)}\to0$ but $\lvert f(x)-f(y)\rvert=1$. For $\varepsilon=1$ no single $\delta$ works everywhere. Continuous but not uniformly continuous.&lt;/li&gt;
  &lt;/ul&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-theorem&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Theorem 3 (Cantor).&lt;/strong&gt; A function continuous on $[a,b]$ is uniformly continuous there.&lt;/p&gt;
&lt;/div&gt;

&lt;p&gt;Cantor’s theorem is proved in chapter 7 and is the reason continuous functions on closed intervals are integrable (chapter 4).&lt;/p&gt;

&lt;h2 id=&quot;interactive&quot;&gt;Interactive&lt;/h2&gt;

&lt;div class=&quot;interactive-frame&quot;&gt;
  &lt;div class=&quot;interactive-frame-head&quot;&gt;
    &lt;div class=&quot;interactive-frame-title&quot;&gt;Continuity and uniform continuity&lt;/div&gt;
    &lt;div class=&quot;interactive-frame-desc&quot;&gt;Pick 1/x and watch the largest δ drop to 0 as a → 0 (right panel).&lt;/div&gt;
  &lt;/div&gt;
  &lt;iframe src=&quot;/interactives/chapter01/epsilon-delta-en.html&quot; title=&quot;Continuity and uniform continuity&quot; loading=&quot;lazy&quot; style=&quot;height: 760px;&quot;&gt;&lt;/iframe&gt;
  &lt;div class=&quot;interactive-frame-foot&quot;&gt;
    &lt;a href=&quot;/interactives/chapter01/epsilon-delta-en.html&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;Open the interactive in a new window&lt;/a&gt;
  &lt;/div&gt;
&lt;/div&gt;

&lt;h2 id=&quot;applications&quot;&gt;Applications&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Computing: bisection is the most reliable root finder.&lt;/strong&gt; The &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;bisect&lt;/code&gt; routine in numerical libraries (e.g. &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;scipy.optimize.bisect&lt;/code&gt;) does exactly Example 1. It is slower than Newton’s method (chapter 3) but always converges when $f$ is continuous and changes sign, so it is often used to bracket a root first.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Physics: two antipodal points with the same temperature.&lt;/strong&gt; On any great circle of the Earth (the equator, say) there are always two diametrically opposite points with the same temperature. Let $T(\theta)$ be the temperature at angle $\theta$, continuous and $2\pi$-periodic, and set $g(\theta)=T(\theta)-T(\theta+\pi)$. Then $g(\pi)=T(\pi)-T(2\pi)=-g(0)$. If $g(0)=0$ we are done; otherwise $g(0)$ and $g(\pi)$ have opposite signs and Corollary 1 gives $\theta$ with $g(\theta)=0$.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Economics: an optimum exists.&lt;/strong&gt; A profit function continuous in output $q\in[0,q_{\max}]$ certainly has a profit-maximising output (Theorem 2). This must be known before searching for it with derivatives in chapter 3.&lt;/p&gt;

&lt;h2 id=&quot;exercises&quot;&gt;Exercises&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Basic.&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;Show that $x^5-3x+1=0$ has a root in $(0,1)$.&lt;/li&gt;
  &lt;li&gt;Does $f(x)=\tfrac1{x^2}$ on $[-1,1]\setminus\lbrace 0\rbrace$ have a maximum? Why is there no contradiction with Theorem 2?&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Answers&lt;/summary&gt;

  &lt;ol&gt;
    &lt;li&gt;$f(0)=1&amp;gt;0$, $f(1)=-1&amp;lt;0$.&lt;/li&gt;
    &lt;li&gt;No maximum (it is unbounded). The domain is not a closed interval and the function is undefined at 0.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;p&gt;&lt;strong&gt;Intermediate.&lt;/strong&gt;&lt;/p&gt;

&lt;ol start=&quot;3&quot;&gt;
  &lt;li&gt;Do 4 bisection steps for $\cos x=x$ on $[0,1]$. Which interval contains the root?&lt;/li&gt;
  &lt;li&gt;Prove that every polynomial of odd degree has at least one real root.&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Answers&lt;/summary&gt;

  &lt;ol start=&quot;3&quot;&gt;
    &lt;li&gt;Midpoints: 0.5 ($g&amp;gt;0$), 0.75 ($g&amp;lt;0$), 0.625 ($g&amp;gt;0$), 0.6875 ($g&amp;gt;0$). The root is in $[0.6875,\,0.75]$ (true root $\approx0.7391$).&lt;/li&gt;
    &lt;li&gt;With $a_n&amp;gt;0$: $p(x)\to+\infty$ as $x\to+\infty$ and $\to-\infty$ as $x\to-\infty$. Pick $b$ large with $p(b)&amp;gt;0$ and $a$ very negative with $p(a)&amp;lt;0$; apply Corollary 1.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;p&gt;&lt;strong&gt;Advanced.&lt;/strong&gt;&lt;/p&gt;

&lt;ol start=&quot;5&quot;&gt;
  &lt;li&gt;Let $f:[0,1]\to[0,1]$ be continuous. Prove there is $c$ with $f(c)=c$ (a fixed point).&lt;/li&gt;
  &lt;li&gt;Prove that $f(x)=\sqrt x$ is uniformly continuous on $[0,\infty)$.&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Hints&lt;/summary&gt;

  &lt;ol start=&quot;5&quot;&gt;
    &lt;li&gt;Consider $g(x)=f(x)-x$: $g(0)=f(0)\ge0$, $g(1)=f(1)-1\le0$.&lt;/li&gt;
    &lt;li&gt;Show $\lvert\sqrt x-\sqrt y\rvert\le\sqrt{\lvert x-y\rvert}$ (square both sides, assuming $x\ge y$). Choose $\delta=\varepsilon^2$.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;h2 id=&quot;summary&quot;&gt;Summary&lt;/h2&gt;

&lt;div class=&quot;content-box summary-box textbook-block&quot;&gt;
  &lt;ul&gt;
    &lt;li&gt;Intermediate value theorem: a continuous function on a closed interval takes every value between $f(a)$ and $f(b)$. The proof uses the supremum.&lt;/li&gt;
    &lt;li&gt;Consequence: if $f(a)f(b)&amp;lt;0$ there is a root in $(a,b)$; $n$ bisection steps give error $\le(b-a)2^{-n}$.&lt;/li&gt;
    &lt;li&gt;Weierstrass: a continuous function on a closed, bounded interval attains its maximum and minimum. Drop any hypothesis and there is a counterexample.&lt;/li&gt;
    &lt;li&gt;Uniform continuity: one $\delta$ for all points. $\tfrac1x$ on $(0,1]$ is not uniformly continuous; continuous functions on closed intervals are (Cantor).&lt;/li&gt;
  &lt;/ul&gt;
&lt;/div&gt;
</content>
 </entry>
 
 <entry>
   <title>Continuous functions and types of discontinuity</title>
   <link href="https://calculus-self-learning.pages.dev/contents/en/chapter01/01_05_Continuous_functions_and_discontinuities/"/>
   <updated>2026-12-01T00:00:00+00:00</updated>
   <id>https://calculus-self-learning.pages.dev/contents/en/chapter01/01_05_Continuous_functions_and_discontinuities</id>
   <content type="html">&lt;div class=&quot;textbook-objectives&quot;&gt;

  &lt;p&gt;&lt;strong&gt;Learning objectives.&lt;/strong&gt; After this lesson you can:&lt;/p&gt;

  &lt;ul&gt;
    &lt;li&gt;check continuity at a point with three conditions;&lt;/li&gt;
    &lt;li&gt;use continuity of elementary functions and compositions to compute limits by substitution;&lt;/li&gt;
    &lt;li&gt;find parameters that make a piecewise function continuous;&lt;/li&gt;
    &lt;li&gt;classify discontinuities: removable, first kind (jump), second kind.&lt;/li&gt;
  &lt;/ul&gt;

&lt;/div&gt;

&lt;h2 id=&quot;why-this-lesson&quot;&gt;Why this lesson&lt;/h2&gt;

&lt;p&gt;Suppose electricity is billed in tiers: the first 50 kWh at 2000 VND/kWh, anything above 50 kWh at 2100 VND/kWh (illustrative figures). The bill for $x$ kWh is&lt;/p&gt;

\[T(x)=\begin{cases}2000x, &amp;amp; 0\le x\le50,\\ 100\,000+2100(x-50), &amp;amp; x&amp;gt;50.\end{cases}\]

&lt;p&gt;Using 49.9 kWh or 50.1 kWh changes the bill by only a few hundred VND: $T$ has no jump, $T$ is &lt;em&gt;continuous&lt;/em&gt;. But the price of the next kWh jumps from 2000 to 2100 at $x=50$. Telling these two behaviours apart is what this lesson is about.&lt;/p&gt;

&lt;h2 id=&quot;continuity-at-a-point&quot;&gt;Continuity at a point&lt;/h2&gt;

&lt;div class=&quot;textbook-definition&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Definition 1 (Continuity).&lt;/strong&gt; $f$ is &lt;em&gt;continuous at&lt;/em&gt; $a$ if all three hold:&lt;/p&gt;

  &lt;ol&gt;
    &lt;li&gt;$f(a)$ is defined;&lt;/li&gt;
    &lt;li&gt;$\lim_{x\to a}f(x)$ exists;&lt;/li&gt;
    &lt;li&gt;$\lim_{x\to a}f(x)=f(a)$.&lt;/li&gt;
  &lt;/ol&gt;

  &lt;p&gt;In ε–δ form: $\forall\varepsilon&amp;gt;0\ \exists\delta&amp;gt;0:\ \lvert x-a\rvert&amp;lt;\delta\Rightarrow\lvert f(x)-f(a)\rvert&amp;lt;\varepsilon$. $f$ is &lt;em&gt;right-continuous&lt;/em&gt; at $a$ if $\lim_{x\to a^+}f(x)=f(a)$, &lt;em&gt;left-continuous&lt;/em&gt; if $\lim_{x\to a^-}f(x)=f(a)$. $f$ is continuous on an interval if it is continuous at every point of it (one-sided at the endpoints of a closed interval).&lt;/p&gt;
&lt;/div&gt;

&lt;p&gt;Compared with the definition of a limit, $L$ is replaced by $f(a)$ and the condition $x\ne a$ is dropped.&lt;/p&gt;

&lt;div class=&quot;textbook-theorem&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Theorem 1 (Operations on continuous functions).&lt;/strong&gt; If $f,g$ are continuous at $a$, then so are $f\pm g$ and $fg$, and $f/g$ is continuous at $a$ if $g(a)\ne0$.&lt;/p&gt;
&lt;/div&gt;

&lt;p&gt;Theorem 1 follows at once from the limit laws (lesson 01_03).&lt;/p&gt;

&lt;div class=&quot;textbook-theorem&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Theorem 2 (Composition).&lt;/strong&gt; If $g$ is continuous at $a$ and $f$ is continuous at $g(a)$, then $f\circ g$ is continuous at $a$.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-proof&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Proof.&lt;/strong&gt; Let $\varepsilon&amp;gt;0$. Since $f$ is continuous at $b=g(a)$, there is $\eta&amp;gt;0$ with $\lvert y-b\rvert&amp;lt;\eta\Rightarrow\lvert f(y)-f(b)\rvert&amp;lt;\varepsilon$. Since $g$ is continuous at $a$, for this $\eta$ there is $\delta&amp;gt;0$ with $\lvert x-a\rvert&amp;lt;\delta\Rightarrow\lvert g(x)-b\rvert&amp;lt;\eta$. Combining: $\lvert x-a\rvert&amp;lt;\delta\Rightarrow\lvert f(g(x))-f(g(a))\rvert&amp;lt;\varepsilon$.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-theorem&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Theorem 3.&lt;/strong&gt; Every elementary function is continuous at every point of its domain.&lt;/p&gt;
&lt;/div&gt;

&lt;p&gt;We accept Theorem 3 without a full proof: for $\sin$, use $\lvert\sin x-\sin a\rvert=2\left\lvert\cos\tfrac{x+a}2\sin\tfrac{x-a}2\right\rvert\le\lvert x-a\rvert$; for $e^x$ and $\ln$, use monotonicity; the rest follow from Theorems 1 and 2 and the fact that the inverse of a continuous monotone function is continuous.&lt;/p&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Example 1.&lt;/strong&gt; Compute $\lim_{x\to0}\sqrt{\dfrac{\sin x}{x}+3}$.&lt;/p&gt;

  &lt;p&gt;The function $u\mapsto\sqrt{u+3}$ is continuous at $u=1$, and $\tfrac{\sin x}x\to1$. By the argument of Theorem 2 the limit is $\sqrt{1+3}=2$. This is the rule “move the limit inside a continuous function” used in lesson 01_04 with $\ln$.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Example 2.&lt;/strong&gt; Find $a$ so that this function is continuous on $\mathbb{R}$:&lt;/p&gt;

\[f(x)=\begin{cases}\dfrac{x^2-4}{x-2}, &amp;amp; x\ne2,\\ a, &amp;amp; x=2.\end{cases}\]

  &lt;p&gt;For $x\ne2$, $f(x)=x+2$ is continuous. At $x=2$: $\lim_{x\to2}f(x)=4$. We need $a=f(2)=4$.&lt;/p&gt;

  &lt;p&gt;Likewise the bill $T$ above is continuous at $50$, since $\lim_{x\to50^-}T=2000\cdot50=100\,000$ and $\lim_{x\to50^+}T=100\,000+0=100\,000=T(50)$.&lt;/p&gt;
&lt;/div&gt;

&lt;h2 id=&quot;classifying-discontinuities&quot;&gt;Classifying discontinuities&lt;/h2&gt;

&lt;div class=&quot;textbook-definition&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Definition 2 (Types of discontinuity).&lt;/strong&gt; Suppose $f$ is not continuous at $a$ (but is defined near $a$).&lt;/p&gt;

  &lt;ul&gt;
    &lt;li&gt;$a$ is a &lt;em&gt;removable&lt;/em&gt; discontinuity if $\lim_{x\to a}f(x)$ exists (finite) but differs from $f(a)$, or $f(a)$ is undefined.&lt;/li&gt;
    &lt;li&gt;$a$ is a discontinuity of the &lt;em&gt;first kind&lt;/em&gt; if both one-sided limits exist and are finite but differ. The difference $f(a^+)-f(a^-)$ is the &lt;em&gt;jump&lt;/em&gt;.&lt;/li&gt;
    &lt;li&gt;All other cases (at least one one-sided limit fails to exist or is infinite) are discontinuities of the &lt;em&gt;second kind&lt;/em&gt;.&lt;/li&gt;
  &lt;/ul&gt;
&lt;/div&gt;

&lt;p&gt;Some books count removable discontinuities as first kind, since both one-sided limits also exist and are finite there.&lt;/p&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Example 3.&lt;/strong&gt; Classify the discontinuity at $x=0$.&lt;/p&gt;

  &lt;ol&gt;
    &lt;li&gt;$f(x)=\dfrac{\sin x}x$: the limit is 1 and $f(0)$ is undefined. Removable: setting $f(0)=1$ makes $f$ continuous.&lt;/li&gt;
    &lt;li&gt;$f(x)=\dfrac{\lvert x\rvert}x$: $f(0^+)=1$, $f(0^-)=-1$. First kind, jump 2.&lt;/li&gt;
    &lt;li&gt;$f(x)=\dfrac1x$: $f(0^+)=+\infty$. Second kind.&lt;/li&gt;
    &lt;li&gt;$f(x)=\sin\dfrac1x$: neither one-sided limit exists (oscillation). Second kind.&lt;/li&gt;
    &lt;li&gt;$f(x)=\lfloor x\rfloor$ (floor) at every integer $n$: $f(n^-)=n-1$, $f(n^+)=n=f(n)$. First kind, right-continuous.&lt;/li&gt;
  &lt;/ol&gt;
&lt;/div&gt;

&lt;h2 id=&quot;interactive&quot;&gt;Interactive&lt;/h2&gt;

&lt;div class=&quot;interactive-frame&quot;&gt;
  &lt;div class=&quot;interactive-frame-head&quot;&gt;
    &lt;div class=&quot;interactive-frame-title&quot;&gt;Continuity via ε–δ&lt;/div&gt;
    &lt;div class=&quot;interactive-frame-desc&quot;&gt;Pick the step function to see that no δ works at a jump.&lt;/div&gt;
  &lt;/div&gt;
  &lt;iframe src=&quot;/interactives/chapter01/epsilon-delta-en.html&quot; title=&quot;Continuity via ε–δ&quot; loading=&quot;lazy&quot; style=&quot;height: 760px;&quot;&gt;&lt;/iframe&gt;
  &lt;div class=&quot;interactive-frame-foot&quot;&gt;
    &lt;a href=&quot;/interactives/chapter01/epsilon-delta-en.html&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;Open the interactive in a new window&lt;/a&gt;
  &lt;/div&gt;
&lt;/div&gt;

&lt;h2 id=&quot;applications&quot;&gt;Applications&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Economics: tiered tariffs.&lt;/strong&gt; The bill $T(x)$ is continuous, but the marginal price (price of the next kWh) has a first-kind discontinuity at 50 kWh with jump 100 VND/kWh. If instead the tariff charged the &lt;em&gt;whole&lt;/em&gt; consumption at the price of the highest tier reached, $T$ would jump from $100\,000$ to $50\cdot2100=105\,000$ just after 50 kWh, and using $0.1$ kWh more would add almost 5000 VND. Continuity of $T$ is what makes a tiered tariff fair.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Machine learning: why the step function was dropped.&lt;/strong&gt; The first neural network (the perceptron) used the step activation $H(x)=1$ for $x\ge0$, $0$ for $x&amp;lt;0$, which has a first-kind discontinuity at 0. Gradient-based training needs small weight changes to cause small output changes, so $H$ was replaced by the continuous sigmoid (lesson 00_03).&lt;/p&gt;

&lt;h2 id=&quot;exercises&quot;&gt;Exercises&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Basic.&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;Where is $f(x)=\dfrac{x^2-x}{x}$ discontinuous, and of what kind?&lt;/li&gt;
  &lt;li&gt;Find $a$ so that $f(x)=\begin{cases}ax+1, &amp;amp; x&amp;lt;1\\ x^2+2, &amp;amp; x\ge1\end{cases}$ is continuous at 1.&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Answers&lt;/summary&gt;

  &lt;ol&gt;
    &lt;li&gt;At $x=0$, removable (the limit is $-1$).&lt;/li&gt;
    &lt;li&gt;$a+1=3$, $a=2$.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;p&gt;&lt;strong&gt;Intermediate.&lt;/strong&gt;&lt;/p&gt;

&lt;ol start=&quot;3&quot;&gt;
  &lt;li&gt;Classify the discontinuity of $f(x)=\dfrac{1}{1+e^{1/x}}$ at $x=0$.&lt;/li&gt;
  &lt;li&gt;Find $a,b$ so that $f(x)=\begin{cases}x+a, &amp;amp; x&amp;lt;0\\ \cos x, &amp;amp; 0\le x\le\pi\\ bx, &amp;amp; x&amp;gt;\pi\end{cases}$ is continuous on $\mathbb{R}$.&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Answers&lt;/summary&gt;

  &lt;ol start=&quot;3&quot;&gt;
    &lt;li&gt;$x\to0^+$: $e^{1/x}\to\infty$, $f\to0$. $x\to0^-$: $e^{1/x}\to0$, $f\to1$. First kind, jump $-1$.&lt;/li&gt;
    &lt;li&gt;At 0: $a=1$. At $\pi$: $b\pi=-1$, $b=-\tfrac1\pi$.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;p&gt;&lt;strong&gt;Advanced.&lt;/strong&gt;&lt;/p&gt;

&lt;ol start=&quot;5&quot;&gt;
  &lt;li&gt;Prove that the Dirichlet function $D(x)=1$ for rational $x$, $0$ for irrational $x$, is discontinuous everywhere.&lt;/li&gt;
  &lt;li&gt;Prove that $g(x)=x\,D(x)$ is continuous at exactly one point.&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Hints&lt;/summary&gt;

  &lt;ol start=&quot;5&quot;&gt;
    &lt;li&gt;Every interval contains rationals and irrationals. Take $\varepsilon=\tfrac12$: for every $\delta$ some $x$ in $(a-\delta,a+\delta)$ has $\lvert D(x)-D(a)\rvert=1$.&lt;/li&gt;
    &lt;li&gt;At 0: $\lvert g(x)\rvert\le\lvert x\rvert$, take $\delta=\varepsilon$. At $a\ne0$: rationals near $a$ give values near $a$, irrationals give 0, so there is no limit.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;h2 id=&quot;summary&quot;&gt;Summary&lt;/h2&gt;

&lt;div class=&quot;content-box summary-box textbook-block&quot;&gt;
  &lt;ul&gt;
    &lt;li&gt;$f$ is continuous at $a$: $f(a)$ is defined and $\lim_{x\to a}f(x)=f(a)$.&lt;/li&gt;
    &lt;li&gt;Sums, products, quotients (nonzero denominator) and compositions of continuous functions are continuous. Elementary functions are continuous on their domains, so limits are computed by substitution.&lt;/li&gt;
    &lt;li&gt;Removable: the limit exists but differs from $f(a)$. First kind: finite, different one-sided limits. Second kind: everything else.&lt;/li&gt;
  &lt;/ul&gt;
&lt;/div&gt;
</content>
 </entry>
 
 <entry>
   <title>Standard limits, infinitesimals and infinitely large quantities</title>
   <link href="https://calculus-self-learning.pages.dev/contents/en/chapter01/01_04_Standard_limits_infinitesimals/"/>
   <updated>2026-12-01T00:00:00+00:00</updated>
   <id>https://calculus-self-learning.pages.dev/contents/en/chapter01/01_04_Standard_limits_infinitesimals</id>
   <content type="html">&lt;div class=&quot;textbook-objectives&quot;&gt;

  &lt;p&gt;&lt;strong&gt;Learning objectives.&lt;/strong&gt; After this lesson you can:&lt;/p&gt;

  &lt;ul&gt;
    &lt;li&gt;prove $\lim_{x\to0}\dfrac{\sin x}x=1$ with the squeeze theorem;&lt;/li&gt;
    &lt;li&gt;use $\lim_{x\to\infty}\left(1+\tfrac1x\right)^x=e$ for $1^\infty$ forms;&lt;/li&gt;
    &lt;li&gt;compare infinitesimals with $\sim$, $o$ and $O$;&lt;/li&gt;
    &lt;li&gt;replace equivalent infinitesimals in products and quotients, and know why not in sums.&lt;/li&gt;
  &lt;/ul&gt;

&lt;/div&gt;

&lt;h2 id=&quot;why-this-lesson&quot;&gt;Why this lesson&lt;/h2&gt;

&lt;p&gt;The pendulum equation is $\theta&apos;&apos;=-\tfrac gL\sin\theta$. High-school physics replaces $\sin\theta$ by $\theta$ and gets simple harmonic motion with period $2\pi\sqrt{L/g}$. How good is that replacement? For $\theta=10^\circ\approx0.17453$ rad, $\sin\theta\approx0.17365$, an error of about $0.5\%$. The underlying reason is $\sin\theta/\theta\to1$ as $\theta\to0$: the two are &lt;em&gt;equivalent infinitesimals&lt;/em&gt;. This lesson proves that limit and builds a computing method on it.&lt;/p&gt;

&lt;h2 id=&quot;the-limit-sin-x--x&quot;&gt;The limit sin x / x&lt;/h2&gt;

&lt;div class=&quot;textbook-theorem&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Theorem 1.&lt;/strong&gt; $\displaystyle\lim_{x\to0}\frac{\sin x}{x}=1$.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-proof&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Proof.&lt;/strong&gt; Take $0&amp;lt;x&amp;lt;\tfrac\pi2$ on the unit circle with centre $O$, $A=(1,0)$, $P=(\cos x,\sin x)$, and $T=(1,\tan x)$ where ray $OP$ meets the tangent at $A$. Compare three areas: triangle $OAP$ lies inside sector $OAP$, which lies inside triangle $OAT$. So&lt;/p&gt;

\[\frac{\sin x}2&amp;lt;\frac x2&amp;lt;\frac{\tan x}2 .\]

  &lt;p&gt;Divide by $\tfrac{\sin x}2&amp;gt;0$ and take reciprocals: $\cos x&amp;lt;\dfrac{\sin x}x&amp;lt;1$. As $x\to0^+$, $\cos x\to1$, so by the squeeze theorem $\tfrac{\sin x}x\to1$. The function $\tfrac{\sin x}x$ is even, so the left limit is also 1.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Example 1.&lt;/strong&gt;&lt;/p&gt;

  &lt;ul&gt;
    &lt;li&gt;$\lim_{x\to0}\dfrac{\sin3x}{x}=\lim_{x\to0}3\cdot\dfrac{\sin 3x}{3x}=3$.&lt;/li&gt;
    &lt;li&gt;$\lim_{x\to0}\dfrac{1-\cos x}{x^2}=\lim_{x\to0}\dfrac{2\sin^2(x/2)}{x^2}=\lim_{x\to0}\dfrac12\left(\dfrac{\sin(x/2)}{x/2}\right)^2=\dfrac12$.&lt;/li&gt;
  &lt;/ul&gt;
&lt;/div&gt;

&lt;h2 id=&quot;the-number-e&quot;&gt;The number e&lt;/h2&gt;

&lt;div class=&quot;textbook-theorem&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Theorem 2.&lt;/strong&gt; $\displaystyle\lim_{x\to\infty}\left(1+\frac1x\right)^x=e\approx2.71828$, and equivalently $\displaystyle\lim_{t\to0}(1+t)^{1/t}=e$.&lt;/p&gt;
&lt;/div&gt;

&lt;p&gt;Chapter 7 proves that the sequence $\left(1+\tfrac1n\right)^n$ is increasing and bounded above (using Bernoulli’s inequality), so it converges; its limit is &lt;em&gt;defined&lt;/em&gt; to be $e$. Here we use the result.&lt;/p&gt;

&lt;p&gt;Consequences (using continuity of $\ln$ and $e^x$, lesson 01_05):&lt;/p&gt;

\[\lim_{x\to0}\frac{\ln(1+x)}x=\lim_{x\to0}\ln(1+x)^{1/x}=\ln e=1,\qquad \lim_{x\to0}\frac{e^x-1}x=1 .\]

&lt;p&gt;For the second, put $t=e^x-1$; then $x=\ln(1+t)$ and $\dfrac{e^x-1}x=\dfrac t{\ln(1+t)}\to1$.&lt;/p&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Example 2.&lt;/strong&gt; Compute $\lim_{x\to\infty}\left(1+\dfrac2x\right)^x$.&lt;/p&gt;

  &lt;p&gt;Put $u=x/2$: $\left(1+\tfrac2x\right)^x=\left[\left(1+\tfrac1u\right)^u\right]^2\to e^2\approx7.389$. In general $\left(1+\tfrac ax\right)^x\to e^a$.&lt;/p&gt;
&lt;/div&gt;

&lt;h2 id=&quot;infinitesimals-and-infinitely-large-quantities&quot;&gt;Infinitesimals and infinitely large quantities&lt;/h2&gt;

&lt;div class=&quot;textbook-definition&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Definition 1.&lt;/strong&gt; $\alpha(x)$ is an &lt;em&gt;infinitesimal&lt;/em&gt; as $x\to a$ if $\lim_{x\to a}\alpha(x)=0$, and &lt;em&gt;infinitely large&lt;/em&gt; if $\lvert\alpha(x)\rvert\to\infty$. For infinitesimals $\alpha,\beta$ as $x\to a$:&lt;/p&gt;

  &lt;ul&gt;
    &lt;li&gt;$\alpha\sim\beta$ (&lt;em&gt;equivalent&lt;/em&gt;) if $\lim\dfrac\alpha\beta=1$;&lt;/li&gt;
    &lt;li&gt;$\alpha=o(\beta)$ ($\alpha$ is of &lt;em&gt;higher order&lt;/em&gt; than $\beta$) if $\lim\dfrac\alpha\beta=0$;&lt;/li&gt;
    &lt;li&gt;$\alpha=O(\beta)$ if $\left\lvert\dfrac\alpha\beta\right\rvert$ is bounded near $a$.&lt;/li&gt;
  &lt;/ul&gt;
&lt;/div&gt;

&lt;p&gt;Equivalences as $x\to0$ that follow from the above:&lt;/p&gt;

&lt;table&gt;
  &lt;thead&gt;
    &lt;tr&gt;
      &lt;th&gt;infinitesimal&lt;/th&gt;
      &lt;th&gt;equivalent to&lt;/th&gt;
    &lt;/tr&gt;
  &lt;/thead&gt;
  &lt;tbody&gt;
    &lt;tr&gt;
      &lt;td&gt;$\sin x$, $\tan x$, $\arcsin x$, $\arctan x$&lt;/td&gt;
      &lt;td&gt;$x$&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;$1-\cos x$&lt;/td&gt;
      &lt;td&gt;$\tfrac{x^2}2$&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;$\ln(1+x)$, $e^x-1$&lt;/td&gt;
      &lt;td&gt;$x$&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;$(1+x)^\alpha-1$&lt;/td&gt;
      &lt;td&gt;$\alpha x$&lt;/td&gt;
    &lt;/tr&gt;
  &lt;/tbody&gt;
&lt;/table&gt;

&lt;div class=&quot;textbook-theorem&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Theorem 3 (Replacing equivalents).&lt;/strong&gt; If $\alpha\sim\alpha_1$ and $\beta\sim\beta_1$ as $x\to a$, then $\lim\dfrac{\alpha}{\beta}=\lim\dfrac{\alpha_1}{\beta_1}$ (whenever the right side exists).&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-proof&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Proof.&lt;/strong&gt; Write $\dfrac\alpha\beta=\dfrac\alpha{\alpha_1}\cdot\dfrac{\alpha_1}{\beta_1}\cdot\dfrac{\beta_1}\beta$. The first and last factors tend to 1, so by the product rule the limit equals $\lim\dfrac{\alpha_1}{\beta_1}$.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Example 3.&lt;/strong&gt;&lt;/p&gt;

  &lt;ul&gt;
    &lt;li&gt;$\lim_{x\to0}\dfrac{\sin3x}{\tan5x}=\lim_{x\to0}\dfrac{3x}{5x}=\dfrac35$.&lt;/li&gt;
    &lt;li&gt;$\lim_{x\to0}\dfrac{1-\cos4x}{x\sin x}=\lim_{x\to0}\dfrac{(4x)^2/2}{x\cdot x}=8$.&lt;/li&gt;
    &lt;li&gt;$\lim_{x\to0}\dfrac{\ln(1+2x)}{e^{3x}-1}=\dfrac{2x}{3x}=\dfrac23$.&lt;/li&gt;
  &lt;/ul&gt;
&lt;/div&gt;

&lt;div class=&quot;content-box warning-box textbook-block&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Caution: do not replace equivalents inside a difference.&lt;/strong&gt; For $\lim_{x\to0}\dfrac{\tan x-\sin x}{x^3}$, replacing $\tan x\sim x$ and $\sin x\sim x$ makes the numerator 0 and gives the wrong answer 0. Correctly: $\tan x-\sin x=\tan x\,(1-\cos x)\sim x\cdot\dfrac{x^2}2$, so the limit is $\dfrac12$. A computer with $x=0.01$ gives $0.500013$.&lt;/p&gt;
&lt;/div&gt;

&lt;h2 id=&quot;short-video&quot;&gt;Short video&lt;/h2&gt;

&lt;div class=&quot;reel-video&quot;&gt;
  &lt;video controls=&quot;&quot; playsinline=&quot;&quot; preload=&quot;metadata&quot; src=&quot;/public/videos/reels/squeeze-sinx-over-x.mp4&quot;&gt;&lt;/video&gt;
  &lt;p class=&quot;reel-caption&quot;&gt;Squeezing sin x / x: three nested areas on the unit circle give cos x &amp;lt; sin x / x &amp;lt; 1, and both ends of the squeeze go to 1 as x → 0 (silent video, about 2 minutes).&lt;/p&gt;
&lt;/div&gt;

&lt;h2 id=&quot;applications&quot;&gt;Applications&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Physics: the small-angle approximation.&lt;/strong&gt; $\sin\theta=\theta+o(\theta)$ as $\theta\to0$. For $\theta=0.1$ rad, $\theta-\sin\theta\approx0.000167$, a relative error of $0.17\%$. Chapter 8 gives a sharper estimate: $\theta-\sin\theta\approx\theta^3/6$.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Economics: continuous compounding.&lt;/strong&gt; Deposit 1 unit at annual rate $r$, compounded $n$ times a year; after a year you have $\left(1+\tfrac rn\right)^n$. As $n\to\infty$, by Example 2 this tends to $e^r$. With $r=10\%$:&lt;/p&gt;

&lt;table&gt;
  &lt;thead&gt;
    &lt;tr&gt;
      &lt;th&gt;compounding&lt;/th&gt;
      &lt;th&gt;yearly&lt;/th&gt;
      &lt;th&gt;monthly&lt;/th&gt;
      &lt;th&gt;daily&lt;/th&gt;
      &lt;th&gt;continuous&lt;/th&gt;
    &lt;/tr&gt;
  &lt;/thead&gt;
  &lt;tbody&gt;
    &lt;tr&gt;
      &lt;td&gt;amount&lt;/td&gt;
      &lt;td&gt;1.1&lt;/td&gt;
      &lt;td&gt;1.104713&lt;/td&gt;
      &lt;td&gt;1.105156&lt;/td&gt;
      &lt;td&gt;$e^{0.1}\approx1.105171$&lt;/td&gt;
    &lt;/tr&gt;
  &lt;/tbody&gt;
&lt;/table&gt;

&lt;p&gt;More frequent compounding pays more, but the gain is capped by $e^r$.&lt;/p&gt;

&lt;h2 id=&quot;exercises&quot;&gt;Exercises&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Basic.&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;Compute $\lim_{x\to0}\dfrac{\tan 2x}{x}$.&lt;/li&gt;
  &lt;li&gt;Compute $\lim_{x\to\infty}\left(1-\dfrac3x\right)^x$.&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Answers&lt;/summary&gt;

  &lt;ol&gt;
    &lt;li&gt;$2$.&lt;/li&gt;
    &lt;li&gt;$e^{-3}$.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;p&gt;&lt;strong&gt;Intermediate.&lt;/strong&gt;&lt;/p&gt;

&lt;ol start=&quot;3&quot;&gt;
  &lt;li&gt;Compute $\lim_{x\to0}\dfrac{\sqrt{1+x}-1}{\sin x}$.&lt;/li&gt;
  &lt;li&gt;Compute $\lim_{x\to0}(1+\sin x)^{1/x}$.&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Answers&lt;/summary&gt;

  &lt;ol start=&quot;3&quot;&gt;
    &lt;li&gt;$\sqrt{1+x}-1\sim\tfrac x2$ and $\sin x\sim x$, so the limit is $\tfrac12$.&lt;/li&gt;
    &lt;li&gt;The logarithm of the expression is $\dfrac{\ln(1+\sin x)}x\sim\dfrac{\sin x}x\to1$, so the limit is $e$.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;p&gt;&lt;strong&gt;Advanced.&lt;/strong&gt;&lt;/p&gt;

&lt;ol start=&quot;5&quot;&gt;
  &lt;li&gt;Compute $\lim_{x\to0}\dfrac{x-\sin x}{x^3}$ using $\sin x=3\sin\tfrac x3-4\sin^3\tfrac x3$. (The answer is checked again with Taylor series in chapter 8.)&lt;/li&gt;
  &lt;li&gt;Prove: if $\alpha\sim\beta$ as $x\to a$ then $\alpha-\beta=o(\beta)$.&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Hints&lt;/summary&gt;

  &lt;ol start=&quot;5&quot;&gt;
    &lt;li&gt;Assume the limit $L$ exists. Write $x-\sin x=3\left(\tfrac x3-\sin\tfrac x3\right)+4\sin^3\tfrac x3$ and divide by $x^3$: the first term tends to $\tfrac L9$, the second to $\tfrac4{27}$. So $L=\tfrac L9+\tfrac4{27}$, i.e. $L=\tfrac16$.&lt;/li&gt;
    &lt;li&gt;$\dfrac{\alpha-\beta}\beta=\dfrac\alpha\beta-1\to0$.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;h2 id=&quot;summary&quot;&gt;Summary&lt;/h2&gt;

&lt;div class=&quot;content-box summary-box textbook-block&quot;&gt;
  &lt;ul&gt;
    &lt;li&gt;$\dfrac{\sin x}x\to1$ (squeezed by areas), $\left(1+\tfrac1x\right)^x\to e$, $\dfrac{\ln(1+x)}x\to1$, $\dfrac{e^x-1}x\to1$.&lt;/li&gt;
    &lt;li&gt;Equivalent infinitesimals: $\sin x\sim\tan x\sim\ln(1+x)\sim e^x-1\sim x$, $1-\cos x\sim\tfrac{x^2}2$.&lt;/li&gt;
    &lt;li&gt;Replace equivalents in products and quotients; never in sums or differences.&lt;/li&gt;
    &lt;li&gt;$1^\infty$ forms: reduce to $\left(1+\tfrac ax\right)^x\to e^a$, or take $\ln$.&lt;/li&gt;
  &lt;/ul&gt;
&lt;/div&gt;
</content>
 </entry>
 
 <entry>
   <title>Limit laws, one-sided limits and limits at infinity</title>
   <link href="https://calculus-self-learning.pages.dev/contents/en/chapter01/01_03_Limit_laws_one_sided_limits_and_limits_at_infinity/"/>
   <updated>2026-12-01T00:00:00+00:00</updated>
   <id>https://calculus-self-learning.pages.dev/contents/en/chapter01/01_03_Limit_laws_one_sided_limits_and_limits_at_infinity</id>
   <content type="html">&lt;div class=&quot;textbook-objectives&quot;&gt;

  &lt;p&gt;&lt;strong&gt;Learning objectives.&lt;/strong&gt; After this lesson you can:&lt;/p&gt;

  &lt;ul&gt;
    &lt;li&gt;compute limits with the sum, product and quotient rules without going back to ε–δ;&lt;/li&gt;
    &lt;li&gt;remove a $\tfrac00$ form by factoring or multiplying by a conjugate;&lt;/li&gt;
    &lt;li&gt;use the squeeze theorem for a bounded function times an infinitesimal;&lt;/li&gt;
    &lt;li&gt;compute one-sided limits and limits at infinity, and find vertical and horizontal asymptotes.&lt;/li&gt;
  &lt;/ul&gt;

&lt;/div&gt;

&lt;h2 id=&quot;why-this-lesson&quot;&gt;Why this lesson&lt;/h2&gt;

&lt;p&gt;A skydiver falls with velocity $v(t)=\dfrac{mg}{k}\left(1-e^{-kt/m}\right)$ when air resistance is proportional to velocity. With $m=70$ kg, $g=9.8$ m/s², $k=14$ kg/s, what velocity does she approach for large $t$? We need $\lim_{t\to\infty}v(t)$. Writing an ε–δ proof for every such limit would be far too long. This lesson gives rules for computing quickly.&lt;/p&gt;

&lt;h2 id=&quot;the-basic-rules&quot;&gt;The basic rules&lt;/h2&gt;

&lt;div class=&quot;textbook-theorem&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Theorem 1 (Limit laws).&lt;/strong&gt; Suppose $\lim_{x\to a}f(x)=L$ and $\lim_{x\to a}g(x)=M$. Then&lt;/p&gt;

  &lt;ol&gt;
    &lt;li&gt;$\lim_{x\to a}\big(f(x)\pm g(x)\big)=L\pm M$;&lt;/li&gt;
    &lt;li&gt;$\lim_{x\to a}c\,f(x)=cL$;&lt;/li&gt;
    &lt;li&gt;$\lim_{x\to a}f(x)g(x)=LM$;&lt;/li&gt;
    &lt;li&gt;$\lim_{x\to a}\dfrac{f(x)}{g(x)}=\dfrac LM$ if $M\ne0$.&lt;/li&gt;
  &lt;/ol&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-proof&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Proof (sum rule).&lt;/strong&gt; Let $\varepsilon&amp;gt;0$. There is $\delta_1$ with $0&amp;lt;\lvert x-a\rvert&amp;lt;\delta_1\Rightarrow\lvert f(x)-L\rvert&amp;lt;\tfrac\varepsilon2$ and $\delta_2$ with $0&amp;lt;\lvert x-a\rvert&amp;lt;\delta_2\Rightarrow\lvert g(x)-M\rvert&amp;lt;\tfrac\varepsilon2$. For $\delta=\min(\delta_1,\delta_2)$ and $0&amp;lt;\lvert x-a\rvert&amp;lt;\delta$:&lt;/p&gt;

\[\lvert(f+g)(x)-(L+M)\rvert\le\lvert f(x)-L\rvert+\lvert g(x)-M\rvert&amp;lt;\varepsilon .\]

  &lt;p&gt;The product and quotient rules are proved similarly, using $fg-LM=f(g-M)+M(f-L)$ and the fact that $f$ is bounded near $a$.&lt;/p&gt;
&lt;/div&gt;

&lt;p&gt;Consequence: for a polynomial $p$, $\lim_{x\to a}p(x)=p(a)$; for a rational function $\tfrac pq$ with $q(a)\ne0$, the limit is $\tfrac{p(a)}{q(a)}$. You may substitute directly. Only when substitution gives $\tfrac00$ do you need to transform.&lt;/p&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Example 1.&lt;/strong&gt; Compute $\lim_{x\to2}\dfrac{x^3-8}{x^2-4}$.&lt;/p&gt;

  &lt;p&gt;Substituting $x=2$ gives $\tfrac00$. Factor: $x^3-8=(x-2)(x^2+2x+4)$, $x^2-4=(x-2)(x+2)$. For $x\ne2$:&lt;/p&gt;

\[\frac{x^3-8}{x^2-4}=\frac{x^2+2x+4}{x+2}\ \xrightarrow{x\to2}\ \frac{12}{4}=3 .\]

&lt;/div&gt;

&lt;h2 id=&quot;the-squeeze-theorem&quot;&gt;The squeeze theorem&lt;/h2&gt;

&lt;div class=&quot;textbook-theorem&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Theorem 2 (Squeeze theorem).&lt;/strong&gt; Suppose $g(x)\le f(x)\le h(x)$ for all $x\ne a$ near $a$, and $\lim_{x\to a}g(x)=\lim_{x\to a}h(x)=L$. Then $\lim_{x\to a}f(x)=L$.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-proof&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Proof.&lt;/strong&gt; Let $\varepsilon&amp;gt;0$. Choose $\delta&amp;gt;0$ small enough that for $0&amp;lt;\lvert x-a\rvert&amp;lt;\delta$ the squeeze inequalities hold, $L-\varepsilon&amp;lt;g(x)$, and $h(x)&amp;lt;L+\varepsilon$. Then $L-\varepsilon&amp;lt;g(x)\le f(x)\le h(x)&amp;lt;L+\varepsilon$, i.e. $\lvert f(x)-L\rvert&amp;lt;\varepsilon$.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Example 2.&lt;/strong&gt; Compute $\lim_{x\to0}x^2\sin\dfrac1x$.&lt;/p&gt;

  &lt;p&gt;The product rule does not apply, since $\sin\tfrac1x$ has no limit. But $-1\le\sin\tfrac1x\le1$, so $-x^2\le x^2\sin\tfrac1x\le x^2$. Both bounds tend to 0, so the limit is 0. General pattern: a bounded function times a function tending to 0 tends to 0.&lt;/p&gt;
&lt;/div&gt;

&lt;h2 id=&quot;one-sided-limits&quot;&gt;One-sided limits&lt;/h2&gt;

&lt;div class=&quot;textbook-definition&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Definition 1 (Right and left limits).&lt;/strong&gt; $\lim_{x\to a^+}f(x)=L$ if for every $\varepsilon&amp;gt;0$ there is $\delta&amp;gt;0$ with $a&amp;lt;x&amp;lt;a+\delta\Rightarrow\lvert f(x)-L\rvert&amp;lt;\varepsilon$. The left limit $\lim_{x\to a^-}$ is defined the same way with $a-\delta&amp;lt;x&amp;lt;a$.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-theorem&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Theorem 3.&lt;/strong&gt; $\lim_{x\to a}f(x)=L$ if and only if both one-sided limits exist and equal $L$.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Example 3.&lt;/strong&gt; Let $f(x)=x^2$ for $x&amp;lt;1$ and $f(x)=3-2x$ for $x\ge1$. Then $\lim_{x\to1^-}f(x)=1$ and $\lim_{x\to1^+}f(x)=1$, so $\lim_{x\to1}f(x)=1$. If the right branch were $3-x$ instead, the right limit would be 2, different from the left limit, and there would be no limit at 1.&lt;/p&gt;
&lt;/div&gt;

&lt;h2 id=&quot;limits-at-infinity-and-asymptotes&quot;&gt;Limits at infinity and asymptotes&lt;/h2&gt;

&lt;p&gt;$\lim_{x\to\infty}f(x)=L$ means: for every $\varepsilon&amp;gt;0$ there is $N$ with $x&amp;gt;N\Rightarrow\lvert f(x)-L\rvert&amp;lt;\varepsilon$. The line $y=L$ is then a &lt;em&gt;horizontal asymptote&lt;/em&gt;. If $f(x)\to\pm\infty$ as $x\to a^+$ or $x\to a^-$, the line $x=a$ is a &lt;em&gt;vertical asymptote&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;Technique for rational functions: divide numerator and denominator by the highest power in the denominator and use $\tfrac1{x^k}\to0$.&lt;/p&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Example 4.&lt;/strong&gt;&lt;/p&gt;

  &lt;ul&gt;
    &lt;li&gt;$\lim_{x\to\infty}\dfrac{3x^2-x}{2x^2+5}=\lim_{x\to\infty}\dfrac{3-1/x}{2+5/x^2}=\dfrac32$.&lt;/li&gt;
    &lt;li&gt;$f(x)=\dfrac{2x+1}{x-1}$ has horizontal asymptote $y=2$ (since $\tfrac{2+1/x}{1-1/x}\to2$) and vertical asymptote $x=1$: as $x\to1^+$ the numerator $\to3$ and the denominator $\to0^+$, so $f\to+\infty$; as $x\to1^-$, $f\to-\infty$.&lt;/li&gt;
    &lt;li&gt;$\lim_{x\to\infty}\left(\sqrt{x^2+x}-x\right)$ has the form $\infty-\infty$. Multiply by the conjugate:&lt;/li&gt;
  &lt;/ul&gt;

\[\sqrt{x^2+x}-x=\frac{x}{\sqrt{x^2+x}+x}=\frac{1}{\sqrt{1+1/x}+1}\to\frac12 .\]

&lt;/div&gt;

&lt;h2 id=&quot;applications&quot;&gt;Applications&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Physics: terminal velocity.&lt;/strong&gt; Since $e^{-kt/m}\to0$ as $t\to\infty$, $\lim_{t\to\infty}v(t)=\dfrac{mg}{k}=\dfrac{70\cdot9.8}{14}=49$ m/s (about 176 km/h). The line $v=49$ is a horizontal asymptote of the velocity graph.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Economics: long-run average cost.&lt;/strong&gt; A workshop has fixed cost 5000 (thousand VND) and variable cost 20 per item. Average cost is $\bar C(q)=\dfrac{5000+20q}{q}=20+\dfrac{5000}q$. As $q\to\infty$, $\bar C\to20$: the more you produce, the smaller the share of fixed cost per item, but the average never drops below the variable cost.&lt;/p&gt;

&lt;h2 id=&quot;exercises&quot;&gt;Exercises&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Basic.&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;Compute $\lim_{x\to-1}\dfrac{x^2+3x+2}{x+1}$.&lt;/li&gt;
  &lt;li&gt;Compute $\lim_{x\to\infty}\dfrac{5x^3-2}{x^3+4x}$.&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Answers&lt;/summary&gt;

  &lt;ol&gt;
    &lt;li&gt;$\dfrac{(x+1)(x+2)}{x+1}=x+2\to1$.&lt;/li&gt;
    &lt;li&gt;$5$.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;p&gt;&lt;strong&gt;Intermediate.&lt;/strong&gt;&lt;/p&gt;

&lt;ol start=&quot;3&quot;&gt;
  &lt;li&gt;Compute $\lim_{x\to0}\dfrac{\sqrt{1+x}-\sqrt{1-x}}{x}$.&lt;/li&gt;
  &lt;li&gt;Find the asymptotes of $f(x)=\dfrac{x^2}{x^2-4}$.&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Answers&lt;/summary&gt;

  &lt;ol start=&quot;3&quot;&gt;
    &lt;li&gt;Multiply by the conjugate: $\dfrac{2x}{x(\sqrt{1+x}+\sqrt{1-x})}\to\dfrac22=1$.&lt;/li&gt;
    &lt;li&gt;Horizontal asymptote $y=1$; vertical asymptotes $x=2$ and $x=-2$.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;p&gt;&lt;strong&gt;Advanced.&lt;/strong&gt;&lt;/p&gt;

&lt;ol start=&quot;5&quot;&gt;
  &lt;li&gt;Compute $\lim_{x\to\infty}\dfrac{\sin x}{x}$ and explain why it does not contradict $\lim_{x\to0}\dfrac{\sin x}x=1$.&lt;/li&gt;
  &lt;li&gt;Prove the product rule in Theorem 1. Hint: first show that $f$ is bounded near $a$.&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Hints&lt;/summary&gt;

  &lt;ol start=&quot;5&quot;&gt;
    &lt;li&gt;$\left\lvert\tfrac{\sin x}x\right\rvert\le\tfrac1x\to0$, so the limit is 0. The two limits are taken at different places ($x\to\infty$ and $x\to0$).&lt;/li&gt;
    &lt;li&gt;With $\varepsilon=1$, near $a$ we have $\lvert f(x)\rvert&amp;lt;\lvert L\rvert+1$. Then $\lvert fg-LM\rvert\le\lvert f\rvert\,\lvert g-M\rvert+\lvert M\rvert\,\lvert f-L\rvert$.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;h2 id=&quot;summary&quot;&gt;Summary&lt;/h2&gt;

&lt;div class=&quot;content-box summary-box textbook-block&quot;&gt;
  &lt;ul&gt;
    &lt;li&gt;The limit of a sum, product or quotient is the sum, product or quotient of the limits (nonzero denominator). For polynomials and rational functions, substitute unless you get $\tfrac00$.&lt;/li&gt;
    &lt;li&gt;$\tfrac00$: factor or multiply by a conjugate. $\infty-\infty$ with roots: multiply by a conjugate.&lt;/li&gt;
    &lt;li&gt;Squeeze theorem: a bounded function times a function tending to 0 tends to 0.&lt;/li&gt;
    &lt;li&gt;A limit exists iff the two one-sided limits are equal. Horizontal asymptote: limit at infinity; vertical asymptote: the function tends to $\pm\infty$.&lt;/li&gt;
  &lt;/ul&gt;
&lt;/div&gt;
</content>
 </entry>
 
 <entry>
   <title>The ε–δ definition of a limit</title>
   <link href="https://calculus-self-learning.pages.dev/contents/en/chapter01/01_02_The_epsilon_delta_definition/"/>
   <updated>2026-12-01T00:00:00+00:00</updated>
   <id>https://calculus-self-learning.pages.dev/contents/en/chapter01/01_02_The_epsilon_delta_definition</id>
   <content type="html">&lt;div class=&quot;textbook-objectives&quot;&gt;

  &lt;p&gt;&lt;strong&gt;Learning objectives.&lt;/strong&gt; After this lesson you can:&lt;/p&gt;

  &lt;ul&gt;
    &lt;li&gt;state the ε–δ definition of $\lim_{x\to a}f(x)=L$ and explain it with horizontal and vertical bands;&lt;/li&gt;
    &lt;li&gt;prove limits of linear, quadratic and simple rational functions by choosing δ in terms of ε;&lt;/li&gt;
    &lt;li&gt;prove that a limit, if it exists, is unique;&lt;/li&gt;
    &lt;li&gt;prove that a limit does not exist by negating the definition.&lt;/li&gt;
  &lt;/ul&gt;

&lt;/div&gt;

&lt;h2 id=&quot;why-this-lesson&quot;&gt;Why this lesson&lt;/h2&gt;

&lt;p&gt;A PT100 temperature sensor has resistance $R(T)=100(1+0.00385\,T)$ ohms at temperature $T$ (°C). A measuring circuit needs $R$ to be within $0.1\,\Omega$ of $R(25)$. How tightly must the temperature be held around 25°C?&lt;/p&gt;

\[\lvert R(T)-R(25)\rvert=0.385\,\lvert T-25\rvert&amp;lt;0.1\iff\lvert T-25\rvert&amp;lt;\frac{0.1}{0.385}\approx0.26 .\]

&lt;p&gt;The allowed output error is $\varepsilon=0.1$; the input tolerance found is $\delta\approx0.26$. The definition of a limit demands that this can be done for &lt;em&gt;every&lt;/em&gt; $\varepsilon&amp;gt;0$, however small.&lt;/p&gt;

&lt;h2 id=&quot;the-definition&quot;&gt;The definition&lt;/h2&gt;

&lt;div class=&quot;textbook-definition&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Definition 1 (Limit).&lt;/strong&gt; Let $f$ be defined on an open interval containing $a$, except possibly at $a$. We say $f$ has limit $L$ as $x$ tends to $a$, written $\lim_{x\to a}f(x)=L$, if&lt;/p&gt;

\[\forall\varepsilon&amp;gt;0\ \ \exists\delta&amp;gt;0\ \ \forall x:\quad 0&amp;lt;\lvert x-a\rvert&amp;lt;\delta\ \Rightarrow\ \lvert f(x)-L\rvert&amp;lt;\varepsilon .\]

&lt;/div&gt;

&lt;p&gt;Picture: draw the horizontal band $(L-\varepsilon,L+\varepsilon)$ around $L$. You must find a vertical band $(a-\delta,a+\delta)$ around $a$ such that the part of the graph inside the vertical band (excluding $x=a$) lies entirely inside the horizontal band. An opponent picks $\varepsilon$; you answer with $\delta$. The condition $0&amp;lt;\lvert x-a\rvert$ removes the point $x=a$, matching “we don’t care about $f(a)$”.&lt;/p&gt;

&lt;h2 id=&quot;choosing-δ-in-terms-of-ε&quot;&gt;Choosing δ in terms of ε&lt;/h2&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Example 1.&lt;/strong&gt; Prove $\lim_{x\to3}(2x+1)=7$.&lt;/p&gt;

  &lt;p&gt;&lt;em&gt;Scratch.&lt;/em&gt; $\lvert(2x+1)-7\rvert=2\lvert x-3\rvert$. To make this less than $\varepsilon$ we need $\lvert x-3\rvert&amp;lt;\varepsilon/2$.&lt;/p&gt;

  &lt;p&gt;&lt;em&gt;Proof.&lt;/em&gt; Let $\varepsilon&amp;gt;0$ and choose $\delta=\varepsilon/2$. If $0&amp;lt;\lvert x-3\rvert&amp;lt;\delta$ then $\lvert(2x+1)-7\rvert=2\lvert x-3\rvert&amp;lt;2\delta=\varepsilon$.&lt;/p&gt;

  &lt;p&gt;With $\varepsilon=0.01$: $\delta=0.005$. A linear function $mx+b$ ($m\ne0$) always allows $\delta=\varepsilon/\lvert m\rvert$: the steeper the line, the narrower the vertical band.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Example 2.&lt;/strong&gt; Prove $\lim_{x\to3}x^2=9$.&lt;/p&gt;

  &lt;p&gt;&lt;em&gt;Scratch.&lt;/em&gt; $\lvert x^2-9\rvert=\lvert x-3\rvert\,\lvert x+3\rvert$. The factor $\lvert x+3\rvert$ varies with $x$, so bound it first. If $\lvert x-3\rvert&amp;lt;1$ then $2&amp;lt;x&amp;lt;4$, so $\lvert x+3\rvert&amp;lt;7$. Then $\lvert x^2-9\rvert&amp;lt;7\lvert x-3\rvert$, and $\lvert x-3\rvert&amp;lt;\varepsilon/7$ suffices.&lt;/p&gt;

  &lt;p&gt;&lt;em&gt;Proof.&lt;/em&gt; Let $\varepsilon&amp;gt;0$ and choose $\delta=\min\left(1,\tfrac\varepsilon7\right)$. If $0&amp;lt;\lvert x-3\rvert&amp;lt;\delta$ then $\lvert x-3\rvert&amp;lt;1$, so $\lvert x+3\rvert&amp;lt;7$, and&lt;/p&gt;

\[\lvert x^2-9\rvert=\lvert x-3\rvert\,\lvert x+3\rvert&amp;lt;\frac{\varepsilon}7\cdot7=\varepsilon .\]

  &lt;p&gt;With $\varepsilon=0.01$: $\delta\approx0.00143$. Check $x=3.0014$: $x^2=9.00840196$, off by $0.0084&amp;lt;0.01$.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Example 3.&lt;/strong&gt; Prove $\lim_{x\to1}\dfrac{x^2-1}{x-1}=2$.&lt;/p&gt;

  &lt;p&gt;For $x\ne1$, $\dfrac{x^2-1}{x-1}-2=(x+1)-2=x-1$. Let $\varepsilon&amp;gt;0$ and choose $\delta=\varepsilon$. If $0&amp;lt;\lvert x-1\rvert&amp;lt;\delta$ then the error is $\lvert x-1\rvert&amp;lt;\varepsilon$. The condition $x\ne1$ (from $0&amp;lt;\lvert x-1\rvert$) is what allows the cancellation. This is also the proof of Theorem 1 of lesson 01_01 in this case.&lt;/p&gt;
&lt;/div&gt;

&lt;h2 id=&quot;uniqueness&quot;&gt;Uniqueness&lt;/h2&gt;

&lt;div class=&quot;textbook-theorem&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Theorem 1 (Limits are unique).&lt;/strong&gt; If $\lim_{x\to a}f(x)=L$ and $\lim_{x\to a}f(x)=M$ then $L=M$.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-proof&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Proof.&lt;/strong&gt; Suppose $L\ne M$. Let $\varepsilon=\tfrac{\lvert L-M\rvert}2&amp;gt;0$. There is $\delta_1$ with $0&amp;lt;\lvert x-a\rvert&amp;lt;\delta_1\Rightarrow\lvert f(x)-L\rvert&amp;lt;\varepsilon$, and $\delta_2$ with $0&amp;lt;\lvert x-a\rvert&amp;lt;\delta_2\Rightarrow\lvert f(x)-M\rvert&amp;lt;\varepsilon$. Take $x$ with $0&amp;lt;\lvert x-a\rvert&amp;lt;\min(\delta_1,\delta_2)$. By the triangle inequality,&lt;/p&gt;

\[\lvert L-M\rvert\le\lvert L-f(x)\rvert+\lvert f(x)-M\rvert&amp;lt;2\varepsilon=\lvert L-M\rvert,\]

  &lt;p&gt;a contradiction.&lt;/p&gt;
&lt;/div&gt;

&lt;h2 id=&quot;proving-that-a-limit-does-not-exist&quot;&gt;Proving that a limit does not exist&lt;/h2&gt;

&lt;p&gt;Negating Definition 1 (lesson 00_04): $\lim_{x\to a}f(x)\ne L$ when&lt;/p&gt;

\[\exists\varepsilon&amp;gt;0\ \ \forall\delta&amp;gt;0\ \ \exists x:\ 0&amp;lt;\lvert x-a\rvert&amp;lt;\delta\ \text{and}\ \lvert f(x)-L\rvert\ge\varepsilon .\]

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Example 4.&lt;/strong&gt; The sign function $\operatorname{sgn}x$ ($1$ for $x&amp;gt;0$, $-1$ for $x&amp;lt;0$, $0$ at $x=0$) has no limit at 0.&lt;/p&gt;

  &lt;p&gt;Suppose the limit were $L$. Take $\varepsilon=1$. For any $\delta&amp;gt;0$ the points $x=\pm\tfrac\delta2$ satisfy $0&amp;lt;\lvert x\rvert&amp;lt;\delta$ and have values $1$ and $-1$. If both were within 1 of $L$, then $2=\lvert1-(-1)\rvert\le\lvert1-L\rvert+\lvert L+1\rvert&amp;lt;2$, impossible. So at least one point has $\lvert f(x)-L\rvert\ge1$.&lt;/p&gt;
&lt;/div&gt;

&lt;h2 id=&quot;interactive&quot;&gt;Interactive&lt;/h2&gt;

&lt;div class=&quot;interactive-frame&quot;&gt;
  &lt;div class=&quot;interactive-frame-head&quot;&gt;
    &lt;div class=&quot;interactive-frame-title&quot;&gt;Finding δ for a given ε&lt;/div&gt;
    &lt;div class=&quot;interactive-frame-desc&quot;&gt;Shrink ε and watch the largest admissible δ.&lt;/div&gt;
  &lt;/div&gt;
  &lt;iframe src=&quot;/interactives/chapter01/epsilon-delta-en.html&quot; title=&quot;Finding δ for a given ε&quot; loading=&quot;lazy&quot; style=&quot;height: 760px;&quot;&gt;&lt;/iframe&gt;
  &lt;div class=&quot;interactive-frame-foot&quot;&gt;
    &lt;a href=&quot;/interactives/chapter01/epsilon-delta-en.html&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;Open the interactive in a new window&lt;/a&gt;
  &lt;/div&gt;
&lt;/div&gt;

&lt;h2 id=&quot;short-video&quot;&gt;Short video&lt;/h2&gt;

&lt;div class=&quot;reel-video&quot;&gt;
  &lt;video controls=&quot;&quot; playsinline=&quot;&quot; preload=&quot;metadata&quot; src=&quot;/public/videos/reels/epsilon-delta-game.mp4&quot;&gt;&lt;/video&gt;
  &lt;p class=&quot;reel-caption&quot;&gt;The ε–δ game for x² at 2: each round ε shrinks and δ follows; for a jump no δ wins (silent video, about 2 minutes).&lt;/p&gt;
&lt;/div&gt;

&lt;h2 id=&quot;applications&quot;&gt;Applications&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Measurement engineering.&lt;/strong&gt; The PT100 problem at the start is one step of proving $\lim_{T\to25}R(T)=R(25)$ with $\varepsilon=0.1$. Since $R$ is linear with slope $0.385$, we can always choose $\delta=\varepsilon/0.385$.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Machine learning: sensitivity of a model.&lt;/strong&gt; A model $f$ with $\lvert f(x)-f(y)\rvert\le K\lvert x-y\rvert$ (Lipschitz constant $K$) allows $\delta=\varepsilon/K$ for every $\varepsilon$. Research on the robustness of neural networks to input noise uses exactly this idea: if $K$ is small, small noise in an input image cannot change the output much.&lt;/p&gt;

&lt;h2 id=&quot;exercises&quot;&gt;Exercises&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Basic.&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;Prove $\lim_{x\to2}(5x-2)=8$. What is $\delta$ for $\varepsilon=0.1$?&lt;/li&gt;
  &lt;li&gt;Prove $\lim_{x\to a}c=c$ for a constant $c$.&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Answers&lt;/summary&gt;

  &lt;ol&gt;
    &lt;li&gt;$\lvert(5x-2)-8\rvert=5\lvert x-2\rvert$; choose $\delta=\varepsilon/5$. For $\varepsilon=0.1$: $\delta=0.02$.&lt;/li&gt;
    &lt;li&gt;$\lvert c-c\rvert=0&amp;lt;\varepsilon$ for every $x$; any $\delta$ works, e.g. $\delta=1$.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;p&gt;&lt;strong&gt;Intermediate.&lt;/strong&gt;&lt;/p&gt;

&lt;ol start=&quot;3&quot;&gt;
  &lt;li&gt;Prove $\lim_{x\to2}\dfrac1x=\dfrac12$.&lt;/li&gt;
  &lt;li&gt;Prove $\lim_{x\to-1}(x^2+x)=0$.&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Answers&lt;/summary&gt;

  &lt;ol start=&quot;3&quot;&gt;
    &lt;li&gt;$\left\lvert\tfrac1x-\tfrac12\right\rvert=\dfrac{\lvert x-2\rvert}{2\lvert x\rvert}$. If $\lvert x-2\rvert&amp;lt;1$ then $x&amp;gt;1$, so this is $&amp;lt;\tfrac12\lvert x-2\rvert$. Choose $\delta=\min(1,2\varepsilon)$.&lt;/li&gt;
    &lt;li&gt;$\lvert x^2+x\rvert=\lvert x+1\rvert\,\lvert x\rvert$. If $\lvert x+1\rvert&amp;lt;1$ then $\lvert x\rvert&amp;lt;2$. Choose $\delta=\min(1,\varepsilon/2)$.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;p&gt;&lt;strong&gt;Advanced.&lt;/strong&gt;&lt;/p&gt;

&lt;ol start=&quot;5&quot;&gt;
  &lt;li&gt;Prove $\lim_{x\to4}\sqrt x=2$.&lt;/li&gt;
  &lt;li&gt;Prove: if $\lim_{x\to a}f(x)=L&amp;gt;0$ then there is $\delta&amp;gt;0$ with $f(x)&amp;gt;\tfrac L2$ for all $0&amp;lt;\lvert x-a\rvert&amp;lt;\delta$ (sign preservation).&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Hints&lt;/summary&gt;

  &lt;ol start=&quot;5&quot;&gt;
    &lt;li&gt;$\lvert\sqrt x-2\rvert=\dfrac{\lvert x-4\rvert}{\sqrt x+2}\le\dfrac{\lvert x-4\rvert}2$. Choose $\delta=\min(4,2\varepsilon)$ so that $x&amp;gt;0$.&lt;/li&gt;
    &lt;li&gt;Use the definition with $\varepsilon=\tfrac L2$: $f(x)&amp;gt;L-\tfrac L2$.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;h2 id=&quot;summary&quot;&gt;Summary&lt;/h2&gt;

&lt;div class=&quot;content-box summary-box textbook-block&quot;&gt;
  &lt;ul&gt;
    &lt;li&gt;$\lim_{x\to a}f(x)=L$: for every $\varepsilon&amp;gt;0$ there is $\delta&amp;gt;0$ with $0&amp;lt;\lvert x-a\rvert&amp;lt;\delta\Rightarrow\lvert f(x)-L\rvert&amp;lt;\varepsilon$.&lt;/li&gt;
    &lt;li&gt;Finding δ: write $\lvert f(x)-L\rvert=\lvert x-a\rvert\cdot(\text{factor})$, bound the factor by first assuming $\lvert x-a\rvert&amp;lt;1$, then take $\delta=\min(1,\dots)$.&lt;/li&gt;
    &lt;li&gt;Limits are unique. To prove a limit fails to exist, use the negation: one $\varepsilon$ for which every $\delta$ fails.&lt;/li&gt;
  &lt;/ul&gt;
&lt;/div&gt;
</content>
 </entry>
 
 <entry>
   <title>Limits of functions: intuition</title>
   <link href="https://calculus-self-learning.pages.dev/contents/en/chapter01/01_01_Limits_of_functions_intuition/"/>
   <updated>2026-12-01T00:00:00+00:00</updated>
   <id>https://calculus-self-learning.pages.dev/contents/en/chapter01/01_01_Limits_of_functions_intuition</id>
   <content type="html">&lt;div class=&quot;textbook-objectives&quot;&gt;

  &lt;p&gt;&lt;strong&gt;Learning objectives.&lt;/strong&gt; After this lesson you can:&lt;/p&gt;

  &lt;ul&gt;
    &lt;li&gt;estimate $\lim_{x\to a}f(x)$ from a table of values taken on both sides of $a$;&lt;/li&gt;
    &lt;li&gt;explain why the limit at $a$ does not depend on $f(a)$, even when $f(a)$ is undefined;&lt;/li&gt;
    &lt;li&gt;recognise three ways a limit can fail to exist: different one-sided values, blow-up, oscillation;&lt;/li&gt;
    &lt;li&gt;know when a table of values misleads you.&lt;/li&gt;
  &lt;/ul&gt;

&lt;/div&gt;

&lt;h2 id=&quot;why-this-lesson&quot;&gt;Why this lesson&lt;/h2&gt;

&lt;p&gt;A ball in free fall covers $s(t)=4.9t^2$ metres after $t$ seconds. Its average velocity from $t=2$ to $t=2+h$ is&lt;/p&gt;

\[\frac{s(2+h)-s(2)}{h}=\frac{4.9(4+4h+h^2)-19.6}{h}=19.6+4.9h .\]

&lt;table&gt;
  &lt;thead&gt;
    &lt;tr&gt;
      &lt;th&gt;$h$&lt;/th&gt;
      &lt;th&gt;0.1&lt;/th&gt;
      &lt;th&gt;0.01&lt;/th&gt;
      &lt;th&gt;0.001&lt;/th&gt;
    &lt;/tr&gt;
  &lt;/thead&gt;
  &lt;tbody&gt;
    &lt;tr&gt;
      &lt;td&gt;average velocity (m/s)&lt;/td&gt;
      &lt;td&gt;20.09&lt;/td&gt;
      &lt;td&gt;19.649&lt;/td&gt;
      &lt;td&gt;19.6049&lt;/td&gt;
    &lt;/tr&gt;
  &lt;/tbody&gt;
&lt;/table&gt;

&lt;p&gt;You cannot set $h=0$, since dividing by 0 is meaningless. But as $h$ shrinks the result gets closer to 19.6. We say the &lt;em&gt;instantaneous&lt;/em&gt; velocity at $t=2$ is $19.6$ m/s and write $\lim_{h\to0}(19.6+4.9h)=19.6$. All of chapter 2 on derivatives rests on this idea.&lt;/p&gt;

&lt;h2 id=&quot;limits-the-idea&quot;&gt;Limits: the idea&lt;/h2&gt;

&lt;div class=&quot;textbook-definition&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Definition 1 (Limit, intuitive form).&lt;/strong&gt; Let $f$ be defined near $a$ (possibly not at $a$ itself). We write&lt;/p&gt;

\[\lim_{x\to a}f(x)=L\]

  &lt;p&gt;if $f(x)$ is as close to $L$ as we like whenever $x$ is close enough to $a$ and $x\ne a$.&lt;/p&gt;
&lt;/div&gt;

&lt;p&gt;“As close as we like” and “close enough” are made precise with ε and δ in the next lesson. Two points to remember now:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;only $x\ne a$ matter, so the value $f(a)$ (if any) has no effect on the limit;&lt;/li&gt;
  &lt;li&gt;$x$ approaches $a$ from both sides.&lt;/li&gt;
&lt;/ul&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Example 1.&lt;/strong&gt; Estimate $\lim_{x\to1}\dfrac{x^2-1}{x-1}$.&lt;/p&gt;

  &lt;p&gt;The function is undefined at $x=1$. Table:&lt;/p&gt;

  &lt;table&gt;
    &lt;thead&gt;
      &lt;tr&gt;
        &lt;th&gt;$x$&lt;/th&gt;
        &lt;th&gt;0.9&lt;/th&gt;
        &lt;th&gt;0.99&lt;/th&gt;
        &lt;th&gt;0.999&lt;/th&gt;
        &lt;th&gt;1.001&lt;/th&gt;
        &lt;th&gt;1.01&lt;/th&gt;
        &lt;th&gt;1.1&lt;/th&gt;
      &lt;/tr&gt;
    &lt;/thead&gt;
    &lt;tbody&gt;
      &lt;tr&gt;
        &lt;td&gt;$f(x)$&lt;/td&gt;
        &lt;td&gt;1.9&lt;/td&gt;
        &lt;td&gt;1.99&lt;/td&gt;
        &lt;td&gt;1.999&lt;/td&gt;
        &lt;td&gt;2.001&lt;/td&gt;
        &lt;td&gt;2.01&lt;/td&gt;
        &lt;td&gt;2.1&lt;/td&gt;
      &lt;/tr&gt;
    &lt;/tbody&gt;
  &lt;/table&gt;

  &lt;p&gt;The limit is 2. Reason: for $x\ne1$, $\dfrac{x^2-1}{x-1}=\dfrac{(x-1)(x+1)}{x-1}=x+1$. The graph is the line $y=x+1$ with a hole at $(1,2)$.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-theorem&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Theorem 1 (Limits depend only on nearby values).&lt;/strong&gt; If $f(x)=g(x)$ for all $x\ne a$ in an interval containing $a$, and $\lim_{x\to a}g(x)=L$, then $\lim_{x\to a}f(x)=L$.&lt;/p&gt;
&lt;/div&gt;

&lt;p&gt;This is immediate from Definition 1, which only looks at $x\ne a$. Lesson 01_02 proves it with ε–δ. It justifies the “simplify, then substitute” step in Example 1.&lt;/p&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Example 2.&lt;/strong&gt; Estimate $\lim_{x\to0}\dfrac{\sin x}{x}$ ($x$ in radians).&lt;/p&gt;

  &lt;table&gt;
    &lt;thead&gt;
      &lt;tr&gt;
        &lt;th&gt;$x$&lt;/th&gt;
        &lt;th&gt;0.1&lt;/th&gt;
        &lt;th&gt;0.01&lt;/th&gt;
        &lt;th&gt;0.001&lt;/th&gt;
      &lt;/tr&gt;
    &lt;/thead&gt;
    &lt;tbody&gt;
      &lt;tr&gt;
        &lt;td&gt;$\dfrac{\sin x}{x}$&lt;/td&gt;
        &lt;td&gt;0.998334&lt;/td&gt;
        &lt;td&gt;0.999983&lt;/td&gt;
        &lt;td&gt;0.9999998&lt;/td&gt;
      &lt;/tr&gt;
    &lt;/tbody&gt;
  &lt;/table&gt;

  &lt;p&gt;The function is even, so negative $x$ give the same values. The limit looks like 1. A table is not a proof; lesson 01_04 proves it with the squeeze theorem.&lt;/p&gt;
&lt;/div&gt;

&lt;h2 id=&quot;when-a-limit-does-not-exist&quot;&gt;When a limit does not exist&lt;/h2&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Example 3.&lt;/strong&gt; These three functions have no limit at $0$.&lt;/p&gt;

  &lt;ol&gt;
    &lt;li&gt;$f(x)=\dfrac{\lvert x\rvert}{x}$: equals $1$ for $x&amp;gt;0$ and $-1$ for $x&amp;lt;0$. The two sides approach different numbers.&lt;/li&gt;
    &lt;li&gt;$f(x)=\dfrac1{x^2}$: as $x\to0$, $f(x)$ grows without bound ($x=0.01$ gives $10\,000$). We write $\lim_{x\to0}\tfrac1{x^2}=+\infty$, but that means “grows without bound”, not a finite limit.&lt;/li&gt;
    &lt;li&gt;$f(x)=\sin\dfrac{\pi}{x}$: at $x=\tfrac1n$ the value is $\sin(n\pi)=0$; at $x=\tfrac2{4n+1}$ it is $\sin\left(\tfrac{(4n+1)\pi}2\right)=1$. Both sequences of points tend to 0, but the values keep jumping between 0 and 1.&lt;/li&gt;
  &lt;/ol&gt;
&lt;/div&gt;

&lt;div class=&quot;content-box warning-box textbook-block&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Caution: tables can mislead.&lt;/strong&gt; For $f(x)=\sin\tfrac\pi x$, trying only $x=0.1,\ 0.01,\ 0.001$ gives $0$ every time, and you would wrongly guess the limit is 0. A table is only a hint. Conclusions must come from algebra or the definition.&lt;/p&gt;
&lt;/div&gt;

&lt;h2 id=&quot;interactive&quot;&gt;Interactive&lt;/h2&gt;

&lt;div class=&quot;interactive-frame&quot;&gt;
  &lt;div class=&quot;interactive-frame-head&quot;&gt;
    &lt;div class=&quot;interactive-frame-title&quot;&gt;A table of values approaching a&lt;/div&gt;
    &lt;div class=&quot;interactive-frame-desc&quot;&gt;Pick a function and watch f(x) as x approaches a from both sides.&lt;/div&gt;
  &lt;/div&gt;
  &lt;iframe src=&quot;/interactives/chapter01/limit-table-en.html&quot; title=&quot;A table of values approaching a&quot; loading=&quot;lazy&quot; style=&quot;height: 640px;&quot;&gt;&lt;/iframe&gt;
  &lt;div class=&quot;interactive-frame-foot&quot;&gt;
    &lt;a href=&quot;/interactives/chapter01/limit-table-en.html&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;Open the interactive in a new window&lt;/a&gt;
  &lt;/div&gt;
&lt;/div&gt;

&lt;h2 id=&quot;applications&quot;&gt;Applications&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Physics: instantaneous velocity.&lt;/strong&gt; Done at the start: instantaneous velocity is the limit of average velocity as the time interval shrinks to 0.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Scientific computing: cancellation when subtracting nearly equal numbers.&lt;/strong&gt; We know (lesson 01_04) that $\lim_{x\to0}\dfrac{1-\cos x}{x^2}=\tfrac12$. But in 64-bit floating point, computing it directly at $x=10^{-8}$ gives $0$: the machine rounds $\cos(10^{-8})$ to exactly $1$, so the numerator is 0. Rewriting $1-\cos x=2\sin^2\tfrac x2$ gives $0.5$. A table computed by machine is trustworthy only if the formula does not subtract nearly equal numbers.&lt;/p&gt;

&lt;h2 id=&quot;exercises&quot;&gt;Exercises&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Basic.&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;Use $x=\pm0.1,\ \pm0.01,\ \pm0.001$ to estimate $\lim_{x\to0}\dfrac{\sqrt{x+9}-3}{x}$.&lt;/li&gt;
  &lt;li&gt;Compute $\lim_{x\to3}\dfrac{x^2-9}{x-3}$ by simplifying.&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Answers&lt;/summary&gt;

  &lt;ol&gt;
    &lt;li&gt;$x=0.001$ gives $0.166662$. The limit is $\tfrac16\approx0.1667$. Multiply by the conjugate: $\dfrac{\sqrt{x+9}-3}{x}=\dfrac{1}{\sqrt{x+9}+3}\to\dfrac16$.&lt;/li&gt;
    &lt;li&gt;$x+3\to6$.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;p&gt;&lt;strong&gt;Intermediate.&lt;/strong&gt;&lt;/p&gt;

&lt;ol start=&quot;3&quot;&gt;
  &lt;li&gt;Estimate $\lim_{x\to0}\dfrac{2^x-1}{x}$ with a table and compare with $\ln2$.&lt;/li&gt;
  &lt;li&gt;Let $f(x)=x^2$ for $x\ne2$ and $f(2)=10$. Find $\lim_{x\to2}f(x)$ and $f(2)$.&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Answers&lt;/summary&gt;

  &lt;ol start=&quot;3&quot;&gt;
    &lt;li&gt;$x=0.001$ gives $0.69339$; the limit is $\ln2\approx0.69315$.&lt;/li&gt;
    &lt;li&gt;The limit is 4, while $f(2)=10$. The limit ignores the value at the point.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;p&gt;&lt;strong&gt;Advanced.&lt;/strong&gt;&lt;/p&gt;

&lt;ol start=&quot;5&quot;&gt;
  &lt;li&gt;Show that $\lim_{x\to0}\cos\dfrac1x$ does not exist by choosing two sequences $x_n\to0$ giving different values.&lt;/li&gt;
  &lt;li&gt;A table with $x=10^{-1},\dots,10^{-6}$ shows $\dfrac{1-\cos x}{x^2}$ near $0.5$. Why does a computer give $0$ at $x=10^{-9}$? Propose a stable formula.&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Hints&lt;/summary&gt;

  &lt;ol start=&quot;5&quot;&gt;
    &lt;li&gt;$x_n=\tfrac1{2n\pi}$ gives $\cos=1$; $x_n=\tfrac1{(2n+1)\pi}$ gives $\cos=-1$.&lt;/li&gt;
    &lt;li&gt;$\cos(10^{-9})=1-5\cdot10^{-19}$, below the roughly $10^{-16}$ precision of 64-bit numbers, so it rounds to 1. Use $\dfrac{2\sin^2(x/2)}{x^2}$.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;h2 id=&quot;summary&quot;&gt;Summary&lt;/h2&gt;

&lt;div class=&quot;content-box summary-box textbook-block&quot;&gt;
  &lt;ul&gt;
    &lt;li&gt;$\lim_{x\to a}f(x)=L$: $f(x)$ is near $L$ when $x$ is near $a$, $x\ne a$. The value $f(a)$ does not matter.&lt;/li&gt;
    &lt;li&gt;Simplifying and then substituting is a valid way to compute limits (Theorem 1).&lt;/li&gt;
    &lt;li&gt;A limit fails to exist when the two sides differ, when the function grows without bound, or when it oscillates.&lt;/li&gt;
    &lt;li&gt;A table is only a hint and can be wrong because of oscillation or rounding.&lt;/li&gt;
  &lt;/ul&gt;
&lt;/div&gt;
</content>
 </entry>
 
 <entry>
   <title>The language of proofs in analysis</title>
   <link href="https://calculus-self-learning.pages.dev/contents/en/chapter00/00_04_The_language_of_proofs_in_analysis/"/>
   <updated>2026-12-01T00:00:00+00:00</updated>
   <id>https://calculus-self-learning.pages.dev/contents/en/chapter00/00_04_The_language_of_proofs_in_analysis</id>
   <content type="html">&lt;div class=&quot;textbook-objectives&quot;&gt;

  &lt;p&gt;&lt;strong&gt;Learning objectives.&lt;/strong&gt; After this lesson you can:&lt;/p&gt;

  &lt;ul&gt;
    &lt;li&gt;read and write statements with $\forall$ (for all) and $\exists$ (there exists), and see that the order of quantifiers changes the meaning;&lt;/li&gt;
    &lt;li&gt;negate a statement with several quantifiers mechanically and correctly;&lt;/li&gt;
    &lt;li&gt;prove statements by contrapositive, contradiction and induction;&lt;/li&gt;
    &lt;li&gt;write a short proof of the form “let $\varepsilon&amp;gt;0$, choose $\delta=\dots$”.&lt;/li&gt;
  &lt;/ul&gt;

&lt;/div&gt;

&lt;h2 id=&quot;why-this-lesson&quot;&gt;Why this lesson&lt;/h2&gt;

&lt;p&gt;Here is the definition of “the sequence $a_n$ converges to $L$” from chapter 7:&lt;/p&gt;

\[\forall\varepsilon&amp;gt;0\ \ \exists N\ \ \forall n\ge N:\quad \lvert a_n-L\rvert&amp;lt;\varepsilon .\]

&lt;p&gt;It has three quantifiers in a row. To prove that a sequence does &lt;em&gt;not&lt;/em&gt; converge, you must negate exactly this statement. Students lose most marks in chapters 1 and 7 by misreading or mis-negating statements like this, not by computing.&lt;/p&gt;

&lt;h2 id=&quot;quantifiers-and-their-order&quot;&gt;Quantifiers and their order&lt;/h2&gt;

&lt;div class=&quot;textbook-definition&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Definition 1 (Quantifiers).&lt;/strong&gt; Let $P(x)$ be a statement depending on a variable $x$ in a set $X$.&lt;/p&gt;

  &lt;ul&gt;
    &lt;li&gt;$\forall x\in X:\ P(x)$ means $P(x)$ is true for every $x$ in $X$.&lt;/li&gt;
    &lt;li&gt;$\exists x\in X:\ P(x)$ means at least one $x$ in $X$ makes $P(x)$ true.&lt;/li&gt;
  &lt;/ul&gt;
&lt;/div&gt;

&lt;p&gt;Order matters. Compare, for $x,y\in\mathbb{R}$:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;$\forall x\ \exists y:\ y&amp;gt;x$. True: given $x$, take $y=x+1$. Here $y$ may depend on $x$.&lt;/li&gt;
  &lt;li&gt;$\exists y\ \forall x:\ y&amp;gt;x$. False: no real number exceeds every real number.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;In the ε–δ definition, “$\forall\varepsilon\ \exists\delta$” lets $\delta$ depend on $\varepsilon$. That is why we write things like $\delta=\varepsilon/3$ or $\delta=\min(1,\varepsilon/5)$.&lt;/p&gt;

&lt;h2 id=&quot;negation&quot;&gt;Negation&lt;/h2&gt;

&lt;div class=&quot;textbook-theorem&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Theorem 1 (Negation rules).&lt;/strong&gt;&lt;/p&gt;

\[\neg\big(\forall x:\ P(x)\big)\iff \exists x:\ \neg P(x),\qquad \neg\big(\exists x:\ P(x)\big)\iff \forall x:\ \neg P(x).\]

  &lt;p&gt;Also $\neg(P\wedge Q)\iff\neg P\vee\neg Q$, $\neg(P\vee Q)\iff\neg P\wedge\neg Q$, and $\neg(P\Rightarrow Q)\iff P\wedge\neg Q$.&lt;/p&gt;
&lt;/div&gt;

&lt;p&gt;Working rule: go from left to right, turn each $\forall$ into $\exists$ and each $\exists$ into $\forall$, then negate the final condition. The negation of $&amp;lt;$ is $\ge$.&lt;/p&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Example 1.&lt;/strong&gt; Negate “the sequence $a_n$ converges to $L$”:&lt;/p&gt;

\[\exists\varepsilon&amp;gt;0\ \ \forall N\ \ \exists n\ge N:\quad \lvert a_n-L\rvert\ge\varepsilon .\]

  &lt;p&gt;In words: there is an error $\varepsilon$ such that however far you go, some later term is at least $\varepsilon$ away from $L$.&lt;/p&gt;

  &lt;p&gt;Use it: $a_n=(-1)^n$ does not converge to 1. Take $\varepsilon=1$. Given any $N$, pick an odd $n\ge N$. Then $\lvert a_n-1\rvert=\lvert-1-1\rvert=2\ge1$.&lt;/p&gt;
&lt;/div&gt;

&lt;h2 id=&quot;contrapositive-and-contradiction&quot;&gt;Contrapositive and contradiction&lt;/h2&gt;

&lt;div class=&quot;textbook-lemma&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Lemma 1 (Contrapositive).&lt;/strong&gt; $P\Rightarrow Q$ is equivalent to $\neg Q\Rightarrow\neg P$.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-proof&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Proof.&lt;/strong&gt; $P\Rightarrow Q$ is false only when $P$ is true and $Q$ false. $\neg Q\Rightarrow\neg P$ is false only when $\neg Q$ is true and $\neg P$ false, i.e. again when $Q$ is false and $P$ true. The two statements fail in exactly the same case, so they are equivalent.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Example 2 (Contrapositive).&lt;/strong&gt; Prove: for an integer $n$, if $n^2$ is even then $n$ is even.&lt;/p&gt;

  &lt;p&gt;Prove the contrapositive: if $n$ is odd then $n^2$ is odd. Write $n=2k+1$; then $n^2=4k^2+4k+1=2(2k^2+2k)+1$ is odd.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-theorem&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Theorem 2.&lt;/strong&gt; $\sqrt2$ is irrational.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-proof&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Proof.&lt;/strong&gt; By contradiction. Suppose $\sqrt2=\tfrac pq$ with $p,q$ positive integers and the fraction in lowest terms. Squaring, $p^2=2q^2$, so $p^2$ is even, hence $p$ is even by Example 2, $p=2m$. Then $4m^2=2q^2$, i.e. $q^2=2m^2$, so $q$ is even too. Both $p$ and $q$ are even, contradicting lowest terms.&lt;/p&gt;
&lt;/div&gt;

&lt;h2 id=&quot;mathematical-induction&quot;&gt;Mathematical induction&lt;/h2&gt;

&lt;p&gt;To prove $P(n)$ for all $n\ge n_0$: check $P(n_0)$ (base case), then prove $P(n)\Rightarrow P(n+1)$ for all $n\ge n_0$ (inductive step).&lt;/p&gt;

&lt;div class=&quot;textbook-theorem&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Theorem 3 (Bernoulli’s inequality).&lt;/strong&gt; For $x\ge-1$ and every integer $n\ge1$,&lt;/p&gt;

\[(1+x)^n\ge1+nx .\]

&lt;/div&gt;

&lt;div class=&quot;textbook-proof&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Proof.&lt;/strong&gt; For $n=1$ both sides are equal. Assume $(1+x)^n\ge1+nx$. Since $1+x\ge0$, multiplying by $1+x$ keeps the direction:&lt;/p&gt;

\[(1+x)^{n+1}\ge(1+nx)(1+x)=1+(n+1)x+nx^2\ge1+(n+1)x .\]

  &lt;p&gt;So the inequality holds for $n+1$.&lt;/p&gt;
&lt;/div&gt;

&lt;p&gt;Bernoulli’s inequality is used in chapter 7 to prove $q^n\to0$ for $0&amp;lt;q&amp;lt;1$ and that $(1+1/n)^n$ is increasing.&lt;/p&gt;

&lt;h2 id=&quot;a-first-εδ-proof&quot;&gt;A first ε–δ proof&lt;/h2&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Example 3.&lt;/strong&gt; Prove: $\forall\varepsilon&amp;gt;0\ \exists\delta&amp;gt;0:\ \lvert x-2\rvert&amp;lt;\delta\Rightarrow\lvert 3x-6\rvert&amp;lt;\varepsilon$.&lt;/p&gt;

  &lt;p&gt;&lt;em&gt;Scratch work.&lt;/em&gt; We need $\lvert3x-6\rvert=3\lvert x-2\rvert&amp;lt;\varepsilon$, i.e. $\lvert x-2\rvert&amp;lt;\varepsilon/3$. So choose $\delta=\varepsilon/3$.&lt;/p&gt;

  &lt;p&gt;&lt;em&gt;Write-up.&lt;/em&gt; Let $\varepsilon&amp;gt;0$. Set $\delta=\varepsilon/3&amp;gt;0$. If $\lvert x-2\rvert&amp;lt;\delta$ then $\lvert3x-6\rvert=3\lvert x-2\rvert&amp;lt;3\delta=\varepsilon$.&lt;/p&gt;

  &lt;p&gt;With numbers: $\varepsilon=0.03$ gives $\delta=0.01$. Take $x=2.009$: $\lvert3x-6\rvert=0.027&amp;lt;0.03$.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;content-box insight-box textbook-block&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Remark.&lt;/strong&gt; An ε–δ proof always has two parts: scratch work (going backwards from the goal to find $\delta$) and the write-up (going forwards from the chosen $\delta$). The reader only needs the write-up, but the writer must do the scratch work first.&lt;/p&gt;
&lt;/div&gt;

&lt;h2 id=&quot;applications&quot;&gt;Applications&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Machine learning: one counterexample refutes a “for all”.&lt;/strong&gt; The claim “gradient descent decreases the loss for every learning rate $\eta&amp;gt;0$” has the form $\forall\eta$. One $\eta$ is enough to refute it.&lt;/p&gt;

&lt;p&gt;Take $f(x)=x^2$. The update is $x_{k+1}=x_k-\eta f&apos;(x_k)=x_k-2\eta x_k=(1-2\eta)x_k$. With $\eta=1.5$ the factor is $-2$: from $x_0=1$ we get $-2,\ 4,\ -8,\dots$ and $f(x_k)=4^k$ grows without bound. The correct statement needs a condition: for $0&amp;lt;\eta&amp;lt;1$, $\lvert1-2\eta\rvert&amp;lt;1$ and $x_k\to0$.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Engineering: tolerance specifications.&lt;/strong&gt; “For every allowed output error $\varepsilon$ there is an input tolerance $\delta$” is how an engineer says a system is stable. If the output is $y=3x$, the input tolerance must be three times smaller than the output tolerance, exactly as in Example 3.&lt;/p&gt;

&lt;h2 id=&quot;exercises&quot;&gt;Exercises&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Basic.&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;Negate: “Every student in the class has at least one test scored 10.”&lt;/li&gt;
  &lt;li&gt;Is $\forall x\in\mathbb{R}\ \exists y\in\mathbb{R}:\ x+y=0$ true? What about $\exists y\ \forall x:\ x+y=0$?&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Answers&lt;/summary&gt;

  &lt;ol&gt;
    &lt;li&gt;Some student in the class has no test scored 10.&lt;/li&gt;
    &lt;li&gt;The first is true (take $y=-x$). The second is false.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;p&gt;&lt;strong&gt;Intermediate.&lt;/strong&gt;&lt;/p&gt;

&lt;ol start=&quot;3&quot;&gt;
  &lt;li&gt;Negate: $\forall\varepsilon&amp;gt;0\ \exists\delta&amp;gt;0\ \forall x:\ \lvert x-a\rvert&amp;lt;\delta\Rightarrow\lvert f(x)-L\rvert&amp;lt;\varepsilon$.&lt;/li&gt;
  &lt;li&gt;Prove by induction: $1+2+\dots+n=\dfrac{n(n+1)}2$.&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Answers&lt;/summary&gt;

  &lt;ol start=&quot;3&quot;&gt;
    &lt;li&gt;$\exists\varepsilon&amp;gt;0\ \forall\delta&amp;gt;0\ \exists x:\ \lvert x-a\rvert&amp;lt;\delta$ and $\lvert f(x)-L\rvert\ge\varepsilon$.&lt;/li&gt;
    &lt;li&gt;Base case $n=1$ holds. Step: $\dfrac{n(n+1)}2+(n+1)=\dfrac{(n+1)(n+2)}2$.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;p&gt;&lt;strong&gt;Advanced.&lt;/strong&gt;&lt;/p&gt;

&lt;ol start=&quot;5&quot;&gt;
  &lt;li&gt;Prove that $\sqrt3$ is irrational.&lt;/li&gt;
  &lt;li&gt;Prove: $\forall\varepsilon&amp;gt;0\ \exists\delta&amp;gt;0:\ \lvert x-1\rvert&amp;lt;\delta\Rightarrow\lvert x^2-1\rvert&amp;lt;\varepsilon$.&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Hints&lt;/summary&gt;

  &lt;ol start=&quot;5&quot;&gt;
    &lt;li&gt;As in Theorem 2, using: if $3\mid p^2$ then $3\mid p$ (check $p=3k+1$ and $p=3k+2$).&lt;/li&gt;
    &lt;li&gt;$\lvert x^2-1\rvert=\lvert x-1\rvert\,\lvert x+1\rvert$. If $\lvert x-1\rvert&amp;lt;1$ then $0&amp;lt;x&amp;lt;2$, so $\lvert x+1\rvert&amp;lt;3$. Choose $\delta=\min(1,\varepsilon/3)$.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;h2 id=&quot;summary&quot;&gt;Summary&lt;/h2&gt;

&lt;div class=&quot;content-box summary-box textbook-block&quot;&gt;
  &lt;ul&gt;
    &lt;li&gt;$\forall x\ \exists y$ lets $y$ depend on $x$; swapping quantifiers can change the meaning.&lt;/li&gt;
    &lt;li&gt;Negation: swap $\forall\leftrightarrow\exists$ from left to right and negate the final condition; $\neg(P\Rightarrow Q)$ is $P\wedge\neg Q$.&lt;/li&gt;
    &lt;li&gt;Contrapositive: prove $\neg Q\Rightarrow\neg P$. Contradiction: assume the opposite and reach an impossibility.&lt;/li&gt;
    &lt;li&gt;Induction: base case and step $P(n)\Rightarrow P(n+1)$. Bernoulli’s inequality $(1+x)^n\ge1+nx$.&lt;/li&gt;
    &lt;li&gt;ε–δ proofs: scratch work to find $\delta$, then write forwards.&lt;/li&gt;
  &lt;/ul&gt;
&lt;/div&gt;
</content>
 </entry>
 
 <entry>
   <title>Elementary functions</title>
   <link href="https://calculus-self-learning.pages.dev/contents/en/chapter00/00_03_Elementary_functions/"/>
   <updated>2026-12-01T00:00:00+00:00</updated>
   <id>https://calculus-self-learning.pages.dev/contents/en/chapter00/00_03_Elementary_functions</id>
   <content type="html">&lt;div class=&quot;textbook-objectives&quot;&gt;

  &lt;p&gt;&lt;strong&gt;Learning objectives.&lt;/strong&gt; After this lesson you can:&lt;/p&gt;

  &lt;ul&gt;
    &lt;li&gt;state the domain, range and shape of the graph of the basic elementary functions;&lt;/li&gt;
    &lt;li&gt;use the rules for exponentials and logarithms to solve exponential equations;&lt;/li&gt;
    &lt;li&gt;evaluate inverse trigonometric functions and simplify expressions such as $\cos(\arcsin x)$;&lt;/li&gt;
    &lt;li&gt;recognise the sigmoid and tanh functions of machine learning as combinations of exponentials.&lt;/li&gt;
  &lt;/ul&gt;

&lt;/div&gt;

&lt;h2 id=&quot;why-this-lesson&quot;&gt;Why this lesson&lt;/h2&gt;

&lt;p&gt;A drug in the bloodstream halves every 6 hours. After $t$ hours, $C(t)=C_0\cdot 2^{-t/6}$ remains. When is only 10% of the dose left? You must solve $2^{-t/6}=0.1$, which needs logarithms: $t=6\log_2 10\approx 19.9$ hours.&lt;/p&gt;

&lt;p&gt;Almost every function in this course is built from a short list of basic functions by addition, multiplication, division and composition. This lesson reviews that list.&lt;/p&gt;

&lt;div class=&quot;textbook-definition&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Definition 1 (Elementary function).&lt;/strong&gt; The &lt;em&gt;basic elementary functions&lt;/em&gt; are: constants, $x^\alpha$, $a^x$, $\log_a x$, $\sin x$, $\cos x$, $\tan x$, $\cot x$ and the inverses $\arcsin x$, $\arccos x$, $\arctan x$. An &lt;em&gt;elementary function&lt;/em&gt; is obtained from these by finitely many additions, subtractions, multiplications, divisions and compositions.&lt;/p&gt;
&lt;/div&gt;

&lt;p&gt;For example $f(x)=\dfrac{e^{-x^2}\sin 3x}{1+\ln(1+x^2)}$ is elementary. So is $\lvert x\rvert=\sqrt{x^2}$.&lt;/p&gt;

&lt;h2 id=&quot;polynomials-and-rational-functions&quot;&gt;Polynomials and rational functions&lt;/h2&gt;

&lt;p&gt;A polynomial of degree $n$, $p(x)=a_nx^n+\dots+a_1x+a_0$ with $a_n\ne0$, is defined on $\mathbb{R}$ and has at most $n$ real roots. For large $\lvert x\rvert$ it behaves like its leading term $a_nx^n$.&lt;/p&gt;

&lt;p&gt;A rational function $\dfrac{p(x)}{q(x)}$ is defined where $q(x)\ne0$. For example $\dfrac{x^2-1}{x-1}$ equals $x+1$ for $x\ne1$ but is undefined at $x=1$. Chapter 1 will say that its limit at 1 is 2.&lt;/p&gt;

&lt;h2 id=&quot;exponentials-and-logarithms&quot;&gt;Exponentials and logarithms&lt;/h2&gt;

&lt;p&gt;For $a&amp;gt;0$, $a\ne1$, the function $a^x$ is defined on $\mathbb{R}$, always positive, increasing if $a&amp;gt;1$ and decreasing if $0&amp;lt;a&amp;lt;1$. The most important base is $e\approx2.71828$ (chapter 1 defines $e$ as the limit of $(1+1/n)^n$).&lt;/p&gt;

&lt;div class=&quot;textbook-definition&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Definition 2 (Logarithm).&lt;/strong&gt; For $a&amp;gt;0$, $a\ne1$, the function $\log_a:(0,\infty)\to\mathbb{R}$ is the inverse of $x\mapsto a^x$:&lt;/p&gt;

\[\log_a y=x\iff a^x=y .\]

  &lt;p&gt;We write $\ln x=\log_e x$ (natural logarithm).&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-theorem&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Theorem 1 (Logarithm rules).&lt;/strong&gt; For $u,v&amp;gt;0$ and $r\in\mathbb{R}$:&lt;/p&gt;

\[\ln(uv)=\ln u+\ln v,\qquad \ln\frac uv=\ln u-\ln v,\qquad \ln u^r=r\ln u,\qquad \log_a u=\frac{\ln u}{\ln a}.\]

&lt;/div&gt;

&lt;div class=&quot;textbook-proof&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Proof.&lt;/strong&gt; Let $p=\ln u$, $q=\ln v$, so $u=e^p$, $v=e^q$. Then $uv=e^pe^q=e^{p+q}$, hence $\ln(uv)=p+q$. The quotient rule follows from $e^p/e^q=e^{p-q}$. For powers: $u^r=(e^p)^r=e^{rp}$, so $\ln u^r=rp$. Finally, if $\log_a u=x$ then $a^x=u$; taking $\ln$ gives $x\ln a=\ln u$, so $x=\ln u/\ln a$.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Example 1.&lt;/strong&gt; Solve $2^{x+1}=5\cdot3^x$.&lt;/p&gt;

  &lt;p&gt;Take $\ln$ of both sides: $(x+1)\ln2=\ln5+x\ln3$. Rearrange: $x(\ln2-\ln3)=\ln5-\ln2$. So&lt;/p&gt;

\[x=\frac{\ln(5/2)}{\ln(2/3)}\approx\frac{0.9163}{-0.4055}\approx-2.260 .\]

  &lt;p&gt;Check: $2^{-1.260}\approx0.418$ and $5\cdot3^{-2.260}\approx5\cdot0.0835\approx0.418$.&lt;/p&gt;
&lt;/div&gt;

&lt;h2 id=&quot;trigonometric-and-inverse-trigonometric-functions&quot;&gt;Trigonometric and inverse trigonometric functions&lt;/h2&gt;

&lt;p&gt;On the unit circle, the point at angle $t$ (radians) is $(\cos t,\sin t)$. Hence $\sin^2t+\cos^2t=1$, both functions have period $2\pi$, and $\tan t=\sin t/\cos t$ has period $\pi$ and is undefined at $t=\tfrac\pi2+k\pi$.&lt;/p&gt;

&lt;p&gt;In calculus angles are always in radians. Only in radians is $(\sin x)&apos;=\cos x$ (chapter 2).&lt;/p&gt;

&lt;p&gt;$\sin$ is not injective on $\mathbb{R}$, so its domain must be restricted before inverting.&lt;/p&gt;

&lt;div class=&quot;textbook-definition&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Definition 3 (Inverse trigonometric functions).&lt;/strong&gt;&lt;/p&gt;

  &lt;ul&gt;
    &lt;li&gt;$\arcsin:[-1,1]\to[-\tfrac\pi2,\tfrac\pi2]$ is the inverse of $\sin$ on $[-\tfrac\pi2,\tfrac\pi2]$.&lt;/li&gt;
    &lt;li&gt;$\arccos:[-1,1]\to[0,\pi]$ is the inverse of $\cos$ on $[0,\pi]$.&lt;/li&gt;
    &lt;li&gt;$\arctan:\mathbb{R}\to(-\tfrac\pi2,\tfrac\pi2)$ is the inverse of $\tan$ on $(-\tfrac\pi2,\tfrac\pi2)$.&lt;/li&gt;
  &lt;/ul&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Example 2.&lt;/strong&gt;&lt;/p&gt;

  &lt;ul&gt;
    &lt;li&gt;$\arcsin\left(\sin\tfrac{5\pi}6\right)=\arcsin\tfrac12=\tfrac\pi6$, not $\tfrac{5\pi}6$, because $\tfrac{5\pi}6$ lies outside $[-\tfrac\pi2,\tfrac\pi2]$.&lt;/li&gt;
    &lt;li&gt;Simplify $\cos(\arcsin x)$ for $x\in[-1,1]$. Let $\theta=\arcsin x\in[-\tfrac\pi2,\tfrac\pi2]$, so $\cos\theta\ge0$ and $\cos\theta=\sqrt{1-\sin^2\theta}=\sqrt{1-x^2}$.&lt;/li&gt;
    &lt;li&gt;$\arctan1=\tfrac\pi4$, $\arctan(-\sqrt3)=-\tfrac\pi3$.&lt;/li&gt;
  &lt;/ul&gt;
&lt;/div&gt;

&lt;h2 id=&quot;hyperbolic-functions&quot;&gt;Hyperbolic functions&lt;/h2&gt;

&lt;div class=&quot;textbook-definition&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Definition 4 (Hyperbolic functions).&lt;/strong&gt;&lt;/p&gt;

\[\sinh x=\frac{e^x-e^{-x}}2,\qquad \cosh x=\frac{e^x+e^{-x}}2,\qquad \tanh x=\frac{\sinh x}{\cosh x}.\]

&lt;/div&gt;

&lt;div class=&quot;textbook-theorem&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Theorem 2.&lt;/strong&gt; $\cosh^2x-\sinh^2x=1$ for all $x$.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-proof&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Proof.&lt;/strong&gt; $\cosh^2x-\sinh^2x=(\cosh x-\sinh x)(\cosh x+\sinh x)=e^{-x}\cdot e^{x}=1$.&lt;/p&gt;
&lt;/div&gt;

&lt;p&gt;The point $(\cosh t,\sinh t)$ runs along the branch of the hyperbola $x^2-y^2=1$, just as $(\cos t,\sin t)$ runs along the circle. A power cable hanging between two poles has the shape $y=a\cosh(x/a)$ (the catenary).&lt;/p&gt;

&lt;h2 id=&quot;short-video&quot;&gt;Short video&lt;/h2&gt;

&lt;div class=&quot;reel-video&quot;&gt;
  &lt;video controls=&quot;&quot; playsinline=&quot;&quot; preload=&quot;metadata&quot; src=&quot;/public/videos/reels/unit-circle-trig.mp4&quot;&gt;&lt;/video&gt;
  &lt;p class=&quot;reel-caption&quot;&gt;A point moving on the unit circle traces the sine and cosine graphs (silent video, about 2 minutes).&lt;/p&gt;
&lt;/div&gt;

&lt;h2 id=&quot;applications&quot;&gt;Applications&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Pharmacology: half-life.&lt;/strong&gt; With $C(t)=C_0\,2^{-t/6}$, the condition $C(t)=0.1\,C_0$ gives $-\tfrac t6\ln2=\ln0.1$, so $t=\dfrac{6\ln10}{\ln2}\approx\dfrac{6\cdot2.3026}{0.6931}\approx19.9$ hours.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Machine learning: sigmoid, tanh and ReLU.&lt;/strong&gt; Three common activation functions are elementary:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;sigmoid $\sigma(x)=\dfrac1{1+e^{-x}}$, values in $(0,1)$, used as a probability;&lt;/li&gt;
  &lt;li&gt;$\tanh x$, values in $(-1,1)$. The two are related by $\sigma(x)=\tfrac12\left(1+\tanh\tfrac x2\right)$;&lt;/li&gt;
  &lt;li&gt;ReLU $(x)=\max(0,x)=\tfrac12(x+\lvert x\rvert)$.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Check the relation: $\tanh\tfrac x2=\dfrac{e^{x/2}-e^{-x/2}}{e^{x/2}+e^{-x/2}}=\dfrac{1-e^{-x}}{1+e^{-x}}$, so $\tfrac12\left(1+\tanh\tfrac x2\right)=\tfrac12\cdot\dfrac{2}{1+e^{-x}}=\sigma(x)$.&lt;/p&gt;

&lt;p&gt;The inverse of the sigmoid is the logit: $\sigma^{-1}(p)=\ln\dfrac{p}{1-p}$, $0&amp;lt;p&amp;lt;1$. For $p=0.9$: $\ln9\approx2.197$.&lt;/p&gt;

&lt;h2 id=&quot;exercises&quot;&gt;Exercises&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Basic.&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;Compute $\log_2 48-\log_2 3$ and $e^{2\ln3}$.&lt;/li&gt;
  &lt;li&gt;Compute $\arccos(-\tfrac12)$ and $\arctan\tfrac1{\sqrt3}$.&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Answers&lt;/summary&gt;

  &lt;ol&gt;
    &lt;li&gt;$\log_2 16=4$; $e^{\ln 9}=9$.&lt;/li&gt;
    &lt;li&gt;$\tfrac{2\pi}3$; $\tfrac\pi6$.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;p&gt;&lt;strong&gt;Intermediate.&lt;/strong&gt;&lt;/p&gt;

&lt;ol start=&quot;3&quot;&gt;
  &lt;li&gt;Solve $e^{2x}-3e^x+2=0$.&lt;/li&gt;
  &lt;li&gt;Simplify $\tan(\arccos x)$ for $0&amp;lt;x\le1$.&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Answers&lt;/summary&gt;

  &lt;ol start=&quot;3&quot;&gt;
    &lt;li&gt;Let $u=e^x&amp;gt;0$: $u^2-3u+2=0$, so $u=1$ or $u=2$. Hence $x=0$ or $x=\ln2$.&lt;/li&gt;
    &lt;li&gt;With $\theta=\arccos x\in[0,\tfrac\pi2)$: $\sin\theta=\sqrt{1-x^2}$, so $\tan\theta=\dfrac{\sqrt{1-x^2}}{x}$.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;p&gt;&lt;strong&gt;Advanced.&lt;/strong&gt;&lt;/p&gt;

&lt;ol start=&quot;5&quot;&gt;
  &lt;li&gt;Prove that $\sinh$ is injective and find its inverse: $\operatorname{arsinh}x=\ln\left(x+\sqrt{x^2+1}\right)$.&lt;/li&gt;
  &lt;li&gt;Prove $\arctan x+\arctan\tfrac1x=\tfrac\pi2$ for $x&amp;gt;0$.&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Hints&lt;/summary&gt;

  &lt;ol start=&quot;5&quot;&gt;
    &lt;li&gt;$\sinh$ is the sum of the strictly increasing functions $\tfrac12e^x$ and $-\tfrac12e^{-x}$. Solve $y=\tfrac{e^x-e^{-x}}2$: with $u=e^x$, $u^2-2yu-1=0$; take the positive root $u=y+\sqrt{y^2+1}$.&lt;/li&gt;
    &lt;li&gt;Let $\theta=\arctan x\in(0,\tfrac\pi2)$. Then $\tan(\tfrac\pi2-\theta)=\cot\theta=\tfrac1x$ and $\tfrac\pi2-\theta\in(0,\tfrac\pi2)$, so $\arctan\tfrac1x=\tfrac\pi2-\theta$.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;h2 id=&quot;summary&quot;&gt;Summary&lt;/h2&gt;

&lt;div class=&quot;content-box summary-box textbook-block&quot;&gt;
  &lt;ul&gt;
    &lt;li&gt;Elementary functions: built from polynomials, exponentials, logarithms, trigonometric and inverse trigonometric functions by arithmetic and composition.&lt;/li&gt;
    &lt;li&gt;$\ln$ is the inverse of $e^x$: $\ln(uv)=\ln u+\ln v$, $\ln u^r=r\ln u$, $\log_a u=\ln u/\ln a$.&lt;/li&gt;
    &lt;li&gt;Inverse trigonometric functions are inverses on a restricted domain: $\arcsin$ takes values in $[-\tfrac\pi2,\tfrac\pi2]$, $\arccos$ in $[0,\pi]$.&lt;/li&gt;
    &lt;li&gt;$\cosh^2x-\sinh^2x=1$; sigmoid, tanh and ReLU are elementary functions.&lt;/li&gt;
  &lt;/ul&gt;
&lt;/div&gt;
</content>
 </entry>
 
 <entry>
   <title>Functions and graphs</title>
   <link href="https://calculus-self-learning.pages.dev/contents/en/chapter00/00_02_Functions_and_graphs/"/>
   <updated>2026-12-01T00:00:00+00:00</updated>
   <id>https://calculus-self-learning.pages.dev/contents/en/chapter00/00_02_Functions_and_graphs</id>
   <content type="html">&lt;div class=&quot;textbook-objectives&quot;&gt;

  &lt;p&gt;&lt;strong&gt;Learning objectives.&lt;/strong&gt; After this lesson you can:&lt;/p&gt;

  &lt;ul&gt;
    &lt;li&gt;find the domain and range of a function given by a formula;&lt;/li&gt;
    &lt;li&gt;form compositions $f\circ g$ and see that in general $f\circ g\ne g\circ f$;&lt;/li&gt;
    &lt;li&gt;decide whether a function has an inverse and find a formula for it;&lt;/li&gt;
    &lt;li&gt;sketch $y=a\,f(bx+c)+d$ quickly from the graph of $y=f(x)$.&lt;/li&gt;
  &lt;/ul&gt;

&lt;/div&gt;

&lt;h2 id=&quot;why-this-lesson&quot;&gt;Why this lesson&lt;/h2&gt;

&lt;p&gt;On a sunny day in Ho Chi Minh City the outdoor temperature runs from about 22°C at 4 a.m. to 34°C at 4 p.m. The graph looks like a sine curve shifted up, stretched and moved to the right. To write a formula you need to know what each parameter in $a\sin(bx+c)+d$ does to the graph. The end of the lesson solves this problem.&lt;/p&gt;

&lt;h2 id=&quot;functions-domain-range&quot;&gt;Functions, domain, range&lt;/h2&gt;

&lt;div class=&quot;textbook-definition&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Definition 1 (Function).&lt;/strong&gt; A &lt;em&gt;function&lt;/em&gt; $f$ from a set $D\subset\mathbb{R}$ to $\mathbb{R}$ is a rule assigning to each $x\in D$ exactly one number $f(x)$. $D$ is the &lt;em&gt;domain&lt;/em&gt;. The set $f(D)=\lbrace f(x)\mid x\in D\rbrace $ is the &lt;em&gt;range&lt;/em&gt;. The &lt;em&gt;graph&lt;/em&gt; of $f$ is the set of points $\lbrace (x,f(x))\mid x\in D\rbrace $ in the plane.&lt;/p&gt;
&lt;/div&gt;

&lt;p&gt;When a function is given only by a formula, its domain is the set of $x$ for which the formula makes sense: denominators nonzero, even roots of nonnegative numbers, logarithms of positive numbers.&lt;/p&gt;

&lt;p&gt;Vertical line test: a curve is the graph of a function exactly when every vertical line meets it at most once. The circle $x^2+y^2=1$ is not the graph of a function $y=f(x)$, since the line $x=0$ meets it twice.&lt;/p&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Example 1.&lt;/strong&gt; Find the domain of $f(x)=\dfrac{\sqrt{4-x^2}}{x-1}$.&lt;/p&gt;

  &lt;ul&gt;
    &lt;li&gt;Root: $4-x^2\ge0\iff -2\le x\le 2$.&lt;/li&gt;
    &lt;li&gt;Denominator: $x\ne1$.&lt;/li&gt;
  &lt;/ul&gt;

  &lt;p&gt;Domain $D=[-2,1)\cup(1,2]$.&lt;/p&gt;

  &lt;p&gt;The range of $g(x)=\sqrt{4-x^2}$ on $[-2,2]$ is $[0,2]$: maximum 2 at $x=0$, minimum 0 at $x=\pm2$, and the graph is the upper half of the circle of radius 2.&lt;/p&gt;
&lt;/div&gt;

&lt;h2 id=&quot;composition&quot;&gt;Composition&lt;/h2&gt;

&lt;div class=&quot;textbook-definition&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Definition 2 (Composition).&lt;/strong&gt; Let $g:D\to\mathbb{R}$ and let $f$ be defined on a set containing $g(D)$. The &lt;em&gt;composition&lt;/em&gt; $f\circ g$ is $(f\circ g)(x)=f(g(x))$, $x\in D$.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Example 2.&lt;/strong&gt; With $f(x)=x^2$, $g(x)=x+3$:&lt;/p&gt;

\[(f\circ g)(x)=(x+3)^2,\qquad (g\circ f)(x)=x^2+3 .\]

  &lt;p&gt;At $x=1$: $(f\circ g)(1)=16$, $(g\circ f)(1)=4$. Order matters.&lt;/p&gt;

  &lt;p&gt;Conversely, $h(x)=\sqrt{1+\sin x}$ is a composition of three functions: $x\mapsto\sin x$, then $u\mapsto1+u$, then $v\mapsto\sqrt v$. Breaking a function into simple links like this is the first step of the chain rule in chapter 2.&lt;/p&gt;
&lt;/div&gt;

&lt;h2 id=&quot;inverse-functions&quot;&gt;Inverse functions&lt;/h2&gt;

&lt;div class=&quot;textbook-definition&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Definition 3 (Injective function, inverse).&lt;/strong&gt; $f:D\to\mathbb{R}$ is &lt;em&gt;injective&lt;/em&gt; (one-to-one) if $x_1\ne x_2$ implies $f(x_1)\ne f(x_2)$. Then each $y$ in the range $f(D)$ has exactly one $x\in D$ with $f(x)=y$; set $f^{-1}(y)=x$. The function $f^{-1}:f(D)\to D$ is the &lt;em&gt;inverse&lt;/em&gt; of $f$, and&lt;/p&gt;

\[f^{-1}(f(x))=x\ \ (x\in D),\qquad f(f^{-1}(y))=y\ \ (y\in f(D)).\]

&lt;/div&gt;

&lt;div class=&quot;textbook-lemma&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Lemma 1.&lt;/strong&gt; A strictly increasing (or strictly decreasing) function on $D$ is injective, hence has an inverse.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-proof&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Proof.&lt;/strong&gt; Let $f$ be strictly increasing and $x_1\ne x_2$, say $x_1&amp;lt;x_2$. Then $f(x_1)&amp;lt;f(x_2)$, so $f(x_1)\ne f(x_2)$. The decreasing case is the same.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-theorem&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Theorem 1 (Graph of the inverse).&lt;/strong&gt; The graph of $f^{-1}$ is the mirror image of the graph of $f$ in the line $y=x$.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-proof&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Proof.&lt;/strong&gt; $(a,b)$ is on the graph of $f$ iff $b=f(a)$ iff $a=f^{-1}(b)$, i.e. iff $(b,a)$ is on the graph of $f^{-1}$. Swapping coordinates $(a,b)\mapsto(b,a)$ is exactly reflection in $y=x$.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Example 3.&lt;/strong&gt; Find the inverse of $f(x)=\dfrac{2x+1}{x-3}$, $x\ne3$.&lt;/p&gt;

  &lt;p&gt;Set $y=\dfrac{2x+1}{x-3}$ and solve for $x$: $y(x-3)=2x+1\iff x(y-2)=3y+1$. For $y\ne2$: $x=\dfrac{3y+1}{y-2}$. The value $y=2$ is never taken (it would give $0=7$), so the range of $f$ is $\mathbb{R}\setminus\lbrace 2\rbrace $ and&lt;/p&gt;

\[f^{-1}(x)=\frac{3x+1}{x-2},\qquad x\ne2 .\]

  &lt;p&gt;Check: $f(4)=9$ and $f^{-1}(9)=\dfrac{28}{7}=4$.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;content-box warning-box textbook-block&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Caution.&lt;/strong&gt; $f^{-1}(x)$ is the value of the inverse function, not $\dfrac{1}{f(x)}$. For $f(x)=x^3$, $f^{-1}(8)=2$ while $\dfrac1{f(8)}=\dfrac1{512}$.&lt;/p&gt;
&lt;/div&gt;

&lt;h2 id=&quot;transforming-graphs&quot;&gt;Transforming graphs&lt;/h2&gt;

&lt;p&gt;From the graph of $y=f(x)$ you get the graph of $y=a\,f(bx+c)+d$ in simple steps. Write $bx+c=b\left(x+\tfrac cb\right)$ with $b&amp;gt;0$:&lt;/p&gt;

&lt;table&gt;
  &lt;thead&gt;
    &lt;tr&gt;
      &lt;th&gt;Change&lt;/th&gt;
      &lt;th&gt;Effect on the graph&lt;/th&gt;
    &lt;/tr&gt;
  &lt;/thead&gt;
  &lt;tbody&gt;
    &lt;tr&gt;
      &lt;td&gt;$f(x)+d$&lt;/td&gt;
      &lt;td&gt;shift up by $d$ (down if $d&amp;lt;0$)&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;$f(x-h)$&lt;/td&gt;
      &lt;td&gt;shift right by $h$ (left if $h&amp;lt;0$)&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;$a\,f(x)$, $a&amp;gt;0$&lt;/td&gt;
      &lt;td&gt;vertical stretch by factor $a$&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;$-f(x)$&lt;/td&gt;
      &lt;td&gt;flip in the $x$-axis&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;$f(bx)$, $b&amp;gt;0$&lt;/td&gt;
      &lt;td&gt;horizontal compression by factor $b$ (period divided by $b$)&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;$f(-x)$&lt;/td&gt;
      &lt;td&gt;flip in the $y$-axis&lt;/td&gt;
    &lt;/tr&gt;
  &lt;/tbody&gt;
&lt;/table&gt;

&lt;p&gt;Why “$f(x-h)$ shifts right”: the value $f$ takes at $x_0$ is taken by the new function at $x_0+h$, since $(x_0+h)-h=x_0$.&lt;/p&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Example 4.&lt;/strong&gt; Describe the graph of $y=2\sin(3x-\pi)+1$.&lt;/p&gt;

  &lt;p&gt;Write $3x-\pi=3\left(x-\tfrac\pi3\right)$. Starting from $y=\sin x$:&lt;/p&gt;

  &lt;ol&gt;
    &lt;li&gt;compress horizontally by 3: period $2\pi/3$;&lt;/li&gt;
    &lt;li&gt;shift right by $\pi/3$;&lt;/li&gt;
    &lt;li&gt;stretch vertically by 2: amplitude 2;&lt;/li&gt;
    &lt;li&gt;shift up by 1.&lt;/li&gt;
  &lt;/ol&gt;

  &lt;p&gt;Range $[-1,3]$. The maximum 3 occurs when $3x-\pi=\tfrac\pi2+2k\pi$, i.e. $x=\tfrac\pi2+\tfrac{2k\pi}3$. Check at $x=\tfrac\pi2$: $2\sin\left(\tfrac{\pi}{2}\right)+1=3$.&lt;/p&gt;
&lt;/div&gt;

&lt;h2 id=&quot;interactive&quot;&gt;Interactive&lt;/h2&gt;

&lt;div class=&quot;interactive-frame&quot;&gt;
  &lt;div class=&quot;interactive-frame-head&quot;&gt;
    &lt;div class=&quot;interactive-frame-title&quot;&gt;Graph transformations&lt;/div&gt;
    &lt;div class=&quot;interactive-frame-desc&quot;&gt;Drag a, b, c, d in y = a·f(bx + c) + d and compare with the original graph.&lt;/div&gt;
  &lt;/div&gt;
  &lt;iframe src=&quot;/interactives/chapter00/graph-transform-en.html&quot; title=&quot;Graph transformations&quot; loading=&quot;lazy&quot; style=&quot;height: 700px;&quot;&gt;&lt;/iframe&gt;
  &lt;div class=&quot;interactive-frame-foot&quot;&gt;
    &lt;a href=&quot;/interactives/chapter00/graph-transform-en.html&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;Open the interactive in a new window&lt;/a&gt;
  &lt;/div&gt;
&lt;/div&gt;

&lt;h2 id=&quot;short-video&quot;&gt;Short video&lt;/h2&gt;

&lt;div class=&quot;reel-video&quot;&gt;
  &lt;video controls=&quot;&quot; playsinline=&quot;&quot; preload=&quot;metadata&quot; src=&quot;/public/videos/reels/graph-transform.mp4&quot;&gt;&lt;/video&gt;
  &lt;p class=&quot;reel-caption&quot;&gt;Graph transformations y = a·f(b(x − c)) + d: knobs a, b, c, d shift and stretch the sine graph, then function composition through two machines in a row (silent video, about 2 minutes 20 seconds).&lt;/p&gt;
&lt;/div&gt;

&lt;h2 id=&quot;applications&quot;&gt;Applications&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Daily temperature.&lt;/strong&gt; Model $T(t)=A\sin(\omega t+\varphi)+B$ with $t$ in hours, minimum 22°C at 4:00, maximum 34°C at 16:00.&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;$B=\tfrac{34+22}{2}=28$, $A=\tfrac{34-22}2=6$.&lt;/li&gt;
  &lt;li&gt;Period 24 hours: $\omega=\tfrac{2\pi}{24}=\tfrac{\pi}{12}$.&lt;/li&gt;
  &lt;li&gt;Maximum at $t=16$: $\tfrac{\pi}{12}\cdot16+\varphi=\tfrac\pi2$, so $\varphi=\tfrac\pi2-\tfrac{4\pi}3=-\tfrac{5\pi}6$.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Check the minimum: $\tfrac{\pi}{12}\cdot 4-\tfrac{5\pi}6=-\tfrac\pi2$, $\sin(-\tfrac\pi2)=-1$, $T(4)=22$. Correct.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Economics: demand and inverse demand.&lt;/strong&gt; Quantity demanded at price $p$ (thousand VND) is $Q(p)=1000-20p$. A seller usually needs the reverse: what price sells $Q$ units? That is the inverse $p(Q)=50-\tfrac{Q}{20}$. To sell 600 units, set $p=20$.&lt;/p&gt;

&lt;h2 id=&quot;exercises&quot;&gt;Exercises&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Basic.&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;Find the domain of $f(x)=\ln(x^2-9)$.&lt;/li&gt;
  &lt;li&gt;With $f(x)=\sqrt x$, $g(x)=x^2-1$, compute $(f\circ g)(3)$ and $(g\circ f)(3)$.&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Answers&lt;/summary&gt;

  &lt;ol&gt;
    &lt;li&gt;$x^2-9&amp;gt;0\iff x&amp;lt;-3$ or $x&amp;gt;3$.&lt;/li&gt;
    &lt;li&gt;$(f\circ g)(3)=\sqrt8=2\sqrt2$; $(g\circ f)(3)=3-1=2$.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;p&gt;&lt;strong&gt;Intermediate.&lt;/strong&gt;&lt;/p&gt;

&lt;ol start=&quot;3&quot;&gt;
  &lt;li&gt;Find the inverse of $f(x)=e^{2x}+1$ and its domain.&lt;/li&gt;
  &lt;li&gt;Which transformations take $y=\lvert x\rvert$ to $y=-\lvert x+2\rvert+3$? Where is the vertex?&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Answers&lt;/summary&gt;

  &lt;ol start=&quot;3&quot;&gt;
    &lt;li&gt;$y-1=e^{2x}$, $x=\tfrac12\ln(y-1)$. So $f^{-1}(x)=\tfrac12\ln(x-1)$ for $x&amp;gt;1$.&lt;/li&gt;
    &lt;li&gt;Shift left 2, flip in the $x$-axis, shift up 3. Vertex $(-2,3)$, the highest point.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;p&gt;&lt;strong&gt;Advanced.&lt;/strong&gt;&lt;/p&gt;

&lt;ol start=&quot;5&quot;&gt;
  &lt;li&gt;Prove: if $f$ and $g$ are strictly increasing then so is $f\circ g$. What if $f$ is increasing and $g$ decreasing?&lt;/li&gt;
  &lt;li&gt;Prove that every function $f$ defined on $\mathbb{R}$ is the sum of an even function and an odd function.&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Hints&lt;/summary&gt;

  &lt;ol start=&quot;5&quot;&gt;
    &lt;li&gt;$x_1&amp;lt;x_2\Rightarrow g(x_1)&amp;lt;g(x_2)\Rightarrow f(g(x_1))&amp;lt;f(g(x_2))$. If $g$ is strictly decreasing, $f\circ g$ is strictly decreasing.&lt;/li&gt;
    &lt;li&gt;$f(x)=\dfrac{f(x)+f(-x)}2+\dfrac{f(x)-f(-x)}2$. The first term is even, the second odd.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;h2 id=&quot;summary&quot;&gt;Summary&lt;/h2&gt;

&lt;div class=&quot;content-box summary-box textbook-block&quot;&gt;
  &lt;ul&gt;
    &lt;li&gt;Domain: the $x$ where the formula makes sense. Range: the set of values $f(x)$.&lt;/li&gt;
    &lt;li&gt;$(f\circ g)(x)=f(g(x))$; in general $f\circ g\ne g\circ f$.&lt;/li&gt;
    &lt;li&gt;Injective functions (e.g. strictly monotone ones) have inverses; the graph of $f^{-1}$ is the reflection of the graph of $f$ in $y=x$.&lt;/li&gt;
    &lt;li&gt;$y=a\,f(b(x-h))+d$: compress horizontally by $b$, shift right $h$, stretch vertically by $a$, shift up $d$.&lt;/li&gt;
  &lt;/ul&gt;
&lt;/div&gt;
</content>
 </entry>
 
 <entry>
   <title>Real numbers, inequalities and absolute value</title>
   <link href="https://calculus-self-learning.pages.dev/contents/en/chapter00/00_01_Real_numbers_inequalities_absolute_value/"/>
   <updated>2026-12-01T00:00:00+00:00</updated>
   <id>https://calculus-self-learning.pages.dev/contents/en/chapter00/00_01_Real_numbers_inequalities_absolute_value</id>
   <content type="html">&lt;div class=&quot;textbook-objectives&quot;&gt;

  &lt;p&gt;&lt;strong&gt;Learning objectives.&lt;/strong&gt; After this lesson you can:&lt;/p&gt;

  &lt;ul&gt;
    &lt;li&gt;read $\lvert x-a\rvert&amp;lt;r$ as “the distance from $x$ to $a$ is less than $r$” and switch to the interval form $(a-r,\,a+r)$;&lt;/li&gt;
    &lt;li&gt;solve equations and inequalities with absolute values by splitting into cases;&lt;/li&gt;
    &lt;li&gt;state and prove the triangle inequality;&lt;/li&gt;
    &lt;li&gt;find the supremum and infimum of a set of numbers and check them with the ε criterion.&lt;/li&gt;
  &lt;/ul&gt;

&lt;/div&gt;

&lt;h2 id=&quot;why-this-lesson&quot;&gt;Why this lesson&lt;/h2&gt;

&lt;p&gt;A factory turns shafts with nominal diameter 20 mm. A shaft passes inspection if its diameter $d$ is off by at most 0.05 mm. In short: $\lvert d-20\rvert\le 0.05$, that is $19.95\le d\le 20.05$.&lt;/p&gt;

&lt;p&gt;The whole course uses sentences of exactly this kind. The definition of a limit in chapter 1 reads “$\lvert f(x)-L\rvert&amp;lt;\varepsilon$ whenever $\lvert x-a\rvert&amp;lt;\delta$”. If you read absolute values as distances without effort, chapter 1 becomes much easier.&lt;/p&gt;

&lt;h2 id=&quot;real-numbers-and-absolute-value&quot;&gt;Real numbers and absolute value&lt;/h2&gt;

&lt;p&gt;The set $\mathbb{R}$ of real numbers contains the rationals ($\tfrac12$, $-3$, $0.75$) and the irrationals ($\sqrt2$, $\pi$, $e$). It has addition, multiplication and the order $&amp;lt;$ you know from school. Two rules are used constantly:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;if $a&amp;lt;b$ then $a+c&amp;lt;b+c$ for every $c$;&lt;/li&gt;
  &lt;li&gt;if $a&amp;lt;b$ and $c&amp;gt;0$ then $ac&amp;lt;bc$; if $c&amp;lt;0$ then $ac&amp;gt;bc$ (the inequality flips).&lt;/li&gt;
&lt;/ul&gt;

&lt;div class=&quot;textbook-definition&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Definition 1 (Absolute value).&lt;/strong&gt; For $x\in\mathbb{R}$,&lt;/p&gt;

\[\lvert x\rvert=\begin{cases}x, &amp;amp; x\ge 0,\\ -x, &amp;amp; x&amp;lt;0.\end{cases}\]

  &lt;p&gt;The number $\lvert x-a\rvert$ is the &lt;em&gt;distance&lt;/em&gt; between $x$ and $a$ on the number line.&lt;/p&gt;
&lt;/div&gt;

&lt;p&gt;Directly from the definition: $\lvert x\rvert\ge0$; $\lvert x\rvert=0\iff x=0$; $\lvert xy\rvert=\lvert x\rvert\,\lvert y\rvert$; $\sqrt{x^2}=\lvert x\rvert$; $-\lvert x\rvert\le x\le\lvert x\rvert$.&lt;/p&gt;

&lt;div class=&quot;textbook-theorem&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Theorem 1 (Absolute value and intervals).&lt;/strong&gt; Let $r&amp;gt;0$. Then&lt;/p&gt;

\[\lvert x-a\rvert&amp;lt;r \iff a-r&amp;lt;x&amp;lt;a+r,\]

  &lt;p&gt;and $\lvert x-a\rvert&amp;gt;r \iff x&amp;lt;a-r$ or $x&amp;gt;a+r$.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-proof&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Proof.&lt;/strong&gt; If $x\ge a$ then $\lvert x-a\rvert=x-a$, so $\lvert x-a\rvert&amp;lt;r\iff x&amp;lt;a+r$; together with $x\ge a&amp;gt;a-r$ this gives $a-r&amp;lt;x&amp;lt;a+r$. If $x&amp;lt;a$ then $\lvert x-a\rvert=a-x$, so $\lvert x-a\rvert&amp;lt;r\iff x&amp;gt;a-r$; together with $x&amp;lt;a&amp;lt;a+r$ we again get $a-r&amp;lt;x&amp;lt;a+r$. The second part is proved the same way: for $x\ge a$ the condition becomes $x&amp;gt;a+r$, for $x&amp;lt;a$ it becomes $x&amp;lt;a-r$.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-theorem&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Theorem 2 (Triangle inequality).&lt;/strong&gt; For all $a,b\in\mathbb{R}$,&lt;/p&gt;

\[\lvert a+b\rvert\le\lvert a\rvert+\lvert b\rvert .\]

&lt;/div&gt;

&lt;div class=&quot;textbook-proof&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Proof.&lt;/strong&gt; We have $-\lvert a\rvert\le a\le\lvert a\rvert$ and $-\lvert b\rvert\le b\le\lvert b\rvert$. Adding,&lt;/p&gt;

\[-(\lvert a\rvert+\lvert b\rvert)\le a+b\le\lvert a\rvert+\lvert b\rvert .\]

  &lt;p&gt;By Theorem 1 (with $\le$), this says $\lvert a+b\rvert\le\lvert a\rvert+\lvert b\rvert$.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;content-box insight-box textbook-block&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Remark.&lt;/strong&gt; The form used most in analysis is $\lvert x-z\rvert\le\lvert x-y\rvert+\lvert y-z\rvert$: going from $x$ to $z$ through $y$ is never shorter than going straight. Put $a=x-y$, $b=y-z$ in Theorem 2.&lt;/p&gt;
&lt;/div&gt;

&lt;h2 id=&quot;solving-inequalities-with-absolute-values&quot;&gt;Solving inequalities with absolute values&lt;/h2&gt;

&lt;p&gt;General method: find the points where each expression inside an absolute value is zero, split the line into intervals there, and drop the absolute values on each interval.&lt;/p&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Example 1.&lt;/strong&gt; Solve $\lvert 2x-3\rvert\le5$.&lt;/p&gt;

  &lt;p&gt;By Theorem 1: $-5\le 2x-3\le 5$. Add 3: $-2\le 2x\le 8$. Divide by 2: $-1\le x\le 4$. Solution set $[-1,4]$.&lt;/p&gt;

  &lt;p&gt;Check: $x=4$ gives $\lvert 5\rvert=5$ (equality), $x=5$ gives $\lvert 7\rvert=7&amp;gt;5$ (rejected).&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Example 2.&lt;/strong&gt; Solve $\lvert x-1\rvert+\lvert x+2\rvert=5$.&lt;/p&gt;

  &lt;p&gt;Split points: $x=1$ and $x=-2$.&lt;/p&gt;

  &lt;ul&gt;
    &lt;li&gt;$x\ge1$: $(x-1)+(x+2)=5$, so $2x+1=5$, $x=2$. Satisfies $x\ge1$.&lt;/li&gt;
    &lt;li&gt;$-2\le x&amp;lt;1$: $(1-x)+(x+2)=5$, so $3=5$. No solution.&lt;/li&gt;
    &lt;li&gt;$x&amp;lt;-2$: $(1-x)+(-x-2)=5$, so $-2x-1=5$, $x=-3$. Satisfies $x&amp;lt;-2$.&lt;/li&gt;
  &lt;/ul&gt;

  &lt;p&gt;Solutions: $x=-3$ or $x=2$. Geometrically: the distances from $x$ to $1$ and to $-2$ add up to 5, while those two points are 3 apart, so $x$ lies outside $[-2,1]$, one unit beyond an endpoint.&lt;/p&gt;
&lt;/div&gt;

&lt;h2 id=&quot;supremum-and-infimum&quot;&gt;Supremum and infimum&lt;/h2&gt;

&lt;p&gt;The set $A=\lbrace 1-\tfrac1n \mid n=1,2,3,\dots\rbrace =\lbrace 0,\ \tfrac12,\ \tfrac23,\ \tfrac34,\dots\rbrace $ has no largest element: every element is beaten by another. Yet every element is below 1, and 1 is the “tightest” upper bound. The supremum captures exactly this.&lt;/p&gt;

&lt;div class=&quot;textbook-definition&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Definition 2 (Upper bound, supremum).&lt;/strong&gt; Let $A\subset\mathbb{R}$ be nonempty.&lt;/p&gt;

  &lt;ul&gt;
    &lt;li&gt;$M$ is an &lt;em&gt;upper bound&lt;/em&gt; of $A$ if $x\le M$ for all $x\in A$. If one exists, $A$ is &lt;em&gt;bounded above&lt;/em&gt;.&lt;/li&gt;
    &lt;li&gt;$s$ is the &lt;em&gt;supremum&lt;/em&gt; (least upper bound) of $A$, written $s=\sup A$, if $s$ is an upper bound and $s\le M$ for every upper bound $M$.&lt;/li&gt;
  &lt;/ul&gt;

  &lt;p&gt;Lower bounds and the infimum $\inf A$ are defined the same way with the inequalities reversed.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-theorem&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Completeness axiom.&lt;/strong&gt; Every nonempty subset of $\mathbb{R}$ that is bounded above has a supremum in $\mathbb{R}$.&lt;/p&gt;
&lt;/div&gt;

&lt;p&gt;The rationals $\mathbb{Q}$ fail this: $\lbrace q\in\mathbb{Q}\mid q^2&amp;lt;2\rbrace $ is bounded above, but its would-be supremum is $\sqrt2\notin\mathbb{Q}$. All the big theorems of Calculus I (intermediate value, Weierstrass, convergence of monotone sequences) rest on this axiom.&lt;/p&gt;

&lt;div class=&quot;textbook-lemma&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Lemma 1 (ε criterion for the supremum).&lt;/strong&gt; Let $s$ be an upper bound of $A$. Then $s=\sup A$ if and only if for every $\varepsilon&amp;gt;0$ there is $x\in A$ with $x&amp;gt;s-\varepsilon$.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-proof&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Proof.&lt;/strong&gt; ($\Rightarrow$) Let $\varepsilon&amp;gt;0$. Since $s-\varepsilon&amp;lt;s$ and $s$ is the least upper bound, $s-\varepsilon$ is not an upper bound, so some $x\in A$ has $x&amp;gt;s-\varepsilon$.&lt;/p&gt;

  &lt;p&gt;($\Leftarrow$) Suppose an upper bound $M&amp;lt;s$ exists. Take $\varepsilon=s-M&amp;gt;0$; then some $x\in A$ has $x&amp;gt;s-\varepsilon=M$, contradicting that $M$ is an upper bound. So every upper bound is $\ge s$, i.e. $s=\sup A$.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;textbook-example&quot;&gt;
  &lt;p&gt;&lt;strong&gt;Example 3.&lt;/strong&gt; For $A=\lbrace 1-\tfrac1n\mid n\ge1\rbrace $, show $\sup A=1$ and $\inf A=0$.&lt;/p&gt;

  &lt;ul&gt;
    &lt;li&gt;$1$ is an upper bound since $1-\tfrac1n&amp;lt;1$.&lt;/li&gt;
    &lt;li&gt;Let $\varepsilon&amp;gt;0$. Choose an integer $n&amp;gt;\tfrac1\varepsilon$; then $\tfrac1n&amp;lt;\varepsilon$, so $1-\tfrac1n&amp;gt;1-\varepsilon$. By Lemma 1, $\sup A=1$. Note $1\notin A$: a supremum need not be attained.&lt;/li&gt;
    &lt;li&gt;$0=1-\tfrac11\in A$ and every element is $\ge0$, so $\inf A=0$, and this time it is attained (it is the minimum).&lt;/li&gt;
  &lt;/ul&gt;

  &lt;p&gt;Numerically: for $\varepsilon=0.001$, $n=1001$ gives $1-\tfrac1{1001}\approx0.999001&amp;gt;0.999$.&lt;/p&gt;
&lt;/div&gt;

&lt;h2 id=&quot;applications&quot;&gt;Applications&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Tolerances in engineering.&lt;/strong&gt; A resistor labelled $100\,\Omega\pm5\%$ has true value $R$ with $\lvert R-100\rvert\le5$. Two of them in series give $R_1+R_2$, and by the triangle inequality&lt;/p&gt;

\[\lvert (R_1+R_2)-200\rvert\le\lvert R_1-100\rvert+\lvert R_2-100\rvert\le 10 .\]

&lt;p&gt;Absolute errors add up; the relative error stays $10/200=5\%$.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Machine learning: gradient clipping.&lt;/strong&gt; When training a neural network one often replaces a gradient $g$ by $\operatorname{clip}(g)=\max(-c,\min(g,c))$, which guarantees $\lvert\operatorname{clip}(g)\rvert\le c$. With $c=1$: $g=3.2$ becomes $1$; $g=-0.4$ is unchanged.&lt;/p&gt;

&lt;h2 id=&quot;exercises&quot;&gt;Exercises&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Basic.&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;Solve $\lvert x+4\rvert&amp;lt;3$.&lt;/li&gt;
  &lt;li&gt;Write $\lbrace x\mid \lvert x-7\rvert\le 0.5\rbrace $ as an interval.&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Answers&lt;/summary&gt;

  &lt;ol&gt;
    &lt;li&gt;$-3&amp;lt;x+4&amp;lt;3$, so $-7&amp;lt;x&amp;lt;-1$.&lt;/li&gt;
    &lt;li&gt;$[6.5,\ 7.5]$.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;p&gt;&lt;strong&gt;Intermediate.&lt;/strong&gt;&lt;/p&gt;

&lt;ol start=&quot;3&quot;&gt;
  &lt;li&gt;Solve $\lvert x-2\rvert&amp;gt;\lvert x+1\rvert$.&lt;/li&gt;
  &lt;li&gt;Find $\sup$ and $\inf$ of $B=\lbrace \tfrac{n}{n+1}\mid n\ge1\rbrace $. Do they belong to $B$?&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Answers&lt;/summary&gt;

  &lt;ol start=&quot;3&quot;&gt;
    &lt;li&gt;Both sides are nonnegative, so square: $x^2-4x+4&amp;gt;x^2+2x+1$, i.e. $-6x&amp;gt;-3$, $x&amp;lt;\tfrac12$. (Geometrically: $x$ is closer to $-1$ than to $2$, i.e. left of the midpoint $\tfrac12$.)&lt;/li&gt;
    &lt;li&gt;$\inf B=\tfrac12\in B$ ($n=1$), $\sup B=1\notin B$. For $\varepsilon&amp;gt;0$ take $n&amp;gt;\tfrac1\varepsilon$, since $1-\tfrac{n}{n+1}=\tfrac1{n+1}&amp;lt;\varepsilon$.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;p&gt;&lt;strong&gt;Advanced.&lt;/strong&gt;&lt;/p&gt;

&lt;ol start=&quot;5&quot;&gt;
  &lt;li&gt;Prove $\big\lvert\lvert a\rvert-\lvert b\rvert\big\rvert\le\lvert a-b\rvert$.&lt;/li&gt;
  &lt;li&gt;Let $A,B$ be nonempty and bounded above, and $A+B=\lbrace a+b\mid a\in A,\ b\in B\rbrace $. Prove $\sup(A+B)=\sup A+\sup B$.&lt;/li&gt;
&lt;/ol&gt;

&lt;details&gt;
  &lt;summary&gt;Hints&lt;/summary&gt;

  &lt;ol start=&quot;5&quot;&gt;
    &lt;li&gt;Write $a=(a-b)+b$ and use Theorem 2: $\lvert a\rvert-\lvert b\rvert\le\lvert a-b\rvert$. Swap $a,b$ to get $\lvert b\rvert-\lvert a\rvert\le\lvert a-b\rvert$.&lt;/li&gt;
    &lt;li&gt;$\sup A+\sup B$ is an upper bound of $A+B$. Given $\varepsilon&amp;gt;0$ pick $a&amp;gt;\sup A-\varepsilon/2$, $b&amp;gt;\sup B-\varepsilon/2$; then $a+b&amp;gt;\sup A+\sup B-\varepsilon$. Use Lemma 1.&lt;/li&gt;
  &lt;/ol&gt;

&lt;/details&gt;

&lt;h2 id=&quot;summary&quot;&gt;Summary&lt;/h2&gt;

&lt;div class=&quot;content-box summary-box textbook-block&quot;&gt;
  &lt;ul&gt;
    &lt;li&gt;$\lvert x-a\rvert$ is a distance; $\lvert x-a\rvert&amp;lt;r\iff a-r&amp;lt;x&amp;lt;a+r$.&lt;/li&gt;
    &lt;li&gt;The triangle inequality $\lvert a+b\rvert\le\lvert a\rvert+\lvert b\rvert$ is the main estimating tool of the course.&lt;/li&gt;
    &lt;li&gt;For equations and inequalities with absolute values, split the line where the inner expressions vanish.&lt;/li&gt;
    &lt;li&gt;$\sup A$ is the least upper bound; check it with the ε criterion. Completeness of $\mathbb{R}$ guarantees a supremum for every nonempty set bounded above.&lt;/li&gt;
  &lt;/ul&gt;
&lt;/div&gt;
</content>
 </entry>
 
 <entry>
   <title>reference</title>
   <link href="https://calculus-self-learning.pages.dev/reference/26_reference/"/>
   <updated>2021-03-28T00:00:00+00:00</updated>
   <id>https://calculus-self-learning.pages.dev/reference/26_reference</id>
   <content type="html">&lt;h1 id=&quot;references-and-resources&quot;&gt;References and Resources&lt;/h1&gt;

&lt;p&gt;This page contains references and resources for the course. Add your own references as needed.&lt;/p&gt;

&lt;h2 id=&quot;textbooks&quot;&gt;Textbooks&lt;/h2&gt;

&lt;ol&gt;
  &lt;li&gt;Author, A. (Year). &lt;em&gt;&lt;a href=&quot;https://example.com&quot;&gt;Book Title&lt;/a&gt;&lt;/em&gt;. Publisher.&lt;/li&gt;
  &lt;li&gt;Author, B. (Year). &lt;em&gt;&lt;a href=&quot;https://example.com&quot;&gt;Another Book Title&lt;/a&gt;&lt;/em&gt;. Publisher.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2 id=&quot;online-courses-and-lectures&quot;&gt;Online Courses and Lectures&lt;/h2&gt;

&lt;ol&gt;
  &lt;li&gt;Instructor, C. (Year). &lt;em&gt;&lt;a href=&quot;https://example.com&quot;&gt;Course Title&lt;/a&gt;&lt;/em&gt;.&lt;/li&gt;
  &lt;li&gt;University. &lt;em&gt;&lt;a href=&quot;https://example.com&quot;&gt;Lecture Series&lt;/a&gt;&lt;/em&gt;.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2 id=&quot;papers-and-articles&quot;&gt;Papers and Articles&lt;/h2&gt;

&lt;ol&gt;
  &lt;li&gt;Author, D. et al. (Year). &lt;em&gt;&lt;a href=&quot;https://example.com&quot;&gt;Paper Title&lt;/a&gt;&lt;/em&gt;. Journal Name, Vol. X, pp. XXX-XXX.&lt;/li&gt;
  &lt;li&gt;Author, E. (Year). &lt;em&gt;&lt;a href=&quot;https://example.com&quot;&gt;Article Title&lt;/a&gt;&lt;/em&gt;.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2 id=&quot;online-resources&quot;&gt;Online Resources&lt;/h2&gt;

&lt;ol&gt;
  &lt;li&gt;Wikipedia. &lt;em&gt;&lt;a href=&quot;https://en.wikipedia.org/wiki/Topic&quot;&gt;Topic Name&lt;/a&gt;&lt;/em&gt;.&lt;/li&gt;
  &lt;li&gt;Documentation. &lt;em&gt;&lt;a href=&quot;https://example.com&quot;&gt;Tool/Library Name&lt;/a&gt;&lt;/em&gt;.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2 id=&quot;additional-materials&quot;&gt;Additional Materials&lt;/h2&gt;

&lt;ol&gt;
  &lt;li&gt;Author, F. (Year). &lt;em&gt;&lt;a href=&quot;https://example.com&quot;&gt;Tutorial/Guide Title&lt;/a&gt;&lt;/em&gt;.&lt;/li&gt;
  &lt;li&gt;Organization. &lt;em&gt;&lt;a href=&quot;https://example.com&quot;&gt;Resource Name&lt;/a&gt;&lt;/em&gt;.&lt;/li&gt;
&lt;/ol&gt;

&lt;hr /&gt;

&lt;p&gt;&lt;strong&gt;Note&lt;/strong&gt;: Replace these placeholder references with actual references relevant to your course content.&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>Conventions</title>
   <link href="https://calculus-self-learning.pages.dev/contribution/conventions/"/>
   <updated>2021-02-03T00:00:00+00:00</updated>
   <id>https://calculus-self-learning.pages.dev/contribution/conventions</id>
   <content type="html">&lt;h2 id=&quot;1-directory-convention&quot;&gt;1. Directory Convention&lt;/h2&gt;

&lt;ul&gt;
  &lt;li&gt;Main content lives under &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;contents/{lang}/chapterXX/&lt;/code&gt; (e.g. &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;contents/en/chapter01/&lt;/code&gt;). Images go in &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;img/chapter_img/&lt;/code&gt;.&lt;/li&gt;
  &lt;li&gt;A typical chapter directory looks like this:&lt;/li&gt;
&lt;/ul&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;contents/
├── en/
│   └── chapter01/
│       ├── _posts/
│       │   ├── 21-01-07-01_00_Introduction.md
│       │   ├── 21-01-07-01_01_optimization_problems.md
│       │   └── ...
│       └── index.html
└── vi/
    └── chapter01/
        ├── _posts/
        └── index.html
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;ul&gt;
  &lt;li&gt;Jekyll treats Markdown or HTML files inside &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;_posts&lt;/code&gt; as blog posts. To add a new post, create a file in the chapter’s &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;_posts/&lt;/code&gt; directory.&lt;/li&gt;
  &lt;li&gt;Post filenames must follow this naming convention:
    &lt;ul&gt;
      &lt;li&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;YYYY-MM-DD-post_name.md&lt;/code&gt;&lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;
  &lt;li&gt;Files outside &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;contents/&lt;/code&gt; and &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;img/&lt;/code&gt; are site configuration. For stability, open an issue instead of editing config directly (config changes can make PR merges difficult).&lt;/li&gt;
&lt;/ul&gt;

&lt;h2 id=&quot;2-posting-convention&quot;&gt;2. Posting Convention&lt;/h2&gt;

&lt;h3 id=&quot;21-header-fields&quot;&gt;2.1. Header Fields&lt;/h3&gt;

&lt;ul&gt;
  &lt;li&gt;Every post must include front matter like this:&lt;/li&gt;
&lt;/ul&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;---
layout: post
title: Quasi-Newton Methods
chapter: &quot;18&quot;
order: 1
owner: &quot;Your Name&quot;
lang: en
categories:
- chapter18
lesson_type: required
---
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;strong&gt;layout&lt;/strong&gt; must be &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;post&lt;/code&gt;.&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;title&lt;/strong&gt; can be any descriptive string.&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;chapter&lt;/strong&gt; is the two-digit chapter number as a string (e.g. &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;&quot;01&quot;&lt;/code&gt; for chapter 1).&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;order&lt;/strong&gt; controls sort order within the chapter and prev/next navigation.&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;owner&lt;/strong&gt; is the post maintainer.&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;lang&lt;/strong&gt; is &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;en&lt;/code&gt; or &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;vi&lt;/code&gt;.&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;categories&lt;/strong&gt; must match the chapter directory name (e.g. &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;chapter18&lt;/code&gt;).&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;lesson_type&lt;/strong&gt; is &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;required&lt;/code&gt; or &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;optional&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3 id=&quot;22-latex&quot;&gt;2.2. LaTeX&lt;/h3&gt;

&lt;ul&gt;
  &lt;li&gt;Write formulas using LaTeX syntax.&lt;/li&gt;
  &lt;li&gt;Use double dollar signs (&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;$$&lt;/code&gt;) to mark math.&lt;/li&gt;
&lt;/ul&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;$$\theta x_1 + (1-\theta)x_2 \in C$$
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;renders as:&lt;/p&gt;

\[\theta x_1 + (1-\theta)x_2 \in C\]

&lt;h3 id=&quot;23-image-convention&quot;&gt;2.3. Image Convention&lt;/h3&gt;

&lt;ul&gt;
  &lt;li&gt;When inserting images in a post, use this format:&lt;/li&gt;
&lt;/ul&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&amp;lt;figure class=&quot;image&quot; style=&quot;align: center;&quot;&amp;gt;
&amp;lt;p align=&quot;center&quot;&amp;gt;
  &amp;lt;img src=&quot;{image_path}&quot; alt=&quot;{description of image}&quot; width=&quot;{scale_ratio}%&quot; height=&quot;{scale_ratio}%&quot;&amp;gt;
  &amp;lt;figcaption style=&quot;text-align: center;&quot;&amp;gt;{figcaption}&amp;lt;/figcaption&amp;gt;
&amp;lt;/p&amp;gt;
&amp;lt;/figure&amp;gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;ul&gt;
  &lt;li&gt;The figure class must be &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;image&lt;/code&gt;.&lt;/li&gt;
  &lt;li&gt;Replace &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;{}&lt;/code&gt; placeholders with appropriate values.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Alternatively, use markdown with the site image URL:&lt;/p&gt;

&lt;div class=&quot;language-markdown highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;p&quot;&gt;![&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;Alt text&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;](&lt;/span&gt;&lt;span class=&quot;sx&quot;&gt;/img/chapter_img/your-image.png&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h3 id=&quot;24-hyperlink-convention&quot;&gt;2.4 Hyperlink Convention&lt;/h3&gt;

&lt;ul&gt;
  &lt;li&gt;For links to other posts in this site, use the &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;multilang_post_url&lt;/code&gt; tag. Example:&lt;/li&gt;
&lt;/ul&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;[Your Post Title](#post-not-found)
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;ul&gt;
  &lt;li&gt;For external URLs:&lt;/li&gt;
&lt;/ul&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;[External Link](&amp;lt;https://example.com&amp;gt;)
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h2 id=&quot;3-github-convention&quot;&gt;3. GitHub Convention&lt;/h2&gt;

&lt;p&gt;If you have questions or find something to fix, use one of these:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;Leave a comment on the post&lt;/li&gt;
  &lt;li&gt;Open an issue in the repository&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;To add or edit content, create a new branch, make your changes, then open a &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;Pull Request&lt;/code&gt;. Anyone can contribute new or updated content.&lt;/p&gt;

&lt;h3 id=&quot;31-repository-policy&quot;&gt;3.1. Repository Policy&lt;/h3&gt;

&lt;p&gt;Merging into &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;main&lt;/code&gt; requires approval from at least one reviewer. If CODEOWNERS is configured, chapter reviewers are assigned automatically.&lt;/p&gt;

&lt;h3 id=&quot;32-branch-naming-convention&quot;&gt;3.2. Branch Naming Convention&lt;/h3&gt;

&lt;p&gt;Name branches using this pattern:&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;[feature|bugfix]/[chapter**|settings]-change-description
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Use two prefixes:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;strong&gt;feature&lt;/strong&gt;
    &lt;ul&gt;
      &lt;li&gt;Migration work&lt;/li&gt;
      &lt;li&gt;Changes to text, formulas, or images&lt;/li&gt;
      &lt;li&gt;New content&lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;bugfix&lt;/strong&gt;
    &lt;ul&gt;
      &lt;li&gt;Typo fixes&lt;/li&gt;
      &lt;li&gt;Broken LaTeX rendering&lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Examples:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;feature/chapter01-migration&lt;/code&gt;: chapter01 migration&lt;/li&gt;
  &lt;li&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;feature/chapter01-fix-formula&lt;/code&gt;: update formula in chapter01&lt;/li&gt;
  &lt;li&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;feature/settings-update-branch-convention&lt;/code&gt;: update conventions&lt;/li&gt;
  &lt;li&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;bugfix/chapter01-fix-typo&lt;/code&gt;: fix typo in chapter01&lt;/li&gt;
&lt;/ul&gt;
</content>
 </entry>
 
 <entry>
   <title>Initial Settings</title>
   <link href="https://calculus-self-learning.pages.dev/contribution/initial_settings/"/>
   <updated>2021-01-27T00:00:00+00:00</updated>
   <id>https://calculus-self-learning.pages.dev/contribution/initial_settings</id>
   <content type="html">&lt;p&gt;The contents of this repository are hosted as a &lt;a href=&quot;https://convex-optimization-for-all.github.io/&quot;&gt;Github Blog&lt;/a&gt; using Jekyll.
Therefore, to edit existing content or create new content, you must follow Jekyll’s directory structure and content writing conventions.
Additionally, you need to verify that changes are properly reflected in your local environment (your current computer) through a web browser.&lt;/p&gt;

&lt;p&gt;We have compiled environment setup instructions for those who are not familiar with GitHub or Jekyll.
If you have difficulties following the guide, please leave an &lt;a href=&quot;https://github.com/convex-optimization-for-all/convex-optimization-for-all.github.io/issues&quot;&gt;issue&lt;/a&gt; in the repository or contact us via the email below for assistance.&lt;/p&gt;

&lt;p&gt;(Kyeongmin Woo, wgm0601@gmail.com)&lt;/p&gt;

&lt;h2 id=&quot;1-git-installation&quot;&gt;1. Git Installation&lt;/h2&gt;

&lt;p&gt;All work management for this blog is performed through Git and GitHub. Please visit the website below to install Git.&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;https://git-scm.com/downloads&quot;&gt;https://git-scm.com/downloads&lt;/a&gt;&lt;/p&gt;

&lt;h2 id=&quot;2-downloading-the-repository&quot;&gt;2. Downloading the Repository&lt;/h2&gt;

&lt;p&gt;To modify the blog, enter the following command in the terminal to download the blog’s source code.&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;git clone https://github.com/convex-optimization-for-all/convex-optimization-for-all.github.io.git
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h2 id=&quot;3-local-hosting&quot;&gt;3. Local Hosting&lt;/h2&gt;

&lt;p&gt;Before applying changed or modified content to the blog, you must verify that the work has been performed as intended through local hosting.
If you merge work content that does not follow Jekyll’s required conventions into the repository, the blog hosted on the actual web may not function properly.
For local hosting setup, you can choose between two methods: using a virtual environment (Docker) (Option 1) or directly installing the Jekyll environment locally (Option 2).
After completing the local hosting setup and running the local server, you can check your blog content through the &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;127.0.0.1:4000&lt;/code&gt; address in your web browser.&lt;/p&gt;

&lt;h3 id=&quot;3-1-option-1-docker-installation&quot;&gt;3-1. (Option 1) Docker Installation&lt;/h3&gt;

&lt;h3 id=&quot;a-docker-installation&quot;&gt;A. Docker Installation&lt;/h3&gt;

&lt;p&gt;Using Docker enables local hosting without direct environment installation on your local machine.
Please visit the website below to install Docker.&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;https://docs.docker.com/get-docker/&quot;&gt;https://docs.docker.com/get-docker/&lt;/a&gt;&lt;/p&gt;

&lt;h3 id=&quot;b-local-hosting&quot;&gt;B. Local Hosting&lt;/h3&gt;

&lt;p&gt;Enter the following command in the terminal.&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;docker-compose up
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h3 id=&quot;3-2-option-2-jekyll-environment-installation&quot;&gt;3-2. (Option 2) Jekyll Environment Installation&lt;/h3&gt;

&lt;h3 id=&quot;a-jekyll-and-ruby-package-installation&quot;&gt;A. Jekyll and Ruby Package Installation&lt;/h3&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;a href=&quot;https://jekyllrb.com/docs/installation/&quot;&gt;Installing Ruby&lt;/a&gt;: Jekyll is built with Ruby. Therefore, you need to install Ruby to use Jekyll.&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://jekyllrb.com/docs/&quot;&gt;Installing Jekyll&lt;/a&gt;: Once Ruby is installed, enter the cloned repository and install Jekyll.&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://jekyllrb.com/docs/&quot;&gt;Installing Bundle Gem&lt;/a&gt;: You need to additionally install Ruby packages required for hosting. Run the following command in the repository’s project directory.&lt;/li&gt;
&lt;/ul&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;bundle &lt;span class=&quot;nb&quot;&gt;install&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h3 id=&quot;b-local-hosting-1&quot;&gt;B. Local Hosting&lt;/h3&gt;

&lt;p&gt;Enter the following command in the terminal.&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;$ jekyll serve
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;If hosting doesn’t work, you can also try the following command.&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;$ bundle exec jekyll serve
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;If both commands don’t work, the Jekyll environment has not been properly installed.&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>How to Contribute</title>
   <link href="https://calculus-self-learning.pages.dev/contribution/how_to_contribute/"/>
   <updated>2021-01-27T00:00:00+00:00</updated>
   <id>https://calculus-self-learning.pages.dev/contribution/how_to_contribute</id>
   <content type="html">&lt;hr /&gt;

&lt;h2 id=&quot;1-editing-content-directly&quot;&gt;1. Editing Content Directly&lt;/h2&gt;

&lt;h3 id=&quot;1-open-your-local-repository-directory-if-you-do-not-have-a-local-copy-yet-see-initial-settings&quot;&gt;(1) Open your local repository directory. If you do not have a local copy yet, see &lt;a href=&quot;/contribution/2021/01/27/initial_settings/&quot;&gt;Initial Settings&lt;/a&gt;.&lt;/h3&gt;

&lt;h3 id=&quot;2-sync-with-the-remote-repository&quot;&gt;(2) Sync with the remote repository.&lt;/h3&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;git checkout main
&lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;git pull &lt;span class=&quot;nt&quot;&gt;--all&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h3 id=&quot;3-create-a-new-branch-for-your-changes-use-prefixchapterreason-see-branch-naming-convention-example&quot;&gt;(3) Create a new branch for your changes. Use &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;[prefix]/[chapter]/[reason]&lt;/code&gt; (see &lt;a href=&quot;/contribution/2021/02/03/conventions/&quot;&gt;Branch Naming Convention&lt;/a&gt;). Example:&lt;/h3&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;git checkout &lt;span class=&quot;nt&quot;&gt;-b&lt;/span&gt; bugfix/chapter01-fix-typo
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h3 id=&quot;4-edit-files-follow-the-conventions-when-creating-or-updating-content&quot;&gt;(4) Edit files. Follow the &lt;a href=&quot;/contribution/2021/02/03/conventions/&quot;&gt;Conventions&lt;/a&gt; when creating or updating content.&lt;/h3&gt;

&lt;h3 id=&quot;5-push-to-the-remote-example&quot;&gt;(5) Push to the remote. Example:&lt;/h3&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;git push origin bugfix/chapter01-fix-typo
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h3 id=&quot;6-open-a-pull-request-to-main-on-github-see-github-docs-for-details&quot;&gt;(6) Open a Pull Request to &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;main&lt;/code&gt; on GitHub. See GitHub Docs for details:&lt;/h3&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;a href=&quot;https://docs.github.com/en/github/collaborating-with-issues-and-pull-requests/creating-a-pull-request&quot;&gt;Creating a pull request&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;hr /&gt;

&lt;h2 id=&quot;2-requesting-content-changes&quot;&gt;2. Requesting Content Changes&lt;/h2&gt;

&lt;ul&gt;
  &lt;li&gt;You can open an &lt;a href=&quot;https://github.com/nglelinh/calculus-self-learning/issues&quot;&gt;Issue&lt;/a&gt; on the GitHub repository.&lt;/li&gt;
&lt;/ul&gt;

&lt;hr /&gt;
</content>
 </entry>
 
 <entry>
   <title>introduction</title>
   <link href="https://calculus-self-learning.pages.dev/home/introduction/"/>
   <updated>2021-01-20T00:00:00+00:00</updated>
   <id>https://calculus-self-learning.pages.dev/home/introduction</id>
   <content type="html">&lt;h1 id=&quot;giải-tích-1-và-2--calculus-i--ii&quot;&gt;Giải tích 1 và 2 / Calculus I &amp;amp; II&lt;/h1&gt;

&lt;p&gt;Khoá tự học giải tích cho sinh viên đại học kỹ thuật và công nghệ: giới hạn, đạo hàm, tích phân, chuỗi,
rồi hàm nhiều biến, tích phân bội và giải tích vectơ. Mỗi bài có bản tiếng Việt và tiếng Anh.&lt;/p&gt;

&lt;p&gt;Nội dung đang được xây dựng. Kế hoạch các chương nằm trong &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;PLAN.md&lt;/code&gt; của repo.&lt;/p&gt;

&lt;p&gt;This is a self-study course in single-variable and multivariable calculus, written in Vietnamese and English.
The content is under construction; see &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;PLAN.md&lt;/code&gt; in the repository for the outline.&lt;/p&gt;

&lt;p&gt;Mã nguồn và góp ý: &lt;a href=&quot;https://github.com/nglelinh/calculus-self-learning&quot;&gt;GitHub&lt;/a&gt;.&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>contents</title>
   <link href="https://calculus-self-learning.pages.dev/home/contents/"/>
   <updated>2021-01-20T00:00:00+00:00</updated>
   <id>https://calculus-self-learning.pages.dev/home/contents</id>
   <content type="html">&lt;h1 id=&quot;mục-tiêu&quot;&gt;Mục tiêu&lt;/h1&gt;

&lt;p&gt;Sau khoá học, người học tính được giới hạn, đạo hàm, tích phân và tổng chuỗi thông thường, đọc được một chứng minh
giải tích ở mức ε–δ, và dùng được đạo hàm riêng, gradient, tích phân bội và các định lý Green, Stokes, Gauss
trong bài toán vật lý, kinh tế và học máy.&lt;/p&gt;

&lt;p&gt;Các chương sẽ xuất hiện ở thanh bên khi bài học được đăng.&lt;/p&gt;
</content>
 </entry>
 

</feed>
