diff --git a/BREAKING-CHANGES.md b/BREAKING-CHANGES.md index 3064be998..777cb0d88 100644 --- a/BREAKING-CHANGES.md +++ b/BREAKING-CHANGES.md @@ -143,6 +143,8 @@ as `a - b = 0`, as a statement's own solve reads it: `"x + 1 = 3".Solve("x")` wa - **Exact forms.** A whole `a >= 1` and `a = 1/2` are elementary. - **Integrals.** Of a linear `u`, beside a polynomial, or beside any power of `x` but `1/x` where `u` is a multiple of `x`, by parts, in gamma functions of `u`. + And of a whole `a <= 0` over a power of another linear, by parts, where what is left is an exponential over + linears. ([#2075](https://github.com/asc-community/AngouriMath/issues/2075)) | Input | Was (2.6.0) | Now | @@ -153,6 +155,7 @@ as `a - b = 0`, as a statement's own solve reads it: `"x + 1 = 3".Solve("x")` wa | `"gamma(1/3, -2)".EvalNumerical()` | a `FunctionArgumentCountException` | `10.212552064243320672…`, real | | `"x^2*gamma(0, a*x)".ToEntity().Integrate("x")` | a `FunctionArgumentCountException` | `x ^ 3 / 3 * gamma(0, a * x) - 1 / (3 * a ^ 3) * 2 * e ^ (-a * x) * (1 + a * x + (a * x) ^ 2 / 2) + C` | | `"x^m*gamma(n, b*x)".ToEntity().Integrate("x")` | a `FunctionArgumentCountException` | `(x ^ (m + 1) * gamma(n, b * x) - x ^ m * (b * x) ^ (-m) * gamma(n + m + 1, b * x) / b) / (m + 1) + C` | +| `"gamma(0, a + b*x)/(c + d*x)^2".ToEntity().Integrate("x")` | a `FunctionArgumentCountException` | `-gamma(0, a + b x)/(d (c + d x))` and two exponential integrals, of `a + b x` and of `b (c + d x)/d` | ### Numerical equality is to half the evaluation's digits diff --git a/Sources/AngouriMath/Functions/Continuous/Integration/IndefiniteIntegralSolver.cs b/Sources/AngouriMath/Functions/Continuous/Integration/IndefiniteIntegralSolver.cs index 54f2355e0..6a8256eee 100644 --- a/Sources/AngouriMath/Functions/Continuous/Integration/IndefiniteIntegralSolver.cs +++ b/Sources/AngouriMath/Functions/Continuous/Integration/IndefiniteIntegralSolver.cs @@ -5039,6 +5039,11 @@ Logf or Entity.Arcsinf or Entity.Arccosf or Entity.Arctanf or Entity.Arccotanf or Entity.Arcsecantf or Entity.Arccosecantf => true, _ when IsASpecialFunction(factor) => true, + // And the upper incomplete gamma function, whose derivative -u^(n - 1) e^(-u) u' leaves + // an exponential beside what was integrated: against 1/(c + d x)^2, a rational function + // of x times e^(-a - b x) for a whole n <= 0, which partial fractions and the exponential + // integral answer. https://github.com/asc-community/AngouriMath/issues/2075 + Entity.IncompleteGammaf => true, // And a whole power of one, which is the same function for this purpose: // differentiating ln(x)^2 gives 2ln(x)/x, whose x cancels against the integrated // polynomial exactly as ln(x)'s does, leaving x*ln(x) -- one step simpler, and diff --git a/Sources/Tests/UnitTests/Calculus/IncompleteGammaIntegrationTest.cs b/Sources/Tests/UnitTests/Calculus/IncompleteGammaIntegrationTest.cs index b6571bf55..4a82b5db1 100644 --- a/Sources/Tests/UnitTests/Calculus/IncompleteGammaIntegrationTest.cs +++ b/Sources/Tests/UnitTests/Calculus/IncompleteGammaIntegrationTest.cs @@ -86,6 +86,18 @@ private static readonly (string Name, string Value)[] Pins = [InlineData("x*(x + 1)*gamma(n, a + b*x)")] public void BesideAPolynomialWithAnOffset(string integrand) => DifferentiatesBack(integrand, Positive); + /// + /// Of a whole order n <= 0 over a power of another linear, by parts with the function differentiated: the + /// remainder is (a + b x)^(n - 1) e^(-a - b x) over a power of c + d x, a rational function times an + /// exponential, which partial fractions and the exponential integral answer. Rubi's 8.6. + /// + [Theory] + [InlineData("gamma(0, a + b*x)/(c + d*x)^2")] + [InlineData("gamma(0, a + b*x)/(c + d*x)^4")] + [InlineData("gamma(-1, a + b*x)/(c + d*x)^3")] + [InlineData("gamma(-3, a + b*x)/(c + d*x)^2")] + public void AWholeOrderOverAPowerOfAnotherLinear(string integrand) => DifferentiatesBack(integrand, Positive); + /// /// As the function it is, rather than expanded: Gamma(100, a x) is a polynomial of degree 99 times /// e^(-a x), and a hundred rounds of parts.