Repository navigation
Integrate a function of the hyperbolic tangent alone under u = tanh - #1956
Merged
Merged
Conversation
The parser writes tanh(L) as (e^(2 L) - 1)/(e^(2 L) + 1) and coth(L) as its reciprocal, so an integrand built from those alone is R(u) with u = tanh(L), and dx = du/(b (1 - u^2)). tanh(x)/sqrt(a + b tanh(x)^2 + c tanh(x)^4) is u/((1 - u^2) sqrt(a + b u^2 + c u^4)), and sin(tanh(x)) is sin(u)/(1 - u^2), onto the sine and cosine integrals. The trigonometric counterparts are answered under u = tan(x); the hyperbolic functions arrive as exponentials, and nothing read them as a tangent. Only where R is not rational in u: those the exponential substitution answers. Rubi's 6.3 and 6.4: 33 rows go from unevaluated or timed out to solved (689 -> 722 of 728), 0 wrong. Families 0 and 1 and samples of 2-8 otherwise identical; gate and suite pass. Part of #233. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012sonx8iAspMiwRwokT1Ura
This was referenced Oct 20, 2026
Rafael-SOWNet
added a commit
that referenced
this pull request
Oct 21, 2026
) #1956 integrates a function of the hyperbolic tangent alone under u = tanh. For a power of a + a coth(L) or a - a coth(L) alone, the 1 ± u of the Jacobian cancels into the base in u and leaves a root over three linears, where in W = e^(2L) the integrand is a binomial differential written in a few terms: (1 + coth(x))^(7/2) became 14,533 characters and 1.3 GB, where the substitution writes 287 characters at 0.13 GB. The rule now declines when the only factor holding u is a power that is not whole of (p u + q)/(r u + s) with p = ±q and q, r not zero. Rubi's 6.4.2:99-105 have their answers from before #1956 again, character for character. #1956's 36 gained rows answer as on master, and the other 50 rows of 6.3 and 6.4 it reaches are unchanged. Part of #233. Claude-Session: https://claude.ai/code/session_012sonx8iAspMiwRwokT1Ura Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Rafael-SOWNet
added a commit
that referenced
this pull request
Oct 21, 2026
…and is defined u answer on the real domain of the question in u, and tanh(L) takes only the values in (-1, 1). sqrt(1 - coth(x)^2), which is i |csch(x)|, is real in u only for |u| > 1, and came back as two arms for u <= -1 and u >= 1: true nowhere on the real line, so the answer had no value at any real x. Written back in x, an answer with no value at any sampled point where the integrand has one is now declined, and the rules in x answer as they did before #1956. Rubi's 6.4.7:31, 33 and 37 go from PART to OK with their answers from before fractional powers of tanh or coth, these three alone move; #1956's 36 gained rows answer as on master. 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
added a commit
that referenced
this pull request
Oct 21, 2026
…and is defined (#1983) u answer on the real domain of the question in u, and tanh(L) takes only the values in (-1, 1). sqrt(1 - coth(x)^2), which is i |csch(x)|, is real in u only for |u| > 1, and came back as two arms for u <= -1 and u >= 1: true nowhere on the real line, so the answer had no value at any real x. Written back in x, an answer with no value at any sampled point where the integrand has one is now declined, and the rules in x answer as they did before #1956. Rubi's 6.4.7:31, 33 and 37 go from PART to OK with their answers from before fractional powers of tanh or coth, these three alone move; #1956's 36 gained rows answer as on master. Part of #233. Claude-Session: https://claude.ai/code/session_012sonx8iAspMiwRwokT1Ura Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
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.
Part of #233.
The parser writes
tanh(L)as(e^(2 L) - 1)/(e^(2 L) + 1)andcoth(L)as its reciprocal, so an integrand built from those alone isR(u)withu = tanh(L), anddx = du/(b (1 - u^2)):tanh(x)/sqrt(a + b tanh(x)^2 + c tanh(x)^4)isu/((1 - u^2) sqrt(a + b u^2 + c u^4)).sin(tanh(x))issin(u)/(1 - u^2), onto the sine and cosine integrals.The trigonometric counterparts are answered under
u = tan(x). The hyperbolic functions arrive as exponentials, and nothing read them as a tangent. The new rule,SolveAFunctionOfTheHyperbolicTangent, applies only whereRis not rational inu. Rational functions of tanh keep the answers the exponential substitution gives them;tanh(x)^2andtanh(x)/(1 + tanh(x))are pinned as unchanged.Measured against master
8a1ef454:The gains include
tanh/cothover the root of a quartic in them,tanh/(a + b tanh^4)^k,sin(tanh(a + b x))^kwith its cos and coth twins, and(b coth(c + d x)^4)^(k/3).The rebase onto #1950–#1955 conflicted at the shared anchors. I resolved it by keeping every rule. The combined tests of #1952, #1953, #1955 and this branch pass, 21/21. All gained rows were declined (35) or timed out (1) on 2.5.0, and
BREAKING-CHANGES.mdhas the entry.🤖 Generated with Claude Code
https://claude.ai/code/session_012sonx8iAspMiwRwokT1Ura