In Psalm 40:6-8, the Son of God, who is the speaker, states that he is about to become a man (these verses are a prophecy). The Son refers to a book or scroll in which certain matters are written about him. While we are not told exactly what the scroll signifies, there are two possibilities. One is that he is referring to the book of God’s eternal purposes in which the Father’s intentions for his Son were detailed (obviously, this would not be a reference to a literal book in heaven).
The other possible meaning of the scroll is that it refers to the Old Testament scriptures. As far as David himself had been concerned, when he became king of Israel he would have discovered God’s requirements in the books of the Old Testament that were then available, mainly in the Pentateuch (Genesis–Deuteronomy). By the time of the Incarnation, the Old Testament was complete and it is full of teaching about Jesus. He himself refers to this in Luke 24:44: ‘These are my words that I spoke to you while I was still with you, that everything written about me in the Law of Moses and the Prophets and the Psalms must be fulfilled.’ There is no doubt that the Old Testament was a primary source of how Jesus understood his Messianic work.
The Son also addresses the Father as ‘my God’. Psalm 40 is not the only Messianic psalm that has this manner of speaking on the lips of the Son (Ps. 22:1, 10). Jesus after his resurrection addresses the Father as God in John 20:17 when he speaks to Mary Magdalene of his imminent ascension to heaven. It is evident in Psalm 40, from the connection that the Son makes with God’s will, that he is speaking to the Father as his servant, and this is one reason why he calls him ‘my God.’
The willing Son also describes his inner life when he says that God’s law is within his heart. The law of God was written on the human heart of Jesus and all that was needed for it to be displayed was the passing of time. This is what took place. Because he had a perfect heart, Jesus lived a perfect life.
The humanity of Jesus, the body that was prepared for him by the Father, should often be on our minds. From heaven he came to the womb of Mary and united himself with his human nature simultaneously to its creation by the Holy Spirit; when he was born, he emerged from the womb to live a perfect life as a child, a teenager and as an adult until he died on the cross and was buried; while his body was in the tomb for three days, his human spirit was in heaven; on the third day, his spirit and body were reunited in resurrection power; a few weeks later, he in his risen humanity ascended to heaven and was glorified and enthroned at God’s right hand. There he is at present, waiting for the next stages of his exaltation: his resurrecting of his people from death and his appearance as the Judge of all creatures. After that, his people will enjoy his endless fellowship as he interacts with them through the body that was prepared for him by his Father.
It is not surprising that the singing Son praised God as he anticipated and experienced the Incarnation. And we can imagine Jesus singing these verses or meditating upon them during the years he was on earth, as he thought about what was going to happen to the body that had been prepared for him by the Father. And now in heaven in his glorified body, he looks forward with joy to what he is yet to experience in the body that was prepared for him so long ago by his Father.
Because he was given a body, we too can look forward to transformation: ‘But our citizenship is in heaven, and from it we await a Saviour, the Lord Jesus Christ, who will transform our lowly body to be like his glorious body, by the power that enables him even to subject all things to himself’ (Phil. 3:20-21). ‘Beloved, we are God's children now, and what we will be has not yet appeared; but we know that when he appears we will be like him, because we shall see him as he is’ (1 John 3:2).