Using 8.9 sagemath on Linux. Where Fricas 1.5 is installed.
After calling fricas for integration from inside sagemath, and then translating the result to latex, the latex do not compile. I get syntax error compiling the latex with latest texlive TL 2019.
>sage
┌────────────────────────────────────────────────────────────────────┐
│ SageMath version 8.9, Release Date: 2019-09-29 │
│ Using Python 2.7.16. Type "help()" for help. │
└────────────────────────────────────────────────────────────────────┘
sage: var('b c x n a')
sage: anti=integrate((b*log(c*x^n) + a)*x^2*polylog(3, e*x),x, algorithm="fricas")
sage: anti_in_latex=latex(anti)
sage: anti_in_latex
-\frac{1}{972} \, {\left(4 \, {\left(4 \, b n - 3 \, a\right)} x^{3} e^{3} + 9 \, {\left(3 \, b n - 2 \, a\right)} x^{2} e^{2} + 36 \, {\left(2 \, b n - a\right)} x e + 36 \, {\left(3 \, b n x^{3} e^{3} \log\left(x\right) + 3 \, b x^{3} e^{3} \log\left(c\right) - {\left(2 \, b n - 3 \, a\right)} x^{3} e^{3} - b n\right)} {\rm %iint}\left(x, -\frac{\log\left(-x e + 1\right)}{x}\right) - 36 \, {\left({\left(b n - a\right)} x^{3} e^{3} - b n + a\right)} \log\left(-x e + 1\right) - 6 \, {\left(2 \, b x^{3} e^{3} + 3 \, b x^{2} e^{2} + 6 \, b x e - 6 \, {\left(b x^{3} e^{3} - b\right)} \log\left(-x e + 1\right)\right)} \log\left(c\right) - 6 \, {\left(2 \, b n x^{3} e^{3} + 3 \, b n x^{2} e^{2} + 6 \, b n x e - 6 \, {\left(b n x^{3} e^{3} - b n\right)} \log\left(-x e + 1\right)\right)} \log\left(x\right) - 108 \, {\left(3 \, b n x^{3} e^{3} \log\left(x\right) + 3 \, b x^{3} e^{3} \log\left(c\right) - {\left(b n - 3 \, a\right)} x^{3} e^{3}\right)} {\rm polylog}\left(3, x e\right)\right)} e^{\left(-3\right)}
sage:
Now when compiling the above, here is the error
(base) >cat foo1.tex
\documentclass[12pt]{article}%
\usepackage{amsmath}
\begin{document}
\[
-\frac{1}{972} \, {\left(4 \, {\left(4 \, b n - 3 \, a\right)} x^{3} e^{3} + 9 \, {\left(3 \, b n - 2 \, a\right)} x^{2} e^{2} + 36 \, {\left(2 \, b n - a\right)} x e + 36 \, {\left(3 \, b n x^{3} e^{3} \log\left(x\right) + 3 \, b x^{3} e^{3} \log\left(c\right) - {\left(2 \, b n - 3 \, a\right)} x^{3} e^{3} - b n\right)} {\rm %iint}\left(x, -\frac{\log\left(-x e + 1\right)}{x}\right) - 36 \, {\left({\left(b n - a\right)} x^{3} e^{3} - b n + a\right)} \log\left(-x e + 1\right) - 6 \, {\left(2 \, b x^{3} e^{3} + 3 \, b x^{2} e^{2} + 6 \, b x e - 6 \, {\left(b x^{3} e^{3} - b\right)} \log\left(-x e + 1\right)\right)} \log\left(c\right) - 6 \, {\left(2 \, b n x^{3} e^{3} + 3 \, b n x^{2} e^{2} + 6 \, b n x e - 6 \, {\left(b n x^{3} e^{3} - b n\right)} \log\left(-x e + 1\right)\right)} \log\left(x\right) - 108 \, {\left(3 \, b n x^{3} e^{3} \log\left(x\right) + 3 \, b x^{3} e^{3} \log\left(c\right) - {\left(b n - 3 \, a\right)} x^{3} e^{3}\right)} {\rm polylog}\left(3, x e\right)\right)} e^{\left(-3\right)}
\]
\end{document}(base)
And
>lualatex foo1.tex
This is LuaTeX, Version 1.10.0 (TeX Live 2019)
restricted system commands enabled.
(./foo1.tex
LaTeX2e <2018-12-01>
luaotfload | main : initialization completed in 0.161 seconds
(/usr/local/texlive/2019/texmf-dist/tex/latex/base/article.cls
Document Class: article 2018/09/03 v1.4i Standard LaTeX document class
(/usr/local/texlive/2019/texmf-dist/tex/latex/base/size12.clo))
(/usr/local/texlive/2019/texmf-dist/tex/latex/amsmath/amsmath.sty
For additional information on amsmath, use the `?' option.
(/usr/local/texlive/2019/texmf-dist/tex/latex/amsmath/amstext.sty
(/usr/local/texlive/2019/texmf-dist/tex/latex/amsmath/amsgen.sty))
(/usr/local/texlive/2019/texmf-dist/tex/latex/amsmath/amsbsy.sty)
(/usr/local/texlive/2019/texmf-dist/tex/latex/amsmath/amsopn.sty)) (./foo1.aux)
! Missing } inserted.
<inserted text>
}
l.8 \]
?
This is the first time I see latex generated by sagemath not compile OK. I am usin
Any one knows what is going on and why this error is generated? Thanks --Nasser