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

Edit detail for FriCASIntegration revision 13 of 13

1 2 3 4 5 6 7 8 9 10 11 12 13
Editor: xak
Time: 2022/10/16 17:59:04 GMT+0
Note: Dr. Waldemar Hebisch kindly proved this one to be non-elementary when we spoke

added:

From xak Sun Oct 16 17:59:04 +0000 2022
From: xak
Date: Sun, 16 Oct 2022 17:59:04 +0000
Subject: Dr. Waldemar Hebisch kindly proved this one to be non-elementary when
	we spoke
Message-ID: <20221016175904+0000@fricas-wiki.math.uni.wroc.pl>

\begin{axiom}
integrate(sqrt(sin(x)+x),x)
\end{axiom}

FriCAS inherited from Axiom implementation of Risch algorithm for elementary integration. It can handle both easy cases

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

\label{eq1}\frac{{e}^{{x}^{2}}}{2}(1)
Type: Union(Expression(Integer),...)
fricas
integrate(exp(1/x^2)/x^3, x)

\label{eq2}-{\frac{{e}^{\frac{1}{{x}^{2}}}}{2}}(2)
Type: Union(Expression(Integer),...)

and some which are hard for simpler algorithms. For example Maxma 5.45.1 can not handle

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

\label{eq3}\frac{{{\sqrt{2}}\ {\log \left({\frac{{{\left({\sqrt{2}}+ x + 1 \right)}\ {\sqrt{{{x}^{2}}+ 1}}}+{{\left(- x - 1 \right)}\ {\sqrt{2}}}-{{x}^{2}}- x - 2}{{{\left(x + 1 \right)}\ {\sqrt{{{x}^{2}}+ 1}}}-{{x}^{2}}- x}}\right)}}-{2 \ {\arctan \left({\frac{{{\left({2 \  x}- 1 \right)}\ {\sqrt{{{x}^{2}}+ 1}}}-{2 \ {{x}^{2}}}+ x - 1}{{\sqrt{{{x}^{2}}+ 1}}- x - 1}}\right)}}}{3}(3)
Type: Union(Expression(Integer),...)

fricas
)set output tex off
 
fricas
)set output algebra on
integrate(sqrt(x^2+1)/(x^4+1), x)
(4) +----------+ +----------+ +------+ | +---+ | +---+ | 2 +---+ 2 - \|\|- 1 - 1 log(\|\|- 1 - 1 - x\|x + 1 - \|- 1 + x ) + +------------+ +------+ +------------+ | +---+ | 2 | +---+ +---+ 2 - \|- \|- 1 - 1 log(- x\|x + 1 + \|- \|- 1 - 1 + \|- 1 + x ) + +------------+ +------+ +------------+ | +---+ | 2 | +---+ +---+ 2 \|- \|- 1 - 1 log(- x\|x + 1 - \|- \|- 1 - 1 + \|- 1 + x ) + +----------+ +----------+ +------+ | +---+ | +---+ | 2 +---+ 2 \|\|- 1 - 1 log(- \|\|- 1 - 1 - x\|x + 1 - \|- 1 + x ) / 4
Type: Union(Expression(Integer),...)
fricas
)set output algebra off
 
fricas
)set output tex on

Default integrators in Mathematica 12.0 and Maple 15 can not handle

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

\label{eq4}\frac{{e}^{\frac{{{\left({{x}^{2}}- 1 \right)}\ {{e}^{x}}}+{{x}^{3}}}{{x \ {{e}^{x}}}+{{x}^{2}}}}}{{e}^{x}}(4)
Type: Union(Expression(Integer),...)

Default integrators in Maple 15 and Maxima 5.45.1 can not handle

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

\label{eq5}-{\frac{\log \left({{2 \ {\sqrt{{{x}^{14}}+{3 \ {{x}^{7}}}+ 2}}}-{2 \ {{x}^{7}}}- 3}\right)}{7}}(5)
Type: Union(Expression(Integer),...)

FriCAS fixed several bugs in Axiom implementation, for example

fricas
integrate(cos(x)^n*sin(x)^(-n-2), x)

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

\label{eq7}\frac{{\left({\sqrt{{{x}^{2}}- 1}}- 1 \right)}\ {{e}^{asec \left({x}\right)}}}{2 \  x}(7)
Type: Union(Expression(Integer),...)

work now but used to return unevaluated result.

Risch algorithm can handle large class of integrands involving special functions

fricas
f := D(1/(1 + ellipticE(x^2+a, m)), x)

\label{eq8}\begin{array}{@{}l}
\displaystyle
- 
\
\
\displaystyle
{\frac{2 \  x \ {\sqrt{-{m \ {{x}^{4}}}-{2 \  a \  m \ {{x}^{2}}}-{{{a}^{2}}\  m}+ 1}}}{{\left({{ellipticE \left({{{{x}^{2}}+ a}, \: m}\right)}^{2}}+{2 \ {ellipticE \left({{{{x}^{2}}+ a}, \: m}\right)}}+ 1 \right)}\ {\sqrt{-{{x}^{4}}-{2 \  a \ {{x}^{2}}}-{{a}^{2}}+ 1}}}}
(8)
Type: Expression(Integer)
fricas
integrate(f, x)

\label{eq9}\frac{1}{{ellipticE \left({{{{x}^{2}}+ a}, \: m}\right)}+ 1}(9)
Type: Union(Expression(Integer),...)
fricas
f := D(1/(Ei(x)-Ei(x-1)), x)

\label{eq10}\frac{{{\left(- x + 1 \right)}\ {{e}^{x}}}+{x \ {{e}^{x - 1}}}}{{{\left({{x}^{2}}- x \right)}\ {{Ei \left({x}\right)}^{2}}}+{{\left(-{2 \ {{x}^{2}}}+{2 \  x}\right)}\ {Ei \left({x - 1}\right)}\ {Ei \left({x}\right)}}+{{\left({{x}^{2}}- x \right)}\ {{Ei \left({x - 1}\right)}^{2}}}}(10)
Type: Expression(Integer)
fricas
integrate(f, x)

\label{eq11}\frac{1}{{Ei \left({x}\right)}-{Ei \left({x - 1}\right)}}(11)
Type: Union(Expression(Integer),...)
fricas
f := D(1/(Si(x+1)+Ci(x-1)), x)

\label{eq12}\frac{{{\left(- x + 1 \right)}\ {\sin \left({x + 1}\right)}}+{{\left(- x - 1 \right)}\ {\cos \left({x - 1}\right)}}}{{{\left({{x}^{2}}- 1 \right)}\ {{Si \left({x + 1}\right)}^{2}}}+{{\left({2 \ {{x}^{2}}}- 2 \right)}\ {Ci \left({x - 1}\right)}\ {Si \left({x + 1}\right)}}+{{\left({{x}^{2}}- 1 \right)}\ {{Ci \left({x - 1}\right)}^{2}}}}(12)
Type: Expression(Integer)
fricas
integrate(f, x)

\label{eq13}\frac{1}{{Si \left({x + 1}\right)}+{Ci \left({x - 1}\right)}}(13)
Type: Union(Expression(Integer),...)
fricas
f := D(1/(Si(Ci(x)^2+1)+Ci(Ci(x)^2-1)), x)

\label{eq14}\frac{{{\left(-{2 \ {{Ci \left({x}\right)}^{3}}}+{2 \ {Ci \left({x}\right)}}\right)}\ {\cos \left({x}\right)}\ {\sin \left({{{Ci \left({x}\right)}^{2}}+ 1}\right)}}+{{\left(-{2 \ {{Ci \left({x}\right)}^{3}}}-{2 \ {Ci \left({x}\right)}}\right)}\ {\cos \left({x}\right)}\ {\cos \left({{{Ci \left({x}\right)}^{2}}- 1}\right)}}}{{{\left({x \ {{Ci \left({x}\right)}^{4}}}- x \right)}\ {{Si \left({{{Ci \left({x}\right)}^{2}}+ 1}\right)}^{2}}}+{{\left({2 \  x \ {{Ci \left({x}\right)}^{4}}}-{2 \  x}\right)}\ {Ci \left({{{Ci \left({x}\right)}^{2}}- 1}\right)}\ {Si \left({{{Ci \left({x}\right)}^{2}}+ 1}\right)}}+{{\left({x \ {{Ci \left({x}\right)}^{4}}}- x \right)}\ {{Ci \left({{{Ci \left({x}\right)}^{2}}- 1}\right)}^{2}}}}(14)
Type: Expression(Integer)
fricas
integrate(f, x)

\label{eq15}\frac{1}{{Si \left({{{Ci \left({x}\right)}^{2}}+ 1}\right)}+{Ci \left({{{Ci \left({x}\right)}^{2}}- 1}\right)}}(15)
Type: Union(Expression(Integer),...)
fricas
f := D(log(Si(Ci(x)^2+1)+Ci(Ci(x)^2-1)), x)

\label{eq16}\frac{{{\left({2 \ {{Ci \left({x}\right)}^{3}}}-{2 \ {Ci \left({x}\right)}}\right)}\ {\cos \left({x}\right)}\ {\sin \left({{{Ci \left({x}\right)}^{2}}+ 1}\right)}}+{{\left({2 \ {{Ci \left({x}\right)}^{3}}}+{2 \ {Ci \left({x}\right)}}\right)}\ {\cos \left({x}\right)}\ {\cos \left({{{Ci \left({x}\right)}^{2}}- 1}\right)}}}{{{\left({x \ {{Ci \left({x}\right)}^{4}}}- x \right)}\ {Si \left({{{Ci \left({x}\right)}^{2}}+ 1}\right)}}+{{\left({x \ {{Ci \left({x}\right)}^{4}}}- x \right)}\ {Ci \left({{{Ci \left({x}\right)}^{2}}- 1}\right)}}}(16)
Type: Expression(Integer)
fricas
integrate(f, x)

\label{eq17}\log \left({{Si \left({{{Ci \left({x}\right)}^{2}}+ 1}\right)}+{Ci \left({{{Ci \left({x}\right)}^{2}}- 1}\right)}}\right)(17)
Type: Union(Expression(Integer),...)

Alas, the following does not work

fricas
f := D(1/(1 + besselJ(m, x^2+a)), x)

\label{eq18}\frac{{x \ {besselJ \left({{m + 1}, \:{{{x}^{2}}+ a}}\right)}}-{x \ {besselJ \left({{m - 1}, \:{{{x}^{2}}+ a}}\right)}}}{{{besselJ \left({m , \:{{{x}^{2}}+ a}}\right)}^{2}}+{2 \ {besselJ \left({m , \:{{{x}^{2}}+ a}}\right)}}+ 1}(18)
Type: Expression(Integer)
fricas
integrate(f, x)

\label{eq19}\int^{
\displaystyle
x}{{\frac{{\%A \ {besselJ \left({{m + 1}, \:{a +{{\%A}^{2}}}}\right)}}-{\%A \ {besselJ \left({{m - 1}, \:{a +{{\%A}^{2}}}}\right)}}}{{{besselJ \left({m , \:{a +{{\%A}^{2}}}}\right)}^{2}}+{2 \ {besselJ \left({m , \:{a +{{\%A}^{2}}}}\right)}}+ 1}}\ {d \%A}}(19)
Type: Union(Expression(Integer),...)

Risch algorithm wants to find elementary integral. For many functions integrals can be written only in terms of special function. FriCAS now contains extensions which can handle some of them, see FriCASSpecialIntegration.

For more elementary examples see FriCASTimofeev1, FriCASTimofeev37, FriCASTimofeev5, FriCASTimofeev9.

Examples involving exponential function from Albert Rich testsuite RichExp1, RichExp2.

integrate(exp(x-x^2), x) --mariuszi28cg, Mon, 25 Sep 2017 20:48:15 +0000 reply
fricas
integrate(exp(x-x^2), x)

\label{eq20}\frac{{{e}^{\frac{1}{4}}}\ {\erf \left({\frac{{2 \  x}- 1}{2}}\right)}\ {\sqrt{\pi}}}{2}(20)
Type: Union(Expression(Integer),...)

Most probably non-elementary, but fricas fails here as of 16.10.22 --xak, Sun, 16 Oct 2022 17:56:19 +0000 reply
fricas
integrate(sqrt((sin(x)^2 + x)/exp(x)),x)
>> Error detected within library code: integrate: implementation incomplete (has polynomial part)

Dr. Waldemar Hebisch kindly proved this one to be non-elementary when we spoke --xak, Sun, 16 Oct 2022 17:59:04 +0000 reply
fricas
integrate(sqrt(sin(x)+x),x)
>> Error detected within library code: integrate: implementation incomplete (has polynomial part)