Luck was finally on Kepler's side. While he made a number of mistakes in calculation and reasoning as he went along, they always seemed to cancel each other out. At one point, he seemed to have stumbled upon the right answer. His results almost matched his predictions. They differed by only a very small error, eight minutes of arc. No astronomer before Kepler would have paused at such a figure – they would have blithely gone on and declared their theory to be true. Kepler himself, at the time of his Mysterium Cosmographicum had clung to his theory in the face of conflicting data, deciding that the data must be wrong.
But Kepler had changed. Accuracy was now his watchword, and eight minutes of arc error was unacceptable. So he threw out his theory and went back to the drawing board.
In the end, it was the formulation of the first law that gave him the most difficulty. Once Kepler was finally convinced that the planetary orbits were oval-shaped, rather than circular, he strove to find a mathematical formula that would describe the shape of the ovals. But try as he might, he was unable to find one. He worked on this problem for over a year, at one point complaining to a friend that things would be so much easier if the ovals were just ellipses. In fact they were, but Kepler was unable to see it.
He worked and worked at the problem, finally coming up with an equation that seemed to exactly describe the orbit. In fact, it was the equation for an ellipse, but Kepler didn't recognize it as such. While testing out his theory, he made a minor mistake in the calculations and concluded that the equation must be incorrect. Throwing up his hands in disgust, Kepler threw out the formula and finally deciding to see what would happen if he treated the orbit as if it was an ellipse. It wasn't until these calculations finally led him to the same place he'd started that he realized he had had the answer all along.