diff --git a/Sources/AngouriMath/Functions/Continuous/Integration/IndefiniteIntegralSolver.cs b/Sources/AngouriMath/Functions/Continuous/Integration/IndefiniteIntegralSolver.cs index a5cfa4a96..b0414ac96 100644 --- a/Sources/AngouriMath/Functions/Continuous/Integration/IndefiniteIntegralSolver.cs +++ b/Sources/AngouriMath/Functions/Continuous/Integration/IndefiniteIntegralSolver.cs @@ -18385,7 +18385,8 @@ private static (Entity Logarithm, Entity Degree, Entity Offset, Entity Slope)? T /// /// Whether is a power that is not whole of something holding a logarithm of something in - /// , or an exponential of something in that is not linear in it. + /// , an exponential of something in that is not linear in it, or holds a + /// sine or a cosine of one. /// private static bool IsATranscendentalPowerOfSomethingInX(Entity factor, Entity.Variable x) => factor switch { @@ -18394,8 +18395,13 @@ private static (Entity Logarithm, Entity Degree, Entity Offset, Entity Slope)? T => exponent.Nodes.Any(node => node is Sumf or Minusf && node.ContainsNode(x)) && !TreeAnalyzer.TryGetPolyLinear(exponent, x, out _, out _), Powf(var @base, var exponent) when !exponent.ContainsNode(x) && exponent is not Number.Integer - => @base.Nodes.Any(node => node is Logf(_, var antilogarithm) && antilogarithm.ContainsNode(x)), - _ => false + && @base.Nodes.Any(node => node is Logf(_, var antilogarithm) && antilogarithm.ContainsNode(x)) => true, + // A sine or a cosine of a sum in x that is not linear, in whatever holds it: x sin(a + b (c + d x)^3), and + // x (a + b sin(c + d (f + g x)^n))^2, which in u are powers of u beside the sine of a power of u, Euler's + // formula's exponentials. Rubi's 4.1.12. + _ => factor.Nodes.Any(node => node is Sinf or Cosf && node.DirectChildren.First() is var argument && argument.ContainsNode(x) + && argument.Nodes.Any(inner => inner is Sumf or Minusf && inner.ContainsNode(x)) + && !TreeAnalyzer.TryGetPolyLinear(argument, x, out _, out _)) }; /// diff --git a/Sources/Tests/UnitTests/Calculus/APowerBesideAnExponentialOfAPowerIntegralTest.cs b/Sources/Tests/UnitTests/Calculus/APowerBesideAnExponentialOfAPowerIntegralTest.cs index 4d2473448..4b9f2c7a2 100644 --- a/Sources/Tests/UnitTests/Calculus/APowerBesideAnExponentialOfAPowerIntegralTest.cs +++ b/Sources/Tests/UnitTests/Calculus/APowerBesideAnExponentialOfAPowerIntegralTest.cs @@ -126,14 +126,19 @@ public void APositiveRateIsTakenOutOfThePower() /// /// A polynomial beside a symbolic power of a logarithm of one shifted linear, or an exponential of a power of one, - /// written in u = a + b x, where each term is a gamma function. The constant in front comes along. Rubi's 3.3, - /// 3.4 and 2.3. + /// written in u = a + b x, where each term is a gamma function. The constant in front comes along. And beside + /// a sine or a cosine of a power of one, which in u is Euler's formula's exponentials of a power of u. Rubi's 3.3, + /// 3.4, 2.3 and 4.1.12. /// [Theory] [InlineData("2*x*(a + b*ln(c*(d + f*x)))^n")] [InlineData("x*(a + b*ln(c*(d + f*sqrt(x))))^n")] [InlineData("x^2*f^(c*(a + b*x)^3)")] [InlineData("(a + b*x)^2*e^(-c*(d + f*x)^3)")] + [InlineData("(a + f*x)*sin(b + c*(d + f*x)^3)")] + [InlineData("x*sin(a + b*(c + d*x)^n)")] + [InlineData("x^2*cos(a + b/(c + d*x)^3)")] + [InlineData("x*(a + b*sin(c + d*(f + x)^n))^2")] public void APolynomialBesideAFunctionOfAShiftedLinear(string integrand) => DifferentiatesBack(integrand); ///