Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions BREAKING-CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,7 @@ as `a - b = 0`, as a statement's own solve reads it: `"x + 1 = 3".Solve("x")` wa
| `"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` |
| `"x^(1/3)*e^(-x)".ToEntity().Integrate("x")` | `integral(x ^ (1/3) * e ^ (-x), x)` | `-gamma(4/3, x) + C` |
| `"x^(1/3)*gamma(2, a + b*x)".ToEntity().Integrate("x")` | a `FunctionArgumentCountException` | `-b * e ^ (-a) * x ^ (7/3) * (b * x) ^ (-7/3) * gamma(7/3, b * x) + -(1 + a) * e ^ (-a) * x ^ (4/3) * (b * x) ^ (-4/3) * gamma(4/3, b * x) + C` |
| `"(c + d*x)^m*e^(a + b*x)".ToEntity().Integrate("x")` | `integral((c + d * x) ^ m * e ^ (a + b * x), x)` | `e ^ (a - b * c / d) * (c + d * x) ^ m * (-b * (c + d * x) / d) ^ (-m) * gamma(m + 1, -b * (c + d * x) / d) / b + C` |
| `"x^31*e^(-x)".ToEntity().Integrate("x")` | a sum of 32 terms, 6,172 characters | `-gamma(32, x) + C` |
| `"integral(e^(x^3), x, 0, 1)".ToEntity().Simplify()` | `integral(e ^ x ^ 3, x, 0, 1)` | `(gamma(1/3, -1) - (-2/3)!) / 3`, which is `1.3419044179774…` |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -435,7 +435,19 @@ private static bool TakeMomentFactor(Entity factor, bool inverted, Entity.Variab
degree = read;
}
else
return null;
{
term = null;
break;
}
// Or a linear written otherwise, as the negation -(a + b x) is, which is how gamma(2, a + b x) is
// elementary: e^(-(a + b x)) (1 + a + b x). https://github.com/asc-community/AngouriMath/issues/2075
if (term is null && TreeAnalyzer.TryGetPolyLinear(exponent, x, out var slopeOfTheExponent, out var offsetOfTheExponent)
&& !TreeAnalyzer.IsZero(slopeOfTheExponent))
{
constant = offsetOfTheExponent;
term = (slopeOfTheExponent * x).InnerSimplified;
degree = Entity.Number.Integer.One;
}
if (term is null || degree is null || TreeAnalyzer.IsZero(degree))
return null;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,10 @@ public void AHighWholePowerIsOneGammaFunction()

[Theory]
[InlineData("(c + d*x)^m*e^(a + b*x)")]
// A linear exponent written as a negation, which is how gamma(2, a + b x) is elementary.
[InlineData("x^(1/3)*e^(-(a + b*x))")]
[InlineData("x^(1/3)*gamma(2, a + b*x)")]
[InlineData("gamma(2, a + b*x)/x^(4/3)")]
[InlineData("(c + d*x)^(1/3)*f^(a + b*x)")]
[InlineData("e^(a + b*x)/(c + d*x)^(4/3)")]
public void APowerOfALinearBesideAnExponentialOfAnother(string integrand) => DifferentiatesBack(integrand);
Expand Down
Loading