# Computing Partial Derivatives and Gradients in Excel

DERIVF can be nested to compute partial derivatives of any order: $\frac{\partial }{\partial z}\frac{\partial }{\partial y}\frac{\partial }{\partial x}f\left(x,y,z\right)$

Consider the partial derivative:

$\frac{\partial }{\partial y}\frac{\partial }{\partial x}cos\left(x,y\right)=-sin\left(xy\right)-xycos\left(xy\right)$

We compute the partial derivative of cos(xy) at (π,π) by nesting DERIVF and compare the result with the analytical value shown in B3 below:

#### Partial derivative at (π,π)

 A 1 =COS(X1*Y1) 2 =DERIVF(B1,X1,PI()) 3 =DERIVF(B2,Y1,PI())
 A B 1 1 2 0 3 9.3394486379 9.3394486379
Question or Comment? Email us:
support @ excel-works.com

ExceLab: Transforming Excel into a Calculus Power House

ExceLab functions and methods are protected by USA Patents 10628634, 10114812, 9892108 and 9286286.

© 2015-2021, ExcelWorks LLC
Boston, USA