Joseph appears in Luke as the father of Jesus and in a "variant reading in Matthew".[19] Matthew and Luke both contain a genealogy of Jesus showing his ancestry from David, but through different sons; Matthew follows the major royal line from Solomon, while Luke traces another line back to Nathan, another son of David and Bathsheba. Consequently, all the names between David and Joseph are different. According to Matthew 1:16 "Jacob begat Joseph the husband of Mary", while according to Luke 3:23, Joseph is said to be "the son of Heli".
The variances between the genealogies given in Matthew and Luke are explained in a number of ways; one possibility is that Matthew's genealogy traces Jesus' legal descent, according to Jewish law, through Joseph; while Luke's genealogy traces his actual physical descent through Mary