Joseph's father was Jacob or Heli? Matthew 1 and Luke 3
"There appear to be differences between Luke's and Matthew's genealogies. Some differences can be explained by Matthew's omitting names in order to achieve a symmetry of three sets of fourteen generations (see Matthew commentary for explanation). Not every single person had to be included in a genealogy—the words "son of" could also mean "descendant of." Luke most likely was tracing Jesus' natural human ancestry through Joseph, while Matthew was focusing on the legal and royal names to emphasize the succession of the throne of David and Jesus' arrival as the promised King. Matthew stressed Israelite history. Luke's longer genealogy traced Jesus' ancestry through David's son, Nathan, not through Solomon, as Matthew did. Matthew also included the names of four women, which Luke did not. Matthew's genealogy begins with Abraham and moves forward to Jesus, showing that Jesus is related to all Jews (Matthew 1). Luke's genealogy begins with Jesus and goes backward to Adam, showing that Jesus is related to all human beings.
Why does Luke give a genealogy at all? To his Gentile audience, it would have had little significance—not nearly as important as to the Jews to whom Matthew was writing. Luke probably included his genealogy to show that Jesus was a man, not a god or a demigod. His story is unlike those of the Greek and Roman gods of mythology. Luke presented a human, descended from the first human, who came to be by God's will alone. This is consistent with Luke's picture of Jesus as the Savior of the whole world.
While it is impossible to completely harmonize the genealogies recorded by Matthew and Luke, believers can trust, as they can with all Scripture, that this is factual information obtained from different sources. Luke would have had no reason to include a false genealogy, for it would have been refuted quickly and would have ruined his purpose to give a "carefully investigated" and "orderly account" of Jesus' life (1:3 niv). If there had been no information on Jesus' heritage other than what Matthew wrote, Luke would have been content to do without a genealogy. While most of Matthew's names can be found in the Old Testament, Luke's names came from other sources, perhaps personal interviews or written registries of the day.
Luke's genealogy begins by saying that Jesus was the son, so it was thought, of Joseph, the son of Heli. Genealogies were always traced through the fathers, so Luke begins with the man who was "thought" to be Jesus' father, Joseph. Although God was Jesus' Father, God had a reason for placing him in this particular line with Mary as his mother and Joseph as his legal father.
According to Matthew 1:16, Joseph's father was Jacob. The answer to this apparent discrepancy may lie in the ancient custom of "levirate marriage" by which the widow of a childless man could marry his brother. A son born to that union would be considered the son of the deceased man. Heli and Jacob may have been half brothers—same mother but different fathers. One may have died and the other married his widow. So depending on which line of the genealogy was to be followed, the name of the actual or legal father would be used.
—Life Application Bible Commentary
"Scholars have proposed various explanations for the differences between the genealogies of Matthew and Luke, of which the following are most prominent: (1) one (probably Matthew) records the genealogy of Joseph, the other of Mary; (2) one (probably Matthew) spiritualizes the genealogy rather than following it literally; (3) the lines of descent cross but are different because one list includes several adoptive lines through levirate marriages (Deut. 25:5-10).—Bible Background Commentary
"The son of need not imply a strict father-son relationship with no gaps in between any more than Matthew’s ‘was the father of’; both family trees may contain jumps over the generations. For Heli Matthew has ‘Jacob’. 24 It is uncertain whether Matthat is to be identified with Matthan (Mt. 1:15). 27 Zerubbabel was the leader of the Jewish community after the return from Babylonian exile. For Shealtiel see Hg. 1:1; but in 1 Ch. 3:19 (Heb. text, not the lxx) Zerub-babel’s father is Pedaiah. According to 1 Ch. 3:17 Shealtiel was the son of Jehoiachin (graecized as Jeconiah, Mt. 1:12) and not of Neri; perhaps an adoption took place. 31 This Nathan is not the well-known prophet but a son of David (2 Sa. 5:14). 32 From this verse onwards the names agree with those in the Gk. version of the OT except for minor spelling differences. See Gn. 5:1–32; 11:10–26; Ru. 4:18–22; 1 Ch. 1:1–34; 2:1–15; 3:5–19. 36 Cainan occurs in the lxx, but not in the Hebrew OT.
---- DA Carson, The New Bible Commentary
"3:23 Heli may have been Joseph's father-in-law. If that were the case, this would be Mary's genealogy that Luke may have received personally from her. It is fitting that Luke would show Mary's genealogy because of the prominence he gives women in his Gospel.
3:23-38 Matthew's genealogy goes back to Abraham and shows that Jesus was related to all Jews (Matthew 1). Luke's genealogy goes back to Adam, showing that Jesus is related to all human beings. This is consistent with Luke's picture of Jesus as the Savior of the whole world.
—Life Application Bible Notes
_____________________________________________________
Lastly, you said "I'm confused! Maybe I don't know enough about it yet...isn't the Bible supposed to be perfect? Could someone help me out? Thank you."
Christians claim that the Bible is perfect, as contained in the original manuscripts. We don't have those today, but what we do have are many many manuscripts. Any difficulties that arise can usually be corrected by this practice (manuscript comparison). I encourage you to check out the following link, which goes to an important statement made regarding the inerrancy, infallibility and inspiration of the Scriptures, its called The Chicago Statement on Biblical Inerrancy. The article is prefaced with this:
"NOTE: This was the statement that launched the International Council on Biblical Inerrancy, an interdenominational joint effort by hundreds of evangelical scholars and leaders to defend biblical inerrancy against the trend toward liberal and neo-orthodox conceptions of Scripture.
The Statement was produced at the Hyatt Regency O'Hare in Chicago in the fall of 1978, during an international summit conference of concerned evangelical leaders. It was signed by nearly 300 noted evangelical scholars, including Boice, Norman L. Geisler, John Gerstner, Carl F. H. Henry, Kenneth Kantzer, Harold Lindsell, John Warwick Montgomery, Roger Nicole, J.I. Packer, Robert Preus, Earl Radmacher, Francis Schaeffer, R.C. Sproul, and John Wenham.
The ICBI disbanded in 1988, its work complete. The Council ultimately produced three major statements: this one on biblical inerrancy in 1978, one on biblical hermeneutics in 1982, and one on biblical application in 1986. A published copy of the statement may be found in Carl F. H. Henry in God, Revelation and Authority, vol. 4 (Waco, Tx.: Word Books, 1979), on pp. 211-219." ( see the full statement at
http://www.spurgeon.org/~phil/creeds/chicago.htm )