Data Fitting
I had an idea on a project I'm doing for work, and I just sat down and worked on it non-stop for the last four hours. Namely from 9:30 p.m. to 1:30 a.m. Oops. It just never occurred to me to check the time.
I got rather engrossed because I managed to accomplish something I've never actually managed before: Fitting a non-trivial functional form to a set of data. A few times before in my work I've encountered datasets that weren't described by any known functional form, and after poking at them for a while I just didn't have any insight as to how to identify or construct one. This time, I managed to have that insight.
In this case I had a hard time at first because though I was able to identify features in the data and think of functions which might produce them, at first they just didn't fit very well. The key trick this time turned out to be to look at the function's derivative, which turned out to be both simpler than the function itself and reveal a key point that I had otherwise missed. After establishing a good fit for the derivative, I was able to just integrate, and get a nice fit for the function itself. This also revealed why I had had essentially no hope of solving the original problem as I had been attempt: I'd been trying to assemble a power series with a few handpicked terms, but the derivative turned out to be an arctangent, whose anti-derivative is really a rather peculiar function. I'd guessed the linear term, hadn't noticed to try an arctangent term, and never in a million years would have guessed the log-of-a-square term.

Now all I have to do is determine the functional dependence of the five fit parameters I had to introduce on the actual physical parameter defining the data. . .