1 | initial version |
This answer may be relevant : the "manual" solution proposed can be programmed (although the relevant simplifications may vary). Sage will give you a mathematically sound solution, that you may have to simplify "manually" (easy with Sage's help...).