We define some finite sums which are associated with the Dedekind type sums and Hardy-Berndt type sums. The aim of this paper is to prove a reciprocity law for one of these sums. Therefore, we define a new function which is related to partial derivatives of the three-term polynomial relations. We give a partial differential equation (PDE) for this function. For some special values, this PDE reduces the three-term relations for Hardy-Berndt sums (cf. Apostol and Vu in Pac. J. Math. 98:17-23, 1982; Berndt and Dieter in J. Reine Angew. Math. 337:208-220, 1982; Simsek in Ukr. Math. J. 56(10): 1434-1440, 2004; Simsek in Turk. J. Math. 22:153-162, 1998; Simsek in Bull. Calcutta Math. Soc. 85:567-572, 1993; Pettet and Sitaramachandraro in J. Number Theory 25:328-339, 1989), to the generalized Carlitz polynomials, which are defined by Beck (Diophantine Analysis and Related Fields, pp. 11-18, 2006), to the Gauss law of quadratic reciprocity (cf. Beck in Diophantine Analysis and Related Fields, pp. 11-18, 2006; Berndt and Dieter in J. Reine Angew. Math. 337:208-220, 1982; Simsek in Turk. J. Math. 22:153-162, 1998), and also to the well-known identity on the greatest integer function which was proved by Berndt and Dieter (J. Reine Angew. Math. 337:208-220, 1982), p. 212, Corollary 3.5. Finally, we prove the reciprocity law for an n-variable new sum which is related to the Dedekind type and Hardy-Berndt type sums. We also raise some open questions on the reciprocity laws of our new finite sums.