|   | 1 |  initial version  | 
You may convert your mathics to a Sage expression and latex that. Using your second example :
sage: latex(mathics.Integrate(x^p*log(a*x), x)._sage_())
\begin{cases}{\frac{{\left(p \log\left(a x\right) + \log\left(a x\right) - 1\right)} x^{p + 1}}{p^{2} + 2 \, p + 1}} & {p \neq \left(-1\right)}\\{\frac{1}{2} \, \log\left(a x\right)^{2}} & {1}\end{cases}
which ask.sagemth.org's Mathjax can't translate...
HTH,
 Copyright Sage, 2010. Some rights reserved under creative commons license. Content on this site is licensed under a Creative Commons Attribution Share Alike 3.0 license.
 
                
                Copyright Sage, 2010. Some rights reserved under creative commons license. Content on this site is licensed under a Creative Commons Attribution Share Alike 3.0 license.