2018年3月28日 星期三

二元一次不等式,法向量所指區域為正區域,法向量反向之區域為負區域;二元一次式之函數值循法向量方向移動而增加

謹以此文紀念我的高中數學老師黃靜卿先生。

==定理1==(用法向量判斷正區域和負區域)


考慮二元一次式$f(x, y) = ax + by + c$,其中$a, b$不同時為零。在座標平面上,

(i) $ax + by + c = 0$的幾何圖形為一直線;
(ii) $ax + by + c > 0$代表之區域正是以直線$ax + by + c = 0$為邊界,而落於法向量$\overrightarrow{n} = (a, b)$所指方向的區域;
(iii) $ax + by + c < 0$代表之區域正是以直線$ax + by + c = 0$為邊界,而落於法向量$\overrightarrow{n} = (a, b)$所指方向反側的區域。

==證明==


(i) 顯然。

(ii) 命直線集合為$L = \{ (x, y) | ax+by+c=0 \}$,而正區域為$L_+ = \{ (x, y) | ax+by+c>0 \}$,負區域為$L_- = \{ (x, y) | ax+by+c<0 \}$。

顯然$\mathbb{R}^2 = L \cup L_+ \cup L_-$,且$L, L_+, L_-$互不相交,亦即$L \cap L_+ = \phi, L \cap L_- = \phi, L_+ \cap L_- = \phi$。

以直線$ax + by + c = 0$為邊界,而落於法向量$\overrightarrow{n} = (a, b)$所指方向的區域」可描述為$L$上的點經任意正倍數的法向量$\overrightarrow{n}$平移後所得到的點集。若記此區域為$D_+$,以數學式表達就是
$$D_+ = \{ (x, y) + t \overrightarrow{n} | (x, y) \in L, t > 0 \}.$$
我們要證明的即是
$$L_+ = D_+.$$

任取$P \in D_+$,則$\exists (x, y) \in L, t > 0$使得$P = (x, y) + t \overrightarrow{n}$。於是
\begin{align}
f(P) &= f(x+ta, y+tb) \notag \\
&= a(x+ta) + b(y+tb) + c \notag \\
&= (ax+by+c) + t(a^2+b^2). \notag
\end{align}
由於$t>0$且$a, b$不同時為零,所以$t(a^2+b^2) > 0$,也就是$f(P) > 0$。因此得$P \in L_+$,從而$D_+ \subseteq L_+$。

任取$Q = (x, y) \in L_+$,我們想證明$Q$也落在$D_+$之中,如此就可得$L_+ \subseteq D_+$。而要完成此目標,我們必須找到$(x_0, y_0) \in L$以及正數$t$使得$Q = (x_0, y_0) + t \overrightarrow{n}$。

設$f(Q) = d$,即有$ax+by+c=d$。由於$Q \in L_+$,所以當然$d > 0$。對照證明$D_+ \subseteq L_+$的過程「$f(P) = \ldots = (ax+by+c) + t(a^2 +b^2)$」,我們合理猜測現在應該取$t = \frac{d}{a^2 +b^2}$,同時$(x_0, y_0)$應為$\left( x - \frac{d}{a^2 +b^2}\cdot a, y - \frac{d}{a^2 +b^2}\cdot b \right)$。以下驗證這樣的猜測是正確的。
\begin{align}
f \left( x - \frac{d}{a^2 +b^2}\cdot a, y - \frac{d}{a^2 +b^2}\cdot b \right)
&= a \left( x - \frac{d}{a^2 +b^2}\cdot a \right) + b \left(y - \frac{d}{a^2 +b^2}\cdot b \right) \notag \\
&= (ax+by+c) - \frac{d}{a^2 + b^2}(a^2 + b^2) \notag \\
&= d - d \notag \\
&= 0. \notag
\end{align}
所以若取$(x_0, y_0) = \left( x - \frac{d}{a^2 +b^2}\cdot a, y - \frac{d}{a^2 +b^2}\cdot b \right)$,則$(x_0, y_0)$確實$\in L$。而
\begin{align}
Q &= (x, y) \notag \\
&= \left( x - \frac{d}{a^2 +b^2}\cdot a + \frac{d}{a^2 +b^2}\cdot a , y - \frac{d}{a^2 +b^2}\cdot b + \frac{d}{a^2 +b^2}\cdot b\right) \notag \\
&= \left( x - \frac{d}{a^2 +b^2}\cdot a, y - \frac{d}{a^2 +b^2}\cdot b \right) + \left( \frac{d}{a^2 +b^2}\cdot a, \frac{d}{a^2 +b^2}\cdot b \right) \notag \\
&= (x_0, y_0) + \frac{d}{a^2 +b^2} (a, b) \notag \\
&= (x_0, y_0) + t \overrightarrow{n}. \notag
\end{align}
如此就證明了$Q \in D_+$,也就有$L_+ \subseteq D_+$。

綜合上述$D_+ \subseteq L_+$與$L_+ \subseteq D_+$,我們得到$L_+ = D_+$。

(iii) 「以直線$ax + by + c = 0$為邊界,而落於法向量$\overrightarrow{n} = (a, b)$所指方向反側的區域」可描述為$L$上的點經任意負倍數的法向量$\overrightarrow{n}$平移後所得到的點集。若記此區域為$D_-$,以數學式表達就是
$$D_- = \{ (x, y) + t \overrightarrow{n} | (x, y) \in L, t < 0 \}.$$

顯然有$\mathbb{R}^2 = L \cup D_+ \cup D_-$,且$L \cap D_+ = \phi, L \cap D_- = \phi, D_+ \cap D_- = \phi$。

由於已知$\mathbb{R}^2 = L \cup L_+ \cup L_-$,與上式相比較,可得
\begin{align}
D_- &= \mathbb{R}^2 \backslash \left( L \cup D_+ \right) \notag \\
&= \mathbb{R}^2 \backslash \left( L \cup L_+ \right) \notag \\
&= \left( L \cup L_+ \cup L_- \right) \backslash \left( L \cup L_+ \right) \notag \\
&= L_-. \notag
\end{align}
(證明終了)

==定理2==(線性規劃中目標函數在限定區域發生極值位置的探索方法)


二元一次式之函數值循法向量方向移動而增加。

==證明==


設$P_0 = (x_0, y_0) \in L, P_t = P_0 + t \overrightarrow{n}$。當$t > 0$時,$P_t \in L_+$;而當$t < 0$時,$P_t \in L_-$。

取正數$t, s$滿足$t < s$,於是乎$P_t$與$P_s$皆落在$L_+$之中,而自$P_t$移動到$P_s$必須沿$(s - t) \overrightarrow{n}$。注意這裡$s - t > 0$,是以自$P_t$移動到$P_s$是循著法向量$\overrightarrow{n}$之正方向前進。

我們要證明的是$f(P_s) > f(P_t)$。

進行以下計算,
\begin{align}
f(P_s) - f(P_t)
&= f(P_0 + s \overrightarrow{n}) - f(P_0 + t \overrightarrow{n}) \notag \\
&= s(a^2 + b^2) - t(a^2 +b^2) \notag \\
&= (s - t)(a^2 + b^2) \notag \\
&> 0. \notag
\end{align}
從而$f(P_s) > f(P_t)$。
(證明終了)

==討論==


我們的討論可以毫無困難地推廣到$n$維空間。這裡我們所得到的結果,其實只是多元微積分學中關於空間曲面梯度向量以及方向導數的定理的特例。

定理. 設$D$為$\mathbb{R}^n$中的開集。若函數$f : D \rightarrow \mathbb{R}$在$D$上可微,則對於任意單位向量${\bf \overrightarrow{u}} \in \mathbb{R}^n$以及${\bf x} \in D$,函數$f$在${\bf x}$循${\bf \overrightarrow{u}}$的方向導數為
$$D_{{\bf \overrightarrow{u}}} f({\bf x}) = \nabla f({\bf x}) \cdot {\bf \overrightarrow{u}}.$$
而方向導數最大值為$|\nabla f({\bf x})|$,發生於${\bf \overrightarrow{u}}$與$\nabla f({\bf x})$平行同向之際。

在高中數學傳統教學中,正、負區域的判定是採用「約定x項的係數為正...P點在L的右邊,則f(P)>0;若P在L的左邊,則f(P)<0」(參見部落格【王的夢田】文章〈平面被一直線分成兩部份的正負情形〉),學生常常會搞不清楚正區域和負區域的位置。因為這個約定太麻煩了,還得先化簡所給定的直線方程式,然後要去記所謂的左邊或是右邊。試想,在三維或是更高維空間中,如果要處理線性規劃區域問題,我們還會有什麼左、右之分嗎?我們唯一可以依循的只有法向量,按其指向去區分各區域,法向量才是處理判定正、負區域的根本工具。

$h \rightarrow 0$時,$o(h) = o(|h|)$

==定理==


$h \rightarrow 0$時,$o(h) = o(|h|)$

==證明==


若$f(h) = o(h)$,則$\lim \limits_{h \rightarrow 0} \frac{f(h)}{h} = 0$。由極限的$\varepsilon-\delta$定義,$\forall \varepsilon > 0, \exists \delta > 0, \forall h \in (-\delta, \delta) \backslash \{0\}, \left| \frac{f(h)}{h} - 0 \right| < \varepsilon$。於是我們有
\begin{align}
\varepsilon &> \left| \frac{f(h)}{h} - 0 \right| \notag \\
&= \left| \frac{f(h)}{h} \right| \notag \\
&= \frac{|f(h)|}{|h|} \notag \\
&= \frac{|f(h)|}{||h||} \notag \\
&= \left| \frac{f(h)}{|h|} \right| \notag \\
&= \left| \frac{f(h)}{|h|} - 0 \right|. \notag
\end{align}
這意味著
$$\lim_{h \rightarrow 0} \frac{f(h)}{|h|} = 0.$$
從而$f(h) = o(|h|)$。

若$f(h) = o(|h|)$,則$\lim \limits_{h \rightarrow 0} \frac{f(h)}{|h|} = 0$。由極限的$\varepsilon-\delta$定義,$\forall \varepsilon > 0, \exists \delta > 0, \forall h \in (-\delta, \delta) \backslash \{0\}, \left| \frac{f(h)}{|h|} - 0 \right| < \varepsilon$。於是我們有
\begin{align}
\varepsilon &> \left| \frac{f(h)}{|h|} - 0 \right| \notag \\
&= \left| \frac{f(h)}{|h|} \right| \notag \\
&= \frac{|f(h)|}{||h||} \notag \\
&= \frac{|f(h)|}{|h|} \notag \\
&= \left| \frac{f(h)}{h} \right| \notag \\
&= \left| \frac{f(h)}{h} - 0 \right|. \notag
\end{align}
這意味著
$$\lim_{h \rightarrow 0} \frac{f(h)}{h} = 0.$$
從而$f(h) = o(h)$。

綜上所述可得$o(h) = o(|h|)$。
(證明終了)

2018年3月27日 星期二

單變數函數的導函數的定義與例子

導函數的定義


設$(a, b) \subseteq \mathbb{R}$。

若$\forall x \in (a, b)$,$f$在$x$皆可導,則稱$f$在$(a, b)$上可導。此時得一函數(映射)
$$f': (a, b) \rightarrow \mathbb{R}, f': x \mapsto f'(x).$$
此函數稱為$f$在$(a, b)$上的導函數(derivative)。

導函數的例子


例1. 常數函數的導函數。

設$c \in \mathbb{R}$是一個常數,$f_1 : (-\infty, +\infty) \rightarrow \mathbb{R}, f_1 (x) = c$。$\forall x \in (-\infty, +\infty)$有$f_1' (x) = 0$,$f_1$在$(-\infty, +\infty)$上可導,所以$f_1$在$(-\infty, +\infty)$的導函數為$f_1' (x) = 0$。

例2. 線型/一次函數的導函數。

設$m, k \in \mathbb{R}, m \neq 0$,$f_2 : (-\infty, +\infty) \rightarrow \mathbb{R}, f_2 (x) = mx+k$。$\forall x \in (-\infty, +\infty)$有$f_2' (x) = m$,$f_2$在$(-\infty, +\infty)$上可導,所以$f_2$在$(-\infty, +\infty)$的導函數為$f_2' (x) = m$。

例3. 二次函數的導函數。

設$a, b, c \in \mathbb{R}, a \neq 0$,$f_3 : (-\infty, +\infty) \rightarrow \mathbb{R}, f_3 (x) = ax^2 + bx +c$。$\forall x \in (-\infty, +\infty)$有$f_3' (x) = 2ax+b$,$f_3$在$(-\infty, +\infty)$上可導,所以$f_3$在$(-\infty, +\infty)$的導函數為$f_3' (x) = 2ax+b$。

例4. $n$次方函數的導函數。

設$n \in \mathbb{N}$,$f_4 : (-\infty, +\infty) \rightarrow \mathbb{R}, f_4 (x) = x^n$。$\forall x \in (-\infty, +\infty)$有$f_4' (x) = nx^{n-1}$,$f_4$在$(-\infty, +\infty)$上可導,所以$f_4$在$(-\infty, +\infty)$的導函數為$f_4' (x) = nx^{n-1}$。

例5. 倒數函數的導函數。

設$f_5 : (-\infty, 0) \cup (0, +\infty) \rightarrow \mathbb{R}, f_5 (x) = \frac{1}{x}$。$\forall x \in (-\infty, 0) \cup (0, +\infty)$有$f_5' (x) = \frac{-1}{x^2}$,$f_5$在$(-\infty, 0) \cup (0, +\infty)$上可導,所以$f_5$在$(-\infty, 0) \cup (0, +\infty)$的導函數為$f_5' (x) = \frac{-1}{x^2}$。

例6. 平方根函數的導函數。

設$f_6 : [0, +\infty) \rightarrow \mathbb{R}, f_6 (x) = \sqrt{x}$。$\forall x \in (0, +\infty)$有$f_6' (x) = \frac{1}{2\sqrt{x}}$,$f_6$在$(0, +\infty)$上可導(注意這裡可導的區間是開區間!),所以$f_6$在$(0, +\infty)$的導函數為$f_6' (x) = \frac{1}{2\sqrt{x}}$。

單變數函數可導必連續

==定理==(可導必連續)


設$(a, b) \subseteq \mathbb{R}, f: (a, b) \rightarrow \mathbb{R}, c \in (a, b)$。

若$f$在$c$可導,則$f$在$c$連續。

==證明==


$f: (a, b) \rightarrow \mathbb{R}$且$c \in (a, b) \Rightarrow f$在$c$有定義,函數值為$f(c)$。

$f$在$c$可導$\Rightarrow \lim \limits_{h \rightarrow 0} \frac{f(c+h) - f(c)}{h}$存在,此極限值即為$f$在$c$的導數$f'(c)$。

注意$\lim \limits_{h \rightarrow 0} h = 0$且$\lim \limits_{h \rightarrow 0} f(c) = f(c)$。

根據極限論的四則運算,我們有
\begin{align}
\lim \limits_{h \rightarrow 0} f(c+h)
&= \lim \limits_{h \rightarrow 0} \left[ \frac{f(c+h) - f(c)}{h} \times h + f(c) \right] \notag \\
&= \left[ \lim \limits_{h \rightarrow 0} \frac{f(c+h) - f(c)}{h} \right] \times \left[ \lim \limits_{h \rightarrow 0} h \right] + \left[ \lim \limits_{h \rightarrow 0} f(c) \right] \notag \\
&= f'(c) \times 0 + f(c) \notag \\
&= f(c). \notag
\end{align}
考慮代換$x = c+h$,則$h = x - c$,而$h \rightarrow 0$變為$x - c \rightarrow 0$,也就有$x \rightarrow c$。所以上面推導所得的
$$\lim_{h \rightarrow 0} f(c+h) = f(c)$$
可改寫為
$$\lim_{x \rightarrow c} f(x) = f(c).$$
換句話說,我們推得「極限值等於函數值」,這意味著$f$在$c$連續。
(證明終了)

==注意==


這個定理告訴我們「可導必連續」,但反之未必成立,亦即「連續不一定可導」。

. 絕對值函數$f: (-\infty, +\infty) \rightarrow \mathbb{R}, f(x) = |x|$,$f$在$(-\infty, +\infty)$上連續,但在$0$不可導。

2018年3月26日 星期一

單變數函數可導的定義與例子

設$(a, b) \subseteq \mathbb{R}$,$f: (a, b) \rightarrow \mathbb{R}$是一個函數(映射),$c \in (a, b)$,也就是說$c$為開區間$(a, b)$內部的一個點。

函數$f$在$c$點當然有定義,函數值記為$f(c)$。

導數/可導的定義


若極限$\displaystyle \lim_{h \rightarrow 0} \frac{f(c+h) - f(c)}{h}$存在,則稱函數$f$在$x = c$處「可導(differentiable)」,而極限值記為$f'(c)$,稱為$f$在$c$的導數(derivative)。換句話說,我們可形式地定義導數$f'(c)$為
$$f'(c) = \lim_{h \rightarrow 0} \frac{f(c+h) - f(c)}{h}.$$
其中極限式裡的分式$\frac{f(c+h) - f(c)}{h}$稱為$f$在$c$的牛頓商(Newton quotient)或是差商(difference quotient)(這裡「形式地」意味著我們只著重上面定義式子所表現的形式,至於右方那個極限式是否有極限並非最優先考慮的事。)

代號的代換


$f$在$x = c$可導$\displaystyle \Leftrightarrow \lim_{h \rightarrow 0} \frac{f(c+h) - f(c)}{h}$存在,導數值$=f'(c)$。

$f$在$x = d$可導$\displaystyle \Leftrightarrow \lim_{h \rightarrow 0} \frac{f(d+h) - f(d)}{h}$存在,導數值$=f'(d)$。

$f$在$x = e$可導$\displaystyle \Leftrightarrow \lim_{h \rightarrow 0} \frac{f(e+h) - f(e)}{h}$存在,導數值$=f'(e)$。

$f$在$x = x_0$可導$\displaystyle \Leftrightarrow \lim_{h \rightarrow 0} \frac{f(x_0+h) - f(x_0)}{h}$存在,導數值$=f'(x_0)$。

$f$在$x = t_1$可導$\displaystyle \Leftrightarrow \lim_{h \rightarrow 0} \frac{f(t_1+h) - f(t_1)}{h}$存在,導數值$=f'(t_1)$。

$f$在$x = {\text{火星}}$可導$\displaystyle \Leftrightarrow \lim_{h \rightarrow 0} \frac{f({\text{火星}}+h) - f({\text{火星}})}{h}$        存在,導數值$=f'(\text{火星})$。

$F$在$x = x_0$可導$\displaystyle \Leftrightarrow \lim_{h \rightarrow 0} \frac{F(x_0+h) - F(x_0)}{h}$存在,導數值$=F'(x_0)$。

$g$在$x = x_0$可導$\displaystyle \Leftrightarrow \lim_{h \rightarrow 0} \frac{g(x_0+h) - g(x_0)}{h}$存在,導數值$=g'(x_0)$。

為何導數要叫做導數?「導」的涵義為何?


這個問題會另文討論,讀者就先暫時接受這樣算出來的東西稱作「導數」。

例子


例1. 常數函數

設$c \in \mathbb{R}, f_1 : (-\infty, +\infty) \rightarrow \mathbb{R}$,$f_1 (x) = c$。

我們稱函數$f_1$是「常數函數(constant function)」,因為$f_1$總是將任何一個$x$對應到固定值$c$。(說文解字:「常」這個字具有「恆定」的意思,所以才用「常」。)

任取$x \in \mathbb{R}$,計算導數定義的極限式
\begin{align}
 \lim_{h \rightarrow 0} \frac{f_1 (x+h) - f_1(x)}{h} &= \lim_{h \rightarrow 0} \frac{c - c}{h} \notag \\
&= \lim_{h \rightarrow 0} \frac{0}{h} \notag \\
&= \lim_{h \rightarrow 0} 0 \notag \\
&= 0. \notag
\end{align}
以上的計算告訴我們常數函數$f_1 (x) = c$在任何一處都可導,且導數值為$0$。換句話說,我們有
$$\forall x \in \mathbb{R}, f_1' (x) = 0.$$

例2. 線型函數/一次函數(linear function)

設$m, k \in \mathbb{R}, m \neq 0, f_2: (-\infty, +\infty) \rightarrow \mathbb{R}, f_2 (x) = mx + k$。

我們稱函數$f_2$為「線型函數」或「一次函數」。(說文解字:「線型」的意思是因為這個函數的圖形畫出來就像是一條直線;「一次」的意思是指自變數$x$的次數為$1$次。注意「線型」與「線性」不大一樣,寫的時候別混淆了。)

任取$x \in \mathbb{R}$,計算導數定義的極限式
\begin{align}
 \lim_{h \rightarrow 0} \frac{f_2 (x+h) - f_2(x)}{h} &= \lim_{h \rightarrow 0} \frac{[m(x+h) + k] - (mx + k)}{h} \notag \\
&= \lim_{h \rightarrow 0} \frac{mh}{h} \notag \\
&= \lim_{h \rightarrow 0} m \notag \\
&= m. \notag
\end{align}
以上的計算告訴我們線型函數$f_2$在任何一處都可導,且導數值為$m$。換句話說,我們有
$$\forall x \in \mathbb{R}, f_2' (x) = m.$$

例3. 二次函數(quadratic function)

設$a, b, c \in \mathbb{R}, a \neq 0, f_3 : (-\infty, +\infty) \rightarrow \mathbb{R}, f_3 (x) = ax^2 + bx + c$。

我們稱函數$f_3$為「二次函數(quadratic function)」。(說文解字:「二次」的意思是指自變數$x$的次數為$2$次。)

任取$x \in \mathbb{R}$,計算導數定義的極限式
\begin{align}
 \lim_{h \rightarrow 0} \frac{f_3 (x+h) - f_3 (x)}{h} &= \lim_{h \rightarrow 0} \frac{[a(x+h)^2 + b(x+h) + c] - (ax^2 + bx + c)}{h} \notag \\
&= \lim_{h \rightarrow 0} \frac{ax^2 + 2axh + ah^2 + bx + bh + c - ax^2 - bx - c}{h} \notag \\
&= \lim_{h \rightarrow 0} \frac{2axh + ah^2 + bh}{h} \notag \\
&= \lim_{h \rightarrow 0} \frac{h(2ax + ah + b)}{h} \notag \\
&= \lim_{h \rightarrow 0} (2ax + ah + b) \notag \\
&= 2ax + a \times 0 + b \notag \\
&= 2ax + b. \notag
\end{align}
以上的計算告訴我們二次函數$f_3 (x) = ax^2 + bx + c$在任何一處都可導,且導數值為$2ax + b$。換句話說,我們有
$$\forall x \in \mathbb{R}, f_3' (x) = 2ax + b.$$

例4. $x$的$n$次方

設$n \in \mathbb{N}, f_4 : (-\infty, +\infty) \rightarrow \mathbb{R}, f_4 (x) = x^n$。

任取$x \in \mathbb{R}$,計算導數定義的極限式
\begin{align}
 \lim_{h \rightarrow 0} \frac{f_4 (x+h) - f_4 (x)}{h} &= \lim_{h \rightarrow 0} \frac{(x+h)^n - x^n}{h} \notag \\
&= \lim_{h \rightarrow 0} \frac{\sum_{k=0}^n {n \choose k}x^{n-k}h^k - x^n}{h} \quad [{\text{二項式定理}}] \notag \\
&= \lim_{h \rightarrow 0} \frac{\left[ x^n + nx^{n-1}h + \frac{n(n-1)}{2}x^{n-2}h^2 + \cdots + h^n \right] - x^n }{h} \notag \\
&= \lim_{h \rightarrow 0} \frac{nx^{n-1}h + \frac{n(n-1)}{2}x^{n-2}h^2 + \cdots + h^n}{h} \notag \\
&= \lim_{h \rightarrow 0} \frac{h \left[ nx^{n-1} + \frac{n(n-1)}{2}x^{n-2}h + \cdots + h^{n-1} \right]}{h} \notag \\
&= \lim_{h \rightarrow 0} \left[ nx^{n-1} + \frac{n(n-1)}{2}x^{n-2}h + \cdots + h^{n-1} \right] \notag \\
&= nx^{n-1} + \frac{n(n-1)}{2}x^{n-2} \times 0 + \cdots + 0^{n-1}\notag \\
&= nx^{n-1}. \notag
\end{align}
以上的計算告訴我們函數$f_4 (x) = x^n$在任何一處都可導,且導數值為$nx^{n-1}$。換句話說,我們有
$$\forall x \in \mathbb{R}, f_4' (x) = nx^{n-1}.$$

例5. $x$分之一

設$f_5 : (-\infty, 0) \cup (0, +\infty) \rightarrow \mathbb{R}, f_5 (x) = \frac{1}{x}$。

任取$x \in (0, +\infty)$,計算導數定義的極限式
\begin{align}
 \lim_{h \rightarrow 0} \frac{f_5 (x+h) - f_5 (x)}{h} &= \lim_{h \rightarrow 0} \frac{\frac{1}{x+h} - \frac{1}{x}}{h} \notag \\
&=  \lim_{h \rightarrow 0} \frac{\left( \frac{1}{x+h} - \frac{1}{x} \right) \cdot (x+h)x}{h \cdot (x+h)x} \notag \\
&=  \lim_{h \rightarrow 0} \frac{x - (x+h)}{hx(x+h)} \notag \\
&=  \lim_{h \rightarrow 0} \frac{-h}{hx(x+h)} \notag \\
&=  \lim_{h \rightarrow 0} \frac{-1}{x(x+h)} \notag \\
&=  \frac{-1}{x(x+0)} \notag \\
&=  \frac{-1}{x^2} \notag
\end{align}
以上的計算告訴我們函數$f_5 (x) = \frac{1}{x}$在$(0, +\infty)$中任何一處都可導,且導數值為$\frac{-1}{x^2}$。換句話說,我們有
$$\forall x \in (0, +\infty), f_5' (x) = \frac{-1}{x^2}.$$

再任取$x \in (-\infty, 0)$,計算導數定義的極限式
\begin{align}
 \lim_{h \rightarrow 0} \frac{f_5 (x+h) - f_5 (x)}{h} &= \lim_{h \rightarrow 0} \frac{\frac{1}{x+h} - \frac{1}{x}}{h} \notag \\
&=  \lim_{h \rightarrow 0} \frac{\left( \frac{1}{x+h} - \frac{1}{x} \right) \cdot (x+h)x}{h \cdot (x+h)x} \notag \\
&=  \lim_{h \rightarrow 0} \frac{x - (x+h)}{hx(x+h)} \notag \\
&=  \lim_{h \rightarrow 0} \frac{-h}{hx(x+h)} \notag \\
&=  \lim_{h \rightarrow 0} \frac{-1}{x(x+h)} \notag \\
&=  \frac{-1}{x(x+0)} \notag \\
&=  \frac{-1}{x^2} \notag
\end{align}
以上的計算告訴我們函數$f_5 (x) = \frac{1}{x}$在$(-\infty, 0)$中任何一處都可導,且導數值為$\frac{-1}{x^2}$。換句話說,我們有
$$\forall x \in (-\infty, 0), f_5' (x) = \frac{-1}{x^2}.$$

所以不論$x$是在$(0, +\infty)$還是$(-\infty, 0)$,$f_5 (x) = \frac{1}{x}$都可導,且導數值為$\frac{-1}{x^2}$。換句話說,我們有
$$\forall x \in (-\infty, 0) \cup (0, +\infty), f_5' (x) = \frac{-1}{x^2}.$$

例6. 根號$x$

設$f_6 : [0, +\infty), f_6 (x) = \sqrt{x}$。

回顧導數的定義,要取導數的點必須在開區間中,所以我們取$x \in (0, +\infty)$,計算導數定義的極限式
\begin{align}
 \lim_{h \rightarrow 0} \frac{f_6 (x+h) - f_6 (x)}{h} &= \lim_{h \rightarrow 0} \frac{\sqrt{x+h} - \sqrt{x}}{h} \notag \\
&= \lim_{h \rightarrow 0} \frac{\sqrt{x+h} - \sqrt{x}}{\color{red}{\sqrt{x+h}^2 - \sqrt{x}^2}} \notag \\
&= \lim_{h \rightarrow 0} \frac{\sqrt{x+h} - \sqrt{x}}{\left( \sqrt{x+h} - \sqrt{x} \right)\left( \sqrt{x+h} + \sqrt{x} \right)} \notag \\
&= \lim_{h \rightarrow 0} \frac{1}{\sqrt{x+h} + \sqrt{x}} \notag \\
&= \frac{1}{\sqrt{x+0} + \sqrt{x}} \notag \\
&= \frac{1}{2\sqrt{x}} \notag
\end{align}
以上的計算告訴我們函數$f_6 (x) = \sqrt{x}$在$(0, +\infty)$中任何一處都可導,且導數值為$\frac{1}{2\sqrt{x}}$。換句話說,我們有
$$\forall x \in \mathbb{R}, f_6' (x) = \frac{1}{2\sqrt{x}}.$$

統整


我們略為統整以上討論的結果:

  1. 常數函數$f_1 (x) = c$在$\mathbb{R}$上處處有定義,在$\mathbb{R}$上任一點都可導。對於任意$x \in \mathbb{R}$,有$f_1' (x) = 0$。
  2. 一次函數$f_2 (x) = mx + k$在$\mathbb{R}$上處處有定義,在$\mathbb{R}$上任一點都可導。對於任意$x \in \mathbb{R}$,有$f_2' (x) = m$。
  3. 二次函數$f_3 (x) = ax^2 + bx + c$在$\mathbb{R}$上處處有定義,在$\mathbb{R}$上任一點都可導。對於任意$x \in \mathbb{R}$,有$f_3' (x) = 2ax$。
  4. $n$次方函數$f_4 (x) = x^n$在$\mathbb{R}$上處處有定義,在$\mathbb{R}$上任一點都可導。對於任意$x \in \mathbb{R}$,有$f_4' (x) = nx^{n-1}$。
  5. 倒數函數$f_5 (x) = \frac{1}{x}$定義於$(-\infty, 0) \cup (0, +\infty)$,在其中任一點都可導。對於任意$x \in (-\infty, 0) \cup (0, +\infty)$,有$f_5' (x) = \frac{-1}{x^2}$。
  6. 平方根函數$f_6 (x) = \sqrt{x}$定義於$[0, +\infty)$,在$(0, +\infty)$上任一點都可導。對於任意$x \in (0, +\infty)$,有$f_6' (x) = \frac{1}{2\sqrt{x}}$。

導數的另稱


導數有很多別稱,以下列出這些名稱,以及使用那些名稱的教材或數學家。
  1. 流數(fluxion):牛頓。目前沒人使用。
  2. 紀數:熊慶來《高等算學引論》(民國初年清華大學算學系分析教材)。目前沒人使用。
  3. 微商:華羅庚《高等數學引論》、鄧東皋《數學分析簡明教程》、龔昇《簡明微積分》、中國科學技術大學高等數學教研室《高等數學導論》。
  4. 微分係數:小平邦彥《解析入門》、Hardy《純數學教程(Course of Pure Mathematics)》。
這些名稱的由來將會另文討論。

導數$\neq$微分


請讀者注意一點,絕對不可將「導數」稱作「微分」!
導數$\neq$微分
導數$\neq$微分
導數$\neq$微分
之所以不同的理由有幾個。數學上來說,導數是差商的極限,但是微分直觀來說是「微增量」;幾何來說,導數是切線斜率,微分是切線上的點的高度改變量;物理來說,導數是速度,而微分是位移。

例5的倒數函數$f_5 (x) = \frac{1}{x}$來說,對於任意$x \in (-\infty, 0) \cup (0, +\infty)$,其導數為$\frac{-1}{x^2}$。但是不可說「$\frac{1}{x}$的微分是$\frac{-1}{x^2}$」。

微分的詳細介紹將於另文討論。

2018年3月18日 星期日

Apostol Linear Algebra Exercise 0.13.2

題目

若一個實數$x$有性質$x^2=x+1$,用歸納法證明存在函數$f(n)$,使得對所有整數$n \geq 1$,都有$x^{n+1} = f(n+1)x +f(n)$。

解答

  • 分析

$n=1$時,所要證明的的式子為
$$x^{1+1}=f(1+1)x + f(1),$$
也就是
$$x^2 = f(2) x + f(1).$$

比對題目所給的條件$x^2 = x +1$,合理猜測$f(2) = 1, f(1) = 1$。

現在看$n=2$的情況。此時要有
\begin{align*}
x^{2+1} &= f(2+1)x + f(2), \\
x^3 &= f(3) x + 1, \\
f(3) &= \frac{x^3 - 1}{x} \\
&= \frac{x \cdot x^2 - 1}{x} \\
&= \frac{x \cdot (x+1) -1}{x} \\
&= \frac{x^2 + x -1}{x} \\
&= \frac{(x+1)+ x -1}{x} \\
&= \frac{2x}{x} \\
&= 2.
\end{align*}
(注意顯然$x \neq 0$,所以$\frac{\square}{x}$是有意義的)而我們有
$$x^3 = 2x + 1.$$

再繼續看看$n=3$的情況。
\begin{align*}
x^{3+1} &= f(3+1)x + f(3) \\
x^4 &= f(4)x + 2 \\
f(4) &= \frac{x^4 - 2}{x} \\
&= \frac{x \cdot x^3 - 2}{x} \\
&= \frac{x \cdot (2x + 1) -2}{x} \\
&= \frac{2x^2 + x - 2}{x} \\
&= \frac{2(x+1) + x - 2}{x} \\
&= \frac{3x}{x} \\
&= 3.
\end{align*}而我們有
$$x^4 = 3x + 2.$$

彙整以上的計算結果如下
$$f(1) = 1, f(2) = 1, f(3) = 2, f(4) =3.$$
這些結果似乎構成Fibonacci數列,故猜測$f(5) = 5$。

計算$n=4$的情況來確認看看。
\begin{align*}
x^{4+1} &= f(4+1)x + f(4) \\
x^5 &= f(5)x + 3 \\
f(5) &= \frac{x^5 - 3}{x} \\
&= \frac{x \cdot x^4 - 3}{x} \\
&= \frac{x \cdot (3x + 2) -3}{x} \\
&= \frac{3x^2 + 2x - 3}{x} \\
&= \frac{3(x+1) + 2x - 3}{x} \\
&= \frac{5x}{x} \\
&= 5.
\end{align*}
而我們有
$$x^5 =5x + 3.$$

果真有$f(5) = 5$!

所以我們的猜測有可能正確!

甚至,由Fibonacci數列的通式可猜測
$$f(n) = \frac{\sqrt{5}}{5} \cdot \left[\left(\frac{1 + \sqrt{5}}{2}\right)^{n} - \left(\frac{1 - \sqrt{5}}{2}\right)^{n}\right].$$
(如此就把函數$f(n)$的顯式給表示出來)參考維基百科關於Fibonacci數列的條目

  • 正式解答

$n=1$時,由條件$x^2 = x + 1$可取$f(1) = 1, f(2) = 1$。

假定命題對於$n - 1$時成立,亦即存在函數$f$使得有$x^{(n-1)+1} = f\left[ (n-1) + 1 \right]x + f(n-1)$,這也意味著我們確定了$f(n-1)$與$f(n)$的值。

在$n$時,
\begin{align*}
x^{n+1} &= x \cdot x^n &[\text{指數的定義}] \\
&= x \cdot x^{(n - 1) + 1} & \\
&= x \cdot \left\{f[(n - 1) + 1]x + f(n-1) \right\} &[\text{歸納假設}] \\
&= x \cdot \left[ f(n)x + f(n-1) \right] & \\
&= f(n) x^2 + f(n-1) x &[\text{分配律}]\\
&= f(n) (x + 1) + f(n-1)x &[x\text{滿足的性質}]\\
&= \left[ f(n-1) + f(n) \right]x + f(n). &
\end{align*}
因為$f(n-1)$與$f(n)$的值都已確定,由此可定義
$$f(n + 1) = f(n-1) + f(n).$$
亦即$f(n+1)$之存在性由$f(n-1)$與$f(n)$所保證。

由數學歸納法證明了命題。

(證明終了)

2018年3月17日 星期六

Perron悖論

T. Apostol在其Linear Algebra - A First Course with Applications to Differential Equations一書的0.14節中提及一個「定理」(簡體中文版p.13):
定理如果存在最大正整數$n$,則$n=1$。
此地定理兩字加註引號的用意是在說明這條敘述其實並非真的是一條定理。而是要展示錯誤的前提可以推導出荒謬的結論。

幾年前我初次閱讀到這裡便卡住了,因為我實在無法如Apostol所稱「讀者可用反證法證明該定理」。

我試著用反證法做。於是便先假設結論不正確,也就是$n \neq 1$。既然$n$是正整數,於是便有$n \geq 2$。因為$n$是最大正整數,所以有
$$n + 1 \leq n,$$
左右同時減去$n$,得
$$1 \leq 0.$$
是為矛盾。

但是,以上的推理完全沒有用到我的「反假設」,也就是沒有用到「於是便有$n \geq 2$」,只用到了原來定理的條件。

在應用反證法時,理想上應當是,
【定理條件】+【與定理結論相反的敘述】$\Rightarrow$【矛盾】
然後在「【定理條件】恆真」的約定下,推論出【與定理結論相反的敘述】是不成立的,從而就得到定理結論必成立。

但是現在並沒有這樣的結構,僅僅只是
【定理條件】$\Rightarrow$【矛盾】
那這樣不是反證法啊...

因為一直沒有新思路,每次重新做這題時,總是按著老路子碰壁,後來就擱下書本不讀了。(這是我的壞毛病,一本書讀到一處讀不下去,不肯問人,非要自己想,偏偏又笨到想不出來,結果書也放著沒念下去,到頭來一場空。)

幾天前我又重新讀Apostol這本書,再次思考該如何處理這問題。這回我放棄自己解決,到ptt數學版請教網友。果不其然,版上高手雲集,walkwall、Vulpix、ADHD三位網友都給了我建議,非常感謝他們。尤其ADHD網友還追溯出這道「定理」的根源---Perron悖論(Perron's paradox):
假設$N$是最大的正整數。 若$N>1$,則$N^2 >N$,與$N$的定義相矛盾。因此$N=1$。
(參見維基百科關於Perron的條目)我當時非常訝異,原來這還竟然冠上了人名,真的是長知識了。

(順帶一提,Oskar Perron的條目在維基百科中本來只有外文版本,我在與網友討論完數學後,就順手把它給翻成中文。是亞洲地區第一個版本喔!日文、韓文等等其他語言版本的維基百科都沒有)

上面的引文已說明了解法。而我在與網友討論的過程中,自己也想出了一個正面證法,紀錄於下。

設$n$是最大正整數。由於$n$是正整數,所以$n \geq 1$。

由$n \geq 1$得$2n - 1 \geq 1$,故$2n - 1$必亦為正整數。

但因$n$是最大正整數,所以有
$$2n - 1 \leq n.$$
從而
$$n - 1 \leq 0,$$
即有
$$n \leq 1.$$

本來就有$n \geq 1$,如今又推論出$n \leq 1$,那麼必有$n = 1$。

(證明終了)