Repository navigation
A power of a homogeneous trigonometric factor is read as that power, and a cos + b sin with symbols reaches the tangent - #1483
Merged
Conversation
…and a cos + b sin with symbols reaches the tangent `sec(x)^2/(a cos(x) + b sin(x))^4` was left as written after ten minutes, where `sec(x)^2/(2 cos(x) + 3 sin(x))^4` took a tenth of a second. Both are quotients of homogeneous polynomials in the sine and cosine, which `t = tan(x)` turns into a rational function -- Bioche's third rule -- and the rule read each side by expanding it first. With numbers the expanded quartic in `t` is `(2 + 3t)^4` again as soon as the rational integrator factors it; with symbols it is `a^4 + 4 a^3 b t + 6 a^2 b^2 t^2 + 4 a b^3 t^3 + b^4 t^4`, a quartic with a symbol in every coefficient that nothing factors back. A side is now read a factor at a time, and a whole power of a homogeneous factor as that power of it: the degrees add and the rewritten factors are raised as written, so the substitution hands on `(1 + t^2)^2/(a + b t)^4`, which takes half a second. A side whose factors are not homogeneous one by one is still read whole, as before. Rubi's 4.7.2, `trig^m (a trig + b trig)^n`, all 290 problems: 199 to 215 with no row lost and 27 timeouts to 20. Family 4 330 to 332 of 422; no row lost in families 1, 4, 5, 6 or 7 or the 1774-problem suite, which stays at 1719. Part of #718. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012sonx8iAspMiwRwokT1Ura
This was referenced Sep 24, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
sec(x)^2/(a cos(x) + b sin(x))^4was left as written after ten minutes, wheresec(x)^2/(2 cos(x) + 3 sin(x))^4took a tenth of a second.Both are quotients of homogeneous polynomials in the sine and cosine, which
t = tan(x)turns into a rational function (Bioche's third rule), andSolveByHomogeneousTrigonometricSubstitutionanswers the numeric one at the top. It read each side by expanding it first. With numbers, the expanded quartic intis(2 + 3t)^4again as soon as the rational integrator factors it. With symbols it isa^4 + 4a^3 b t + 6a^2 b^2 t^2 + 4a b^3 t^3 + b^4 t^4, a quartic with a symbol in every coefficient that nothing factors back — so the search went on past its budget. Timing each step of the rule settled it: read in 5 ms, substituted and simplified by 99 ms, and then the expanded quartic.A side is now read a factor at a time, with a whole power of a homogeneous factor read as that power of it: the degrees add and the rewritten factors are raised as written, so the substitution hands on
(1 + t^2)^2/(a + b t)^4, which takes half a second. A side whose factors are not homogeneous one by one is still read whole, as before.Measured
sec(x)^2/(a cos(x) + b sin(x))^4trig^m (a trig + b trig)^n, all 290 problemsThe sixteen rows are all
trig^m/(a cos + b sin)^nwith symbolicaandb,sin,cos,secandcscabove — two of them thea cos + i a sinkind. The existing tests all had numeric coefficients, which is why this survived them; the new ones pina = 1.7,b = 0.6after integrating symbolically.The family 1/5/6/7 counts are not quoted as gains here: their baselines predate the harness change that checks complex-valued integrands as complex numbers, so a raised count would mix the two. "No row lost" holds either way, since that change only ever adds answered rows.
Part of #718.
🤖 Generated with Claude Code
https://claude.ai/code/session_012sonx8iAspMiwRwokT1Ura