Scholars believe Shakespeare wrote "Macbeth" to entertain and win the approval of King James I. Shakespeare's troupe, originally "The Lord Chamberlain's Men," changed its name to "The King's Men" to honor the new Scottish king upon his ascension to the throne. They first performed in this work in 1606 at Hampton Court Palace for James and his guests.
Several factors point to the Bard's attempt at impressing James I. The basis of the play comes from Scottish history; the real Macbeth, one of James' ancestors, ruled from 1040 to 1057. It explores similar themes to James' writings about the ideal king as one who does his duty to God and country with spotless integrity. The witches relate to James' interest in the supernatural and involvement in witch trials while ruling in Scotland. Even though Shakespeare portrays the witches as evil and emissaries of the devil, they pay complements to James in the prediction of Macbeth's long line of descendants to serve on the throne.
The oldest printed text of "Macbeth" is in the First Folio from 1623. By this time, there were significant alterations to the play, including two additional songs from Thomas Middleton's play "The Witch" (1615). Scholars believe these additions represent the audience's interest in the scenes from Shakespeare's original work; however, they are not indicators of his attempts at impressing the new king.