howin neighborhood of xthe function can be approximated by linear functionf ( hf (xj ( )hand similarly for (ythe well-known chain rule of calculus simply states that the derivative of the composition is the matrix product of the derivatives of and that ischain rule gf (xj (yj (xgf rn figure function composition the blue arrows symbolize the linear mappings in terms of our vector/vector derivative notationwe have ### ormore simplyz ( in similar way we can establish scalar/matrix chain rule in particularsuppose is an matrixwhich is mapped to :xa for fixed -dimensional vector in turny is mapped to scalar : (yfor some function denote the columns of by thenp xa jj= andthereforey/ in it follows by the chain rule ( that in ai xi xi thereforei xzp ax ( example (derivative of the log-determinantsuppose we are given positive definite matrix pxp and wish to compute the scalar/matrix derivative lna|athe result is ln |aa- to see thiswe can reason as follows by theorem we can write qwhere