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
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);

/// <summary>
/// A power of a power of a linear, <c>((d + f x)^n)^m</c>, which is not <c>(d + f x)^(n m)</c> 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.
/// </summary>
[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);

/// <summary>
/// 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 <c>i u</c>, each a gamma
Expand Down
Loading