This is about as broad a question as possible. Try to narrow it down. Are you talking about any kind of specific equations? What diagrams are you talking about?
The algorithm for deriving equations is quite similar to the algorithm for proving theorems. Write down true statements until you're satisfied with what you've done. Of course, there are many heuristic refinements, but you'll have to figure those out on your own with practice practice practice!