login  home  contents  what's new  discussion  bug reports     help  links  subscribe  changes  refresh  edit

Edit detail for FriCASSpecialIntegration revision 6 of 6

1 2 3 4 5 6
Editor: test1
Time: 2023/09/17 11:58:57 GMT+0
Note:

added:
\end{axiom}
\begin{axiom}
)set output algebra on
)set output tex off

added:
)set output algebra off
)set output tex on
\end{axiom}
\begin{axiom}

added:

There is also limited support to handle integrals where answer depends on elliptic functions:
\begin{axiom}
integrate(1/sqrt((1 - x^2)*(1 + 2*x^2)), x)
integrate(1/sqrt(x^3 - 1), x)
\end{axiom}

FriCAS can now handle large class of integrals expressible in terms of exponential integral, error functions, incomplete Gamma function with constant first argument, logarithmic integral and polylogarithms. Like

fricas
(1) -> integrate(1/log(x), x)

\label{eq1}li \left({x}\right)(1)
Type: Union(Expression(Integer),...)
fricas
integrate(1/(log(x) + 1), x)

\label{eq2}\frac{li \left({x \  e}\right)}{e}(2)
Type: Union(Expression(Integer),...)
fricas
integrate(1/(log(x)^2-1), x)

\label{eq3}\frac{-{li \left({x \  e}\right)}+{{{e}^{2}}\ {li \left({\frac{x}{e}}\right)}}}{2 \  e}(3)
Type: Union(Expression(Integer),...)
fricas
integrate(exp(x + a)/x, x)

\label{eq4}{Ei \left({x}\right)}\ {{e}^{a}}(4)
Type: Union(Expression(Integer),...)
fricas
integrate(exp(x + a)/x^2, x)

\label{eq5}\frac{-{{e}^{x + a}}+{x \ {Ei \left({x}\right)}\ {{e}^{a}}}}{x}(5)
Type: Union(Expression(Integer),...)
fricas
integrate(exp(x)/(x^2 - 1), x)

\label{eq6}\frac{-{Ei \left({x + 1}\right)}+{{{e}^{2}}\ {Ei \left({x - 1}\right)}}}{2 \  e}(6)
Type: Union(Expression(Integer),...)
fricas
integrate(x/(exp(x) - 1), x)

\label{eq7}\frac{{2 \  x \ {\log \left({-{{e}^{x}}+ 1}\right)}}+{2 \ {dilog \left({-{{e}^{x}}+ 1}\right)}}-{{x}^{2}}}{2}(7)
Type: Union(Expression(Integer),...)
fricas
integrate(x^3/(exp(x) - 1), x)

\label{eq8}\frac{{{24}\ {polylog \left({4, \:{{e}^{x}}}\right)}}-{{24}\  x \ {polylog \left({3, \:{{e}^{x}}}\right)}}+{4 \ {{x}^{3}}\ {\log \left({-{{e}^{x}}+ 1}\right)}}+{{12}\ {{x}^{2}}\ {dilog \left({-{{e}^{x}}+ 1}\right)}}-{{x}^{4}}}{4}(8)
Type: Union(Expression(Integer),...)
fricas
integrate(2*x*exp(x)/(exp(x)^2 - 1), x)

\label{eq9}\begin{array}{@{}l}
\displaystyle
-{x \ {\log \left({{{e}^{x}}+ 1}\right)}}+{x \ {\log \left({-{{e}^{x}}+ 1}\right)}}-{dilog \left({{{e}^{x}}+ 1}\right)}+ 
\
\
\displaystyle
{dilog \left({-{{e}^{x}}+ 1}\right)}
(9)
Type: Union(Expression(Integer),...)
fricas
integrate(x/sinh(x), x)

\label{eq10}\begin{array}{@{}l}
\displaystyle
-{x \ {\log \left({{\sinh \left({x}\right)}+{\cosh \left({x}\right)}+ 1}\right)}}+ 
\
\
\displaystyle
{x \ {\log \left({-{\sinh \left({x}\right)}-{\cosh \left({x}\right)}+ 1}\right)}}- 
\
\
\displaystyle
{dilog \left({{\sinh \left({x}\right)}+{\cosh \left({x}\right)}+ 1}\right)}+ 
\
\
\displaystyle
{dilog \left({-{\sinh \left({x}\right)}-{\cosh \left({x}\right)}+ 1}\right)}
(10)
Type: Union(Expression(Integer),...)

fricas
)set output algebra on
 
fricas
)set output tex off
integrate(log(sinh(x)), x)
(11) - 2 x log(sinh(x) + cosh(x) + 1) + 2 x log(sinh(x)) + - 2 x log(- sinh(x) - cosh(x) + 1) - 2 dilog(sinh(x) + cosh(x) + 1) + 2 - 2 dilog(- sinh(x) - cosh(x) + 1) + x / 2
Type: Union(Expression(Integer),...)
fricas
)set output algebra off
 
fricas
)set output tex on

fricas
integrate(exp((-x^2-2*x-1)/x^2)/x^2, x)

\label{eq11}-{\frac{{\erf \left({\frac{x + 1}{x}}\right)}\ {\sqrt{\pi}}}{2}}(11)
Type: Union(Expression(Integer),...)
fricas
integrate(x^3*exp(-x^3), x)

\label{eq12}\frac{-{\Gamma \left({{\frac{1}{3}}, \:{{x}^{3}}}\right)}-{3 \  x \ {{e}^{-{{x}^{3}}}}}}{9}(12)
Type: Union(Expression(Integer),...)
fricas
integrate(x^2*exp(-(x+1)^3), x)

\label{eq13}\frac{{2 \ {\Gamma \left({{\frac{2}{3}}, \:{{{x}^{3}}+{3 \ {{x}^{2}}}+{3 \  x}+ 1}}\right)}}-{\Gamma \left({{\frac{1}{3}}, \:{{{x}^{3}}+{3 \ {{x}^{2}}}+{3 \  x}+ 1}}\right)}-{{e}^{-{{x}^{3}}-{3 \ {{x}^{2}}}-{3 \  x}- 1}}}{3}(13)
Type: Union(Expression(Integer),...)
fricas
integrate(x^n*exp(b*x^2), x)

\label{eq14}\frac{{\Gamma \left({{\frac{n + 1}{2}}, \: -{b \ {{x}^{2}}}}\right)}\ {{e}^{\frac{{\left(- n + 1 \right)}\ {\log \left({- b}\right)}}{2}}}}{2 \  b}(14)
Type: Union(Expression(Integer),...)

FriCAS can introduce new algebraic constants when needed:

fricas
integrate(1/(log(x)^2-3), x)

\label{eq15}\frac{-{li \left({x \ {{e}^{\sqrt{3}}}}\right)}+{{{{e}^{\sqrt{3}}}^{2}}\ {li \left({\frac{x}{{e}^{\sqrt{3}}}}\right)}}}{2 \ {\sqrt{3}}\ {{e}^{\sqrt{3}}}}(15)
Type: Union(Expression(Integer),...)
fricas
integrate(exp(x)/(x^2 - 5), x)

\label{eq16}\frac{{{Ei \left({-{\sqrt{5}}+ x}\right)}\ {{{e}^{\sqrt{5}}}^{2}}}-{Ei \left({{\sqrt{5}}+ x}\right)}}{2 \ {\sqrt{5}}\ {{e}^{\sqrt{5}}}}(16)
Type: Union(Expression(Integer),...)

The method is robust, FriCAS can handle both

fricas
integrate(((x+1)*exp(x))/log(x*exp(x)), x)

\label{eq17}li \left({x \ {{e}^{x}}}\right)(17)
Type: Union(Expression(Integer),...)
fricas
integrate(((x+1)*exp(x))/(x + log(x)), x)

\label{eq18}li \left({x \ {{e}^{x}}}\right)(18)
Type: Union(Expression(Integer),...)

while Mathematca 12 can handle the first form, but not the second one (Maple 15 and Maxima 5.45.1 can not handle any).

Similarly FriCAS has no troubles with

fricas
integrate(((-4*x-8)*log(x)+(-2*x^2-4*x))/(3*x*exp(2*log(x)+x)^2-x), x)

\label{eq19}\begin{array}{@{}l}
\displaystyle
{{\left(-{2 \ {\log \left({x}\right)}}- x \right)}\ {\log \left({\frac{{3 \ {{e}^{{2 \ {\log \left({x}\right)}}+ x}}}+{\sqrt{3}}}{\sqrt{3}}}\right)}}+ 
\
\
\displaystyle
{{\left(-{2 \ {\log \left({x}\right)}}- x \right)}\ {\log \left({\frac{-{3 \ {{e}^{{2 \ {\log \left({x}\right)}}+ x}}}+{\sqrt{3}}}{\sqrt{3}}}\right)}}- 
\
\
\displaystyle
{dilog \left({\frac{{3 \ {{e}^{{2 \ {\log \left({x}\right)}}+ x}}}+{\sqrt{3}}}{\sqrt{3}}}\right)}- 
\
\
\displaystyle
{dilog \left({\frac{-{3 \ {{e}^{{2 \ {\log \left({x}\right)}}+ x}}}+{\sqrt{3}}}{\sqrt{3}}}\right)}+{4 \ {{\log \left({x}\right)}^{2}}}+ 
\
\
\displaystyle
{4 \  x \ {\log \left({x}\right)}}+{{x}^{2}}
(19)
Type: Union(Expression(Integer),...)
fricas
integrate(((-4*x-8)*log(x)+(-2*x^2-4*x))/(3*x^3*exp(log(x)+x)^2-x), x)

\label{eq20}\begin{array}{@{}l}
\displaystyle
{{\left(-{2 \ {\log \left({x}\right)}}- x \right)}\ {\log \left({\frac{{3 \ {{e}^{{2 \ {\log \left({x}\right)}}+ x}}}+{\sqrt{3}}}{\sqrt{3}}}\right)}}+ 
\
\
\displaystyle
{{\left(-{2 \ {\log \left({x}\right)}}- x \right)}\ {\log \left({\frac{-{3 \ {{e}^{{2 \ {\log \left({x}\right)}}+ x}}}+{\sqrt{3}}}{\sqrt{3}}}\right)}}- 
\
\
\displaystyle
{dilog \left({\frac{{3 \ {{e}^{{2 \ {\log \left({x}\right)}}+ x}}}+{\sqrt{3}}}{\sqrt{3}}}\right)}- 
\
\
\displaystyle
{dilog \left({\frac{-{3 \ {{e}^{{2 \ {\log \left({x}\right)}}+ x}}}+{\sqrt{3}}}{\sqrt{3}}}\right)}+{4 \ {{\log \left({x}\right)}^{2}}}+ 
\
\
\displaystyle
{4 \  x \ {\log \left({x}\right)}}+{{x}^{2}}
(20)
Type: Union(Expression(Integer),...)
fricas
integrate(((2*x^4-x^3+3*x^2+2*x+2)*exp(x/(x^2+2)))/(x^3+2*x), x)

\label{eq21}{{\left({{x}^{2}}+ 2 \right)}\ {{e}^{\frac{x}{{{x}^{2}}+ 2}}}}+{Ei \left({\frac{x}{{{x}^{2}}+ 2}}\right)}(21)
Type: Union(Expression(Integer),...)

None of Mathematca 12, Maple 15 and Maxima 5.45.1 can handle them.

Since FriCAS uses algorithmic approach some integrals can be done easily without any extra special support. For example:

fricas
)set output tex off
 
fricas
)set output algebra on
integrate(-erf(((2*m - k^2) - 2*log(c + b) + 2*log(a))/(2*sqrt(2)*k))/2 - 1/2, c)
(23) +----+ 2 | 1 (2 log(c + b) - 2 log(a) - 2 m - k ) |---- | 2 +-+ \|2 k log(a) + m - \|2 erf(-------------------------------------------)%e 2 + +----+ 2 | 1 (2 log(c + b) - 2 log(a) - 2 m + k ) |---- | 2 +-+ \|2 k b\|2 erf(-------------------------------------------) 2 + +----+ 2 +----+ | 1 2 log(c + b) - 2 log(a) - 2 m + k | 1 2 c k |---- erf(----------------------------------) - 2 c k |---- | 2 +-+ | 2 \|2 k 2 k\|2 \|2 k / +----+ | 1 4 k |---- | 2 \|2 k
Type: Union(Expression(Integer),...)
fricas
)set output tex on
 
fricas
)set output algebra off

is done combining general support for Liouvillian integrands with procedure for handling erf. In Rubi this example required adding a new special rule.

FriCAS can also handle some integrals involving special functions of algebraic arguments:

fricas
integrate(((26*x+23)*x^(1/2)+4*x^2+50*x-6)*exp(2*x^(1/2)+x)/((16*x^2+36*x)*x^(1/2)+(2*x^3+42*x^2)), x)

\label{eq22}\frac{{{e}^{{2 \ {\sqrt{x}}}+ x}}+{{\left({3 \ {\sqrt{x}}}+ x \right)}\ {Ei \left({{2 \ {\sqrt{x}}}+ x}\right)}}}{{3 \ {\sqrt{x}}}+ x}(22)
Type: Union(Expression(Integer),...)

There is also limited support to handle integrals where answer depends on elliptic functions:

fricas
integrate(1/sqrt((1 - x^2)*(1 + 2*x^2)), x)

\label{eq23}ellipticF \left({x , \: - 2}\right)(23)
Type: Union(Expression(Integer),...)
fricas
integrate(1/sqrt(x^3 - 1), x)

\label{eq24}2 \ {weierstrassPInverse \left({0, \: 4, \: x}\right)}(24)
Type: Union(Expression(Integer),...)