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 @@ -12882,9 +12882,15 @@ private static bool TheInverseIsBelowTheBar(Entity expr, Entity inverse, Entity.
// leaves `x^2 arccsc(x)/sqrt(x^2 - 1)` and stalls, where under `x = csc(u)` it is
// `-u^2 csc(u)^4 cot(u)`, two steps of parts against a power of the cosecant.
// Or of a function of it alone -- `(a + b arcsin(c x))^2` -- which is a power of
// u after the substitution.
// u after the substitution. Or, of an inverse sine or cosine, a power that is not whole,
// which parts cannot lower: `x^2 arcsin(a x)^n` under the sine is
// `u^n sin(u)^2 cos(u)/a^3`, Euler's formula's exponentials of `i u` beside a power of u,
// each a gamma function. Not of the others: `1/((c + a^2 c x^2) sqrt(arctan(a x)))` is
// a derivative of the inverse's root, answered in 0.7 s elsewhere and in 5 s under the
// tangent.
var powerOfTheInverse = expr.Nodes.Any(node =>
node is Powf(var @base, Number.Integer power) && power.EInteger.CompareTo(EInteger.One) > 0
node is Powf(var @base, var power)
&& (power is Number.Integer whole ? whole.EInteger.CompareTo(EInteger.One) > 0 : inverse is Arcsinf or Arccosf && !power.ContainsNode(x))
&& @base.ContainsNode(inverse) && !@base.Substitute(inverse, u).ContainsNode(x));
// Or, asked for the sine and cosine integrals, the inverse function below the bar, or
// a function of it alone there: `x^m/(a + b arcsin(c x))^n` is a polynomial in the
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,19 @@ 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 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
/// function. Parts cannot lower such a power, and the substitution was taken only for a whole one. Rubi's 5.1.2,
/// 5.2.2 and 5.1.5.
/// </summary>
[Theory]
[InlineData("asin(a*x)^n")]
[InlineData("x*acos(a*x)^n")]
[InlineData("x^2*(d + f*asin(a*x))^n")]
[InlineData("(c + a*asin(d - a*x))^n")]
public void ASymbolicPowerOfAnInverseSineOrCosine(string integrand) => DifferentiatesBack(integrand);

/// <summary>
/// Not where the integral is elementary, an exponential integral or an error function: those keep the form
/// they had.
Expand Down
Loading