Skip to content

Cancel a sum the exponential substitution writes on both sides of the bar before simplifying the quotient - #1989

Merged
Rafael-SOWNet merged 1 commit into
masterfrom
cancel-a-sum-written-on-both-sides-before-simplifying
Oct 21, 2026
Merged

Rafael-SOWNet merged 1 commit into
masterfrom
cancel-a-sum-written-on-both-sides-before-simplifying

Conversation

@Rafael-SOWNet

Copy link
Copy Markdown
Member

x csch(x)^2/(a + b coth(x))^2 went through the exponential substitution as 4 (u^2 - 1)^2 u^2/((u^2 - 1)^2 (a (u^2 - 1) + b (u^2 + 1))^2 u). Its Simplify ran past 20 s with the symbols in it, and that stalled SolveAPolynomialTimesARationalFunctionOfAnExponential.

Where the integrand holds symbols and a sum is written on both sides of the bar, that factor is now cancelled as written and the simplification is skipped. The quotient becomes 4 u (a (u^2 - 1) + b (u^2 + 1))^(-2), in 7 ms. WithTheFactorsWrittenOnBothSidesCancelled gains an overload that keeps the written bases and says whether anything was cancelled; its two-argument call behaves as before.

Two earlier versions were measured and dropped. Declining a piecewise antiderivative, and keeping Simplify after the cancellation, each lengthened x sech^2/(a + b tanh)^2 from 1,013 to 1,513 characters.

Measured on 8270086f, branch against master:

Run Problems Master Branch
Pocket: Rubi's family 2, and family 6 sampled 1,956 1,885 solved 1,885 solved
Family 1, 40 a file 1,381 1,368 1,367
Family 0, whole 1,814 1,789 1,789
Families 2 to 8, sampled 2,410 2,380 2,380

Re-run alone, 6.4.2:203 goes from timed out to answered, in 27 ms. It was checked at four pin sets, negative x included, and by quadrature on [0.3, 2.5]. x/(sinh(x)^2 (a + b coth(x))^2) is newly answered too.

The other two moves, 1.1.2.4:548 and 6.1.1:124, come out the same on both builds. They are problems that take 13–25 s and flipped under load, which is also the one-row difference in family 1.

Of 158 solved symbolic hyperbolic and exponential rows, every one answers as before, character for character. x sech(x)^2/(a + b tanh(x))^2 keeps its answer at 0.017 GB of allocation, from 0.69. At a = -b the answer has no value, as master's tanh sibling has none, through a generic 1/(a + b) in the substitution. 6.1.5:94 reads wrong on both builds; that is the evaluator artefact of #1944.

AFactorTheExponentialSubstitutionWritesOnBothSidesIntegralTest differentiates the answers back. BREAKING-CHANGES.md has the entry, with the 2.5.0 column measured on v2.5.0.

Part of #233.

🤖 Generated with Claude Code

https://claude.ai/code/session_012sonx8iAspMiwRwokT1Ura

… bar before simplifying the quotient

x csch(x)^2/(a + b coth(x))^2 went through the exponential substitution as
4 (u^2 - 1)^2 u^2/((u^2 - 1)^2 (a (u^2 - 1) + b (u^2 + 1))^2 u), whose
Simplify ran past 20 s with the symbols in it and stalled
SolveAPolynomialTimesARationalFunctionOfAnExponential. Where the integrand
holds symbols and a sum is written on both sides of the bar, that factor is
now cancelled as written and the simplification skipped:
4 u (a (u^2 - 1) + b (u^2 + 1))^(-2), in 7 ms.

Rubi's 6.4.2:203 is answered in 31 ms, checked at four pin sets on both
sides and by quadrature; x/(sinh(x)^2 (a + b coth(x))^2) too. 158 solved
symbolic hyperbolic and exponential rows answer as before, character for
character; x sech(x)^2/(a + b tanh(x))^2 keeps its answer at 0.017 GB from
0.69.

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 7a49ad0 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 cancel-a-sum-written-on-both-sides-before-simplifying 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