Skip to content

A quotient by the square of a base is integrated by parts against the base's reciprocal - #1759

Merged
Rafael-SOWNet merged 5 commits into
masterfrom
a-quotient-by-a-squared-base-is-integrated-against-its-reciprocal
Oct 4, 2026
Merged

Rafael-SOWNet merged 5 commits into
masterfrom
a-quotient-by-a-squared-base-is-integrated-against-its-reciprocal

Conversation

@Rafael-SOWNet

@Rafael-SOWNet Rafael-SOWNet commented Oct 4, 2026 •

Copy link
Copy Markdown
Member

Part of #718.

x^2/(a x cos(a x) - sin(a x))^2 was declined, with the rest of Rubi's 4.7.7 over the square of a x cos(a x) - sin(a x) or of cos(a x) + a x sin(a x). 2.5.0 declined them too:

integrand 2.5.0 master 9848e467 this
x^2/(a x cos(a x) - sin(a x))^2 declined declined after 2.7 s x/(a^2 sin(a x) (a x cos(a x) - sin(a x))) - cot(a x)/a^3, in 0.4 s
sin(a x)^2/(a x cos(a x) - sin(a x))^2 declined declined after 1.1 s in 0.03 s
sin(a x)^3/(x (a x cos(a x) - sin(a x))^2) declined declined with Si(a x), in 0.1 s
sin(a x)^4/(x^2 (a x cos(a x) - sin(a x))^2) declined declined after 1.5 s in 1.8 s
x^2/(cos(a x) + a x sin(a x))^2 declined declined in 0.1 s
cos(a x)^2/(cos(a x) + a x sin(a x))^2 declined declined in 0.07 s
cos(a x)^3/(x (cos(a x) + a x sin(a x))^2) declined declined in 0.1 s

Each answer is differentiated back with a = 1.3 and compared at x = -2.3, -1.1, -0.4, 0.4, 1.1, 2.3; the times include that.

What changes. A quotient N/(M v^2) by the square of a base v with a function of x in it is g v'/v^2 with g = N/(M v'), and v'/v^2 is the derivative of -1/v; by parts its integral is -g/v plus that of g'/v. Taken where the base's derivative is one term -- (a x cos(a x) - sin(a x))' is -a^2 x sin(a x) -- and where v cancels from g'/v, so that what is left is an integral without the base; g is cancelled with the functions in it taken for indeterminates, and a power of x that divides the base comes out of it first. Where the tower ansatz answers the quotient its answer comes first: x^2/(x cos(x) - sin(x))^2 is (x sin(x) + cos(x))/(x cos(x) - sin(x)) there, as before, continuous across the zeros of the base's derivative, where -g/v and the remainder each have a pole that cancels. The base has to hold x outside its functions as well: (a + b sin(x))^2 below the bar is a quotient the other rules answer, and this one sent eight of them past the budget.

Tests: SquaredBaseByPartsIntegralTest, seven rows differentiated back with a = 1.3 on both sides of zero; master declines all seven.

Measured first on 4.7.7's 66 problems with a squared base and 300 more of family 4 drawn at random, 247 of them run, at the corpus's 5-second budget, against master cb8e133d, the branch's base:

master this
solved 224 236
wrong 0 0
past the budget 9 9

Measured then on the Rubi corpus against master cb8e133d:

master this
family 0, independent suites (1814) 1772 1772
family 1, 40 a file (1381) 1305 1306
families 2 to 8, sampled (2410) 2279 2279

The harness counts no answer wrong in the pocket or the sample on either build. Of the 22 problems the two builds disagreed on, pocket and sample together, run again one build at a time, master answers 8 and this 18. The twelve more are 4.7.7's quotients by the squared bases, sin(a x)^6/(x^4 (a x cos(a x) - sin(a x))^2) among them, answered here in a hundredth of a second to two seconds where master declines them. Two that master answers at seventeen and nineteen seconds ran past the harness's patience here; run again, twice on each build, both builds answer both at nineteen to twenty-four seconds. Two are declined or past the budget on both, and the other six both answer at nine to twenty seconds.

The suite on the commit measured, e5a2b3c0, passed but for TrigonometricTowerAnsatzTest.TheAnswerIsInTheSineAndCosine, which asks for the ring's form of x^2/(x cos(x) - sin(x))^2; the rule asks the ring first now. On the merge with master 9848e467, f9dbd7b0, the 4,160 calculus and corpus tests that run pass, that one among them, with 2 skipped, and the allocation gate passed on the commit measured. Every row of the first table is as it says on the merge. On the merge with master 4c3aa3b4, 890210ff, the head here, the 4,177 that run pass, with 2 skipped, and the library builds for netstandard2.0.

🤖 Generated with Claude Code

https://claude.ai/code/session_012sonx8iAspMiwRwokT1Ura

Rafael-SOWNet and others added 5 commits October 4, 2026 15:18
… base's reciprocal

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012sonx8iAspMiwRwokT1Ura
…ctions too

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012sonx8iAspMiwRwokT1Ura
x^2/(x cos(x) - sin(x))^2 is (x sin(x) + cos(x))/(x cos(x) - sin(x)) by
the tower ansatz, continuous across the zeros of the base's derivative,
where the by-parts answer's two terms each have a pole that cancels.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012sonx8iAspMiwRwokT1Ura
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012sonx8iAspMiwRwokT1Ura
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 4, 2026
@Rafael-SOWNet
Rafael-SOWNet merged commit a10be86 into master Oct 4, 2026
35 of 37 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant