Given gradient and hessian of $\phi$ and the first and second derivatives of $h$ I would like to find the gradient and hessian matrix of $f$


Where $f:R^n \longrightarrow R$

$\phi:R^n \longrightarrow R$

$h:R \longrightarrow R$

According to the chain rule: $\nabla f = h'(\phi(x))\nabla\phi(x)$ Is it correct and trivial and doesn't need any other proof? And how can I find the hessian of $f$?

  • $\begingroup$ Well, yeah, the chain rule says exactly that, why should you need some other proof? And just compute all (mixed) second order partial derivatives to find the hessian $\endgroup$ – VanillaThunder Mar 31 '18 at 19:08
  • $\begingroup$ you might have to use the chain rule again... $\endgroup$ – VanillaThunder Mar 31 '18 at 19:14
  • $\begingroup$ @cbdes Please remember that you can choose an answer among the given if the OP is solved, more details here meta.stackexchange.com/questions/5234/… $\endgroup$ – gimusi Apr 3 '18 at 14:35



by chain rule we have that

$$\frac{\partial f}{\partial x_i}=h'(\phi(\vec x))\frac{\partial \phi}{\partial x_i}\implies \nabla f(\vec x) = h'(\phi(\vec x))\nabla\phi(\vec x)$$

For the Hessian note that

$$\frac{\partial^2 f}{\partial x_i^2}=h''(\phi(\vec x))\left(\frac{\partial \phi}{\partial x_i}\right)^2+h'(\phi(\vec x))\frac{\partial^2 \phi}{\partial x_i^2}$$

$$\frac{\partial^2 f}{\partial x_ix_j}=h''(\phi(\vec x))\frac{\partial \phi}{\partial x_i}\frac{\partial \phi}{\partial x_j}+h'(\phi(\vec x))\frac{\partial^2 \phi}{\partial x_ix_j}$$


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.