We let the scalar \( \alpha \) be defined by
$$ \alpha = \boldsymbol{y}^T\boldsymbol{x}, $$where both \( \boldsymbol{y} \) and \( \boldsymbol{x} \) have the same length \( n \), or if we wish to think of them as column vectors, they have dimensions \( n\times 1 \). We assume that both \( \boldsymbol{y} \) and \( \boldsymbol{x} \) depend on a vector \( \boldsymbol{z} \) of the same length. To calculate the derivative of \( \alpha \) with respect to a given component \( z_k \) we need first to write out the inner product that defines \( \alpha \) as
$$ \alpha = \sum_{i=0}^{n-1}y_ix_i, $$and the partial derivative
$$ \frac{\partial \alpha}{\partial z_k} = \sum_{i=0}^{n-1}\left(x_i\frac{\partial y_i}{\partial z_k}+y_i\frac{\partial x_i}{\partial z_k}\right), $$for \( \forall k =0,1,2,\dots,n-1 \). We can rewrite the partial derivative in a more compact form as
$$ \frac{\partial \alpha}{\partial \boldsymbol{z}} = \boldsymbol{x}^T\frac{\partial \boldsymbol{y}}{\partial \boldsymbol{z}}+\boldsymbol{y}^T\frac{\partial \boldsymbol{x}}{\partial \boldsymbol{z}}, $$and if \( \boldsymbol{y}=\boldsymbol{x} \) we have
$$ \frac{\partial \alpha}{\partial \boldsymbol{z}} = 2\boldsymbol{x}^T\frac{\partial \boldsymbol{x}}{\partial \boldsymbol{z}}. $$