Eusebius (260-340 AD), who is called the father of church history, covers this topic in his classic work titled " Ecclesiastical History" in book 1 chapter 7:
CHAPTER VII.
On the discrepancy which is supposed to exist in the Gospels
respecting the genealogy of Christ.
As the genealogy of Christ is differently given to us by Matthew
and Luke, and they are supposed by the generality to disagree in
their statements ; and as every believer, for want of knowing the
truth, has been led to apply some investigation to explain the
passages, we may also subjoin the account which has come down to us.
We refer to the history which has been handea down on these passages
by Africanus, in an epistle to Aristides, respecting the harmony of
the genealogy of the gospels. After having refuted the opinions of
others as forced and fictitious, he sets forth the account that he
had ascertained himself, in the following words. " It was customary
in Israel to calculate the names of the generations, either according
to nature, or accord ing to the law; according to nature, by the
succession of legitimate offspring ; according to the law, when
another raised children to the name of a brother who had died
childless. For as the hope of a resurrection was not yet clearly
given, they imitated the promise which was to take place by a kind
of mortal resurrection, with a view to perpetuate the name of the
person who had died. Since then, there are some of those who are
inserted in this gene- alogical table, that succeed each other in the
natural order of father and son, some again that were born of others,
and were as- cribed to others by name, both the real and reputed
fathers have been recorded. Thus, neither of the gospels has made a
false statement, whether calculating in the order of nature, or
accord- ing to law. For the families descended from Solomon, and
those from Nathan, were so intermingled, by substitutions in the
place of those who had died childless, by second marriages and the
raising up of seed, that the same persons are justly considered, as
in one respect, belonging to the one of these, and in another respect
belonging to others. Hence it is, that both of these accounts being
true, viz. of those who were reputed fathers, and those v>'ho really
were fathers, they come down to Joseph with considerable intri- cacy,
it is true, but with great accuracy. That this, however, may be made
evident, I will state the series of generations. If (in the genealogy
of Matthew,) you reckon the generations from David through Solomon,
Matthan, who begat Jacob the father of Joseph, is found to be the
third from the end. But if, with Luke, you reckon from Nathan the son
of David, in like manner, Melchi, whose son was Eli, the father of
Joseph, will be found to be the third. As Joseph, then, is our
proposed object, we are to show how it happened that each is recorded
as his father ; both Jacob, as deduced from Solomon, and Eli from
Nathan ; also, how it happened that these two, Jacob and Eli, were
brothers ; and more- over, how the fathers of these, Matthan and
Melchi, being of different families, are proved to be the
grandfathers of Joseph.
Matthan and Melchi, having married in succession the same woman, had
children, who were brothers by the same mother, as the law did not
prohibit a widow, whether she became such by divorce, or by the death
of her husband, to marry again. Mat- than, therefore, who traces his
lineage from Solomon, first had Jacob, by Estha, for this is her name
as handed down by tradition. Matthan dying, and Melchi, who traces
his descent from Nathan, though he was of the same tribe, but of
another family, having as before said, married her, had a son Eli.
Thus, then, we shall find the two of different families, Jacob and
Eli, brothers by the same mother. Of these, the one Jacob, on the
death of his bro- ther, marrying his widow, became the father of a
third, viz. Jo- seph ; his son both by nature and calculation.
Wherefore, it is written, Jacob begat Joseph. But according to the
lav/, he was the son of Eli, for Jacob being his brother, raised up
seed to him. Wherefore, the genealogy traced also through him, will
not be rendered void, which, according to Matthew, is given thus — "
but Jacob begat Joseph." But Luke, on the other hand, says, " who was
the son, as was supposed, (for this he also adds,) the son of Joseph,
the son of Eli, the son of Melchi." For it was not possible to ex-
press the legal genealogy more distinctly, so that he entirely omits
the expression, " he begat,''^ in a generation like this, until the
end ; having traced it back as far as Adam, " who was the son of
God," he resolves the whole series by referring back to God. Neither
is this incapable of proof, nor is it an idle conjecture. For the re-
latives of our Lord, according to the flesh, whether to display their
own illustrious origin, or simply to show the fact, but at any rate
adhering strictly to the truth, have also handed down the following
accounts : That robbers of Idumea, attacking Ascalon, a city of
Palestine, led Antipater away captive together with other booty, from
the temple of Apollo, which was built close to the walls. He was the
son of one Herod, a minister of the temple. The priest, however, not
being able to pay the ransom for his son, Antipater was trained up in
the practices of the Idumeans, and afterwards in great favour with
Hyrcanus the high priest of Ju- dea. He was subsequently sent by
Hyrcanus on an embassy to Pompey, and having restored the kingdom to
him, which had been invaded by Aristobulus, the brother of the
latter, Antipater himself had the good fortune to be nominated the
procurator of Palestine. Antipater, however, having been
treacherously slain, by those who envied his good fortune, was
succeeded by his son Herod. He was afterwards, by a decree of the
senate, appointed king of the Jews, under Antony and Augustus. His
sons were Herod and the other tetrarchs. These accounts of the Jews
also coincide with those of the Greeks. But, as the genealogies of
the Hebrews had been regularly kept in the archives until then, and
also of those who referred back as far as the ancient proselytes ; as
for mstance, to Achior the Ammonite, and Ruth the Moabitess, and to
those that were intermixed with the Israelites at their depar- ture
from Egypt ; and as the hneage of the Israelites contributed nothing
to Herod's advantage, he was goaded by the conscious- ness of his
ignoble extraction, and committed all these records of their families
to the flames. Thinking that himself might ap- pear of noble origin,
by the fact that no one else would be able to trace his pedigree by
the pubhc records, back to patriarchs or proselytes, and to those
strangers that were called georas.* A few however of the careful,
either remembering the names, or having it in their power in some
other way, by means of copies, to have private records of their own,
gloried in the idea of preserving the memory of their noble
extraction. Of these were the above- mentioned persons, called
desposyni,-!" on account of tlieir afiinity to the family of our
Saviour. These coming from Nazara and Cochaba, villages of Judea, to
the other parts of the world, explained
the aforesaid genealogy from the book of daily records, as
faithfully as possible. Whether, then, the matter be thus or other-
wise, as far as I and every impartial judge would say, no one
certainly could discover a more obvious interpretation. And this,
then, may suffice on the subject ; for, although it be not sup-
ported by testimony, we have nothing to advance, either better or
more consistent with truth. The gospel, altogether, states the
truth." At the close of the same epistle, this writer, (Africanus,)
adds the following : " Matthan, whose descent is traced to Solo- mon,
begat Jacob, Matthan dying, Melchi, whose lineage is from Nathan, by
marrying the widow of the former, had Eli. Hence, Eli and Jacob were
brothers by the same mother. Eli dying childless, Jacob raised up
seed to him, having Joseph, according to nature belonging to himself,
but by the law to Eli. Thus, Jo- seph was the son of both." So far
Africanus ; and the lineage of Joseph thus being traced, Mary, also,
at the same time, as far as can be, is evinced to be of the same
tribe, since, by the ^Mosaic law, intermarriages among different
tribes were not permitted. For the injunction is, to marry one of the
same kindred, and the same family, so that the inheritance may not be
transferred from tribe to tribe. And this may suffice, also, on the
present point.