Maximum and minimum of a function

這裡我們要討論一個函數的最大值以及最小值.

首先我們有極值定理

Theorem: Extreme value theorem

If $f$ is a real-valued continuous function on the closed interval $[a,b]$, then $f$ must attain a maximum and a minimum.

所以對於定義在封閉區間的連續函數, 必定會有極值. 接下來我們看一下實際上我們怎麼把極值找出來.

在微積分課本裡有所謂的封閉區間法, 如下:

The closed interval method

graph TD;
  B[f is `continuous` on a `closed interval`]-->A;
  B-->C;
  A[Determine the critical points]-->|f'=0| D(The largest value at these points is the abs. max. and the smallest value is the abs. min.);
  A-->|f' not exists| D;
  C[Determine the end points]-->D;

這個方法的原理跟做法都很簡單, 我這邊就不多做說明.

不過我要做一些補充. 事實上這個方法要能用還有一個很重要的假設是假設這個函數只在有限個地方微分不存在. 如果一個函數在無窮多地方微分不存在, 雖然最大值還會是 “微分等於 0”, “微分不存在”, “端點” 這些地方的函數值中找最大的. 不過實作上會找不完. 所以等於是沒有用.

當然這樣的假設看起來很正常, 難道有函數是連續的, 但是在無窮多地方微分不存在嗎? 很不幸的也很幸運的, 真的有! 其中有一個很特別的函數叫做 Weierstrass function. 它是定義在實數軸上的函數, 在每個點都連續, 但是同時在任何一個點微分都不存在. 所以如果套用 the closed interval method 在這函數上會發現所有的點都是 critical point, 所以套用之後還是必須要找出所有點中函數值最大的. 完全沒有簡化到.

Question 1: 是否存在連續, 但是在每個點微分都等於 0 的函數?

當然有! 常數函數就是. 不過這個很好 check 最大最小值所以沒什麼問題.

Question 2: 是否存在連續, 但是在每個點微分都等於 0 的非常數函數(non-constant function)?

I will leave it as an exercise.


最後再補充一點, 函數在某個點連續但是微分不存在有幾種情形:

  1. 尖點. 例如 $f(x) = |x|$ 在 $x=0$ 時.

  2. 垂直切線. 例如 $f(x) = \sqrt[3]{x}$ 在 $x=0$ 時.

  3. 微分定義中的極限不存在. 例如 $f(x) = x\sin(x)$ 在 $x=0$ 時.


Avatar
Te-Sheng Lin (林得勝)
Associate Professor

The focus of my research is concerned with the development of analytical and computational tools, and further to communicate with scientists from other disciplines to solve engineering problems in practice.

Related