I've thought about this before. It gets harder when dealing with >2 inputs and names longer than 1 letter, so I organized it with lines to make it look more tree-like.
│u│v│x│y
├─┴─├─┴─
│f │g
├───┴─
│h
└─
With >2 inputs and longer names. │uh│v │xizzy│yeez
├──┴─ ├─────┴────
│fooey │gar
├──────┴───
│hello
└─────
The associative property. (a+b)+c=a+(b+c)=a+b+c
│a│b │b│c
├─┴─ ├─┴─
│+ │c│a│+ │a│b│c
├───┴─├─┴─ ├─┴─┴─
│+ │+ │+
├─────┴─────┴─
│=
└─
The quadratic formula. (-b±sqrt(b^2-4*a*c))/(2*a)
│b│2│4│a│c
├─┴─├─┴─┴─
│^ │*
├───┴─
│b│-
├─├─
│-│sqrt│2│a
├─┴────├─┴─
│± │*
├──────┴─
│/
└─
Obviously, it takes way more space and time to draw. Tell me if you like it!