Deuteronomy 21:15 - 21:17
15 “If a man has two wives, the one loved and the other unloved, and both the loved and the unloved have borne him sons, if the firstborn son belongs to the unloved, 16 then it shall be in the day he wills what he has to his sons, he cannot make the son of the loved the firstborn before the son of the unloved, who is the firstborn. 17 But he shall recognize the firstborn, the son of the unloved, by giving him a double portion of all that he has, for he is the first of his vigor; the legal judgment for the firstborn belongs to him.