Skip to content

Commit c267991

Browse files
x over a cubic binomial beside the root of another is integrated at the third elementary ratio (#1862)
* x over a cubic binomial beside the root of another is integrated at the third elementary ratio Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012sonx8iAspMiwRwokT1Ura * Record the third elementary ratio of x over two cubic binomials in the breaking changes Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012sonx8iAspMiwRwokT1Ura --------- Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
1 parent f009b5d commit c267991

3 files changed

Lines changed: 67 additions & 8 deletions

File tree

‎BREAKING-CHANGES.md‎

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1796,6 +1796,21 @@ closed form now, by the sign of `c`
17961796
| `"x/((4*c + d*x^3)*sqrt(c + d*x^3))".ToEntity().Integrate("x")` | `integral(...)` | the same in `sqrt(c + d x^3)` and `q = (d/c)^(1/3)`, by the sign of `c` |
17971797
| `"x/((8 - d*x^3)*sqrt(1 + d*x^3))".ToEntity().Integrate("x")` | `integral(...)` | `(artanh((1 + d^(1/3) x)^2/(3 sqrt(1 + d x^3))) - artanh(sqrt(1 + d x^3)/3))/(18 d^(2/3)) - atan(sqrt(3) (1 + d^(1/3) x)/sqrt(1 + d x^3))/(6 sqrt(3) d^(2/3))`, written with logarithms |
17981798

1799+
### `x` over a cubic binomial beside the root of another is integrated at its third elementary ratio
1800+
1801+
**Answers where there were none.** `x/((b x^3 + 2 a (5 + 3 sqrt(3))) sqrt(a + b x^3))` was declined, with its
1802+
seven variants in Rubi's 1.1.3.4, and so were four numeric ones in its Welz problems.
1803+
`x/((a + b x^3) sqrt(c + d x^3))` is elementary at a third ratio as well, `a^2 d^2 - 20 a b c d - 8 b^2 c^2 = 0`, where `r = (a d - 10 b c)/(6 b c)` is `sqrt(3)` or `-sqrt(3)`, as two
1804+
arctangents and two inverse hyperbolic tangents for each sign of `c r`
1805+
([#718](https://github.com/asc-community/AngouriMath/issues/718), PR
1806+
[#1862](https://github.com/asc-community/AngouriMath/pull/1862)).
1807+
1808+
| Input | Was (2.5.0) | Now |
1809+
|---|---|---|
1810+
| `"x/((b*x^3 + 2*a*(5 + 3*sqrt(3)))*sqrt(a + b*x^3))".ToEntity().Integrate("x")` | `integral(...)` | 1,663 characters, by the sign of `a` |
1811+
| `"x/((b*x^3 + 2*a*(5 - 3*sqrt(3)))*sqrt(a + b*x^3))".ToEntity().Integrate("x")` | `integral(...)` | 1,703 characters, by the sign of `a` |
1812+
| `"x/((x^3 + 10 + 6*sqrt(3))*sqrt(1 + x^3))".ToEntity().Integrate("x")` | `integral(...)` | 626 characters |
1813+
17991814
### `x^2` over a three-quarter power of a quadratic binomial beside another is integrated where that is elementary
18001815

18011816
**Answers where there were none.** `x^2/((A + B x^2)^(3/4) (C + D x^2))` at `B C - 2 A D = 0`, Rubi's

‎Sources/AngouriMath/Functions/Continuous/Integration/IndefiniteIntegralSolver.cs‎

Lines changed: 43 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6137,8 +6137,9 @@ Entity OverOnePlus(Entity k)
61376137
}
61386138

61396139
/// <summary>
6140-
/// <c>x/((a + b x^3) sqrt(c + d x^3))</c> at the two ratios where its integral is elementary,
6141-
/// Rubi's 1.1.3.4: <c>4 b c = a d</c> and <c>8 b c + a d = 0</c>, in closed form.
6140+
/// <c>x/((a + b x^3) sqrt(c + d x^3))</c> at the three ratios where its integral is elementary,
6141+
/// Rubi's 1.1.3.4: <c>4 b c = a d</c>, <c>8 b c + a d = 0</c> and
6142+
/// <c>a^2 d^2 - 20 a b c d - 8 b^2 c^2 = 0</c>, in closed form.
61426143
/// </summary>
61436144
/// <remarks>
61446145
/// <para>
@@ -6160,10 +6161,25 @@ Entity OverOnePlus(Entity k)
61606161
/// Rubi splits the second into three integrals, a substitution's in <c>x^3</c>, a linear
61616162
/// over a linear and a quadratic over a quadratic, each elementary, and their sum is the
61626163
/// form above; asked as three, two come back piecewise in the symbols and their sum holds
6163-
/// every combination of the arms. Every condition is decided as a value, and the answer is
6164-
/// differentiated back at sampled points before it is returned.
6164+
/// every combination of the arms.
6165+
/// </para>
6166+
/// <para>
6167+
/// At the third, <c>r = (a d - 10 b c)/(6 b c)</c> is <c>sqrt(3)</c> or <c>-sqrt(3)</c>, the
6168+
/// condition's two roots, and with <c>s = sqrt(c r)</c> Rubi's four terms are
6169+
/// <code>
6170+
/// -q (2 - r)/(sqrt(2) b) (atan(s (1 - r) y/(sqrt(2) c r^2))/(3 r s) + atan(s (1 + r) (1 + q x)/(sqrt(2) y))/(2 r s)
6171+
/// + artanh(s (1 - r) (1 + q x)/(sqrt(2) y))/(6 s) + artanh(s (1 + r - 2 q x)/(sqrt(2) y))/(3 s))
6172+
/// </code>
6173+
/// Each is <c>atan(s v)/s</c> or <c>artanh(s v)/s</c>, which depends on <c>s^2</c> alone, so
6174+
/// where <c>c r</c> is negative the same terms are written with <c>t = sqrt(-c r)</c>, each
6175+
/// <c>atan</c> becoming an <c>artanh</c> and each <c>artanh</c> an <c>atan</c>: one real form
6176+
/// for each sign, where Rubi has one for each sign of <c>c</c> and a power of <c>r</c> that is
6177+
/// complex at <c>r = -sqrt(3)</c>.
6178+
/// Every condition is decided as a value, and the answer is differentiated back at sampled
6179+
/// points before it is returned.
61656180
/// Welz's <c>x/((4 - x^3) sqrt(1 - x^3))</c> and <c>x/((8 - d x^3) sqrt(1 + d x^3))</c> were
6166-
/// declined, with the rest of 1.1.3.4 at those ratios.
6181+
/// declined, with the rest of 1.1.3.4 at those ratios, and
6182+
/// <c>x/((b x^3 + 2 a (5 + 3 sqrt(3))) sqrt(a + b x^3))</c> with its seven variants after them.
61676183
/// https://github.com/asc-community/AngouriMath/issues/718
61686184
/// </para>
61696185
/// </remarks>
@@ -6219,6 +6235,28 @@ Entity OverOnePlus(Entity k)
62196235
- MathS.Hyperbolic.Artanh(sqrtOfThree * s * (1 + q * x) / y) / (6 * sqrtOfThree)) / (MathS.Pow(s, 3) * MathS.Sqr(q));
62206236
answer = LowestOverTheSymbols(-d / b) * BySign(c, wherePositive, whereNegative);
62216237
}
6238+
else if (Zero(MathS.Sqr(a * d) - 20 * a * b * c * d - 8 * MathS.Sqr(b * c))
6239+
&& ((a * d - 10 * b * c) / (6 * b * c)) is var ratio
6240+
&& (Zero(ratio - sqrtOfThree) ? sqrtOfThree : Zero(ratio + sqrtOfThree) ? -sqrtOfThree : null) is { } r)
6241+
{
6242+
// Each term is atan(s v)/s or atanh(s v)/s for s = sqrt(c r), which depends on s^2
6243+
// alone, so the sign of c r picks the real form.
6244+
var k = LowestOverTheSymbols(c * r);
6245+
var w = 1 + q * x;
6246+
Entity Terms(bool positive, Entity s)
6247+
=> -q * (2 - r) / (Sqr2() * b) * (
6248+
Circular(positive, s * (1 - r) * y / (Sqr2() * c * MathS.Sqr(r))) / (3 * r * s)
6249+
+ Circular(positive, s * (1 + r) * w / (Sqr2() * y)) / (2 * r * s)
6250+
+ Hyperbolic(positive, s * (1 - r) * w / (Sqr2() * y)) / (6 * s)
6251+
+ Hyperbolic(positive, s * (1 + r - 2 * q * x) / (Sqr2() * y)) / (3 * s));
6252+
var sPositive = MathS.Sqrt(k);
6253+
var sNegative = MathS.Sqrt(LowestOverTheSymbols(-k));
6254+
// atan(i t v)/(i t) = atanh(t v)/t, and atanh(i t v)/(i t) = atan(t v)/t.
6255+
answer = BySign(k, Terms(true, sPositive), Terms(false, sNegative));
6256+
static Entity Sqr2() => MathS.Sqrt(2);
6257+
static Entity Circular(bool positive, Entity v) => positive ? MathS.Arctan(v) : MathS.Hyperbolic.Artanh(v);
6258+
static Entity Hyperbolic(bool positive, Entity v) => positive ? MathS.Hyperbolic.Artanh(v) : MathS.Arctan(v);
6259+
}
62226260
if (answer is null)
62236261
return null;
62246262
answer = (multiple * answer).InnerSimplified;

‎Sources/Tests/UnitTests/Calculus/XOverACubicBinomialBesideTheRootOfAnotherIntegralTest.cs‎

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@
1212
namespace AngouriMath.Tests.Calculus
1313
{
1414
/// <summary>
15-
/// <c>x/((a + b x^3) sqrt(c + d x^3))</c> at the two ratios where its integral is elementary,
16-
/// Rubi's 1.1.3.4: <c>4 b c = a d</c>, in closed form by the sign of <c>c</c>, and
17-
/// <c>8 b c + a d = 0</c>, as three integrals.
15+
/// <c>x/((a + b x^3) sqrt(c + d x^3))</c> at the three ratios where its integral is elementary,
16+
/// Rubi's 1.1.3.4: <c>4 b c = a d</c>, in closed form by the sign of <c>c</c>,
17+
/// <c>8 b c + a d = 0</c>, as three integrals, and <c>a^2 d^2 - 20 a b c d - 8 b^2 c^2 = 0</c>.
1818
/// <a href="https://github.com/asc-community/AngouriMath/issues/718">#718</a>
1919
/// </summary>
2020
/// <remarks>
@@ -37,6 +37,12 @@ public sealed class XOverACubicBinomialBesideTheRootOfAnotherIntegralTest
3737
[InlineData("x/((8*c - d*x^3)*sqrt(c + d*x^3))", 1.3)]
3838
[InlineData("x/((8*c - d*x^3)*sqrt(c + d*x^3))", -1.3)]
3939
[InlineData("3*x/((8 + x^3)*sqrt(-1 + x^3))", 1.3)]
40+
// a^2 d^2 - 20 a b c d - 8 b^2 c^2 = 0, at both of its roots.
41+
[InlineData("x/((d*x^3 + 2*c*(5 + 3*sqrt(3)))*sqrt(c + d*x^3))", 1.3)]
42+
[InlineData("x/((d*x^3 + 2*c*(5 + 3*sqrt(3)))*sqrt(c + d*x^3))", -1.3)]
43+
[InlineData("x/((d*x^3 + 2*c*(5 - 3*sqrt(3)))*sqrt(c + d*x^3))", 1.3)]
44+
[InlineData("x/((d*x^3 + 2*c*(5 - 3*sqrt(3)))*sqrt(c + d*x^3))", -1.3)]
45+
[InlineData("x/((-x^3 + 2*(5 - 3*sqrt(3)))*sqrt(1 - x^3))", 1.3)]
4046
public void IsIntegrated(string integrand, double c)
4147
{
4248
var integral = integrand.ToEntity().Integrate("x");

0 commit comments

Comments
 (0)