Skip to content

A rational function with complex coefficients is integrated through its real and imaginary parts - #1710

Merged
Rafael-SOWNet merged 2 commits into
masterfrom
a-rational-function-with-complex-coefficients
Oct 3, 2026
Merged

Rafael-SOWNet merged 2 commits into
masterfrom
a-rational-function-with-complex-coefficients

Conversation

@Rafael-SOWNet

Copy link
Copy Markdown
Member

Part of #718.

A rational function with a complex number among its coefficients was declined, whatever its shape: the rational integrator reads coefficients that are rational numbers. The tangent substitution makes such a function of every power of a + i a tan(c + d x), which Rubi has by the hundred.

integrand master 9c2509d8 this
1/((1 + i x)^2 (1 + x^2)) declined 0.6 s
x^3/((1 + i x)^4 (1 + x^2)) declined 0.9 s
1/((a + i a x)(1 + x^2)) declined 0.4 s
1/(a + i a tan(x))^2 declined after 8.7 s 0.7 s
tan(x)^3/(a + i a tan(x))^4 declined after 23 s 1.4 s
(A + B tan(x))/(a + i a tan(x))^2 declined after 9.8 s 3.3 s
1/(a + i a tan(c + d x))^3 past 60 s 1.3 s

What changes. One rule, after the Rothstein-Trager step. N/D with complex coefficients is N D'/(D D'), D' the polynomial whose coefficients are those of D conjugated: D D' has real coefficients, and N D' is P + i S with P and S real, so the integral is that of P/(D D') plus i times that of S/(D D'), each one the rational integrator reads. A product of symbols common to a polynomial's coefficients, a + i a x, comes out in front first. To the twelfth degree.

Tests: ComplexCoefficientRationalIntegralTest, ten rows: three with numbers, two with a symbol in common, five powers of a + i a tan. Each differentiated back with the symbols pinned.

Measured first on the 1,112 corpus problems with i in the integrand, at the corpus's 5-second budget, against master 148f3007, the branch's base:

master this
solved 593 670
wrong 0 0

77 more are answered, 32 of them in 4.3.2.1 (a + b tan)^m (c + d tan)^n, and none that master answers is lost.

Measured then on the Rubi corpus against master 148f3007:

master this
family 0, independent suites (1814) 1758 1758
family 1, 40 a file (1381) 1254 1253
families 2 to 8, sampled (2410) 2176 2184

No answer is wrong on either build. The 87 problems the two builds disagreed on, run again one build at a time, are 81 answered here and 3 on master, and those 3 are answered here too: the one in family 1 and one in family 7 each took 24 s on master and timed out here in the sampled run, and alone both builds answer them.

The suite passes on the commit measured, a676acea, 14,504 tests, and so does the allocation gate. Master 9c2509d8 is merged in since, without conflicts, and the calculus tests pass on the merge, 3,929 of them.

🤖 Generated with Claude Code

https://claude.ai/code/session_012sonx8iAspMiwRwokT1Ura

Rafael-SOWNet and others added 2 commits October 3, 2026 05:16
…ts real and imaginary parts

1/((1 + i x)^2 (1 + x^2)) was declined: the rational integrator reads
coefficients that are rational numbers. Times the conjugate of its
denominator over itself, N/D = N D'/(D D') with D' the polynomial whose
coefficients are those of D conjugated, the denominator has rational
coefficients and the numerator is P + i S with P and S rational, so the
integral is that of P/(D D') and i times that of S/(D D'). A product of
symbols common to a polynomial's coefficients, a + i a x, comes out with
the constants. The tangent substitution makes such a function of Rubi's
(a + i a tan(c + d x))^n.

Part of #718

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 3, 2026
@Rafael-SOWNet
Rafael-SOWNet merged commit 9a33298 into master Oct 3, 2026
34 checks passed
@Rafael-SOWNet
Rafael-SOWNet deleted the a-rational-function-with-complex-coefficients 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

None yet

Development

Successfully merging this pull request may close these issues.

1 participant