The original quote is:
M. Porcius Cato dixit litterarum radices amaras esse fructus iocundiores.
(Cato said that the roots of education are bitter, its fruits more pleasant.)
Declined in numerous different ways by a Latin grammarian named Diomedes in his Ars grammatica, 4th or 5th c. AD. Printed in Grammatici Latini, ed. Heinrich Keil, vol. 1.310. Leipzig: BG Teubner, 1855-1880.
The chreia and ancient rhetoric: classroom exercises, Volume 2002, Part 2, p. 67-68, by Ronald F. Hock, Edward N. O'Neil, Society of Biblical Literature
It would be really helpful to everyone if quotes were cited!!