This Psalm is a celebration of God’s great goodness and mercy vouchsafed unto him and all his people. It is certain and evident that David speaks some things in this Book of Psalms in his own name and person, and some things ill the name and person of Christ, or whom he was an eminent type; and that sometimes he speaks in both these capacities in the same Psalm, as hath been noted before. And this seems to be the condition of this Psalm; wherein there are some passages which cannot belong to Christ, as Psa_40:13, and some which do not properly belong to David, or to that time and state of the church, but only to Christ, and to the times of the New Testament, as Psa_40:6,7.
David by his own experience showeth the benefit of trusting in God, Psa_40:1-5. Christ’s obedience and sacrifice, Psa_40:6-10. His sufferings for sin; his fervent prayer, Psa_40:11-17.