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
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