Skip to content

Integrate a function of the hyperbolic tangent alone under u = tanh - #1956

Merged
Rafael-SOWNet merged 1 commit into
masterfrom
a-function-of-the-hyperbolic-tangent
Oct 20, 2026
Merged

Rafael-SOWNet merged 1 commit into
masterfrom
a-function-of-the-hyperbolic-tangent

Conversation

@Rafael-SOWNet

Copy link
Copy Markdown
Member

Part of #233.

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)).
  • 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. The new rule, SolveAFunctionOfTheHyperbolicTangent, applies only where R is not rational in u. Rational functions of tanh keep the answers the exponential substitution gives them; tanh(x)^2 and tanh(x)/(1 + tanh(x)) are pinned as unchanged.

Measured against master 8a1ef454:

master this branch
Rubi 6.3 and 6.4, all 728 rows 689 722
moves, each re-run alone 3 of 41 36 of 41, 0 wrong
families 0 (whole) and 1 (40 a file), samples of 2–8 identical
performance gate passed
suite 15,603 passed, 0 failed

The gains include tanh/coth over the root of a quartic in them, tanh/(a + b tanh^4)^k, sin(tanh(a + b x))^k with 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.md has the entry.

🤖 Generated with Claude Code

https://claude.ai/code/session_012sonx8iAspMiwRwokT1Ura

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
@Rafael-SOWNet Rafael-SOWNet added this to the 2.6.0 milestone Oct 20, 2026
@Rafael-SOWNet
Rafael-SOWNet merged commit 4877ed2 into master Oct 20, 2026
34 checks passed
@github-project-automation github-project-automation Bot moved this from Todo to Done in AngouriMath 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>
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