I struggled to believe that a mathematician was like a poet at all. But I never expected math to help me become a poet.

When I declared an English major, I hoped I had escaped calculus, trigonometry and the associated nightmares once and for all.

So, I resented my school’s mathematics requirement. I dreaded returning to those enigmatic numbers — and worse, to the letters, the x’s and y’s I found illegible.

Grudgingly, I registered for a course called “Math and Creativity.” I hoped for more emphasis on the creativity, or at least for an easy A.

My first glimpse of just how creative mathematics could be came in our cryptography unit, where we broke basic codes to decipher a message from the poet John Keats: “Beauty is Truth, Truth Beauty.”

Then our professor, the late Dick Horwath, assigned some chapters from the British mathematician G. H. Hardy’s memoir, “A Mathematician’s Apology” (1940). What I found there fulfilled Rainer Maria Rilke’s poetic challenge all over again: it changed my life.

“A mathematician,” Hardy writes, “like a painter or a poet, is a maker of patterns. If his patterns are more permanent than theirs, it is because they are made with ideas.”

ardy continued:

The mathematician’s patterns, like the painter’s or the poet’s, must be beautiful; the ideas, like the colors or the words, must fit together in a harmonious way. Beauty is the first test: there is no permanent place in the world of ugly mathematics.

All the math I’d ever done was either right or wrong (and usually the latter). Hardy spoke instead of the beauty of mathematics — not the answer itself but the elegance of its expression.

This I could understand. I loved poetry for its ecstasy of language, but also because in poetry x could be x and y at once. I did not grasp how slippery those mathematical ideas — variables and constants, x and y and π — could be.

I did not yet know that light could be both a particle and a wave. Or that to observe particles’ behavior changes their behavior. I took science on faith.

Soon I learned that a certain “uncertainty” had marked the scientific world in the twentieth century and onward just as profoundly as it marks my humanist sphere.

I learned that those worlds were the same world.

Even that line of Keats’s — “Beauty is truth, truth beauty” — is a mathematical formulation, a metaphorical x=y, y=x.

The “equals” sign may be the bridge between what C. P. Snow famously called “The Two Cultures,” the sciences and the arts. Mathematicians and poets are indeed makers of patterns, observers and describers of relationships.

What the equals sign accomplishes in mathematics the metaphor achieves in letters: the demonstration of congruence among two elements previously thought separate.

I thought of Professor Horwath again, years later, when I began teaching a course called “Poetry for People Who Hate Poetry.” I hoped to win a few converts to poetry from a crowd of STEM students.

I offered Albert Einstein’s formula for mass-energy equivalence, E=mc2. Einstein’s equation is poetic, I argued, because it so elegantly expresses an aspect of a profoundly complicated universe.

I felt quite pleased with myself, until a student scoffed. “Einstein’s okay,” she said, “but if you want real mathematical beauty, you need Euler’s identity theorem.” I stood there stumped — so I invited her to the board, where she wrote out eiπ+1=0.

The Swiss mathematician Leonhard Euler used this equality, I later learned, to express the relationship between some of the most fundamental mathematical ideas. Poetry in a language I could not speak.

The students murmured. Another spoke in favor of a different equation, and soon our discussion became a debate about the aesthetics of mathematics — the sort of argument I’d often relished in poetry workshops.

It was a moment out of the college brochures: math and poetry, the sciences and the arts aligned in the pursuit of truth — and beauty.

At the end of the semester, a student brought in something he called “his favorite poem.” It was not a poem per se, though it offers everything I seek in poetry: words to make us feel at once infinitesimal and significant.

The passage — from Carl Sagan’s 1994 lecture “A Pale Blue Dot” — refers to a photograph of our solar system, taken by the Voyager 1 probe from a distance of about 3.7 billion miles. In the photograph, Earth is barely visible, a pale blue dot smaller than a single pixel.

This is just the perspective for Sagan to consider:

Our planet is a lonely speck in the great enveloping cosmic dark . . . To me, it underscores our responsibility to deal more kindly and compassionately with one another and to preserve and cherish that pale blue dot, the only home we’ve ever known.

Sagan used to say that we are all “made of starstuff,” a cosmological truism to imagine ourselves remarkable.

And we are remarkable — in that we exist, in that we express our existence in words and numbers, periodic tables and blots of paint. Why anything exists at all is a bone in the throat of the philosopher and the physicist alike.

In the universe we are simply molecules, yours more or less the same as mine. All of us are made of the same starstuff, the same mapped genome, the same cells and thin membranes, mostly water.

The cosmos expands — and may eventually collapse — regardless of what we call “the self.” Science tells us as much; poetry and the arts help us live with it.

In our brief instant amidst the infinite, we ought to remember, with Walt Whitman, that “every atom belonging to me as good belongs to you.”