Skip to content

Integrate a half-odd power of a cosine beside the root of a - a cos without a sign - #1991

Merged
Rafael-SOWNet merged 1 commit into
masterfrom
integrate-a-half-odd-cosine-power-beside-the-root-of-a-minus-a-cos
Oct 21, 2026
Merged

Rafael-SOWNet merged 1 commit into
masterfrom
integrate-a-half-odd-cosine-power-beside-the-root-of-a-minus-a-cos

Conversation

@Rafael-SOWNet

Copy link
Copy Markdown
Member

cos(c + d x)^(5/2)/sqrt(a - a cos(c + d x)) and its kin went through the sign of the complement, sin y = sgn(sin y) sqrt(1 - u^2) under u = cos y, and then the reciprocal substitution. The answers:

  • carried sgn(...), whose derivative does not evaluate;
  • held only provided cos(y) >= 0;
  • ran to 489–1,567 characters, and took 0.5–25 GB to build.

The corpus harness could not check them, and read eight as unverified.

Under Rubi's v = g/(sqrt(Q) sqrt(f)), with f the cosine or the sine, g the other and Q = a - a f, the integrand f^p Q^q dy is a rational function of v. The new rule, SolveAHalfOddPowerOfACosineBesideTheRootOfAMinusACosine, integrates that rational function itself. The answer is a sum of g f^k/sqrt(Q) terms and logarithms of (1 + z)^2, (sqrt 2 + z)^2/(1 - f) and f, with z = sqrt(a) v.

  • The logarithm of f stands apart, so nothing jumps at y = pi for a < 0. A single-artanh spelling did jump there, and Rubi's artanh(z) sits on the branch cut for a > 0.
  • The rule uses only v^2 = (1 + f)/(a f), so it holds for either sign of a.
  • It is dispatched just before the polynomial term, which would otherwise push 1/(A B) a level down, out of reach.

Measured on 8270086f, branch against master:

Run Problems Master Branch
Pocket: Rubi's 4.1.1–4.1.3 and 4.2.1–4.2.3, whole 1,646 1,629 solved 1,639 solved
Family 1, 40 a file 1,381 1,368 1,368
Family 0, whole 1,814 1,789 1,789
Families 2 to 8, sampled 2,410 2,380 2,382

Re-run alone, ten problems go from unverified to verified, in 37–256 ms: Rubi's 4.2.2.1:312–315 and 319–322, and 4.1.2.1:114 and 115. Each has no sign or condition, runs to 126–467 characters (Rubi's are 124–337), and takes about 5 MB. 4.2.2.1:298–309, 323 and 324 come out shorter too: 298, 304 and 323 go from partial to OK, and 324 from past 20 s to 49 ms.

7.4.1:369, which master answers in 20 s against a 5 s budget, timed out on the branch alone. At a 60 s budget both builds answer it, and the allocations agree to 0.01% (29.5 GB). Of 182 rows of 4.2.2.1 with a root of a ± a cos, 157 answer as before, character for character, and so do 73 solved rows of 4.1.2.1, 4.2.3.1 and 4.1.3.1 with such roots. No run had a wrong answer.

AHalfOddPowerOfACosineBesideTheRootOfAMinusACosineIntegralTest differentiates the answers back at a = ±1.3, where the integrand is real. It also checks that each answer is real, has no sgn or provided, is under 600 characters, and is continuous across y = pi. BREAKING-CHANGES.md has the entry, with the 2.5.0 column measured on v2.5.0 and master's old lengths beside it.

Part of #233.

🤖 Generated with Claude Code

https://claude.ai/code/session_012sonx8iAspMiwRwokT1Ura

…ithout a sign

cos(c + d x)^(5/2)/sqrt(a - a cos(c + d x)) and its kin went through the
sign of the complement, sin y = sgn(sin y) sqrt(1 - u^2) under u = cos y,
and the reciprocal substitution after it: answers of 489-1,567 characters
carrying sgn(...), whose derivative does not evaluate, provided cos(y) >= 0,
and 0.5-25 GB to build. Under Rubi's v = g/(sqrt(Q) sqrt(f)), with f the
cosine or the sine, g the other and Q = a - a f, f^p Q^q dy is a rational
function of v; the rule integrates it itself into g f^k/sqrt(Q) terms and
logarithms of (1 + z)^2, (sqrt 2 + z)^2/(1 - f) and f, with z = sqrt(a) v,
the logarithm of f apart so that nothing jumps at y = pi for a < 0. It uses
only v^2 = (1 + f)/(a f), so it holds for either sign of a.

Rubi's 4.2.2.1:312-322 and 4.1.2.1:114 and 115 are answered without a sign
in 126-467 characters and about 5 MB; 4.2.2.1:298-309, 323 and 324 come out
shorter too. Of 182 rows of 4.2.2.1 with a root of a +- a cos, 157 answer as
before, character for character, and 73 solved rows of 4.1.2.1, 4.2.3.1 and
4.1.3.1 with such roots likewise.

Part of #233.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012sonx8iAspMiwRwokT1Ura
@Rafael-SOWNet Rafael-SOWNet added this to the 2.6.0 milestone Oct 21, 2026
@Rafael-SOWNet
Rafael-SOWNet merged commit 70cee87 into master Oct 21, 2026
34 checks passed
@github-project-automation github-project-automation Bot moved this from Todo to Done in AngouriMath Oct 21, 2026
@Rafael-SOWNet
Rafael-SOWNet deleted the integrate-a-half-odd-cosine-power-beside-the-root-of-a-minus-a-cos branch October 29, 2026 00:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

1 participant