Skip to main content

微分中值定理

1. 微分中值定理

1.1 费马引理

f(x)f(x)x0x_0的邻域U(x0)U(x_0)有定义,并且x0x_0处可导,对xU(x0)\forall x\in U(x_0),有:

f(x)f(x0)f(x)≤f(x_0)

f(x)f(x0)f(x)≥f(x_0)

那么f(x0)=0f'(x_0)=0.

推论:函数f在定义域A内的最大值和最小值只能在边界上,不可导的点,或驻点取得。

在这里,f(x_0)其实是个极大值。

可以用python画出示意图:

import numpy as np
import matplotlib.pyplot as plt

# 定义函数 f(x)
def f(x):
return - (x - 2)**2 + 4

# 生成 x 数据
x = np.linspace(0, 4, 400)
y = f(x)

# 绘制函数图像
plt.figure(figsize=(8, 6))
plt.plot(x, y, label='$f(x) = -(x - 2)^2 + 4$', color='blue')

# 标记极值点
x0 = 2
y0 = f(x0)
plt.plot(x0, y0, 'ro') # 极值点
plt.text(x0, y0 + 0.5, '$x_0$', fontsize=12, ha='center')

# 绘制切线(导数为零)
plt.axhline(y0, color='gray', linestyle='--')

# 设置图形属性
plt.title('示意图:费马引理')
plt.xlabel('$x$')
plt.ylabel('$f(x)$')
plt.legend()
plt.grid(True)
plt.show()

Figure_1

warning

试证明费马引理.

答案

对于xU(x0)x\in U(x_0), f(x)f(x0)f(x)\leq f(x_0), 有很小的Δx\Delta x使得x0+ΔxU(x0),f(x0+Δx)f(x0)x_0+\Delta x \in U(x_0), f(x_0+\Delta x) \leq f(x_0)

要想证明f(x0)=0f'(x_0)=0,可以研究f(x0)f'(x_0)的定义。

f(x0)=limΔx0f(x+Δx)f(x0)Δx0f'_{-}(x_0)=\lim_{\Delta x \to 0^{-}}\frac{f(x+\Delta x)-f(x_0)}{\Delta x} \geq 0f+(x0)=limΔx0+f(x+Δx)f(x0)Δx0f'_{+}(x_0)=\lim_{\Delta x \to 0^{+}}\frac{f(x+\Delta x)-f(x_0)}{\Delta x} \leq 0

x0x_0处可导代表着左右可导,所以上面两个式子成立的时候也就只能是他们相等的时候。

f(x0)=0f'(x_0)=0.

驻点:导数为0的点。但是它可能不是最大值也不是最小值点。

1.2 罗尔定理

f(x)f(x)满足:

  1. 在[a,b]连续
  2. 在(a,b)内可导
  3. f(a)=f(b)f(a)=f(b),则至少x0(a,b),f(x0)=0\exists x_0\in(a,b), f'(x_0)=0
import numpy as np
import matplotlib.pyplot as plt

# 定义函数 f(x)
def f(x):
return (x - 1)**2 - 1 # 选择一个简单的二次函数

# 生成 x 数据
x = np.linspace(-2, 4, 400)
y = f(x)

# 绘制函数图像
plt.figure(figsize=(8, 6))
plt.plot(x, y, label='$f(x) = (x - 1)^2 - 1$', color='blue')

# 标记端点 a 和 b
a, b = 0, 2
fa, fb = f(a), f(b)
plt.plot(a, fa, 'ro', label='$f(a) = f(b)$')
plt.plot(b, fb, 'ro')

# 标记极值点 x0
x0 = 1
y0 = f(x0)
plt.plot(x0, y0, 'go') # 极值点
plt.text(x0, y0 + 0.5, '$x_0$', fontsize=12, ha='center')

# 绘制切线(导数为零)
plt.axhline(y0, color='gray', linestyle='--')

# 设置图形属性
plt.title('示意图:罗尔定理')
plt.xlabel('$x$')
plt.ylabel('$f(x)$')
plt.legend()
plt.grid(True)
plt.show()

Figure_1

1.3 拉格朗日中值定理

f(x)f(x)满足:

  1. 在[a,b]连续
  2. 在(a,b)内可导
  3. f(a)=f(b)f(a)=f(b),则至少x0(a,b),f(x0)(ba)=f(b)f(a)\exists x_0\in(a,b), f'(x_0)(b-a)=f(b)-f(a)
import numpy as np
import matplotlib.pyplot as plt

# 定义函数 f(x)
def f(x):
return np.sin(x) # 选择一个简单的正弦函数

# 生成 x 数据
x = np.linspace(0, 2 * np.pi, 400)
y = f(x)

# 端点
a, b = 0, 2 * np.pi
fa, fb = f(a), f(b)

# 找到导数为零的点
from scipy.optimize import minimize_scalar

def neg_f_prime(x):
return -np.cos(x) # 负导数

result = minimize_scalar(neg_f_prime, bounds=(a, b), method='bounded')
x0 = result.x
y0 = f(x0)

# 绘制函数图像
plt.figure(figsize=(8, 6))
plt.plot(x, y, label='$f(x) = \sin(x)$', color='blue')

# 标记端点 a 和 b
plt.plot(a, fa, 'ro', label='$f(a) = f(b)$')
plt.plot(b, fb, 'ro')

# 标记导数为零的点 x0
plt.plot(x0, y0, 'go') # 极值点
plt.text(x0, y0 + 0.5, '$x_0$', fontsize=12, ha='center')

# 绘制切线(导数为零)
plt.axhline(y0, color='gray', linestyle='--')

# 设置图形属性
plt.title('Lagrange mean value theorem')
plt.xlabel('$x$')
plt.ylabel('$f(x)$')
plt.legend()
plt.grid(True)
plt.show()

Figure_1

要想证明拉格朗日中值定理,可以做一个线性替换.也就是替换坐标系.

定理:f(x)f(x)在区间I上连续,I内可导且导数恒为0,f(x)=Cf(x)=C

证明:x1,x2.δ(x1,x2)\forall x_1,x_2. \delta \in (x_1,x_2)

f(x1)f(x2)=f(δ)(x1x2)=0f(x_1)-f(x_2) = f'(\delta)(x_1-x_2) = 0f(x1)=f(x2),f(x)=Cf(x_1) = f(x_2), f(x) = C

1.4 柯西中值定理

{x=φ(t)y=ϕ(t)\begin{cases} x=\varphi(t) \\ y=\phi(t) \end{cases}dydx=dydtdxdt=ϕ(t)φ(t)\frac{dy}{dx} = \frac{\frac{dy}{dt}}{\frac{dx}{dt}} = \frac{\phi'(t)}{\varphi'(t)}

使t=δt = \delta,至少有一点δ(a<δ<b)\delta(a<\delta<b)

ϕ(δ)φ(δ)=ϕ(b)ϕ(a)φ(b)φ(a)\frac{\phi'(\delta)}{\varphi'(\delta)} = \frac{\phi(b)-\phi(a)}{\varphi(b)-\varphi(a)}

柯西中值定理:若f(x)f(x)F(x)F(x)

  1. [a,b]连续
  2. 在(a,b)内可导
  3. x(a,b)\forall x \in (a,b)F(x)0F'(x) \neq 0

则至少δ(a,b)\exists \delta \in(a,b),

f(δ)F(δ)=f(b)f(a)F(a)F(b)\frac{f'(\delta)}{F'(\delta)}=\frac{f(b)-f(a)}{F(a)-F(b)}

柯西中值定理相较来说更加一般.

import numpy as np
import matplotlib.pyplot as plt

# 定义函数 f(x) 和 g(x)
def f(x):
return np.sin(x)

def g(x):
return x

# 生成 x 数据
x = np.linspace(0, 2 * np.pi, 400)
y_f = f(x)
y_g = g(x)

# 端点
a, b = 0, 2 * np.pi
fa, fb = f(a), f(b)
ga, gb = g(a), g(b)

# 找到导数比值符合柯西中值定理的点
from scipy.optimize import minimize_scalar

def mean_value_condition(x):
return (np.cos(x) / 1) - (fb - fa) / (gb - ga)

result = minimize_scalar(mean_value_condition, bounds=(a, b), method='bounded')
x0 = result.x
y0_f = f(x0)
y0_g = g(x0)

# 绘制函数图像
plt.figure(figsize=(10, 6))

# 绘制 f(x) 和 g(x)
plt.plot(x, y_f, label='$f(x) = \sin(x)$', color='blue')
plt.plot(x, y_g, label='$g(x) = x$', color='red')

# 标记端点 a 和 b
plt.plot(a, fa, 'bo', label='$f(a)$, $g(a)$')
plt.plot(b, fb, 'bo')
plt.plot(a, ga, 'ro')
plt.plot(b, gb, 'ro')

# 标记点 x0
plt.plot(x0, y0_f, 'go') # 对应 f(x)
plt.plot(x0, y0_g, 'go') # 对应 g(x)
plt.text(x0, y0_f + 0.5, '$x_0$', fontsize=12, ha='center')

# 绘制导数比值的条件
plt.axhline(y=f(x0) / g(x0), color='gray', linestyle='--')

# 设置图形属性
plt.title('示意图:柯西中值定理')
plt.xlabel('$x$')
plt.ylabel('$f(x)$ 和 $g(x)$')
plt.legend()
plt.grid(True)
plt.show()

Figure_1

2. 洛必达法则

洛必达法则是用于计算形如 00\frac{0}{0}\frac{\infty}{\infty} 不定式极限的重要方法。

我们将给出0/0型和无穷/无穷型的证明:

2.1 0/0型洛必达法则

如果函数 f(x)f(x)g(x)g(x) 满足:

  1. limxaf(x)=0\lim\limits_{x \to a} f(x) = 0limxag(x)=0\lim\limits_{x \to a} g(x) = 0
  2. 在点 aa 的某个去心邻域内,f(x)f'(x)g(x)g'(x) 都存在且 g(x)0g'(x) \neq 0
  3. limxaf(x)g(x)\lim\limits_{x \to a} \dfrac{f'(x)}{g'(x)} 存在(或为无穷大)

则有:

limxaf(x)g(x)=limxaf(x)g(x)\lim_{x \to a} \frac{f(x)}{g(x)} = \lim_{x \to a} \frac{f'(x)}{g'(x)}

推导过程:

F(x)={f(x)如果 xa0如果 x=aG(x)={g(x)如果 xa0如果 x=aF(x) = \begin{cases} f(x) & \text{如果 } x \neq a \\ 0 & \text{如果 } x = a \end{cases} \quad G(x) = \begin{cases} g(x) & \text{如果 } x \neq a \\ 0 & \text{如果 } x = a \end{cases}F(x)F(a)G(x)G(a)=F(c)G(c)\frac{F(x) - F(a)}{G(x) - G(a)} = \frac{F'(c)}{G'(c)}

其中 ccaaxx 之间。

代入得:

f(x)g(x)=f(c)g(c)\frac{f(x)}{g(x)} = \frac{f'(c)}{g'(c)}

取极限:

limxaf(x)g(x)=limcaf(c)g(c)=limxaf(x)g(x)\lim_{x \to a} \frac{f(x)}{g(x)} = \lim_{c \to a} \frac{f'(c)}{g'(c)} = \lim_{x \to a} \frac{f'(x)}{g'(x)}

2.2 ∞/∞型洛必达法则

如果函数 f(x)f(x)g(x)g(x) 满足:

  1. limxaf(x)=\lim\limits_{x \to a} f(x) = \inftylimxag(x)=\lim\limits_{x \to a} g(x) = \infty
  2. 在点 aa 的某个去心邻域内,f(x)f'(x)g(x)g'(x) 都存在且 g(x)0g'(x) \neq 0
  3. limxaf(x)g(x)\lim\limits_{x \to a} \dfrac{f'(x)}{g'(x)} 存在(或为无穷大)

则有:

limxaf(x)g(x)=limxaf(x)g(x)\lim_{x \to a} \frac{f(x)}{g(x)} = \lim_{x \to a} \frac{f'(x)}{g'(x)}

推导过程:

无穷不太直观,我们先转换为0/0型:

f(x)g(x)=1/g(x)1/f(x)\frac{f(x)}{g(x)} = \frac{1/g(x)}{1/f(x)}

令:

F(x)=1g(x),G(x)=1f(x)F(x) = \frac{1}{g(x)}, \quad G(x) = \frac{1}{f(x)}limxaF(x)G(x)=limxaF(x)G(x)\lim_{x \to a} \frac{F(x)}{G(x)} = \lim_{x \to a} \frac{F'(x)}{G'(x)}

计算导数:

F(x)=g(x)[g(x)]2,G(x)=f(x)[f(x)]2F'(x) = -\frac{g'(x)}{[g(x)]^2}, \quad G'(x) = -\frac{f'(x)}{[f(x)]^2}

代入得:

F(x)G(x)=g(x)f(x)[f(x)]2[g(x)]2\frac{F'(x)}{G'(x)} = \frac{g'(x)}{f'(x)} \cdot \frac{[f(x)]^2}{[g(x)]^2}limxaF(x)G(x)=limxaf(x)g(x)\lim_{x \to a} \frac{F(x)}{G(x)} = \lim_{x \to a} \frac{f(x)}{g(x)}

因此:

limxaf(x)g(x)=limxa[g(x)f(x)(f(x)g(x))2](1)\lim_{x \to a} \frac{f(x)}{g(x)} = \lim_{x \to a} \left[ \frac{g'(x)}{f'(x)} \cdot \left( \frac{f(x)}{g(x)} \right)^2 \right] \tag{1}

设:

L=limxaf(x)g(x)L = \lim_{x \to a} \frac{f(x)}{g(x)}

从等式(1)得:

L=L2limxag(x)f(x)L = L^2 \cdot \lim_{x \to a} \frac{g'(x)}{f'(x)}

整理得:

1=Llimxag(x)f(x)1 = L \cdot \lim_{x \to a} \frac{g'(x)}{f'(x)}

因此:

L=1limxag(x)f(x)=limxaf(x)g(x)L = \frac{1}{\lim\limits_{x \to a} \frac{g'(x)}{f'(x)}} = \lim_{x \to a} \frac{f'(x)}{g'(x)}

3. 泰勒定理

定理:

f(x)f(x)表示成xx0x-x_0nn次多项式+Rn(x)R_n(x)f(x)=f(x0)+f(x0)f(x) = f(x_0)+f'(x_0)

f(x)=f(x0)+f(x0)(xx0)+f(x0)2!(xx0)2++f(n)(x0)n!(xx0)n+Rn(x)f(x) = f(x_0)+ f'(x_0)(x-x_0) + \frac{f''(x_0)}{2!}(x-x_0)^2 + \cdots + \frac{f^{(n)}(x_0)}{n!}(x-x_0)^n + R_n(x)

拉格朗日型余项:

Rn(x)=f(n+1)(x0)(n+1)!(xx0)n+1+R_n(x) = \frac{f^{(n+1)}(x_0)}{(n+1)!}(x-x_0)^{n+1} + \cdotsRn(x)Mxx0n+1(n+1)!xx0|R_n(x)| \leq \frac{M|x-x_0|^{n+1}}{(n+1)!} x \rightarrow x_0

马克劳林公式:

f(x)=f(0)+f(0)(x)+f(0)2!(x)2++f(n)(0)n!(0)nf(x)=f(0)+f'(0)(x) + \frac{f''(0)}{2!}(x)^2 + \cdots + \frac{f^{(n)}(0)}{n!}(0)^n

f(x)=exf(x)=e^xnn阶马克劳林公式:

f(x)=f(x)==f(n)(x)=exf'(x) = f''(x) = \cdots = f^{(n)}(x) = e^xf(0)=f(0)==f(n)(0)=e0=1f'(0) = f''(0) = \cdots = f^{(n)}(0) = e^0 = 1ex=1+x+x22!++xnn!e^x = 1 + x + \frac{x^2}{2!} + \cdots + \frac{x^n}{n!}
tip

f(x)=sinxf(x)=sinx, sinx=x13!x3+15!x5+(1)m1(2m1)!x2m1+R2mxsinx = x - \frac{1}{3!}x^3+\frac{1}{5!}x^5-\cdots + \frac{(-1)^{m-1}}{(2m-1)!}x^{2m-1}+R_{2m}x

4. 函数的单调性和曲线的凹凸性

函数 y=f(x)y = f(x) 在区间上的单调性与其导数符号有密切关系:

  • 如果函数在 [a,b][a,b]单调增加,图形沿 xx 轴正向上升,切线斜率非负f(x)0f'(x) \geq 0
  • 如果函数在 [a,b][a,b]单调减少,图形沿 xx 轴正向下降,切线斜率非正f(x)0f'(x) \leq 0

设函数 f(x)f(x)[a,b][a,b] 上连续,在 (a,b)(a,b) 内可导。在 [a,b][a,b] 上任取两点 x1,x2x_1, x_2(其中 x1<x2x_1 < x_2),应用拉格朗日中值定理

f(x2)f(x1)=f(ξ)(x2x1)(x1<ξ<x2)f(x_2) - f(x_1) = f'(\xi)(x_2 - x_1) \quad (x_1 < \xi < x_2)

由于 x2x1>0x_2 - x_1 > 0,函数值差 f(x2)f(x1)f(x_2) - f(x_1) 的符号完全由 f(ξ)f'(\xi) 的符号决定。

如果在 (a,b)(a,b)f(x)>0f'(x) > 0,则 f(ξ)>0f'(\xi) > 0,于是:

f(x2)f(x1)=f(ξ)(x2x1)>0f(x_2) - f(x_1) = f'(\xi)(x_2 - x_1) > 0

即:

f(x1)<f(x2)f(x_1) < f(x_2)

这表明函数 y=f(x)y = f(x)[a,b][a,b] 上单调增加。

如果在 (a,b)(a,b)f(x)<0f'(x) < 0,则 f(ξ)<0f'(\xi) < 0,于是:

f(x2)f(x1)=f(ξ)(x2x1)<0f(x_2) - f(x_1) = f'(\xi)(x_2 - x_1) < 0

即:

f(x1)>f(x2)f(x_1) > f(x_2)

这表明函数 y=f(x)y = f(x)[a,b][a,b] 上单调减少。

5. 函数的极值与最大值最小值

6. 函数图形的描绘

7. 曲率