Thanks to Greg Coxson who has recently alerted me to this 2011 article by Paul Collins in New Scientist, "Rhyme and reason: The Victorian poet scientists." In the article, Collins is reviewing an anthology edited by Daniel Brown entitled The Poetry of Victorian Scientists: Style, Science and Nonsense (Cambridge University Press, Reprint-2015).
The article has links to poetry by James Clerk Maxwell (1831-1879), William J. Macquorn Rankine (1820-1872), and James Joseph Sylvester (1814-1897). Below I offer two of the eight entertaining stanzas from Rankine's poem, "The Mathematician in Love." (This poem and Maxwell's "A Lecture on Thomson's Galvanometer" also appear in the wonderful anthology that Sarah Glaz and I edited -- Strange Attractors: Poems of Love and Mathematics (A K Peters/CRC Press, 2008, now available as an e-book.)
from The Mathematician in Love by William J Macquorn Rankine
A mathematician fell madly in love
With a lady, young, handsome, and charming:
By angles and ratios harmonic he strove
Her curves and proportions all faultless to prove.
As he scrawled hieroglyphics alarming.
“Let x denote beauty, -- y, manners well-bred,--
“z, Fortune, -- (this last is essential), --
“Let L stand for love” -- our philosopher said, --
“Then L is a function of x, y, and z,
“Of the kind which is known as potential.”
The full text of "The Mathematician in Love" may be found here at the poemhunter.com website and lots more poems by Maxwell also may be found at poemhunter.com. Here, again, is the link to Collins' article about the "the Victorian poet scientists."