Sure -- Basically I represent the equation as a tree where I have something like:
addition(power(x, 2), multiplication(x, sin(x)))
then I choose a value for all of the variables -- say, x=2, and evaluate each of the tree nodes. So at the leaves of the tree there is either a variable or a constant. When I go to render the equation, for each render node, I apply a scaling transform that is a function of the value of that node (basically you can evaluate each branch of the tree as if it were standalone) and the highest value of all of its children (that second part is so i don't "double count" the scale factors as they go up the tree). So because it's a tree, the scaling transforms compound, so the most influential branches of the tree because large while th\e less influential parts of the tree become small. The animation is basically incrementing the input values and recomputing the weights for each value.
So essentially what happens is if you have x^2 + 2*x, the x's are of equal weight, but the x^2 is x/2 times more influential than the 2*x factor, so as x increases, you see the x^2 dominate the visualization.
Incidentally, one curious issue I've been working on is that I evaluate essentially like order of ops, so if I have (x + 5 + x), it's evaluated as ((x+ 5) + x), so the first term is (x + 5) and is 5 units larger than the second x, so it looks slightly larger than than the second x. I avoid this currently by ignoring computing the rolled up scale factor for an addition. It's less noticable for multiplication sense multiplication usually has a larger influence anyway, so you don't notice the small initial differences like you do with addition which works "more slowly". I've always been debating about how to handle function notation like sin(x). Currently I scale the function variable, but I'm thinking I shouldn't. In general, you can't know what kind of affect the function parameters will have on the output, so it's slightly misleading to make it appear that the parameter is influential. For instance, high values of x for sin(x) aren't any more influential than small values of x since sin(x) is bounded.
This is mostly useless, it was just a fun program to write. That and the equation renderer is kind of cool
ms