Derivation of backpropagation with more than one layer