Luke 2:21-24
Jesus was circumcised on the eighth day, as the law prescribed (Gen. 17:12; cf. Gal 4:4-5). "He was named Jesus" (Luke 2:21; cf. Luke 1:31). Ryle quoting Poole says, "We read of four people in the Old Testament to whom God gave names before they were born: Isaac (Genesis 17:19); Josiah (1 Kings 13:2); Ishmael (Genesis 16:11); Cyrus (Isaiah 44:28); and in the New Testament we read of two: John the Baptist and Jesus Christ. This tells us how certain God was about future contingencies."
The need for purification arose from the fact that a mother was ceremonially unclean for seven days after the birth of a son (Lev. 12:2). For another 33 days, she was to keep away from holy things (the time periods were doubled after the birth of a daughter; Lev. 12:1-5). She was then to offer a lamb and a dove or pigeon. If she was poor, her offering was to be two doves or pigeons (Lev. 12:6-8). Mary's offering was that of the poor. Only the first male child of every mother was presented to the Lord (Exod. 13:2). As to the relationship between circumcision and baptism please see the Birth of John the Baptist - Luke 1:57-66 (below).
Obedience to the Law of Moses is mentioned several times in these verses. This emphasizes the piety of Joseph and Mary. It also shows Jesus's obedience to and fulfillment of the Law (Matt. 3:15; 5:17-18). Though Jesus was sinless, he was willingly born under the Law (Gal. 4:4-5). This allowed him to experience the fullness of human life and be a perfect substitute for humanity before God (Rom. 8:3; Heb. 2:17).