• FriCAS result on an algebraic integral

    From Sam Blake@21:1/5 to All on Wed Jan 19 21:48:41 2022
    Greetings,

    I was looking at this test on Nasser's website:

    <https://12000.org/my_notes/CAS_integration_tests/reports/summer_2021/test_cases/9_Blake_problems/resu1078.htm#x1106-11050003.11.64>

    Unless I am mistaken, the result from FriCAS is seemingly not in the minimal extension field. I vaguely recall this is a guarantee for the transcendental case of the Risch-Trager-Bronstein algorithm. Is this not the case for Risch-Trager-Bronstein for
    algebraic integrals? To be clear, I am puzzled by the nested radicals within the arctans, ie Sqrt[(x^2 + Sqrt[2] x (-1 + x^3)^(1/4) + Sqrt[-1 + x^3])/x^2]. In comparison, Trager's algorithm in Maple does not return nested radicals.

    Sam

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From antispam@math.uni.wroc.pl@21:1/5 to Sam Blake on Fri Jan 21 21:53:52 2022
    Sam Blake <samuel.thomas.blake@gmail.com> wrote:
    Greetings,

    I was looking at this test on Nasser's website:

    <https://12000.org/my_notes/CAS_integration_tests/reports/summer_2021/test_cases/9_Blake_problems/resu1078.htm#x1106-11050003.11.64>

    Unless I am mistaken, the result from FriCAS is seemingly not in the minimal extension field. I vaguely recall this is a guarantee for the transcendental case of the Risch-Trager-Bronstein algorithm. Is this not the case for Risch-Trager-Bronstein for
    algebraic integrals? To be clear, I am puzzled by the nested radicals within the arctans, ie Sqrt[(x^2 + Sqrt[2] x (-1 + x^3)^(1/4) + Sqrt[-1 + x^3])/x^2]. In comparison, Trager's algorithm in Maple does not return nested radicals.

    It is not clear which example you have in mind. Note:
    - ATM FriCAS makes no attempt to denest root, so if nested root is
    created at some stage it has high chance to appear in final result
    - FriCAS may discover that there is nontrivial algebraic dependency
    in the input and express is using nested root
    - things like asin effectively have hidden root which will be
    visible in result
    - FriCAS takes shorcuts in some places. Shortcuts may lead to
    algebraic extentions.

    --
    Waldek Hebisch

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Sam Blake@21:1/5 to anti...@math.uni.wroc.pl on Sun Jan 23 01:44:08 2022
    On Saturday, January 22, 2022 at 8:54:05 AM UTC+11, anti...@math.uni.wroc.pl wrote:
    Sam Blake <samuel.th...@gmail.com> wrote:
    Greetings,

    I was looking at this test on Nasser's website:

    <https://12000.org/my_notes/CAS_integration_tests/reports/summer_2021/test_cases/9_Blake_problems/resu1078.htm#x1106-11050003.11.64>

    Unless I am mistaken, the result from FriCAS is seemingly not in the minimal extension field. I vaguely recall this is a guarantee for the transcendental case of the Risch-Trager-Bronstein algorithm. Is this not the case for Risch-Trager-Bronstein
    for algebraic integrals? To be clear, I am puzzled by the nested radicals within the arctans, ie Sqrt[(x^2 + Sqrt[2] x (-1 + x^3)^(1/4) + Sqrt[-1 + x^3])/x^2]. In comparison, Trager's algorithm in Maple does not return nested radicals.
    It is not clear which example you have in mind. Note:
    - ATM FriCAS makes no attempt to denest root, so if nested root is
    created at some stage it has high chance to appear in final result
    - FriCAS may discover that there is nontrivial algebraic dependency
    in the input and express is using nested root
    - things like asin effectively have hidden root which will be
    visible in result
    - FriCAS takes shorcuts in some places. Shortcuts may lead to
    algebraic extentions.

    --
    Waldek Hebisch

    The example is

    integrate(x^2*(x^3-4)/(x^3-1)^(3/4)/(x^4+x^3-1),x)

    Per Nasser's website, FriCAS returns

    2*sqrt(2)*arctan((sqrt(2)*x*sqrt((x^2 + sqrt(2)*(x^3 - 1)^(1/4)*x + sqrt(x^3 - 1))/x^2) - x - sqrt(2)*(x^3 - 1)^(1/4))/x) + 2*sqrt(2)*arctan((sqrt(2)*x*sqrt((x^2 - sqrt(2)*(x^3 - 1)^(1/4)*x + sqrt(x^3 - 1))/x^2) + x - sqrt(2)*(x^3 - 1)^(1/4))/x) - 1/2*
    sqrt(2)*log(4*(x^2 + sqrt(2)*(x^3 - 1)^(1/4)*x + sqrt(x^3 - 1))/x^2) + 1/2*sqrt(2)*log(4*(x^2 - sqrt(2)*(x^3 - 1)^(1/4)*x + sqrt(x^3 - 1))/x^2)

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From antispam@math.uni.wroc.pl@21:1/5 to Sam Blake on Sun Jan 23 12:39:37 2022
    Sam Blake <samuel.thomas.blake@gmail.com> wrote:
    On Saturday, January 22, 2022 at 8:54:05 AM UTC+11, anti...@math.uni.wroc.pl wrote:
    Sam Blake <samuel.th...@gmail.com> wrote:
    Greetings,

    I was looking at this test on Nasser's website:

    <https://12000.org/my_notes/CAS_integration_tests/reports/summer_2021/test_cases/9_Blake_problems/resu1078.htm#x1106-11050003.11.64>

    Unless I am mistaken, the result from FriCAS is seemingly not in the minimal extension field. I vaguely recall this is a guarantee for the transcendental case of the Risch-Trager-Bronstein algorithm. Is this not the case for Risch-Trager-Bronstein
    for algebraic integrals? To be clear, I am puzzled by the nested radicals within the arctans, ie Sqrt[(x^2 + Sqrt[2] x (-1 + x^3)^(1/4) + Sqrt[-1 + x^3])/x^2]. In comparison, Trager's algorithm in Maple does not return nested radicals.
    It is not clear which example you have in mind. Note:
    - ATM FriCAS makes no attempt to denest root, so if nested root is
    created at some stage it has high chance to appear in final result
    - FriCAS may discover that there is nontrivial algebraic dependency
    in the input and express is using nested root
    - things like asin effectively have hidden root which will be
    visible in result
    - FriCAS takes shorcuts in some places. Shortcuts may lead to
    algebraic extentions.

    --
    Waldek Hebisch

    The example is

    integrate(x^2*(x^3-4)/(x^3-1)^(3/4)/(x^4+x^3-1),x)

    Per Nasser's website, FriCAS returns

    2*sqrt(2)*arctan((sqrt(2)*x*sqrt((x^2 + sqrt(2)*(x^3 - 1)^(1/4)*x + sqrt(x^3 - 1))/x^2) - x - sqrt(2)*(x^3 - 1)^(1/4))/x) + 2*sqrt(2)*arctan((sqrt(2)*x*sqrt((x^2 - sqrt(2)*(x^3 - 1)^(1/4)*x + sqrt(x^3 - 1))/x^2) + x - sqrt(2)*(x^3 - 1)^(1/4))/x) - 1/2*
    sqrt(2)*log(4*(x^2 + sqrt(2)*(x^3 - 1)^(1/4)*x + sqrt(x^3 - 1))/x^2) + 1/2*sqrt(2)*log(4*(x^2 - sqrt(2)*(x^3 - 1)^(1/4)*x + sqrt(x^3 - 1))/x^2)


    This is postprocessing. Actual result from integrator is:

    +------+
    4| 3
    --+ \|x - 1
    > %LTJ log(- %LTJ + ---------)
    --+ x
    4
    %LTJ + 1 = 0

    That is root sum over roots of order 4 from 1. This gets expanded
    to more explicit form. In this case expander messed up things...

    --
    Waldek Hebisch

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From nobody@nowhere.invalid@21:1/5 to antispam@math.uni.wroc.pl on Sat Jan 29 11:37:24 2022
    antispam@math.uni.wroc.pl schrieb:

    Sam Blake <samuel.thomas.blake@gmail.com> wrote:
    On Saturday, January 22, 2022 at 8:54:05 AM UTC+11, anti...@math.uni.wroc.pl wrote:
    Sam Blake <samuel.th...@gmail.com> wrote:
    Greetings,

    I was looking at this test on Nasser's website:

    <https://12000.org/my_notes/CAS_integration_tests/reports/summer_2021/test_cases/9_Blake_problems/resu1078.htm#x1106-11050003.11.64>

    Unless I am mistaken, the result from FriCAS is seemingly not
    in the minimal extension field. I vaguely recall this is a
    guarantee for the transcendental case of the
    Risch-Trager-Bronstein algorithm. Is this not the case for Risch-Trager-Bronstein for algebraic integrals? To be clear, I
    am puzzled by the nested radicals within the arctans, ie
    Sqrt[(x^2 + Sqrt[2] x (-1 + x^3)^(1/4) + Sqrt[-1 + x^3])/x^2].
    In comparison, Trager's algorithm in Maple does not return
    nested radicals.
    It is not clear which example you have in mind. Note:
    - ATM FriCAS makes no attempt to denest root, so if nested root is created at some stage it has high chance to appear in final result
    - FriCAS may discover that there is nontrivial algebraic
    dependency in the input and express is using nested root
    - things like asin effectively have hidden root which will be
    visible in result
    - FriCAS takes shorcuts in some places. Shortcuts may lead to
    algebraic extentions.


    The example is

    integrate(x^2*(x^3-4)/(x^3-1)^(3/4)/(x^4+x^3-1),x)

    Per Nasser's website, FriCAS returns

    2*sqrt(2)*arctan((sqrt(2)*x*sqrt((x^2 + sqrt(2)*(x^3 - 1)^(1/4)*x
    + sqrt(x^3 - 1))/x^2) - x - sqrt(2)*(x^3 - 1)^(1/4))/x) + > > 2*sqrt(2)*arctan((sqrt(2)*x*sqrt((x^2 - sqrt(2)*(x^3 - 1)^(1/4)*x
    + sqrt(x^3 - 1))/x^2) + x - sqrt(2)*(x^3 - 1)^(1/4))/x) - 1/2*sqrt(2)*log(4*(x^2 + sqrt(2)*(x^3 - 1)^(1/4)*x + sqrt(x^3 -
    1))/x^2) + 1/2*sqrt(2)*log(4*(x^2 - sqrt(2)*(x^3 - 1)^(1/4)*x +
    sqrt(x^3 - 1))/x^2)


    This is postprocessing. Actual result from integrator is:

    +------+
    4| 3
    --+ \|x - 1
    > %LTJ log(- %LTJ + ---------)
    --+ x
    4
    %LTJ + 1 = 0

    That is root sum over roots of order 4 from 1. This gets expanded
    to more explicit form. In this case expander messed up things...


    The postprocessing designer must have had something in mind.

    On the real axis, a term of the form C*ATAN(f(x)) can only take values
    from (-C*pi/2, +C*pi/2); antiderivatives involving such a term must
    therefore exhibit jump discontinuities if they need to cover a larger
    range. Using familiar relations of trigonometry, the ATAN term may be
    rewritten as C/2*ATAN(f2(x)) and more generally as C/n*ATAN(fn(x)),
    which, however, makes matters worse. Integrators should therefore
    produce antiderivatives transformed in the reverse manner as long as
    this is possible without introducing spurious radical extensions.

    To my knowledge, FriCAS is not doing this consistently. In the case at
    hand, it is even going one step too far, introducing the unnecessary
    nested radical

    SQRT((x^2 - SQRT(2)*(x^3 - 1)^(1/4)*x + SQRT(x^3 - 1))/x^2)

    supposedly in order to avoid discontinuities. Without this step, the antiderivative simply reads:

    INT(x^2*(-4 + x^3)/((-1 + x^3)^(3/4)*(-1 + x^3 + x^4)), x) = SQRT(2)*ATAN(SQRT(2)*x*(-1 + x^3)^(1/4)/(- x^2 + SQRT(-1 + x^3))) - SQRT(2)*ATANH(SQRT(2)*x*(-1 + x^3)^(1/4)/(x^2 + SQRT(-1 + x^3)))

    which, apart from two logarithmic poles, is continuous on the real axis nonetheless.

    Martin.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From antispam@math.uni.wroc.pl@21:1/5 to clicliclic@freenet.de on Sun Jan 30 13:45:09 2022
    clicliclic@freenet.de <nobody@nowhere.invalid> wrote:

    antispam@math.uni.wroc.pl schrieb:

    Sam Blake <samuel.thomas.blake@gmail.com> wrote:
    On Saturday, January 22, 2022 at 8:54:05 AM UTC+11, anti...@math.uni.wroc.pl wrote:
    Sam Blake <samuel.th...@gmail.com> wrote:
    Greetings,

    I was looking at this test on Nasser's website:

    <https://12000.org/my_notes/CAS_integration_tests/reports/summer_2021/test_cases/9_Blake_problems/resu1078.htm#x1106-11050003.11.64>

    Unless I am mistaken, the result from FriCAS is seemingly not
    in the minimal extension field. I vaguely recall this is a
    guarantee for the transcendental case of the
    Risch-Trager-Bronstein algorithm. Is this not the case for Risch-Trager-Bronstein for algebraic integrals? To be clear, I
    am puzzled by the nested radicals within the arctans, ie
    Sqrt[(x^2 + Sqrt[2] x (-1 + x^3)^(1/4) + Sqrt[-1 + x^3])/x^2].
    In comparison, Trager's algorithm in Maple does not return
    nested radicals.
    It is not clear which example you have in mind. Note:
    - ATM FriCAS makes no attempt to denest root, so if nested root is created at some stage it has high chance to appear in final result
    - FriCAS may discover that there is nontrivial algebraic
    dependency in the input and express is using nested root
    - things like asin effectively have hidden root which will be
    visible in result
    - FriCAS takes shorcuts in some places. Shortcuts may lead to
    algebraic extentions.


    The example is

    integrate(x^2*(x^3-4)/(x^3-1)^(3/4)/(x^4+x^3-1),x)

    Per Nasser's website, FriCAS returns

    2*sqrt(2)*arctan((sqrt(2)*x*sqrt((x^2 + sqrt(2)*(x^3 - 1)^(1/4)*x
    + sqrt(x^3 - 1))/x^2) - x - sqrt(2)*(x^3 - 1)^(1/4))/x) + > > 2*sqrt(2)*arctan((sqrt(2)*x*sqrt((x^2 - sqrt(2)*(x^3 - 1)^(1/4)*x
    + sqrt(x^3 - 1))/x^2) + x - sqrt(2)*(x^3 - 1)^(1/4))/x) - 1/2*sqrt(2)*log(4*(x^2 + sqrt(2)*(x^3 - 1)^(1/4)*x + sqrt(x^3 -
    1))/x^2) + 1/2*sqrt(2)*log(4*(x^2 - sqrt(2)*(x^3 - 1)^(1/4)*x +
    sqrt(x^3 - 1))/x^2)


    This is postprocessing. Actual result from integrator is:

    +------+
    4| 3
    --+ \|x - 1
    > %LTJ log(- %LTJ + ---------)
    --+ x
    4
    %LTJ + 1 = 0

    That is root sum over roots of order 4 from 1. This gets expanded
    to more explicit form. In this case expander messed up things...


    The postprocessing designer must have had something in mind.

    On the real axis, a term of the form C*ATAN(f(x)) can only take values
    from (-C*pi/2, +C*pi/2); antiderivatives involving such a term must
    therefore exhibit jump discontinuities if they need to cover a larger
    range. Using familiar relations of trigonometry, the ATAN term may be rewritten as C/2*ATAN(f2(x)) and more generally as C/n*ATAN(fn(x)),
    which, however, makes matters worse. Integrators should therefore
    produce antiderivatives transformed in the reverse manner as long as
    this is possible without introducing spurious radical extensions.

    Yes.

    To my knowledge, FriCAS is not doing this consistently. In the case at
    hand, it is even going one step too far, introducing the unnecessary
    nested radical

    SQRT((x^2 - SQRT(2)*(x^3 - 1)^(1/4)*x + SQRT(x^3 - 1))/x^2)

    supposedly in order to avoid discontinuities. Without this step, the antiderivative simply reads:

    INT(x^2*(-4 + x^3)/((-1 + x^3)^(3/4)*(-1 + x^3 + x^4)), x) = SQRT(2)*ATAN(SQRT(2)*x*(-1 + x^3)^(1/4)/(- x^2 + SQRT(-1 + x^3))) - SQRT(2)*ATANH(SQRT(2)*x*(-1 + x^3)^(1/4)/(x^2 + SQRT(-1 + x^3)))

    which, apart from two logarithmic poles, is continuous on the real axis nonetheless.

    This is really ancient principle "left hand does not know what
    right hand is doing". As part of postprocessing FriCAS checks
    that function is real and in such case computes real part of
    integral. But code computing real part does not know that
    works on result of integration. In fact, code computingh real
    part does not know if it is dealing with a function or a constant.
    Simply, it applies general formulas. But general formula contains
    square root...

    And to clarify: this is going to change. But currently
    this step is helping in several cases and any replacement
    must handle cases handled well by current code.

    --
    Waldek Hebisch

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)