Was the role of Hecate written by Shakespeare?
Straight answer? No-one knows.
Hecate appears in Act III, Scene V (there seems to be a mistake in the enotes linking of the text - suggesting, incorrectly, Act V, Scene V).
And this scene has long been thought to not fit with the rest of the play. Though it appears in the Folio (the only text we have of "Macbeth") it includes only the first two lines of two songs "Come away, come away" and "Black spirits". The full lyric to both songs appears - and this is about where the evidence ends - in the other play of the Jacobethan period to feature a "Hecate": "The Witch" by Thomas Middleton.
Let's assume for a second that Shakespeare didn't write the Hecate section of "Macbeth". In that case, it appears that somebody took it up on themselves (or was paid) to transplant these songs from Middleton's play into Shakespeare's. Who usually gets the blame for being that person? Thomas Middleton.
Gary Taylor, in his recent edition of Middleton, argues that, not only did Middleton do that job, but tidied up and cut down the text (which is one of Shakespeare's shortest in the state that we have it) - Taylor thinks Middleton might have cut a quarter of the original play.
Arguments that Hecate is Shakespeare's? 1. He refers to "pale Hecate" in Macbeth's soliloquy (2.1). 2. Hecate in the Folio is totally different (even in verse form) to Middleton's Hecate in "The Witch".
Can we be sure either way? No.