Skip to content

Let's steal some issues from https://github.com/davidedc/Algebrite! >:3 #180

Open
2 of 2 issues completed

Description

@Happypig375

Tests for our future integral implementation

  • 13: 1/x^3*1/sqrt(x^2-4)
  • 15: arccos(x)
  • 16: arctanh, arcsinh, arccosh [Requires hyperbolic functions and their inverses]
  • 17: 1/x [Requires abs function and flag for signifying real variables]
  • 18: x^2/(a+b*x)
  • 19: x*sqrt((-9)-x^2)
  • 22: t^(-1/2)*exp(-t^(-2))

Tests for our future simplification

  • 35: incorrect simplification of: sqrt(x*y) , sqrt(1/x) , sqrt(x^y)
  • 108: Error in simplify() with division and powers: 1 / (( y ^ 2 ) ^ ( 1 / 2 ) )

New functions

  • 20: summation [Should include product as well]
  • 33: How to compare two numbers? [Requires boolean logic]
  • 80: Is it possible to find the domain of a function over the reals?
  • 87: Solving equations with modular arithmetic

Bugs

  • 29: incorrect ordering of function calls
  • 99: Simplify call significantly slower for "x^(-6)+1" than for "x^(-6)" [AngouriMath literally hangs for this]

Tests to add

  • 38: simplify (x^2-xy)/(xy-y^2)

Activity

  1. WhiteBlackGoose commented on Nov 2, 2020

    @WhiteBlackGoose
    Member

    incorrect ordering of function calls

    Huh?

  2. Rafael-SOWNet commented on Aug 11, 2026

    @Rafael-SOWNet
    Member

    Triage, 2026-08-11. Recommended for closure, and labelled Opinions wanted rather than closed because declining a proposal is a maintainer's call.

    "Steal issues from Algebrite" is not actionable as written — it names no behaviour to add and no test that would pass. Anything specific taken from it would be a better issue than this one.

    This is one of thirteen dormant proposals swept in the same pass. If you disagree with any of them the label is the place to say so; if you agree, closing is the action. Nothing here is a defect report, so nothing is lost by closing except the record of the idea, which this comment preserves.

  3. Happypig375 commented on Aug 11, 2026

    @Happypig375
    MemberAuthor

    At least make sure each of the subissues in the original issue are done with reference to their original issues at the original repo

  4. Rafael-SOWNet commented on Aug 16, 2026

    @Rafael-SOWNet
    Member

    At least make sure each of the subissues in the original issue are done with reference to their original issues at the original repo

    Done. Measured on master at a45a7256, .NET 10, 20-second cut-off per case.

    Integrals

    Algebrite # integrand today
    13 1/x^3 * 1/sqrt(x^2-4) timeout > 20 s
    15 arccos(x) done — x*arccos(x) - sqrt(1 - x^2) + C
    16 inverse hyperbolics partly — see below
    17 1/x done, including the part the item asks for
    18 x^2/(a + b*x) timeout > 20 s
    19 x*sqrt(-9 - x^2) done — C - (-9 - x^2)^(3/2)/3
    22 t^(-1/2) * exp(-t^(-2)) timeout > 20 s

    Item 17 is worth calling out, because its bracketed requirement was "requires abs function and flag for signifying real variables" — that flag now exists and is consulted:

    "1/x".Integrate("x")                                      // C + ln(x)
    using var _ = MathS.Settings.Codomain.Set(Domain.Real);
    "1/x".Integrate("x")                                      // C + ln(abs(x))

    That is #946, merged as #952. So item 17 is complete as originally specified, not merely "it integrates".

    Item 16. The functions exist, but under area names rather than arc ones — arsinh, artanh, arcosh, not arcsinh/arctanh/arccosh, which is deliberate (they are areas, not arcs). They parse into their logarithmic forms. Integration is uneven: artanh(x) integrates, arsinh(x) and arcosh(x) come back unevaluated, and tanh(x) times out. So the item is half done and the remaining half is a real gap.

    Simplification

    Item 35 (sqrt(x*y), sqrt(1/x), sqrt(x^y)): all three are left unsimplified. The Algebrite issue was about incorrect simplification of these — splitting sqrt(x*y) into sqrt(x)*sqrt(y) is wrong off the positive reals — and declining is the correct answer rather than a missing feature. I would call this resolved by not doing it, and it is worth saying so explicitly since a future contributor may otherwise "fix" it.

    Item 108 and the others already ticked check out.

    New functions

    Item 20 (summation, product): no syntax for either — sum(i, i, 1, 10) and product(...) are parse errors. Not done.

    Summary

    3 of 7 integrals done, 1 partly, 3 time out; item 17 fully complete including its side condition; item 35 correctly declined; item 20 outstanding. So the checklist is roughly half retired, and what remains is three integration gaps, the inverse-hyperbolic integrals, and summation.

    If you would rather track those as their own issues than keep this one open as a shopping list, the three timeouts are the concrete ones and I can file them with these measurements.

  5. Happypig375 commented on Aug 16, 2026

    @Happypig375
    MemberAuthor

    You can split this into individual issues as you see fit

  6. Rafael-SOWNet commented on Sep 2, 2026

    @Rafael-SOWNet
    Member

    The three timeouts are no longer timeouts. Re-measured on master at 6eba229f, the same
    seven integrands as the table above:

    Algebrite # integrand recorded here now
    13 1/x^3 * 1/sqrt(x^2-4) timeout > 20 s declines in 27 ms
    18 x^2/(a + b*x) timeout > 20 s declines in 11 ms
    22 t^(-1/2) * exp(-t^(-2)) timeout > 20 s declines in 478 ms

    All three still come back unevaluated, so no integral on this list has been gained — what
    changed is the verdict, from hangs to declines. That is worth correcting here rather than
    leaving, because the two call for different work and the note at the bottom offers to file the
    three as their own issues on the strength of the timing:

    If you would rather track those as their own issues than keep this one open as a shopping
    list, the three timeouts are the concrete ones and I can file them with these measurements.

    Filed on today's measurements they would be three missing capabilities, not three
    performance bugs.

    What actually blocks item 18, which is the tractable one

    x^2/(a + b*x) is an improper rational function — the numerator's degree is not below the
    denominator's. Both partial fraction steps require a proper fraction and decline otherwise, and
    they say so in their own comments: an improper one is a polynomial plus a proper fraction and
    has to be divided out first, which is not done anywhere. Nothing else is missing for this one;
    the same single gap accounts for x^2/(1 + x), x^3/(1 + x^2), x^4/(x^2 + 1),
    (x^3 + 1)/(x + 1), tan(x)^2 and tan(x)^3, all of which are unevaluated on master for that
    reason and no other. I am doing that division now, and item 18 should come with it.

    Items 13 and 22 are not that shape and would each want their own work — 13 a trigonometric or
    Euler substitution for sqrt(x^2 - a^2), 22 something for exp of a negative power.

    The rest of the table, re-measured

    item recorded now
    15 arccos(x) done unchanged
    17 1/x, with and without the real-codomain flag done unchanged
    19 x*sqrt(-9 - x^2) done unchanged
    16 arsinh(x), arcosh(x) unevaluated unchanged
    16 tanh(x) times out declines in 192 ms
    35 sqrt(x*y), sqrt(1/x), sqrt(x^y) correctly declined unchanged

    So tanh(x) moves the same way the other three do, and item 16 is still half done.

    Item 20 (sum(i, i, 1, 10), product(...) as parse errors) I did not re-measure here; the
    closed forms are still absent, which is tracked in #717.

    What did change on the integration side, for context

    None of it touches this list, which is why the table above moves so little: the recent work was
    partial fraction decomposition of a biquadratic denominator over the reals, a fractional-power
    substitution, and the tangent substitution. Those closed out
    #233's five, and took the corpus gate
    from 39 solved of 40 to 40 of 40 — but the shapes here are different ones.

  7. Rafael-SOWNet commented on Sep 2, 2026

    @Rafael-SOWNet
    Member

    Correcting my own comment above. I said of item 18:

    Nothing else is missing for this one … I am doing that division now, and item 18 should come
    with it.

    The division landed in #1147 and item 18 did not come with it. Measured on master at
    174cf88d:

    integrand now
    x^2/(a + b*x) — item 18 still integral(x ^ 2 / (a + b * x), x)
    x^2/(x + a) still unevaluated
    x^2/(x + 1) x ^ 2 / 2 + -x + ln(x + 1) + C
    x^2/(2*x + 3) x ^ 2 / 2 / 2 + -3/4 * x + 9/4 * ln(2 * x + 3) / 2 + C

    So the division works and the boundary is not where I put it. It is numeric coefficients
    throughout
    , not "a leading coefficient of one": 2x + 3 divides fine. Any symbolic
    coefficient stops it, whether it is the leading one or not.

    Why the symbolic case is not a small extension of this

    For a + b*x the division has to divide by b, and b is not decidably non-zero. That is not
    a fussy guard — at b = 0 the quotient is x^2/a, whose antiderivative is x^3/(3a), and that
    is not the limit of the divided form as b goes to zero. So a division that assumed b != 0
    would be silently wrong on a whole branch of the input rather than merely unhelpful.

    The library already has the shape this wants: IntegrateRationalQuadratic answers
    k/(ax^2 + bx + c) as a Piecewise whose first arm is guarded on a = 0. Doing the same here
    is a real change with its own soundness argument, not a follow-on. x^2/(x + a) is a separate,
    smaller case — the leading coefficient is 1 and no assumption is owed, so that one is only
    blocked by PolynomialLongDivision declining polynomials with symbolic coefficients at all.

    What the division did deliver, since it is adjacent

    Not on this list, but it is the same change: x^2/(x + 1), x^3/(1 + x^2), x^4/(x^2 + 1),
    (x^5 + 2)/(x^2 + 1), (x^3 + 1)/(x + 1), and — through substitutions that produce an improper
    fraction rather than being written as one — tan(x)^2, tan(x)^3 and sqrt(x)/(x + 1).

    The division itself was not written for it: TreeAnalyzer.PolynomialLongDivision had been doing
    this all along for the simplifier's own rule set, and the integrator never asked it.

    So the state of the three timeouts

    Unchanged from my previous comment, and none of them is fixed:

    Algebrite # integrand verdict on 174cf88d
    13 1/x^3 * 1/sqrt(x^2-4) declines, 95 ms
    18 x^2/(a + b*x) declines, 11 ms
    22 t^(-1/2) * exp(-t^(-2)) declines, 494 ms

    If these are filed as their own issues, item 18 is now the most sharply specified of the three:
    it needs a decision about what to answer when a denominator's leading coefficient may be zero,
    and the Piecewise convention already in the quadratic rule is the obvious candidate.

  8. Happypig375 commented on Sep 18, 2026

    @Happypig375
    MemberAuthor

    All items on this issue should be done by 2.6.0 with integration work and the implementation of proper modular arithmetic.

  9. added this to the 2.6.0 milestone on Sep 18, 2026
  10. added theissue type on Sep 22, 2026
  11. Rafael-SOWNet commented on Sep 30, 2026

    @Rafael-SOWNet
    Member

    Measured the items outside integration on master (at 6a55dbd), where you want them all done by 2.6.0:

    Algebrite # now
    20 summation, and product sum(k, k, 1, n) is (n + n^2)/2 provided n >= 0, and product(k, k, 1, n) is n! provided n >= 1 done, ticked
    35 sqrt(x*y), sqrt(1/x), sqrt(x^y), sqrt(x^2) all four stay as written; none is split, which is right over the complex numbers done, ticked
    29 function calls ordered before letters a log(x) + y sin(x) simplifies to sin(x) * y + a * log(10, x) not done: #1628
    87 equations with a remainder x + 1 = 3 (mod 4) solves to { x in ZZ : x = 2 (mod 4) }, but (x mod 4) + 1 = 3 stays an unsolved set builder half done: #1629

    Both new issues are sub-issues here on 2.6.0, and I'm taking them. The integration items (13, 15, 16, 17, 18, 19, 22) are for the session working on integration to report on.

  12. Rafael-SOWNet commented on Sep 30, 2026

    @Rafael-SOWNet
    Member

    The integration items, measured on master (371b38e). Each answer is differentiated back and compared with the integrand at sampled points:

    # integrand now
    13 1/x^3*1/sqrt(x^2-4) answered, with arctan(sqrt(x^2 - 4)/2)
    15 arccos(x) x arccos(x) - sqrt(1 - x^2)
    16 artanh(x), arsinh(x), arcosh(x) all three answered
    17 1/x ln(x), and ln(abs(x)) with the codomain set to the reals. That setting is the flag for real variables (#946), and IntegralAnswerCacheTest pins both
    18 x^2/(a+b*x) x^2/(2b) - a x/b^2 + a^2 ln(b x + a)/b^3: the generic answer, for b != 0, the way 1/(a + b x) is answered
    19 x*sqrt((-9)-x^2) -(-9 - x^2)^(3/2)/3
    22 t^(-1/2)*exp(-t^(-2)) declined, correctly. It is 2 sqrt(t) e^(-1/t^2) - 2 Γ(3/4, 1/t^2), checked numerically, and the library has no incomplete gamma function

    13 to 19 are ticked. 22 needs Γ(a, x), which is also what Rubi's file 8.6 needs (233 problems).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions