# Medium-Sized Calculations and Organization

This is not a math question as much as a process question. For the first time in my (very short) career, I find myself doing one of those messy calculations, where each 'line' of the calculation can spread over a page or three. Essentially all of the calculation is trivial if I'm willing to write some reasonable inequalities in places, and all of these choices are obvious as they're being made, but I am having a rough time keeping the assumptions on term sign required for the various inequalities and the calculations themselves even close to organized, and the copying errors are a nightmare.

Does anybody have any good suggestions on how to stay organized for this sort of trivial-in-theory but messy-in-practice calculation? What do you actually do in these situations? This is especially directed at people in areas like statistical physics or mathematical statistics where these sorts of things show up frequently, and there must be some way of dealing with them. Clever renaming of variables, latexing as you go, good use of Maple...?

Mathematica can be very useful for this kind of thing. If you're good enough at it you can force it to go through calculations pretty much step-by-step if you need it too. You can also export its output to LaTeX, which is very nice and saved me a lot of work on various physics homeworks!

For more complicated things, you can often still make mathematica do it, but it's often better (and can be more insightful) to try to restructure things into smaller blocks that are easier to handle. You can do this through renaming things, or lemmas, or whatever else. In physics, physical intuition about things like conserved or almost conserved quantities can be really useful to use here, since they can tell you about things you might otherwise miss.

I agree with the others that a CAS is probably your best bet, but failing that, the folks who do really sprawling but straightforwards calculations are the theoretical computer scientists. Most of them have adopted a proof notation due to Dijkstra of the form

expression1

= { comment about why equality holds }

expression2

= { comment... }

...

The classic book on this is Dijkstra's "Predicate Calculus and Program Semantics," which is lovely but tends to drive a lot of logicians batty. You can also find nice examples of its use in the small scale in papers like A tutorial on the universality and expressiveness of fold

I think Mathematica or a suitable CAS is the way to go to deal with this issue.

• Seems like the best possible answer to me... – Rob Grey Jun 21 '10 at 23:46