Skip to content

integral(1/(a + sin(x)), x, 0, 2 pi) does not finish: the limits at a break are taken without the cache and budget of the limits at a bound #2658

In review

Description

@Rafael-SOWNet

simplify(integral(1/(a + sin(x)), x, 0, 2 pi)) does not finish within the probe's 20 s. This happens on master and on #2651's branch. Its value is 2 pi / sqrt(a^2 - 1) for a > 1, and the integral diverges for |a| <= 1. With no assumption on a, the honest answer is to leave it unevaluated, and that should be fast.

The antiderivative is found in 0.4 s. It is a piecewise on a. Each case has a break at the pole of tan(x/2) at pi, and the one-sided limits there are undecided after 0.15–3.4 s each:

one-sided limit at pi master
4 arctan((2a tan(x/2) + 2)/sqrt(4a^2 - 4)) / sqrt(4a^2 - 4) undecided, 3.4 s
ln(2 tan(x/2) + a) undecided, 1.5 s
(-4)/(2a tan(x/2) + 2) undecided, 0.15 s

eval of the integral declines after 4.8 s. Simplify evaluates the integral again for every candidate. The limits at a break are taken with neither the cache nor the budget that the limits at a bound have (LimitAtTheBound), so every candidate pays the whole cost again.

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