Skip to content

sqrt(c + d tan(x))/(a + i a tan(x))^2 is answered in 250,000 characters that the default precision cannot evaluate #1788

Description

@Rafael-SOWNet

sqrt(c + d*tan(x))/(a + i*a*tan(x))^2 integrates on master to an answer of about 250,000 characters, and evaluated at the default precision its derivative is not the integrand: it differs at every sample point. 2.5.0 declines it.

The answer is right. With a = 13/10, c = 7/10, d = 107/100 and x at 57/100 and 129/100, its derivative agrees with the integrand to 49 significant digits at 50, 300 and 2000 digits of precision. What fails at the default precision is the evaluation: the coefficients grow to products such as 65536 d^572 256 256 16 16 ... and d^892, and terms that large cancel.

Under u = tan(x) it is sqrt(c + d u)/((a + i a u)^2 (1 + u^2)), answered the same way. The partial fractions at the top find the root the two factors below the bar share, (i a)^2 (u - i)^3 (u + i), and under t = sqrt(c + d u) the question is 2 d^3 t^2/((t^2 - c - i d)^3 (t^2 - c + i d)); the swell is in its answer. With a number for a the integral is declined, and with 1 + u under the root it is answered shortly.

Rubi's 4.3.2.1 has three rows of this shape, (c + d tan(x))^(k/2)/(a + i a tan(x))^2 for k = 1, 3 and 5. Seen on 85d6601c and on 2b86349c.

Part of #233.

Activity

  1. added this to the 2.6.0 milestone on Oct 5, 2026
  2. added theissue type on Oct 5, 2026
  3. changed the title [-]sqrt(c + d tan(x))/(a + i a tan(x))^2 is integrated wrongly[/-] [+]sqrt(c + d tan(x))/(a + i a tan(x))^2 is answered in 250,000 characters that the default precision cannot evaluate[/+] on Oct 5, 2026
  4. Rafael-SOWNet commented on Oct 5, 2026

    @Rafael-SOWNet
    MemberAuthor

    Corrected the title and description: the answer is right -- it agrees with the integrand to 49 digits once evaluated with exact parameters and enough precision -- and what the first version reported as a wrong answer was the default-precision evaluation of its swollen coefficients. The defect is the answer's size.

    🤖 Generated with Claude Code

    https://claude.ai/code/session_012sonx8iAspMiwRwokT1Ura

  5. Rafael-SOWNet commented on Oct 5, 2026

    @Rafael-SOWNet
    MemberAuthor

    The three defects behind these sizes are fixed, each in its own PR: #1795 puts constants holding i in lowest terms, #1797 writes a quadratic's discriminant one way so the powers of a quadratic share their arms, and #1799 lets the arm off the real line exclude the arms on the sign of the discriminant. Each PR's description has its rows measured before and after.

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

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions