Those who were surprised to encounter Jesus' genealogy in the Gospel of Matthew, will be equally surprised to learn that the Gospel of Luke includes one as well. Some of you may be familiar with both, and aware of the more obvious differences. Matthew begins with Abraham and moves down the generations towards the birth of Jesus. Luke goes in the opposite direction, beginning with Jesus and stretching all the way past Abraham to the first man (Adam) and God. These differences underscore the different themes inherent in each Gospel. Matthew emphasizes Jesus as the fulfillment of God's promises to God's people, while Luke highlights how Jesus is the Savior of the entire world.
What is not obvious, however, is that the two genealogies differ also in those eras where they overlap: Matthew follows the line of David’s son Solomon, while Luke follows the line of Nathan another child of David. The end result is two distinct genealogies.*
So what are we to make of these two family trees? Did one of the Gospel writers get it wrong?
Those of us who find Scripture trustworthy sees such differences as these as opportunities to search for other explanations. As soon as you start exploring this 'problem' you will discover a wide range of plausible explanations.
Some suggest that one of the Gospel writers has described a metaphorical (theological) genealogy, while the other has provided something more akin to modern-day family trees. Another explanation is that the different Gospels each provide a genealogy of Jesus' parents: Matthew gives us Joseph's genealogy and Luke provides Mary's. It is also possible that Mary's dad had no natural sons, and adopted Joseph so as to continue the family name. This would provide Joseph with two different genealogies: one by birth and the other by adoption.*
Whatever the case, both genealogies name Jesus a royal heir and reveal Jesus as an authentic Jew. Both genealogies highlight the saints and sinners among Jesus' ancestors and show us that our God works through broken families.
*some of this material has been distilled from the blog post "Why Are Jesus’ Genealogies in Matthew and Luke Different?" Zondervan Academic December 14, 2016