In this quote of his:
“When I wrote this, only God and I understood what I was doing. Now, God only knows.”
Which piece of Mathematical work was this in reference to?
According to Quote Investigator, the first written record of the quote is attributed to the German romantic writer Johann Richter, also known as Jean Paul, shortly after his death at a time when Weierstrass would have been just eleven years old.
The earliest instance known to QI appeared in a London newspaper in 1826 and featured the German writer Johann Paul Friedrich Richter who died shortly before in 1825. The anecdote used the alternate appellation John Paul Richter. The capitalization is in the original text. Boldface has been added to excerpts below:
The works of JOHN PAUL RICHTER are almost uninteresting to any but Germans, and even to some of them. A worthy German, just before RICHTER’S death, edited a complete edition of his works, in which one particular passage puzzled him. Determined to have it explained at the source, he went to JOHN PAUL himself, and asked him what was the meaning of the mysterious passage. JOHN PAUL’S reply was very German and characteristic. “My good friend,” said he, “when I wrote that passage, God and I knew what it meant. It is possible that God knows it still; but as for me, I have totally forgotten.” This story can be expressed in many ways and instances before 1826 may exist. Early examples of the anecdote typically feature German intellectuals, and the tale may have appeared previously in a German language book or periodical.
As noted on Quote Investigator, a number of additional attributions followed shortly after the Richter attribution. The author also notes :
Special thanks to Daniel Gackle who asked QI to investigate this topic after presenting the yarn and connecting it to the philosopher Hegel and the mathematician Weierstrass.