"There's a method to my madness"
"Though this be madness, yet there is method in 't. Will you walk out of the air, my lord?"
How Shakespeare uses it: Polonius says it in "Hamlet," basically suggesting that there is reason behind apparent chaos.
Modern definition: The meaning is the same nowadays, although the language is a bit updated into modern terms. It is also a Bee Gees song.
Source: "Hamlet," Act 2, Scene 2