Skip to content

Commit 04e2fe6

Browse files
x^2 over a three-quarter power of a quadratic binomial beside another is integrated where that is elementary (#1728)
x^2/((A + B x^2)^(3/4) (C + D x^2)) at B C - 2 A D = 0, Rubi's 1.1.2.4, is the difference of the two functions whose sum answers the quarter power at that ratio, with another constant, and was declined. It is answered by the signs of A and B now, the constants solved for from the two functions' derivatives and each form checked at points in its sign case. Part of #718. Claude-Session: https://claude.ai/code/session_012sonx8iAspMiwRwokT1Ura Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
1 parent b2157e0 commit 04e2fe6

3 files changed

Lines changed: 84 additions & 5 deletions

File tree

‎BREAKING-CHANGES.md‎

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -419,6 +419,20 @@ leading coefficient once expanded, and declined: it is read expanded and bare no
419419
| `"sin(x)/(a+b*sin(x))^3".Integrate("x")`, Rubi's 4.1.2.1 row 242 | `integral(...)` | the antiderivative |
420420
| `"4*x*(1+x^2)/(a*x^2+2*b*x+a)^3".Integrate("x")` | `integral(...)` | the antiderivative |
421421

422+
### `x^2` over a three-quarter power of a quadratic binomial beside another is integrated where that is elementary
423+
424+
**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
425+
1.1.2.4, is the difference of the two functions whose sum answers `1/((A + B x^2)^(1/4) (C + D x^2))`
426+
at that ratio (the entry below), with another constant, and was declined. It is answered by the
427+
signs of `A` and `B` now, each form checked at points in its sign case
428+
([#718](https://github.com/asc-community/AngouriMath/issues/718)).
429+
430+
| Input | Was (2.5.0) | Now |
431+
|---|---|---|
432+
| `"x^2/((a - b*x^2)^(3/4)*(2*a - b*x^2))".ToEntity().Integrate("x")` | `integral(...)` | an arctangent and an inverse hyperbolic tangent, by the signs of `a` and `b` |
433+
| `"x^2/((-2 + 3*x^2)*(-1 + 3*x^2)^(3/4))".ToEntity().Integrate("x")` | `integral(...)` | `(arctan(u) - artanh(u))/(3 sqrt(6))`, `u = sqrt(3) x/(sqrt(2) (-1 + 3 x^2)^(1/4))` |
434+
| `"x^2/((2 - 3*x^2)^(3/4)*(4 - 3*x^2))".ToEntity().Integrate("x")` | `integral(...)` | an arctangent and an inverse hyperbolic tangent |
435+
422436
### A cube or fourth root of a quadratic binomial beside another is integrated where that is elementary
423437

424438
**Answers where there were none.** `1/((A + B x^2)^(1/3) (C + D x^2))` is an elliptic integral

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

Lines changed: 55 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4372,22 +4372,45 @@ private static bool TryReadAsABinomialIn(Entity expr, Entity.Variable x, out Ent
43724372
/// it holds.
43734373
/// https://github.com/asc-community/AngouriMath/issues/718
43744374
/// </para>
4375+
/// <para>
4376+
/// <c>x^2/((A + B x^2)^(3/4) (C + D x^2))</c> at the same ratio is the same two functions'
4377+
/// difference where the quarter power is their sum, with another constant -- Rubi's
4378+
/// 1.1.2.4, <c>x^2/((a - b x^2)^(3/4) (2 a - b x^2))</c>, which was declined:
4379+
/// <code>
4380+
/// A &gt; 0, B &gt; 0: -(atan(A^(3/4) (1 + s/sqrt(A))/(x y r)) - artanh(A^(3/4) (1 - s/sqrt(A))/(x y r)))/(A^(1/4) r^3)
4381+
/// A &gt; 0, B &lt; 0: (atan(A^(3/4) (1 - s/sqrt(A))/(x y r)) - artanh(A^(3/4) (1 + s/sqrt(A))/(x y r)))/(A^(1/4) r^3)
4382+
/// A &lt; 0: (atan(u) - artanh(u))/((-A)^(1/4) sqrt(2) r^3)
4383+
/// </code>
4384+
/// each times <c>B/D</c> as before, the constants solved for from the two functions'
4385+
/// derivatives and checked at points in every sign case.
4386+
/// </para>
43754387
/// </remarks>
43764388
internal static Entity? SolveAnEllipticLookingQuotientOfBinomials(Entity expr, Entity.Variable x)
43774389
{
43784390
var (numerator, denominator) = Functions.SingleQuotient.Of(expr);
4379-
if (numerator.ContainsNode(x))
4380-
return null;
4391+
// Or c x^2 above, beside a three-quarter power below.
4392+
var squareAbove = false;
43814393
Entity constant = numerator;
4394+
if (numerator.ContainsNode(x))
4395+
{
4396+
if (!TreeAnalyzer.TryGetPolynomial(numerator, x, out var above) || above.Count != 1
4397+
|| !above.TryGetValue(EInteger.FromInt32(2), out var squared) || squared.ContainsNode(x))
4398+
return null;
4399+
squareAbove = true;
4400+
constant = squared;
4401+
}
43824402
Entity? radicand = null;
43834403
var order = 0;
43844404
Entity? other = null;
43854405
foreach (var factor in Mulf.LinearChildren(denominator))
43864406
{
43874407
if (!factor.ContainsNode(x))
43884408
constant = constant / factor;
4389-
else if (radicand is null && factor is Powf(var @base, Number.Rational power) && power.ERational.Numerator.Equals(EInteger.One)
4390-
&& (power.ERational.Denominator.Equals(EInteger.FromInt32(3)) || power.ERational.Denominator.Equals(EInteger.FromInt32(4))))
4409+
else if (radicand is null && factor is Powf(var @base, Number.Rational power)
4410+
&& (squareAbove
4411+
? power.ERational.Equals(ERational.Create(3, 4))
4412+
: power.ERational.Numerator.Equals(EInteger.One)
4413+
&& (power.ERational.Denominator.Equals(EInteger.FromInt32(3)) || power.ERational.Denominator.Equals(EInteger.FromInt32(4)))))
43914414
{
43924415
radicand = @base;
43934416
order = power.ERational.Denominator.ToInt32Unchecked();
@@ -4427,7 +4450,34 @@ Entity Negative(Entity q) => twelfth * q / a * (MathS.Hyperbolic.Artanh(MathS.Po
44274450
var ratio = LowestOverTheSymbols(B / A);
44284451
answer = BySign(ratio, Positive(MathS.Sqrt(ratio)), Negative(MathS.Sqrt(LowestOverTheSymbols(-ratio))));
44294452
}
4430-
else if (order == 4 && VanishesIdentically(B * C - 2 * A * D))
4453+
else if (order == 4 && squareAbove && VanishesIdentically(B * C - 2 * A * D))
4454+
{
4455+
var s = MathS.Sqrt(radicand);
4456+
var threeQuarters = Number.Rational.Create(3, 4);
4457+
var quarter = Number.Rational.Create(1, 4);
4458+
Entity BothPositive()
4459+
{
4460+
var r = MathS.Sqrt(B);
4461+
return -(MathS.Arctan(MathS.Pow(A, threeQuarters) * (1 + s / MathS.Sqrt(A)) / (x * y * r))
4462+
- MathS.Hyperbolic.Artanh(MathS.Pow(A, threeQuarters) * (1 - s / MathS.Sqrt(A)) / (x * y * r))) / (MathS.Pow(A, quarter) * MathS.Pow(r, 3));
4463+
}
4464+
Entity SlopeNegative()
4465+
{
4466+
var r = MathS.Sqrt(-B);
4467+
return (MathS.Arctan(MathS.Pow(A, threeQuarters) * (1 - s / MathS.Sqrt(A)) / (x * y * r))
4468+
- MathS.Hyperbolic.Artanh(MathS.Pow(A, threeQuarters) * (1 + s / MathS.Sqrt(A)) / (x * y * r))) / (MathS.Pow(A, quarter) * MathS.Pow(r, 3));
4469+
}
4470+
Entity ConstantNegative()
4471+
{
4472+
var r = MathS.Sqrt(B);
4473+
var u = x * r / (MathS.Pow(-A, quarter) * y * MathS.Sqrt(2));
4474+
return (MathS.Arctan(u) - MathS.Hyperbolic.Artanh(u)) / (MathS.Pow(-A, quarter) * MathS.Sqrt(2) * MathS.Pow(r, 3));
4475+
}
4476+
var toTheRatio = LowestOverTheSymbols(B / D);
4477+
var form = BySigns(A, B, BothPositive(), SlopeNegative(), ConstantNegative());
4478+
answer = toTheRatio == Number.Integer.One ? form : toTheRatio * form;
4479+
}
4480+
else if (order == 4 && !squareAbove && VanishesIdentically(B * C - 2 * A * D))
44314481
{
44324482
var s = MathS.Sqrt(radicand);
44334483
var threeQuarters = Number.Rational.Create(3, 4);

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

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,21 @@ public void AtTheRatioWhereItIsElementary(string integrand, double a, double b,
7676
public void WithNumbers(string integrand, double[] points)
7777
=> DifferentiatesBack(integrand, points);
7878

79+
/// <summary>
80+
/// <c>x^2</c> over the three-quarter power at the fourth root's ratio, the same two
81+
/// functions' difference: for each sign of <c>b</c> with <c>a</c> positive, for <c>a</c>
82+
/// negative, and with numbers. Rubi's 1.1.2.4.
83+
/// </summary>
84+
[Theory]
85+
[InlineData("x^2/((a + b*x^2)^(3/4)*(2*a + b*x^2))", 1.3, 0.7, new[] { 0.3, 0.9, 1.7, -0.6 })]
86+
[InlineData("x^2/((a + b*x^2)^(3/4)*(2*a + b*x^2))", 1.3, -0.7, new[] { 0.3, 0.9, 1.1, -0.6 })]
87+
[InlineData("x^2/((a + b*x^2)^(3/4)*(2*a + b*x^2))", -1.3, 0.7, new[] { 1.5, 2.0, 2.6, -1.8 })]
88+
[InlineData("x^2/((a - b*x^2)^(3/4)*(2*a - b*x^2))", 1.3, 0.7, new[] { 0.3, 0.9, 1.1, -0.6 })]
89+
[InlineData("x^2/((-2 + 3*x^2)*(-1 + 3*x^2)^(3/4))", 0, 0, new[] { 0.7, 1.1, 1.9, -1.3 })]
90+
[InlineData("x^2/((2 - 3*x^2)^(3/4)*(4 - 3*x^2))", 0, 0, new[] { 0.2, 0.5, 0.7, -0.4 })]
91+
public void XSquaredOverTheThreeQuarterPower(string integrand, double a, double b, double[] points)
92+
=> DifferentiatesBack(integrand, points, ("a", a), ("b", b));
93+
7994
/// <summary>
8095
/// Across 0, where the cube root's answers are written over <c>x</c>: the value is the one
8196
/// quadrature gives.

0 commit comments

Comments
 (0)