Skip to content

An odd power of the complement left by the substitution of a sine or a cosine is its sign times a root, and the sign is a constant between the complement's zeros - #1323

Merged
Rafael-SOWNet merged 1 commit into
masterfrom
sign-of-the-odd-complement
Sep 14, 2026
Merged

Rafael-SOWNet merged 1 commit into
masterfrom
sign-of-the-odd-complement

Conversation

@Rafael-SOWNet

Copy link
Copy Markdown
Member

Charlwood's ln(sin(x)) sqrt(1 + sin(x)) by parts leaves
-2 cos(x)^2/(sin(x) sqrt(1 + sin(x))), and under u = sin(x) that is
-2 cos(x)/(u sqrt(1 + u)) du, a cosine over: the substitution reads even
powers of the complement as powers of 1 - u^2 and refuses an odd one,
since cos(x) is not a function of sin(x). It is one on every interval
between the zeros of the cosine, sgn(cos(x)) sqrt(1 - u^2), and the sign
is a constant there. So the integrand is that constant times an algebraic
function of u -- -2 sgn(cos(x)) sqrt(1 - u)/u -- which is integrated,
-4 sqrt(1 - u) + 4 atanh(sqrt(1 - u)), and the sign goes back in as
sgn(cos(x)). Exact wherever the cosine is not zero, the generic case,
and checked on both signs of it. Charlwood's
cos(x)^2/sqrt(1 + cos(x)^2 + cos(x)^4) is the same under the cosine:
-u^2/(sin(x) sqrt(1 + u^2 + u^4)), which is -sgn(sin(x)) u^2/sqrt(1 - u^6)
once the roots combine, and -sgn(sin(x)) arcsin(u^3)/3 -- Rubi's
x/3 + arctan(...)/3 written the other way.

A rule of its own, and late, after the half-angle substitution: inside
the general substitution it answered 1/(1 + sin(x)) as a sign times a
root where the half-angle substitution gives the tangent of the half
angle, and the remainder by parts left beside that root was nine seconds
of search for ln(sin(x))/(1 + sin(x)), which the tangent answers in a
moment. Only for an integrand with a root in it, since a rational
function of the sine and cosine is the half-angle substitution's and
Jeffrey's paid half a second here on the way to it; only where the
complement is a factor of the product, since inside a sum,
1/(cos(x) + sin(x)), the sign beside a root of 1 - u^2 is a search that
timed out; and only where what is left is algebraic in u, since beside a
logarithm of u it ended nowhere.

Rubi sample (463 problems, 5 s budget), against the #1320 master this branch is cut from:

master at #1320     411/463, 0 wrong, 0 timeouts, ~97 s
with this           413/463, 0 wrong, 0 timeouts, 97 s

Two more, nothing lost: Charlwood 128 in 1.4 s and Charlwood 20 in 0.3 s. Charlwood 131 (sec(x)/sqrt(sec(x)^4 - 1), answered) takes 0.7 s where it took 0.4; nothing else moved by more than noise. Three things were measured on the way and are not in this branch: the sign inside the general substitution (Apostol 192 to a timeout, Charlwood 125 and 47 lost), the rule without the algebraic condition, and the rule without the root condition (half a second on each of Jeffrey 20 and 23).

Independent of #1321 (merged meanwhile) and #1322 (open), which touch other rules.

The five test suites are green.

Part of #718.

🤖 Generated with Claude Code

https://claude.ai/code/session_012sonx8iAspMiwRwokT1Ura

…a cosine is its sign times a root, and the sign is a constant between the complement's zeros

Charlwood's `ln(sin(x)) sqrt(1 + sin(x))` by parts leaves
`-2 cos(x)^2/(sin(x) sqrt(1 + sin(x)))`, and under `u = sin(x)` that is
`-2 cos(x)/(u sqrt(1 + u)) du`, a cosine over: the substitution reads even
powers of the complement as powers of `1 - u^2` and refuses an odd one,
since `cos(x)` is not a function of `sin(x)`. It is one on every interval
between the zeros of the cosine, `sgn(cos(x)) sqrt(1 - u^2)`, and the sign
is a constant there. So the integrand is that constant times an algebraic
function of `u` -- `-2 sgn(cos(x)) sqrt(1 - u)/u` -- which is integrated,
`-4 sqrt(1 - u) + 4 atanh(sqrt(1 - u))`, and the sign goes back in as
`sgn(cos(x))`. Exact wherever the cosine is not zero, the generic case,
and checked on both signs of it. Charlwood's
`cos(x)^2/sqrt(1 + cos(x)^2 + cos(x)^4)` is the same under the cosine:
`-u^2/(sin(x) sqrt(1 + u^2 + u^4))`, which is `-sgn(sin(x)) u^2/sqrt(1 - u^6)`
once the roots combine, and `-sgn(sin(x)) arcsin(u^3)/3` -- Rubi's
`x/3 + arctan(...)/3` written the other way.

A rule of its own, and late, after the half-angle substitution: inside
the general substitution it answered `1/(1 + sin(x))` as a sign times a
root where the half-angle substitution gives the tangent of the half
angle, and the remainder by parts left beside that root was nine seconds
of search for `ln(sin(x))/(1 + sin(x))`, which the tangent answers in a
moment. Only for an integrand with a root in it, since a rational
function of the sine and cosine is the half-angle substitution's and
Jeffrey's paid half a second here on the way to it; only where the
complement is a factor of the product, since inside a sum,
`1/(cos(x) + sin(x))`, the sign beside a root of `1 - u^2` is a search that
timed out; and only where what is left is algebraic in `u`, since beside a
logarithm of `u` it ended nowhere.

Rubi sample: +2 (Charlwood 128 and 20), 0 wrong, 0 timeouts.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012sonx8iAspMiwRwokT1Ura
@Rafael-SOWNet
Rafael-SOWNet merged commit 11a2a80 into master Sep 14, 2026
31 checks passed
@Rafael-SOWNet
Rafael-SOWNet deleted the sign-of-the-odd-complement branch September 14, 2026 07:06
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