Cálculo de derivadas direccionales y gradientes

$\rm f : \underset{ \begin{subarray}{c} \displaystyle \downarrow \\ \displaystyle \rm u_\rlap{0} \mathstrut \end{subarray} }{B} \subset \mathbb{R}^n \to \mathbb{R} $

$ \rm \begin{gathered}[t] \rm \nabla f(u_0) \\ \uparrow \\ \text{gradi}\rlap{\text{ente de $\rm f$ en $\rm u_0$}} \end{gathered} = \left( \dfrac{\partial f}{\partial x_1}(u_0), \dotsc, \dfrac{\partial f}{\partial x_n}(u_0) \right) $

$ \begin{array}{l} \begin{aligned} \rm h : \mathbb{R} &\to \rm \mathbb{R}^n \\ \rm t &\to \rm u_0 + t \, v \end{aligned} \\[1ex] \rm \underset{ \begin{subarray}{c} \uparrow \\ \begin{subarray}{l} \text{fun} \rlap{\text{ción compuesta}} \\ \text{de} \rlap{\text{ $\rm h$ y $\rm f$}} \end{subarray} \end{subarray} }{(f \circ h)} = f(h(t)) \qquad \underset{ \begin{subarray}{c} \uparrow \\ \begin{subarray}{l} \text{der} \rlap{\text{ivada direccional según}} \\ \rm v \rlap{\text{ de la función $\rm f$ en $\rm u_0$}} \end{subarray} \end{subarray} }{D_v f(u_0)} = (f \circ h)'(0) \end{array} $


Ejemplo:

$\rm x^2 + y^2 \quad u_0 = (1,1) \quad v = (2,3)$

$\rm D_v f(u_0) \enspace ?$

$ \def\rarrow#1#2{ \stackrel{#1}{ \underset{#2}{ \Rule{0pt}{0.4em}{0pt} \smash{ \xrightarrow[\hspace{8px}\hphantom{#2}\hspace{8px}]{\hspace{8px}\hphantom{#1}\hspace{8px}} } } } } \begin{align} \mathbb{R} &\rarrow{\large \rm h}{} \mathbb{R}^2 \\ \rm t &\rm \rarrow{\hphantom{\large h}}{} (1,1) + t(2,3) = (1+2t,1+3t) \end{align} $

$ \begin{align} \rm (f \circ h)(t) = (1+2t)^2 + (1+3t)^2 &= \rm 1 + 4t + 4t^2 + 1 + 6t + 9t^2 = \\[1ex] &= \rm 13t^2 + 10t + 2 \end{align} $

$\rm (f \circ h)'(t) = 26t + 10$

$\rm D_{(2,3)} f(1,1) = (f \circ h)'(0) = 10$


Teorema:

$\rm D_v f(u_0) = \nabla f(u_0) \cdot v \enspace \leftarrow$ producto escalar


Ejemplo:

$\rm x^2 + y^2$

$\rm \nabla f = (2x,2y)$

$\rm u_0 = (1,1)$

$\rm \nabla f(1,1) = (2,2)$

$\rm v = (2,3)$

$\rm D_v f(u_0) = D_{(2,3)} f(1,1) = (2,2) \cdot (2,3) = 4 + 6 = \underline{\underline{10}}$


$ \qquad \begin{array}[t]{l} \rm \dfrac{v}{\lVert v \rVert} \enspace \text{vector normalizado} \\[1ex] \rm \lVert \dfrac{v}{\lVert v \rVert} \rVert = 1 \end{array} \qquad \begin{array}[t]{l} \rm v = (x_1, \dotsc, x_n) \\[1ex] \rm \lVert v \rVert = \sqrt{x_1^2 + \dotsb + x_n^2} \end{array} $

$ \rm D_{v{∕}\|v\|} f(u_0): {} $ derivada direccional de $\rm f$ según la dirección de $\rm v$ en $\rm u_0$ respecto al vector normalizado $\rm \dfrac{v}{\|v\|}$.


Ejemplo:

$\rm x^2 + y^2$

$\rm u_0 = (1, 1) \quad v = (2,3)$

$\rm \lVert v \rVert = \sqrt{4 + 9} = \sqrt{13}$

$ \begin{align} \rm D_{\left(2{∕}\sqrt{13},\,3{∕}\sqrt{13}\right)} f(1,1) &= (2,2) \cdot \left(2{∕}\sqrt{13}, 3{∕}\sqrt{13}\right) = 4{∕}\sqrt{13} + 6{∕}\sqrt{13} = \\[1ex] &= 10{∕}\sqrt{13} \end{align} $

$\Rightarrow \rm D_{v{∕}\lVert v \rVert} f(u_0) = \dfrac{D_v f(u_0)}{\lVert v \rVert}$


Por definición un producto escalar es tal que:

$\rm u_1 \cdot u_2 = \lVert u_1 \rVert \lVert u_2 \rVert \cos α$

$α \rightarrow$ ángulo que forman $\rm u_1$ y $\rm u_2$

$ -1 \leq \cos α \leq 1 \quad \begin{aligned}[t] 1 &\rightarrow α = 0° \\[1ex] -1 &\rightarrow α = 180° \end{aligned} $

Así que:

$ \begin{align} \rm D_{v{∕}\|v\|} f(u_0) &= \rm \lVert \nabla f(u_0) \rVert \lVert \dfrac{v}{\lVert v \rVert} \rVert \cos α = \\[1ex] &= \rm \lVert \nabla f(u_0) \rVert \cos α \left\{ \begin{array}{l} \text{máximo: } \rm \lVert \nabla f(u_0) \rVert \\ \text{mínimo: } \rm - \lVert \nabla f(u_0) \rVert \end{array} \right. \end{align} $

El valor máximo de la derivada direccional en el punto $\rm u_0$ se produce cuando $\rm v = \nabla f(u_0)$ y el mínimo cuando $\rm v = -\nabla f(u_0)$ (sentido opuesto).

Siendo:

$ \rm f : \underset{ \begin{subarray}{c} \displaystyle \downarrow \\ \displaystyle \rm u\rlap{{}_{0}} \mathstrut \end{subarray} }{B} \subset \mathbb{R}^n \to \mathbb{R}^m \qquad f : \underbrace{(f_1, \dotsc, f_m)}_{\text{vector}} \qquad f_i : \underset{ \begin{subarray}{c} \displaystyle \downarrow \\ \displaystyle \rm u\rlap{{}_0} \mathstrut \end{subarray} }{B} \subset \mathbb{R}^n \rightarrow \mathbb{R} $

Se pueden encontrar cada una de las derivadas parciales de cada componente del vector respecto a cada variable:

$\rm \dfrac{\partial f_i}{\partial x_j}(u_0), \enspace j = 1, \dotsc, n$

$ \underset{ \begin{subarray}{l} \rm n \text{ columnas} \\ \rm m \text{ filas} \end{subarray} }{ \begin{pmatrix} \rm \dfrac{\partial f_1}{\partial x_1}(u_0) & \dots & \rm \dfrac{\partial f_1}{\partial x_n}(u_0) \\ \vdots & & \vdots \\ \rm \dfrac{\partial f_m}{\partial x_1}(u_0) & \dots & \rm \dfrac{\partial f_m}{\partial x_n}(u_0) \end{pmatrix} } = \rm Df(u_0) \left\langle \begin{array}{l} \text{"diferencial de $\rm f$ en $\rm u_0$"} \\[1em] \text{"matriz jacobiana de $\rm f$ en $\rm u_0$"} \end{array} \right. $


Ejemplos:

$ \rm \begin{aligned} \rm \mathbb{R}^2 &\rm \rarrow{\large f}{} \mathbb{R}^3 \\ \rm (x,y) &\rm \rarrow{\hphantom{\large f}}{} (e^{x+y}, 2x-y, 4y) \end{aligned} \quad \Rightarrow \quad Df = \begin{pmatrix} \rm e^{x+y} & \rm e^{x+y} \\ 2 & -1 \\ 0 & 4 \end{pmatrix} $

$ \rm \begin{aligned} \mathbb{R} &\rm \rarrow{\large f}{} \mathbb{R}^4 \\ \rm t &\rm \rarrow{\hphantom{\large f}}{} (e^t, \sin t, 4t{e}^t, 5t) \end{aligned} \quad \Rightarrow \quad Df = \begin{pmatrix} \rm e^t \\ \rm \cos t \\ \rm 4e^t + 4t{e}^t \\ 5 \end{pmatrix} $

$ \begin{aligned} \mathbb{R}^4 &\rm \rarrow{\large f}{} \mathbb{R} \\ \rm (x,y,z,t) &\rm \rarrow{\hphantom{\large f}}{} 2x e^y - 2tz \end{aligned} \quad \Rightarrow \quad \rm Df = (2e^y, 2x e^y, -2t, -2z) $


$\rm f : B \subset \mathbb{R}^n \to \mathbb{R}^m$

$\rm g : C \subset \mathbb{R}^m \to \mathbb{R}^p$

$\rm u_0 \in B \quad f(u_0) \in C$

$\rm g(f(u_0)) = g \circ f(u_0)$

Regla de la cadena:

$\rm D(g \circ f(u_0)) = Dg(f(u_0)) \cdot Df(u_0)$

$ \rm p) \! \updownarrow \overset{ \displaystyle \rm \underleftrightarrow{n)} }{ \begin{pmatrix} \enspace & \enspace \\ & \\ & \end{pmatrix} } = p) \! \updownarrow \overset{ \displaystyle \underleftrightarrow{m)} }{ \begin{pmatrix} \enspace & \enspace & \enspace & \enspace \\ & & & \\ & & & \end{pmatrix} } \cdot \overset{ \displaystyle \underleftrightarrow{n)} }{ \begin{pmatrix} \enspace & \enspace \\ & \\ & \\ & \end{pmatrix} } \updownarrow \! m) $

$\rm g \circ f : B \subset \mathbb{R}^n \to \mathbb{R}^p$


Ejemplo:

$ \begin{align} \mathbb{R}^2 &\rm \rarrow{\large f}{} \mathbb{R}^3 \\ \rm (x,y) &\rm \rarrow{\hphantom{\large f}}{} (xy,x+y,x) \end{align} $

$ \begin{align} \mathbb{R}^3 &\rm \rarrow{\large g}{} \mathbb{R}^2 \\ \rm (x,y,z) &\rm \rarrow{\hphantom{\large g}}{} (x+y,y-z) \end{align} $

$\rm u_0 = (1, 1)$

$\rm D(g \circ f)(u_0) \enspace ?$

$ \rm Df = \begin{pmatrix} \rm y & \rm x \\ 1 & 1 \\ 1 & 0 \end{pmatrix} \qquad Df(u_0) = \begin{pmatrix} 1 & 1 \\ 1 & 1 \\ 1 & 0 \end{pmatrix} $

$\rm f(1,1) = (1,2,1)$

$ \rm Dg(f(u_0)) = \begin{pmatrix} 1 & 1 & 0 \\ 0 & 1 & -1 \end{pmatrix} $

$ \rm D(g \circ f)(1,1) = \begin{pmatrix} 1 & 1 & 0 \\ 0 & 1 & -1 \end{pmatrix} \begin{pmatrix} 1 & 1 \\ 1 & 1 \\ 1 & 0 \end{pmatrix} = \begin{pmatrix} 2 & 2 \\ 0 & 1 \end{pmatrix} $

$ \begin{align} \mathbb{R}^2 &\rarrow{\large \rm g \: \circ \: f}{} \mathbb{R}^2 \\ \rm (x,y) &\rm \rarrow{\large f}{} (xy, x + y, x) \rarrow{\large g}{} (xy + x + y, x + y - x) = (xy + x +y, y) \end{align} $

$ \rm D(g \circ f) = \begin{pmatrix} \rm y+1 &\rm x+1 \\ 0 & 1 \end{pmatrix} $

$ \rm D(g \circ f)(1,1) = \begin{pmatrix} 2 & 2 \\ 0 & 1 \end{pmatrix} $


Ejemplo:

$ \begin{align} \mathbb{R}^2 &\rm \rarrow{\large f}{} \mathbb{R}^2 \\ \rm (x, y) &\rm \rarrow{\hphantom{\large f}}{} (xy, x + y) \end{align} $

$ \begin{align} \mathbb{R}^2 &\rm \rarrow{\large g}{} \mathbb{R}^3 \\ \rm (x, y) &\rm \rarrow{\hphantom{\large g}}{} (e^{xy}, \sin x, xy) \end{align} $

$\rm D(g \circ f) \enspace ?$

$ \rm Df = \begin{pmatrix} \rm y & \rm x \\ 1 & 1 \end{pmatrix} \qquad Dg = \begin{pmatrix} \rm ye^{xy} &\rm xe^{xy} \\ \rm \cos x & 0 \\ \rm y & \rm x \end{pmatrix} $

$ \begin{align} \rm D(g \circ f)(x,y) &= \rm Dg(f(x,y)) \cdot Df(x,y) = \\[1ex] &= \begin{pmatrix} \rm (x+y)e^{xy(x+y)} &\rm xye^{xy(x+y)} \\ \rm \cos xy & 0 \\ \rm x+y & \rm xy \end{pmatrix} \cdot \begin{pmatrix} \rm y & \rm x \\ 1 & 1 \end{pmatrix} = \\[1ex] &= \begin{pmatrix} \rm y(x+y)e^{xy(x+y)} + xye^{xy(x+y)} & \rm x(x+y)e^{xy(x+y)} + xye^{xy(x+y)} \\ \rm y \cos xy & \rm x \cos xy \\ \smash{ \underset{ \begin{subarray}{c} \uparrow \\ \rm \partial (g \circ f)_3 {∕} \partial x \end{subarray} }{ \enclose{roundedbox}{\rm 2xy + y^2} } } \vphantom{ \enclose{roundedbox}{\rm 2xy + y^2} } & \rm 2xy + x^2 \end{pmatrix} \end{align} $

$ \begin{align} \mathbb{R}^2 &\rarrow{\large \rm g \: \circ \: f}{} \mathbb{R}^3 \\ \rm (x,y) &\rm \rarrow{\hphantom{\large g \circ f}}{} (e^{xy(x+y)}, \sin xy, xy(x + y)) \end{align} $

$\rm (g \circ f)_3 = x^2 y + xy^2$

$\rm \partial (g \circ f)_3 {∕} \partial x = 2xy + y^2$


$ \rm \dfrac{\partial (g \circ f)_i}{\partial x_j}(u_0) = \nabla g_i(f(u_0)) \cdot \left( \dfrac{\partial f_k}{\partial x_j}(u_0) \right)_{k=1,\dotsc,m} $


Ejemplo:

$ \begin{align} \mathbb{R}^2 &\rarrow{\rm \large f}{} \mathbb{R}^2 \\ \rm (x, y) &\rm \rarrow{\hphantom{\large f}}{} (x + y, x - y) \end{align} $

$ \begin{align} \mathbb{R}^2 &\rarrow{\rm \large g}{} \mathbb{R} \\ \rm (x, y) &\rm \rarrow{\hphantom{\large g}}{} e^{xy} \end{align} $

$\rm g \circ f : \mathbb{R}^2 \to \mathbb{R}$

$\rm Dg = (ye^{xy}, xe^{xy})$

$ \begin{align} \rm \partial (g \circ f) {∕} \partial x &= \rm Dg(f(x,y)) \cdot \left( \dfrac{\partial f_1}{\partial x}(x,y), \dfrac{\partial f_2}{\partial x}(x,y) \right) = \\[1ex] &= \rm \left( (x-y)e^{x^2-y^2},(x+y)e^{x^2-y^2} \right) \cdot (1,1) = \\[1ex] &= \rm (x-y)e^{x^2-y^2} + (x+y)e^{x^2-y^2} = 2xe^{x^2 - y^2} \end{align} $

$\rm (x,y) \rarrow{\large f}{} (x+y,x-y) \rarrow{\large g}{} e^{(x+y)(x-y)} = e^{x^2 - y^2}$

$\rm \partial (g \circ f){∕}\partial x = 2xe^{x^2 - y^2}$


Ejemplo:

$ \begin{align} \mathbb{R}^2 &\rarrow{\rm \large f}{} \mathbb{R}^3 \\ \rm (x,y) &\rm \rarrow{\hphantom{\large f}}{} (x+y, xy, x-y) \end{align} $

$ \begin{align} \mathbb{R}^3 &\rarrow{\rm \large g}{} \mathbb{R}^2 \\ \rm (x,y,z) &\rm \rarrow{\hphantom{\large g}}{} (\underbrace{xy}_{\large g_1},yz) \end{align} $

$\rm \partial (g \circ f)_1{∕} \partial y \enspace ?$

$ \rm \partial (g \circ f)_1 {∕} \partial y = \nabla g_1(f(x,y)) \cdot \left( \dfrac{\partial f_1}{\partial y}(x,y), \dfrac{\partial f_2}{\partial y}(x,y), \dfrac{\partial f_3}{\partial y}(x,y) \right) $

$\rm \nabla g_1(x,y,z) = (y, x, 0)$

$\rm \nabla g_1(f(x,y)) = (xy, x + y, 0)$

$\rm \partial (g \circ f)_1 {∕} \partial y = (xy, x + y, 0) \cdot (1, x, -1) = xy + x^2 + xy = 2xy + x^2$

$ \begin{align} \mathbb{R}^2 &\rarrow{\rm \large g \circ f}{} \mathbb{R}^2 \\ \rm (x,y) &\rm \rarrow{\hphantom{\large g \circ f}}{} (\underbrace{x^2y + xy^2}_{\large (g \circ f)_1},x^2y - xy^2) \end{align} $

$\rm \partial (g \circ f)_1 {∕} \partial y = x^2 + 2xy$


Demostración:

$ \rm f : \underset{ \begin{subarray}{c} \displaystyle \downarrow \\ \displaystyle \rm u\rlap{{}_{0}} \end{subarray} }{B} \subset \mathbb{R}^n \to \mathbb{R} $

$ \rm h : \underset{ \begin{subarray}{c} \displaystyle \downarrow \\ \displaystyle \rm t\rlap{{}_0 \quad h(t_0) = u_0} \end{subarray} }{I} \subset \mathbb{R} \to \mathbb{R}^n $

$\rm (f \circ h) : I \subset \mathbb{R} \to \mathbb{R}$

Aplicando la regla de la cadena:

$\rm (f \circ h)'(t_0) = \nabla f(h(t_0)) \cdot h'(t_0)$