Ecclesiastes 1:17

And I gave my heart to know wisdom, and to know madness and folly: I perceived that this also is vexation of spirit.

Solomon deliberately set his heart to know and explore both wisdom on the one hand and madness and folly on the other. His inquiry was not casual but a wholehearted giving of himself to test the full range of experience. In doing so he turned away from communion with God toward sensual pleasures in pursuit of satisfaction. That search did not yield lasting fulfillment but ended in vexation of spirit.