From 0e88255944ae920bcabfd64d1df860796d6807d9 Mon Sep 17 00:00:00 2001 From: Rafael Vuijk Date: Sat, 3 Oct 2026 12:02:37 +0000 Subject: [PATCH] e^(n i arctan(a x)) to a power that is not whole is one power of a quotient of linears e^(n i arctan(L)) is written algebraically as (1 + i L)^n (1 + L^2)^(-n/2), and for an n that is not whole those are two radicals of different orders that nothing reads: x^2 e^(3/2 i arctan(a x)) was declined. For such an n it is written ((1 + i L)/(1 - i L))^(n/2), the same on the principal branch for a real L -- the quotient is e^(2 i arctan(L)) and 2 arctan(L) its principal argument -- and one power of a quotient of linears, which the substitution for that reads. Rubi's 5.3.6. Part of #718. Co-Authored-By: Claude Opus 5.5 (1M context) Claude-Session: https://claude.ai/code/session_012sonx8iAspMiwRwokT1Ura --- BREAKING-CHANGES.md | 15 +++++++++++++++ .../Integration/IndefiniteIntegralSolver.cs | 10 +++++++++- .../InverseTrigonometricSubstitutionTest.cs | 15 +++++++++++++++ 3 files changed, 39 insertions(+), 1 deletion(-) diff --git a/BREAKING-CHANGES.md b/BREAKING-CHANGES.md index 891e0ae34..cdf5aaf6d 100644 --- a/BREAKING-CHANGES.md +++ b/BREAKING-CHANGES.md @@ -436,6 +436,21 @@ read them as nonzero. They are now decided over one bar, expanded, and at pinned | `"e^(3*acoth(a*x))/(c-a*c*x)^3".Integrate("x")`, and over `(c - a c x)^4` | left unevaluated | an antiderivative in `sqrt((a x + 1)/(a x - 1))` | | `"e^(2*acoth(a*x))*sqrt(c-a*c*x)/x".Integrate("x")`, and over `x^2` | left unevaluated | an antiderivative in `sqrt(c - a c x)`, by cases on the sign of `c` | +### `e^(n i arctan(a x))` to a power that is not whole is integrated + +**Answers where there were none.** `e^(n i arctan(L))` is written algebraically, as +`(1 + i L)^n (1 + L^2)^(-n/2)`, and for an `n` that is not whole those are two radicals of different +orders that nothing reads: `x^2 e^(3/2 i arctan(a x))` was left unevaluated. For such an `n` it is +written `((1 + i L)/(1 - i L))^(n/2)`, the same on the principal branch for a real `L`, one power of a +quotient of linears, which the substitution for that reads. Rubi's 5.3.6 +([#718](https://github.com/asc-community/AngouriMath/issues/718)). + +| Input | Was (2.5.0) | Now | +|---|---|---| +| `"e^(3/2*i*arctan(a*x))*x^2".ToEntity().Integrate("x")` | `integral(...)` | an antiderivative in `((1 + i a x)/(1 - i a x))^(1/4)` | +| `"x^3/e^(3/2*i*arctan(a*x))".ToEntity().Integrate("x")` | `integral(...)` | the same | +| `"e^(1/3*i*arctan(x))*x".ToEntity().Integrate("x")` | `integral(...)` | an antiderivative in `((1 + i x)/(1 - i x))^(1/6)` | + ### `NaN` again, from an exponent that was read as written rather than as a number **A wrong answer, and a second one of the same kind.** `(a^2 + 2abx^2 + b^2x^4)^3/x^7` came back as diff --git a/Sources/AngouriMath/Functions/Continuous/Integration/IndefiniteIntegralSolver.cs b/Sources/AngouriMath/Functions/Continuous/Integration/IndefiniteIntegralSolver.cs index 402d52850..fff94d9ac 100644 --- a/Sources/AngouriMath/Functions/Continuous/Integration/IndefiniteIntegralSolver.cs +++ b/Sources/AngouriMath/Functions/Continuous/Integration/IndefiniteIntegralSolver.cs @@ -7094,10 +7094,18 @@ node is Powf(var @base, Number.Rational power) && power is not Number.Integer && return node; rewrote = true; // The tangent's as two powers, `(1 + i L)^n (1 + L^2)^(-n/2)`, which the - // radical rules read where a power of the quotient is one node to them. + // radical rules read where a power of the quotient is one node to them; for an + // n that is not whole, as the power of the quotient, + // `((1 + i L)/(1 - i L))^(n/2)`, the same on the principal branch for a real L -- + // the quotient is `e^(2 i arctan(L))` and `2 arctan(L)` is its principal + // argument -- and one power of a quotient of linears, which the substitution + // for it reads, where `(1 + i a x)^(3/2) (1 + a^2 x^2)^(-3/4)` is two radicals + // of different orders that nothing reads. if (inverse is Arctanf) { var halfPower = Number.Rational.Create(n.ERational.Negate().Divide(2)); + if (n is not Number.Integer) + return MathS.Pow((1 + MathS.i * argument) / (1 - MathS.i * argument), Number.Rational.Create(n.ERational.Divide(2))); return (n == Number.Integer.One ? 1 + MathS.i * argument : MathS.Pow(1 + MathS.i * argument, n)) * MathS.Pow(1 + MathS.Sqr(argument), halfPower); } Entity unit = inverse is Arcsinf diff --git a/Sources/Tests/UnitTests/Calculus/InverseTrigonometricSubstitutionTest.cs b/Sources/Tests/UnitTests/Calculus/InverseTrigonometricSubstitutionTest.cs index 6b990befe..811e69f61 100644 --- a/Sources/Tests/UnitTests/Calculus/InverseTrigonometricSubstitutionTest.cs +++ b/Sources/Tests/UnitTests/Calculus/InverseTrigonometricSubstitutionTest.cs @@ -216,5 +216,20 @@ public void ALinearArgumentAndAMultipleOfTheQuadratic(string integrand, double[] [InlineData("x/e^(2*i*arctan(1 + 2*x))", new[] { -1.6, -0.4, 0.3, 1.1, 2.4 })] public void AnExponentialOfTheInverseIsAlgebraic(string integrand, double[] points) => DifferentiatesBack(integrand, points); + + /// + /// To a power that is not whole, e^(n i arctan(L)) is one power of a quotient of + /// linears, ((1 + i L)/(1 - i L))^(n/2) for a real L, which the substitution + /// for such a power reads, where (1 + i L)^n (1 + L^2)^(-n/2) is two radicals of + /// different orders: Rubi's 5.3.6. + /// + [Theory] + [InlineData("e^(3/2*i*arctan(2*x))*x^2", new[] { -1.6, -0.4, 0.3, 1.1, 2.4 })] + [InlineData("e^(3/2*i*arctan(2*x))/x^4", new[] { -1.6, -0.4, 0.3, 1.1, 2.4 })] + [InlineData("x^3/e^(3/2*i*arctan(2*x))", new[] { -1.6, -0.4, 0.3, 1.1, 2.4 })] + [InlineData("e^(1/3*i*arctan(x))*x", new[] { -1.6, -0.4, 0.3, 1.1, 2.4 })] + [InlineData("e^(3/2*i*arctan(1 + 2*x))*x^2", new[] { -1.6, -0.4, 0.3, 1.1, 2.4 })] + public void ToAPowerThatIsNotWhole(string integrand, double[] points) + => DifferentiatesBack(integrand, points); } }