Title: A method for deriving functional equations with applications to the zeta and generalized theta functions