I have wracked my mind and heart for what I ought to say to you today. I have asked myself what I wish I had known at my own graduation, and what important lessons I have learned in the 21 years that has expired between that day and this. I have come up with two answers. On this wonderful day when we are gathered together to celebrate your academic success, I have decided to talk to you about the benefits of failure. And as you stand on the threshold of what is sometimes called 'real life', I want to extol the crucial importance of imagination.
So why do I talk about the benefits of failure? Simply because failure meant a stripping away of the inessential. I stopped pretending to myself that I was anything other than what I was, and began to direct all my energy into finishing the only work that mattered to me. Had I really succeeded at anything else, I might never have found the determination to succeed in the one arena I believed I truly belonged. I was set free, because my greatest fear had already been realised, and I was still alive, and I still had a daughter whom I adored, and I had an old typewriter and a big idea. And so rock bottom became the solid foundation on which I rebuilt my life.
Failure gave me an inner security that I had never attained by passing examinations. Failure taught me things about myself that I could have learned no other way I discovered that I had a strong will, and more discipline than I had suspected; I also found out that I had friends whose value was truly above rubies.
The knowledge that you have emerged wiser and stronger from setbacks means that you are, ever after, secure in your ability to survive. You will never truly know yourself, or the strength of your relationships, until both have been tested by adversity. Such knowledge is a true gift, for all that it is painfully won, and it has been worth more to me than any qualification I ever earned.
You might think that I chose my second theme, the importance of imagination, because of the part it played in rebuilding my life, but that is not wholly so. Though I will defend the value of bedtime stories to my last gasp, I have learned to value imagination in a much broader sense. Imagination is not only the uniquely human capacity to envision that which is not, and therefore the fount of all invention and innovation. In its arguably most transformative and revelatory capacity, it is the power that enables us to empathise with humans whose experiences we have never shared.
One of the greatest formative experiences of my life preceded Harry Potter, though it informed much of what I subsequently wrote in those books. This revelation came in the form of one of my earliest day jobs. Though I was sloping off to write stories during my lunch hours, I paid the rent in my early 20s by working in the research department at Amnesty International's headquarters in London.
There in my little office I read hastily scribbled letters smuggled out of totalitarian regimes by men and women who were risking imprisonment to inform the outside world of what was happening to them. I saw photographs of those who had disappeared without trace, sent to Amnesty by their desperate families and friends. I read the testimony of torture victims and saw pictures of their injuries. I opened handwritten, eye-witness accounts of summary trials and executions, of kidnappings and rapes.
Many of my co-workers were ex-political prisoners, people who had been displaced from their homes, or fled into exile, because they had the temerity to think independently of their government. I shall never forget the African torture victim, a young man no older than I was at the time, who had become mentally ill after all he had endured in his homeland. He trembled uncontrollably as he spoke into a video camera about the brutality inflicted upon him. He was a foot taller than I was, and seemed as fragile as a child. I was given the job of escorting him to the Underground Station afterwards, and this man whose life had been shattered by cruelty took my hand with exquisite courtesy, and wished me future happiness.
And as long as I live l shall remember walking along an empty corridor and suddenly hearing, from behind a closed door, a scream of pain and horror such as I have never heard since. The door opened, and the researcher poked out her head and told me to run and make a hot drink for the young man sitting with her She had just given him the news that in retaliation for his own outspokenness against his country's regime, his mother had been seized and executed.
Every day of my working week in my early 20s I was reminded how incredibly fortunate I was, to live in a country with a democratically elected government, where legal representation and a public trial were the rights of everyone.
And tomorrow, I hope that even if you remember not a single word of mine, you remember those of Seneca, another of those old Romans I met when I fled down the Classics corridor in retreat from career ladders, in search of ancient wisdom: As is a tale, so is life: not how long it is, but how good it is, is what matters.
JK Rowling is the author of the Harry Potter novels. This is an edited extract of the Harvard University Commencement Address she delivered on June 5