# Differentiating (Gradient and Hessian) a Rn->R function

Suppose that $g(z)=f(x)$, where $x=Sz+s$ for some $S\in R^{n\times n}$ and $s\in R^n$
Please Show that $\nabla g(z)=S^T\nabla f(x)$ and $\nabla^2g(z)=S^T\nabla^2 f(x) S$
where $\nabla$shows the gradient and $\nabla^2$ shows the Hessian.