You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
A root of the cosine beside a half-odd power of a + a sec is integrated wrongly where the cosine is negative #1581
sqrt(cos(c + d*x))/sqrt(a + a*sec(c + d*x)) is integrated wrongly where cos(c + d x) is negative.
Found by work/intbench on Rubi's 4.5.1.2 and 4.5.3.1, master a8a2b7e: seven problems come back wrong. All seven are a root of the cosine beside a half-odd power of a + a sec:
Where the cosine is positive, all seven differentiate back (a = 1.3, c = 0.2, d = 1, A = 0.7, B = 1.1, at x = 0.3, 0.6, 0.9, 1.1). Where it is negative, the integrand is still real: sqrt(cos) and the root of a + a sec are both imaginary there. None of the seven differentiates back at x = 1.9, 2.2, 2.5, 2.9. By quadrature from 1.9 to 2.9, Simpson gives 3.6947 for the first, and master's answer gives F(2.9) - F(1.9) = -3.6947. The next three are also the exact negative of the quadrature there. The three with A + B sec(c + d x) differ from it by more than a sign.
SolveByTheSignOfTheComplement writes the integrand in w = cos(u).
SolveBySubstitution takes v = sqrt(w). For the first integrand, that leaves -2 v^2/(sqrt(1 + 1/v^2) sqrt(1 - v^4)).
SolveByCombiningRadicals writes the product of roots as sqrt(v^4 - v^8 + v^2 - v^6)/v^2.
Step 5 is right for a real v, where sqrt(v^4) = v^2. Wherever the cosine is negative, v = sqrt(w) is imaginary, sqrt(v^4) = -v^2, and the answer comes back negated.
SolveBySubstitution already conditions the answer on the radicand after an even root, provided w >= 0, for this reason. Its comment names (1 + sec(x))^(5/2) sqrt(cos(x)). It does so only when the answer below read a sign or a modulus of v (if (asTheRoot != resultInU)). Here the rules below wrote v^2 for sqrt(v^4) and read neither.
Tested: with that condition attached to every answer through an even root (a probe, not a proposal), all seven come back conditioned on cos(c + d x) >= 0: the first says provided a > 0 and cos(c + d * x) >= 0, where master says provided a > 0. They still differentiate back where the cosine is positive, and claim nothing where it is negative. The probe also conditions answers that hold on both sides, which a fix would have to avoid.
#1584 answers these seven by the half-angle tangent, conditioned on cos(c + d x) >= 0, before SolveBySubstitution is asked, so they will stop showing up in the corpus. The defect is still there for anything else that reaches the even-root step.
Activity
Rafael-SOWNet commentedon Sep 29, 2026
#1584 answers these seven by the half-angle tangent, conditioned on
cos(c + d x) >= 0, beforeSolveBySubstitutionis asked, so they will stop showing up in the corpus. The defect is still there for anything else that reaches the even-root step.An answer that took an even root real without reading its sign says w…
An answer that took an even root real without reading its sign says w…