when x is a vector, derivative of vector diag(f'(x)) is formal notation?
You are partially right and partially wrong: $f'(\textbf{x})$ is a matrix, but $\text{diag}(f'(\textbf{x}))$ means taking the diagonal of that matrix and making a vector out of it.