diff --git a/Sources/AngouriMath/Functions/Continuous/Integration/IntegralPatterns.cs b/Sources/AngouriMath/Functions/Continuous/Integration/IntegralPatterns.cs
index 1329b1995..0127fae31 100644
--- a/Sources/AngouriMath/Functions/Continuous/Integration/IntegralPatterns.cs
+++ b/Sources/AngouriMath/Functions/Continuous/Integration/IntegralPatterns.cs
@@ -543,10 +543,15 @@ private static bool TakeMomentFactor(Entity factor, bool inverted, Entity.Variab
return sum;
}
- // A power of a linear with an offset, beside an exponential of a linear.
+ // A power of a linear with an offset, beside an exponential of a linear -- or a power of a power of one,
+ // ((c + d x)^n)^m, which stands as written where (c + d x)^(n m) would: its logarithmic derivative is
+ // n m d/(c + d x) on every branch, and that is all the answer asks of it.
if (factorsInX != 1 || !degree.Equals(Entity.Number.Integer.One)
- || single is not Entity.Powf(var linear, var exponentOfLinear) || exponentOfLinear.ContainsNode(x)
- || !TreeAnalyzer.TryGetPolyLinear(linear, x, out var slope, out var offset)
+ || single is not Entity.Powf(var linear, var exponentOfLinear) || exponentOfLinear.ContainsNode(x))
+ return null;
+ while (linear is Entity.Powf(var innerLinear, var innerExponent) && !innerExponent.ContainsNode(x))
+ (linear, exponentOfLinear) = (innerLinear, (innerExponent * exponentOfLinear).InnerSimplified);
+ if (!TreeAnalyzer.TryGetPolyLinear(linear, x, out var slope, out var offset)
|| !TreeAnalyzer.TryGetPolyLinear(term, x, out var rate, out _))
return null;
var exponentOfPower = singleBelow ? (-exponentOfLinear).InnerSimplified : exponentOfLinear;
diff --git a/Sources/Tests/UnitTests/Calculus/APowerBesideAnExponentialOfAPowerIntegralTest.cs b/Sources/Tests/UnitTests/Calculus/APowerBesideAnExponentialOfAPowerIntegralTest.cs
index 1a7e0b76a..26869d95a 100644
--- a/Sources/Tests/UnitTests/Calculus/APowerBesideAnExponentialOfAPowerIntegralTest.cs
+++ b/Sources/Tests/UnitTests/Calculus/APowerBesideAnExponentialOfAPowerIntegralTest.cs
@@ -205,6 +205,16 @@ public void APositiveRateIsTakenOutOfThePower()
[InlineData("x^2*e^(b*(1 + 4*x + 6*x^2 + 4*x^3 + x^4))")]
public void AnExponentThatIsAPowerOfAShiftedLinearWrittenExpanded(string integrand) => DifferentiatesBack(integrand);
+ ///
+ /// A power of a power of a linear, ((d + f x)^n)^m, which is not (d + f x)^(n m) off the right half-line
+ /// but has its logarithmic derivative, and stands as written in the answer where that power would. Rubi's 2.1.
+ ///
+ [Theory]
+ [InlineData("c^(a + b*x)*((d + f*x)^n)^m")]
+ [InlineData("e^(b*x)/((d + f*x)^n)^m")]
+ [InlineData("e^(-x)*((x + d)^2)^m")]
+ public void APowerOfAPowerOfALinear(string integrand) => DifferentiatesBack(integrand);
+
///
/// A power that is not whole of an inverse sine or cosine, which the substitution that undoes it writes as a power of
/// u beside a polynomial in the sine and cosine of u, Euler's formula's exponentials of i u, each a gamma