Derivada parcial
¿Qué es una derivada parcial?
La derivada parcial de una función de dos variables \(f(x,y)\) en un punto \((x,y)\), respecto a \(x\), se define como el límite $$ \frac{\partial f(x,y)}{\partial x} = \lim_{h \to 0} \frac{f(x+h,y)-f(x,y)}{h} $$ De forma análoga, la derivada parcial respecto a \(y\) es $$ \frac{\partial f(x,y)}{\partial y} = \lim_{h \to 0} \frac{f(x,y+h)-f(x,y)}{h} $$
Si estos límites existen y son finitos, decimos que la derivada parcial existe en ese punto.
¿Cómo se calcula una derivada parcial?
Para calcular la derivada parcial respecto a una variable, se consideran constantes todas las demás.
Después, se deriva la función con respecto a la variable elegida aplicando las reglas habituales de derivación.
Nota. Si la función depende de más de dos variables -por ejemplo, \(f(x,y,z)\)- el procedimiento es idéntico: se mantienen fijas las demás y se deriva únicamente con respecto a la variable de interés.
Las derivadas parciales pueden escribirse de distintas maneras:
$$ D_x f \quad\quad D_y f $$
$$ \partial_x f \quad\quad \partial_y f $$
$$ \frac{\partial f}{\partial x} \quad\quad \frac{\partial f}{\partial y} $$
o, de forma más abreviada, \(f_x\) y \(f_y\).
¿Y si la función depende de tres variables?
Cuando una función depende de varias variables, la derivada parcial se toma respecto a una sola, considerando las demás como constantes.
Por ejemplo, la derivada parcial de \(f(x,y,z)\) respecto a \(x\) es:
$$ \frac{\partial f(x,y,z)}{\partial x} = \lim_{\Delta x \to 0} \frac{f(x+\Delta x,\,y,\,z)-f(x,y,z)}{\Delta x} $$
¿Qué información nos aporta una derivada parcial?
La derivada parcial respecto a \(x\) describe la tasa de variación -es decir, la pendiente- de la función en la dirección del eje \(x\).
Nota. De manera análoga, las derivadas respecto a \(y\) y \(z\) se definen como: $$ \frac{\partial f(x,y,z)}{\partial y} = \lim_{\Delta y \to 0} \frac{f(x,\,y+\Delta y,\,z)-f(x,y,z)}{\Delta y} $$ $$ \frac{\partial f(x,y,z)}{\partial z} = \lim_{\Delta z \to 0} \frac{f(x,\,y,\,z+\Delta z)-f(x,y,z)}{\Delta z} $$ Estas representan las pendientes de la función en las direcciones de \(y\) y \(z\), respectivamente.
En general, una función de \(n\) variables tendrá \(n\) derivadas parciales de primer orden, una para cada variable independiente.
Un ejemplo práctico
Consideremos la función de dos variables:
$$ f(x,y) = x^2 + y^3 $$
Derivamos primero respecto a \(x\), tratando \(y\) como constante:
$$ D_x f(x,y) = D_x[x^2 + y^3] = 2x $$
Nota. Como \(y^3\) se considera constante respecto a \(x\), su derivada es cero: \(D_x[y^3] = 0\).
Ahora derivamos respecto a \(y\), considerando \(x\) como constante:
$$ D_y f(x,y) = D_y[x^2 + y^3] = 3y^2 $$
Por tanto, las derivadas parciales de \(f(x,y)\) son:
$$ D_x f(x,y) = 2x \qquad D_y f(x,y) = 3y^2 $$
Nota. En este caso, \(f(x,y)\) es derivable respecto a ambas variables. El par \((D_x, D_y)\) constituye el gradiente: $$ \nabla f = [D_x, D_y] $$
Más ejemplos de derivadas parciales
A continuación se muestran varios ejemplos de derivadas parciales de primer orden para funciones de dos variables.
| f(x, y) | \( f_x \) | \( f_y \) |
|---|---|---|
| \( x^2+y^3 \) | \( 2x \) | \( 3y^2 \) |
| \( x^3y + y^3x \) | \( 3x^2y + y^3 \) | \( x^3 + 3y^2x \) |
| \( x^2 + 3xy + y^2 \) | \( 2x + 3y \) | \( 3x + 2y \) |
| \( e^x \sin(y) \) | \( e^x \sin(y) \) | \( e^x \cos(y) \) |
| \( \sin(xy^2) \) | \( \cos(xy^2)\cdot y^2 \) | \( \cos(xy^2)\cdot 2xy \) |
| \( e^{xy} \cos y \) | \( e^{xy} \cdot y \cos y \) | \( x e^{xy} \cos y - e^{xy} \sin y \) |
| Como \(x\) aparece solo en el primer término, el segundo se trata como constante al derivar respecto a \(x\). | En cambio, como \(y\) interviene en ambos, al derivar respecto a \(y\) debe aplicarse la regla del producto. | |
| \( \ln(x^2 + y^2) \) | \( \frac{2x}{x^2 + y^2} \) | \( \frac{2y}{x^2 + y^2} \) |
| \( \log(1+x^2+y^4) \) | \( \frac{2x}{1+x^2+y^4} \) | \( \frac{4y^3}{1+x^2+y^4} \) |
| \( \tfrac{1}{x^2 + y^2} \) | \( \tfrac{-2x}{(x^2 + y^2)^2} \) | \( \tfrac{-2y}{(x^2 + y^2)^2} \) |
| \( \arctan\!\left(\tfrac{y}{x}\right) \) | \( \tfrac{-y}{x^2 + y^2} \) | \( \tfrac{x}{x^2 + y^2} \) |
| \( x^y \) | \( yx^{y-1} \) | \( x^y \log x \) |
| Análogo a derivar \(x^k\), con \(k\) constante. | Similar a derivar \(k^y\), tratando \(k\) como constante. | |
| \( \sqrt{1+x^2+y^2} \) | \( \tfrac{x}{\sqrt{1+x^2+y^2}} \) | \( \tfrac{y}{\sqrt{1+x^2+y^2}} \) |
| \( \tfrac{xy}{x^2+y^2} \) | \( \tfrac{y(y^2-x^2)}{(x^2+y^2)^2} \) | \( \tfrac{x(x^2-y^2)}{(x^2+y^2)^2} \) |
Veamos ahora algunos ejemplos con funciones de tres variables:
| \( f(x,y,z) \) | \( f_x \) | \( f_y \) | \( f_z \) |
|---|---|---|---|
| \( x^2+y^2+z^2 \) | \( 2x \) | \( 2y \) | \( 2z \) |
| \( xyz \) | \( yz \) | \( xz \) | \( xy \) |
| \( e^{x+y+z} \) | \( e^{x+y+z} \) | \( e^{x+y+z} \) | \( e^{x+y+z} \) |
| \( \sin(xy+z) \) | \( \cos(xy+z)\cdot y \) | \( \cos(xy+z)\cdot x \) | \( \cos(xy+z) \) |
| \( \ln(x^2+y^2+z^2) \) | \( \tfrac{2x}{x^2+y^2+z^2} \) | \( \tfrac{2y}{x^2+y^2+z^2} \) | \( \tfrac{2z}{x^2+y^2+z^2} \) |
| \( x^y+z^x \) | \( yx^{y-1}+\log(z)\,z^x \) | \( x^y \log x \) | \( xz^{x-1} \) |
| \( \sqrt{1+x^2+y^2+z^2} \) | \( \tfrac{x}{\sqrt{1+x^2+y^2+z^2}} \) | \( \tfrac{y}{\sqrt{1+x^2+y^2+z^2}} \) | \( \tfrac{z}{\sqrt{1+x^2+y^2+z^2}} \) |
| \( \tfrac{xz}{y^2+1} \) | \( \tfrac{z}{y^2+1} \) | \( \tfrac{-2xyz}{(y^2+1)^2} \) | \( \tfrac{x}{y^2+1} \) |
| \( \arctan\!\left(\tfrac{y+z}{x}\right) \) | \( \tfrac{-(y+z)}{x^2+(y+z)^2} \) | \( \tfrac{x}{x^2+(y+z)^2} \) | \( \tfrac{x}{x^2+(y+z)^2} \) |
| \( x^y z \) | \( yx^{y-1}z \) | \( x^y \log x \cdot z \) | \( x^y \) |
| Se aplica la regla de la potencia en el exponente de \(x\). | Se usa la regla logarítmica al derivar respecto a \(y\). | Como \(x^y\) es constante respecto a \(z\), permanece inalterado. |
The same principles extend naturally to functions of \( n \) variables.
Notes
Additional remarks and clarifications on partial derivatives.
- Partial derivatives alone do not ensure continuity or differentiability
The existence of partial derivatives at a point does not, by itself, guarantee that the function is continuous or differentiable there.Example. Consider the function: \[ f(x,y) = \begin{cases} \dfrac{2xy}{x^2+y^2}, & (x,y) \neq (0,0), \\ 0, & (x,y) = (0,0). \end{cases} \] At \((0,0)\), both partial derivatives exist and equal zero, since the derivative of the constant value \(f(0,0)=0\) with respect to either variable is zero: \[ \frac{\partial f}{\partial x}(0,0) = 0, \qquad \frac{\partial f}{\partial y}(0,0) = 0. \] However, the function is not continuous at the origin, because the limit of \(f(x,y)\) as \((x,y)\to(0,0)\) depends on the path of approach. Along the \(x\)-axis (\(y=0\)): \[ \lim_{(x,y)\to(0,0)} f(x,0) = \lim_{x\to0} \frac{2x\cdot0}{x^2+0} = 0, \] and similarly along the \(y\)-axis (\(x=0\)): \[ \lim_{(x,y)\to(0,0)} f(0,y) = \lim_{y\to0} \frac{2\cdot0\cdot y}{0+y^2} = 0. \] So far the limits agree. But along the line \(y=x\): \[ \lim_{(x,y)\to(0,0)} f(x,x) = \lim_{x\to0} \frac{2x^2}{2x^2} = 1. \] Since the limit depends on the path, it does not exist at \((0,0)\). Thus, although the partial derivatives exist at the origin, the function is not continuous there.
- Higher-order partial derivatives
Higher-order derivatives are obtained by differentiating repeatedly: \[ \frac{\partial^2 f}{\partial x_i \partial x_k}. \] When differentiation is repeated with respect to the same variable, they are called pure derivatives; when with respect to different variables, they are called mixed derivatives: \[ \frac{\partial^2 f}{\partial x_i \partial x_k}, \quad D^2_{x_i x_k} f, \quad f_{x_k x_i}. \]Example. Let \( f(x,y) = xy^2 \). First-order derivatives: \[ \frac{\partial f}{\partial x} = y^2, \qquad \frac{\partial f}{\partial y} = 2xy. \] Pure second-order derivatives: \[ \frac{\partial^2 f}{\partial x^2} = 0, \qquad \frac{\partial^2 f}{\partial y^2} = 2x. \] Mixed derivatives: \[ \frac{\partial^2 f}{\partial y \partial x} = \frac{\partial}{\partial y}(y^2) = 2y, \quad \frac{\partial^2 f}{\partial x \partial y} = \frac{\partial}{\partial x}(2xy) = 2y. \] As expected, the mixed derivatives coincide, since they are continuous - exactly as stated by Schwarz’s theorem.
- Schwarz’s Theorem
For a function of two or more variables, if the mixed second-order partial derivatives are continuous, then the order of differentiation can be interchanged: \[ \frac{\partial^2 f}{\partial x_i \partial x_k} = \frac{\partial^2 f}{\partial x_k \partial x_i}. \]
In other words, the order of differentiation does not matter. This reduces the number of distinct second-order derivatives that must be computed from \(n^2\) to \(\tfrac{n(n+1)}{2}\), where \(n\) is the number of variables. For functions of a single variable the issue does not arise, since there is only one direction of differentiation.Example. Take \( f(x,y) = x^2y + 3xy^2 \). First-order derivatives: \[ \frac{\partial f}{\partial x} = 2xy + 3y^2, \qquad \frac{\partial f}{\partial y} = x^2 + 6xy. \] Pure second-order derivatives: \[ \frac{\partial^2 f}{\partial x^2} = 2y, \qquad \frac{\partial^2 f}{\partial y^2} = 6x. \] Mixed second-order derivatives: \[ \frac{\partial^2 f}{\partial y \partial x} = 2x + 6y, \qquad \frac{\partial^2 f}{\partial x \partial y} = 2x + 6y. \] As Schwarz’s theorem predicts, the mixed derivatives agree, confirming that the order of differentiation is immaterial when the mixed derivatives are continuous. This greatly simplifies computation: instead of four second derivatives, only three distinct ones are needed.
And so on.