多变量函数的微分与偏导数

多变量函数的微分学

张瑞
中国科学技术大学数学科学学院

多变量函数的微分与偏导数

二元函数的微分与偏导数

一元时,找$A$,满足

\[f(x+\Delta x)-f(x)=A\Delta x+o(\Delta x), \Delta x\to 0 \]
\begin{tikzpicture}[x=2cm, y=2cm, global scale=0.6] % 上面,用 x=2cm, y=2cm 来设置x,y方向的单位长度,缺省是1cm % \draw[very thin,color=gray] (-1.5,-1.2) grid (1.5,1.22); \path[name path=axis x] (-0.4,0) -- (2.8,0); \draw[->] (-0.2,0) -- (2.8,0) node[right] {$x$}; \draw[->] (0,-0.2) -- (0,2.1) node[left] {$y$}; \draw[blue, name path=func] (-0.2,0.3) .. controls (1,0.3) and (2,0.6) .. (2.5,1.9); \path[name path=l1] (1.1,0) -- (1.1,2.9); \path[name path=l2] ($ (1,0)+(0.01,0) $) -- ($ (1,2.9)+(0.01,0) $); \path[name intersections={of=func and l1, name=o}]; \coordinate (m) at (o-1); \path[name path=slant] ($(m)!-0.5!(2.6,1.7)$) -- (2.6, 1.7); \path[name intersections={of=func and slant}]; \coordinate (n) at (intersection-2); %\node at (n) {$N$}; \fill (m) circle(1pt) node[above] {$M$}; \fill (n) circle(1pt) node[above] {$N$}; % \node (a) {$M$}; \coordinate (xe) at (2.7, 0); \coordinate (orig) at (0,0); \draw[dashed] (n-|orig) -- (n -| xe); \draw[dashed] (m) -- (m -| xe); \draw[dashed] (m) -- (m|-orig) node[below] {$x$}; \draw[dashed, name path=line dx] (n|-orig) node[below] {$x+\Delta x$}--(n); \node[below] at ($ (m)!0.5!(m-|n) $) {$dx=\Delta x$}; \node[right] at ($ (n)!0.5!(m-|n)+(0.2,0) $) {$\Delta y$}; \draw[purple, <->] ($ (n)+(0.3,0) $) -- ($(m-|n)+(0.3,0) $); \path[name intersections={of=func and l2, name=p}]; \draw[red, name path=tangent] ($ (o-1)!-15!(p-1) $)--($ (o-1)!10!(p-1) $); \path[name intersections={of=tangent and line dx}]; \coordinate (dy) at (intersection-1); \node[right] at ($ (dy)!0.5!(m-|n) $) {$dy$}; \draw[red, <->] (dy) -- (m-|n); \draw (dy)--($ (dy)+(0.2,0) $); \draw (m-|n) -- (m -| xe); \draw (n) -- (n -| xe); \end{tikzpicture}

二元时类似,把直线换成平面。

定义 1. (二元函数的可微性)
$z=f(x,y)$为区域$D\subset\mathbb{R}^2$上的二元函数,$(x_0,y_0)\in D$,记$\rho=\sqrt{(\Delta x)^2+(\Delta y)^2}$

若存在常数$A,B$,满足

\[\begin{aligned} f(x_0+\Delta x,y_0+\Delta y)-f(x_0,y_0) \\ =A\Delta x+B\Delta y+o(\rho), \rho\to0 \end{aligned} \]

则称$f$$(x_0,y_0)$可微,且称$A\Delta x+B\Delta y$$f$$(x_0,y_0)$处的微分,记为$df(x_0,y_0)$

\begin{tikzpicture}[x=2cm, y=2cm, global scale=0.6] % 上面,用 x=2cm, y=2cm 来设置x,y方向的单位长度,缺省是1cm % \draw[very thin,color=gray] (-1.5,-1.2) grid (1.5,1.22); \path[name path=axis x] (-0.4,0) -- (2.8,0); \draw[->, thick] (0,0) -- (2.8,0) node[right] {$x$}; \draw[->, thick] (0,0) -- (0,2.6) node[left] {$z$}; \draw[->, thick, name path=y axis] (0,0) -- (48:1.9) node[left] {$y$}; \coordinate (a) at (30:0.8); \coordinate (a1) at ($ (a) + (0:1.3) $); \coordinate (a2) at ($ (a1) + (48:0.9) $); \coordinate (a3) at ($ (a2) - (0:1.3) $); \draw (a) -- (a1) -- (a2); \draw[dashed] (a) -- (a3) -- (a2); \path[name path=x0 line] ($ (a)!-1.5!(a3) $) -- (a); \path[name intersections={of=x0 line and axis x}]; \coordinate (x0) at (intersection-1); \draw[dashed] (x0) node[below]{$x_0$} -- (a); \path[name path=x1 line] ($(a1)!-1.5!(a2)$) -- (a1); \path[name intersections={of=x1 line and axis x}]; \coordinate (x1) at (intersection-1); \draw[dashed] (x1) node[below]{$x_0+dx$} -- (a1); \path[name path=y0 line] ($(a)!-0.5!(a1)$) -- (a); \path[name intersections={of=y0 line and y axis}]; \coordinate (y0) at (intersection-1); \draw[dashed] (y0) node[left]{$y_0$} -- (a); \path[name path=y1 line] ($(a3)!-0.5!(a2)$) -- (a3); \path[name intersections={of=y1 line and y axis}]; \coordinate (y1) at (intersection-1); \draw[dashed] (y1) node[left]{$y_0+dy$} -- (a3); \coordinate (b) at ($ (a)+(90:1.3) $); \coordinate (b1) at ($ (b) + (0:1.3) $); \coordinate (b2) at ($ (b1) + (48:1.) $); \coordinate (b3) at ($ (b2) - (0:1.3) $); \draw (a)--(b)--(b1)--(a1); \draw (b1)--(b2)--(a2); \draw[dashed] (b2)--(b3)--(b); \coordinate (c1) at ($ (b1) + (0,0.2) $); \coordinate (c2) at ($ (b2) + (0,0.4) $); \coordinate (c3) at ($ (b3) + (0,0.33) $); \fill[blue, opacity=0.5] (b)--(c1)--(c2)--(c3)--cycle; \draw (b)--(c1)--(b1) (c1)--(c2)--(b2); \draw[dashed] (c2)-- node[below] {$P$}(c3)--(b); \coordinate (d1) at ($ (c1) + (0,0.2) $); \coordinate (d2) at ($ (c2) + (0,0.4) $); \coordinate (d3) at ($ (c3) + (0,0.33) $); \draw (b) to[out=15,in=220] (d1) to[in=230,out=40] (d2); \draw (d2) to[out=190,in=-10] (d3) node[above]{$z=f(x,y)$} (d3) to[out=260,in=60] (b); \draw (c1)--(d1); \draw (c2)--(d2); \draw[dashed] (d3)--(a3); \draw[name path=df bottom] (b2) -- +(0:0.6) ; \draw[name path=df top] (c2) -- +(0:0.3) ; \draw[name path=deltaf top] (d2) -- +(0:0.6) ; \path[name path=df vert] ($ (a2)+(0:0.15) $) -- +(0, 2.5); \path[name path=deltaf vert] ($ (a2)+(0:0.45) $) -- +(0, 2.5); \path[name intersections={of=df vert and df bottom}]; \coordinate (df0) at (intersection-1); \path[name intersections={of=deltaf vert and df bottom}]; \coordinate (deltaf0) at (intersection-1); \path[name intersections={of=df vert and df top}]; \coordinate (df1) at (intersection-1); \path[name intersections={of=deltaf vert and deltaf top}]; \coordinate (deltaf1) at (intersection-1); \draw[red, <->] (df0)--node[right]{$df$} (df1); \draw[red, <->] (deltaf0)--node[right]{$\Delta f$} (deltaf1); \coordinate (orig) at (0,0); \draw[dashed] (b)--(b-|orig) node[above right] {$f(x_0,y_0)$}; \end{tikzpicture}

平面$P: z=f(x_0,y_0)+A(x-x_0)+B(y-y_0)$

式子

\[\begin{aligned} f(x_0+\Delta x,y_0+\Delta y)-f(x_0,y_0) =A\Delta x+B\Delta y+o(\rho) \end{aligned} \]

中取$\Delta y=0$,得到

\[f(x_0+\Delta x,y_0)-f(x_0,y_0)=A\Delta x+o(\Delta x) \]

$\Delta x\to0$,则有

\[A=\lim_{\Delta x\to0}\dfrac{f(x_0+\Delta x,y_0)-f(x_0,y_0)}{\Delta x} \]

就是说,$A$可以看成是一元函数$\phi(x)=f(x,y_0)$$x_0$处的导数。

类似地,$B$是一元函数$\psi(y)=f(x_0,y)$$y_0$处的导数。

difference-partial-x difference-partial-y

定义 2. (偏导数)
$z=f(x,y)$为区域$D\subset\mathbb{R}^2$上的二元函数,$(x_0,y_0)\in D$。 若极限

\[\lim_{\Delta x\to0}\dfrac{f(x_0+\Delta x,y_0)-f(x_0,y_0)}{\Delta x} \]

存在,则称它为$f(x,y)$$(x_0,y_0)$关于x的偏导数,记为

\[\dfrac{\partial f}{\partial x}(x_0,y_0), \dfrac{\partial z}{\partial x}(x_0,y_0), \left.\dfrac{\partial f}{\partial x}\right|_{(x_0,y_0)}, \left.\dfrac{\partial z}{\partial x}\right|_{(x_0,y_0)}, f_x(x_0,y_0) \]

类似,极限

\[\lim_{\Delta y\to0}\dfrac{f(x_0,y_0+dy)-f(x_0,y_0)}{\Delta y} \]

称为$f(x,y)$$(x_0,y_0)$关于y的偏导数。记为

\[\dfrac{\partial f}{\partial y}(x_0,y_0), \dfrac{\partial z}{\partial y}(x_0,y_0), \left.\dfrac{\partial f}{\partial y}\right|_{(x_0,y_0)}, \left.\dfrac{\partial z}{\partial y}\right|_{(x_0,y_0)}, f_y(x_0,y_0) \]

定理 1. (可微的必要条件)
$z=f(x,y)$为区域$D\subset\mathbb{R}^2$上的二元函数,$(x_0,y_0)\in D$

  1. $f(x,y)$$(x_0,y_0)$处可微,则$f(x,y)$$(x_0,y_0)$处连续
  2. $f(x,y)$$(x_0,y_0)$处可微,则$f(x,y)$$(x_0,y_0)$处的两个偏导数存在,且
    \[df(x_0,y_0)=\dfrac{\partial f}{\partial x}(x_0,y_0)\Delta x +\dfrac{\partial f}{\partial y}(x_0,y_0)\Delta y \]

类似1维的证明

  • $f(x,y)$$D$中每一点处都可微,则称$f(x,y)$$D$中可微。
  • $f(x,y)$$D$中每一点处都有偏导数$f'_x(x,y)$,则映射$(x,y)\to f'_x(x,y)$确定了$D$上的二元函数$f'_x(x,y)$称为$f(x,y)$关于x的偏导函数(简称偏导数、偏微商)。
  • 类似,有$f(x,y)$关于y的偏导数$f'_y(x,y)$
  • 偏导数$f'_x(x,y),f'_y(x,y)$也记为$f'_1(x,y), f'_2(x,y)$, 分别表示对第1个变量和第2个变量的偏导数。

例 1. 求偏导数

1). $f(x,y)=x^y$

2). $f(x,y)=\arctan\dfrac{x}{y}$

(1) $\displaystyle f'_1=yx^{y-1}$,

$\displaystyle f'_2=x^y \ln (x)$

(2) $\displaystyle f'_1=\frac1{1+(\frac{x}y)^2}\frac1y$,

$\displaystyle f'_2=\frac1{1+(\frac{x}y)^2}x\frac{-1}{y^2}$,

1.

$z=f(x,y)$$D$中可微,则对$\forall (x,y)\in D$,有

\[dz(x,y)=df(x,y)=f'_x(x,y)\Delta x+f'_y(x,y)\Delta y \]

类似一元情形,

  • $f(x,y)=x$,则有$dx=\Delta x$
  • $f(x,y)=y$,则有$dy=\Delta y$

常记

\[dz(x,y)=df(x,y)=f'_x(x,y)dx+f'_y(x,y)dy \]

\[dz=df=f'_x dx+f'_y dy \]

$df$称为$f(x,y)$$D$上的微分(或全微分)。

定义 3.
矩阵$\begin{pmatrix} f'_x(x_0,y_0) & f'_y(x_0,y_0) \end{pmatrix}$称为$f(x,y)$$(x_0,y_0)$处的 Jacobi矩阵

则微分可以写成

\[df(x,y) = \begin{pmatrix} f'_x(x,y) & f'_y(x,y) \end{pmatrix} \begin{pmatrix} dx \\ dy \end{pmatrix} \]

例 2. 函数的连续性、可微性、偏导数

\[f(x,y)=\begin{cases} \dfrac{xy}{\sqrt{x^2+y^2}}, x^2+y^2\neq 0 \\ 0, x^2+y^2=0 \end{cases} \]

例 3. 函数的连续性、可微性、偏导数

\[f(x,y)=\begin{cases} (x^2+y^2)\sin\dfrac{1}{x^2+y^2}, x^2+y^2\neq 0 \\ 0, x^2+y^2=0 \end{cases} \]

. 2 虽然$f'_x$, $f'_y$都存在且有界,但$df$不存在。

. 3 虽然$f'_x$, $f'_y$都存在但无界,$df$仍然存在。

例 4. (例6.2.3) (两个偏导数存在,但不可微)

\[f(x,y)=\begin{cases} \dfrac{x^2y}{x^4+y^2}, x^2+y^2\neq 0 \\ 0, x^2+y^2=0 \end{cases} \]

定理 2.
$f'_x, f'_y$$(x_0,y_0)$的某个邻域内存在,且$f'_x,f'_y$$(x_0,y_0)$连续,则$f(x,y)$$(x_0,y_0)$处可微

证明:

高阶偏导数

函数$z=f(x,y)$在定义区域中每一点都有偏导数$f'_x(x,y), f'_y(x,y)$,则这些偏导函数仍然是二元函数。若它们仍然有偏导数,则可以继续对它们求偏数,这样就得到了高阶偏导数(或高阶偏微商)。

二元函数有四种可能的二阶偏导数:

\[\begin{aligned} \dfrac{\partial}{\partial x}\left(\dfrac{\partial f}{\partial x}\right) =\dfrac{\partial^2f}{\partial x^2} ,& \dfrac{\partial}{\partial y}\left(\dfrac{\partial f}{\partial x}\right) =\dfrac{\partial^2f}{\partial y\partial x} \\ \dfrac{\partial}{\partial x}\left(\dfrac{\partial f}{\partial y}\right) =\dfrac{\partial^2f}{\partial x\partial y} ,& \dfrac{\partial}{\partial y}\left(\dfrac{\partial f}{\partial y}\right) =\dfrac{\partial^2f}{\partial y^2} \end{aligned} \]

也可以把偏导数$\dfrac{\partial^2f}{\partial y\partial x}$记为$f''_{xy}, f''_{12}$

例 5. 求函数的2阶偏导数

\[u=x^y \]

例 6. 求函数的2阶偏导数

\[f(x,y)=\begin{cases} xy\dfrac{x^2-y^2}{x^2+y^2} , &x^2+y^2\neq 0 \\ 0, &x^2+y^2=0 \end{cases} \]

. 5. $u'_x = y x^{y-1}$, $u'_y = x^y \ln x$

$u''_{xx} = y(y-1)x^{y-2}$, $u''_{yy} = x^y \ln^2x$

$u''_{xy} = y x^{y-1}\ln x+x^{y-1}$, $u''_{yx}=x^y\frac1x+yx^{y-1}\ln x$

 

. 6. $f''_{xy}\neq f''_{yx}$

定理 3.
$f(x,y)$在区域$D$上有定义,如果$f''_{xy}, f''_{yx}$在区域$D$中连续,则两者相等,即求导的次序可以交换

证:

多元函数与向量值函数的微分

平行地推广二元函数的概念到$n$元函数

\[\begin{aligned} df(x_1,x_2,\cdots,x_n)=&\dfrac{\partial f}{\partial x_1}dx_1+\dfrac{\partial f}{\partial x_2}dx_2+\cdots+\dfrac{\partial f}{\partial x_n}dx_n \\ =&\begin{pmatrix} \dfrac{\partial f}{\partial x_1} & \dfrac{\partial f}{\partial x_2} & \cdots & \dfrac{\partial f}{\partial x_n}\end{pmatrix} \begin{pmatrix} dx_1 \\ dx_2 \\ \cdots \\ dx_n \end{pmatrix} \end{aligned} \]

对向量值函数

\[\vec f(\vec x)=(f_1(\vec x),f_2(\vec x),\cdots,f_m(\vec x))^T \]

若每个分量函数$f_i$可微,则称映射$\vec f$可微,且微分定义为

\[d\vec{f}=(df_1(\vec x),df_2(\vec x),\cdots,df_m(\vec x))^T \]

其中

\[\begin{aligned} df_j(x_1,x_2,\cdots,x_n) =\begin{pmatrix} \dfrac{\partial f_j}{\partial x_1} & \dfrac{\partial f_j}{\partial x_2} &\cdots & \dfrac{\partial f_j}{\partial x_n}\end{pmatrix} \begin{pmatrix} dx_1 \\ dx_2 \\ \cdots \\ dx_n \end{pmatrix} \end{aligned} \]

这样

\[d\vec f=\begin{pmatrix} df_1 \\ df_2 \\ \cdots \\ df_m \end{pmatrix} =\begin{pmatrix} \dfrac{\partial f_1}{\partial x_1} & \dfrac{\partial f_1}{\partial x_2} & \cdots & \dfrac{\partial f_1}{\partial x_n} \\ \dfrac{\partial f_2}{\partial x_1} & \dfrac{\partial f_2}{\partial x_2} & \cdots & \dfrac{\partial f_2}{\partial x_n} \\ & \cdots & & \\ \dfrac{\partial f_m}{\partial x_1} & \dfrac{\partial f_m}{\partial x_2} & \cdots & \dfrac{\partial f_m}{\partial x_n} \\ \end{pmatrix} \begin{pmatrix} dx_1 \\ dx_2 \\ \cdots \\ dx_n \end{pmatrix} \]

矩阵为$J \vec f=J_{\vec x}\vec f = \begin{pmatrix}\dfrac{\partial f_1}{\partial x_1} & \cdots & \dfrac{\partial f_1}{\partial x_n} \\& \cdots & \\\dfrac{\partial f_m}{\partial x_1} & \cdots & \dfrac{\partial f_m}{\partial x_n} \\\end{pmatrix}$,称为向量值函数的Jacobi矩阵

  • 对向量值函数 $\vec y =\vec f(\vec x)$,有微分$d\vec y = J_{\vec x}\vec f \cdot d\vec x$
  • $m=n$时,Jacobi矩阵的行列式简记为
    \[\dfrac{\partial(f_1,f_2,\cdots,f_n)}{\partial(x_1,x_2,\cdots,x_n)} =\left|{J_{\vec x}\vec f}\right| \]
    称为Jacobi行列式
  • $\vec h=(h_1,h_2,\cdots,h_n)\in\mathbb{R}^n$,定义映射
    \[T(\vec h)=J\vec f\cdot \vec h^T \]
    $|\vec h|=\sqrt{h_1^2+h_2^2+\cdots+h_n^2}$很小时,向量值函数$f$有,
    \[\vec f(\vec x+\vec h)\approx \vec f(\vec x)+T(\vec h) \]

类似二元函数的结论,当多变量函数的高阶偏导数连续时,它的值也会与求导的次序无关。如:

若三元函数$f(x,y,z)$的偏导数$f'''_{yyz}$,$f'''_{yzy}$,$f'''_{zyy}$连续,则 $f'''_{yyz}=f'''_{yzy}=f'''_{zyy}$

区域$D$上具有各种$n$阶偏导数,并且各$n$阶偏导数连续的函数的全体记为$C^n(D)$

特别地,$C^0(D)$表示$D$上连续函数的全体。

目录

谢谢

例 7. 本节读完

7.