Appendix—Derivation of equations