Skip to content

A power of a linear plus a root whose square matches it is integrated in their sum - #1775

Merged
Rafael-SOWNet merged 2 commits into
masterfrom
a-linear-plus-a-root-of-a-quadratic-is-eulers-variable
Oct 5, 2026
Merged

Rafael-SOWNet merged 2 commits into
masterfrom
a-linear-plus-a-root-of-a-quadratic-is-eulers-variable

Conversation

@Rafael-SOWNet

Copy link
Copy Markdown
Member

Part of #718.

(d + e x + f sqrt(Q))^n with e^2 the leading coefficient of Q times f^2 -- Rubi's 1.3.2 writes Q as a + b x + e^2 x^2/f^2 -- was declined for a symbolic e or f, whatever n was, and for any power but a whole one. 2.5.0 declined these too:

integrand 2.5.0 master 4105b3bf this
(d + k x + f sqrt(a + 2 d k x/f^2 + k^2 x^2/f^2))^n declined declined T^(n + 1)/(2k (n + 1)) + (a f^2 - d^2) T^(n - 1)/(2k (n - 1)), T the sum, in 0.5 s; 245 characters
1/(d + k x + f sqrt(a + k^2 x^2/f^2)) declined declined logarithms of T and of T - d, and a reciprocal of T - d, in 0.2 s; 267 characters
sqrt(d + k x + f sqrt(a + b x + k^2 x^2/f^2)) declined declined powers of sqrt(T), and an arctangent or a logarithm of it by the sign of d - b f^2/(2k), in 0.3 s; 2,853 characters
1/(d + k x + f sqrt(a + b x + k^2 x^2/f^2))^(3/2) declined declined the same, in 0.5 s; 3,495 characters
Welz's sqrt(b x + sqrt(a + b^2 x^2))/sqrt(a + b^2 x^2) declined declined 2 sqrt(b x + sqrt(a + b^2 x^2))/b, in 0.05 s

Each answer is differentiated back and compared with the integrand at six points; the times include that. The two answers with a general b are long: the shift d - b f^2/(2k) is written into every term. Simplified in t while the constants are named, they are two-fifths shorter, at a second and a half more each; that is a follow-up.

What changes. The sum is Euler's variable: t = d + e x + f sqrt(Q) squares to an equation linear in x, so x, the root and dx are rational in t, and a power of the sum is a power of t. With the shift s = d - b f^2/(2e) and kappa = c f^2 - (b f^2/(2e))^2, x = ((t - d)^2 - c f^2)/(2e (t - s)), sqrt(Q) = ((t - s)^2 + kappa)/(2f (t - s)) and dx/dt = ((t - s)^2 + kappa)/(2e (t - s)^2). Three things keep it short:

  • the substitution's compound constants, s and kappa, are named while the question in t is asked and put back in the answer, which took the rows with a general b from 6 to 171 seconds to under half of one;
  • a polynomial in t over a monomial beside the power, which is what the written sum makes of Q^k (d + e x + f sqrt(Q))^n where b f^2 = 2 d e, is integrated term by term by the power rule, with its coefficients reduced by their gcd; through the general chain it took seconds a term;
  • the rule is asked for such a sum before the split that would expand the powers of Q beside it.

Tests: SumOfALinearAndARootAsEulersVariableIntegralTest, six rows differentiated back with the symbols pinned; master declines all six.

Measured first on Rubi's 1.3.2, all 714 problems, at the corpus's 5-second budget, against master 287c69a7, the branch's base:

master this
solved 544 569
wrong 0 0
past the budget 8 8

Measured then on the Rubi corpus against master 287c69a7:

master this
family 0, independent suites (1814) 1772 1773
family 1, 40 a file (1381) 1308 1307
families 2 to 8, sampled (2410) 2301 2298

The harness counts no answer wrong in either. The 33 problems the two builds disagreed on, pocket and sample together, run again one build at a time: master answers 3 and this 29. This answers 27 that master does not -- the sums of 1.3.2:640-669 and 698-707 and Welz's 73 at under a fifth of a second each, and 3.2.1:152 at 20 seconds -- and master answers one this does not, 7.3.2:89, (a + b artanh(c x^2))^2/x^5, which both take 24 to 26 seconds alone, past the budget on either build. The figures above were measured with three other corpus runs on the machine.

The suite on the commit measured, 2bdfbebd, passed but for SettingsAndThreads.SettingParallelSolve, which passes alone and in its class, 10 of 10. The allocation gate passed. The head here merges master 4105b3bf, which brings #1774's fix to the same substitution; the calculus and corpus tests pass on it and the library builds for netstandard2.0.

🤖 Generated with Claude Code

https://claude.ai/code/session_012sonx8iAspMiwRwokT1Ura

Rafael-SOWNet and others added 2 commits October 5, 2026 01:48
… in their sum

(d + e x + f sqrt(Q))^n with e^2 the leading coefficient of Q times f^2 was
declined for a symbolic e or f, and for any power but a whole one. The sum is
Euler's variable: t = d + e x + f sqrt(Q) squares to an equation linear in x, so
x, the root and dx are rational in t and a power of the sum is a power of t. The
substitution's compound constants are named while the question is asked; a
polynomial in t over a monomial beside the power is integrated term by term; and
the rule is asked for such a sum before the split that would expand the powers of
Q beside it.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012sonx8iAspMiwRwokT1Ura
…t-of-a-quadratic-is-eulers-variable

# Conflicts:
#	BREAKING-CHANGES.md
#	Sources/AngouriMath/Functions/Continuous/Integration/IndefiniteIntegralSolver.cs
@Rafael-SOWNet Rafael-SOWNet added this to the 2.6.0 milestone Oct 5, 2026
@Rafael-SOWNet
Rafael-SOWNet merged commit d563958 into master Oct 5, 2026
34 checks passed
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