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
15 changes: 15 additions & 0 deletions BREAKING-CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -619,6 +619,21 @@ and the two together are a polynomial in `e^(i z)` and its reciprocal, multiplie
| `"sqrt(tan(c + d*x))*(A + B*tan(c + d*x))/(a + i*a*tan(c + d*x))".ToEntity().Integrate("x")` | `integral(...)` | arctangents and logarithms of `sqrt(tan(c + d x))` |
| `"(a + i*a*tan(c + d*x))^2*(A + B*tan(c + d*x))/(q - i*q*tan(c + d*x))^4".ToEntity().Integrate("x")` | `integral(...)` | a sum of multiples of `e^(k i (c + d x))` |

### A root over a number times `1 + i tan(z)` is integrated as it is over `a + i a tan(z)`

**Answers where there were none.** `sqrt(c + d tan(x))/(1 + i tan(x))` was declined, where
`sqrt(c + d tan(x))/(a + i a tan(x))` is answered. Under the tangent `1 + i u` beside `1 + u^2` shares
the root `u = i` with it, and the root was taken out first, as `i (u - i)^2 (u + i)`, only where a symbol
stood below the bar: with numbers alone the split over the rationals and `i` was left to answer it,
which it does for a polynomial above the bar and not for a root. The root is taken out beside anything
above the bar that is not a polynomial now
([#1788](https://github.com/asc-community/AngouriMath/issues/1788)).

| Input | Was (2.5.0) | Now |
|---|---|---|
| `"sqrt(c + d*tan(x))/(1 + i*tan(x))".ToEntity().Integrate("x")` | `integral(...)` | arctangents and logarithms of `sqrt(c + d tan(x))` |
| `"(c + d*tan(x))^(3/2)/(1 + i*tan(x))".ToEntity().Integrate("x")` | `integral(...)` | the same, with a multiple of the root |

### A polynomial over a power of one linear with a symbol in it is written in powers of the linear

**Answers where there were none.** `t^9/(a + b t)^8` is a polynomial and eight powers of `1/(a + b t)`,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -782,7 +782,7 @@ is var (multiple, leftover)
// `1/((a + i a tan(x)) (c + d tan(x)))`. The quadratic is written over the linears of
// its roots and the shared one taken as one power, coprime and squarefree for the
// splits below.
if (OverAComplexRootSharedWithAQuadratic(denominator, x) is { } overTheSharedRoot
if (OverAComplexRootSharedWithAQuadratic(numerator, denominator, x) is { } overTheSharedRoot
&& (SolveByPartialFractions(numerator / overTheSharedRoot, x, integrateByParts)
?? Integration.ComputeIndefiniteIntegral(numerator / overTheSharedRoot, x, integrateByParts)) is { } overTheComplexRoot)
return overTheComplexRoot;
Expand Down Expand Up @@ -14371,11 +14371,16 @@ private static bool IsASumOfMonomials(Entity expr, Entity.Variable x)
/// where no quadratic shares such a root. <c>(1 + i x)(1 + x^2)</c> is
/// <c>i (x - i)^2 (x + i)</c>.
/// </summary>
private static Entity? OverAComplexRootSharedWithAQuadratic(Entity denominator, Entity.Variable x)
private static Entity? OverAComplexRootSharedWithAQuadratic(Entity numerator, Entity denominator, Entity.Variable x)
{
// With numbers only, the split over the rationals and the imaginary unit answers it as
// it is written.
if (!denominator.Vars.Any(symbol => symbol != x))
// With numbers only below the bar and a polynomial above it, the split over the
// rationals and the imaginary unit answers it as it is written. Not with a root above
// it: `sqrt(c + d u)/((1 + i u)(1 + u^2))`, which the tangent substitution makes of
// `sqrt(c + d tan(x))/(1 + i tan(x))`, is a question for the substitution in the root,
// and in its variable the shared root is a quadratic beside a quartic, which nothing
// reads; with `a + i a u` for `1 + i u` it was answered, and with the number declined.
// https://github.com/asc-community/AngouriMath/issues/1788
if (!denominator.Vars.Any(symbol => symbol != x) && TreeAnalyzer.TryGetPolynomial(numerator, x, out _))
return null;
var written = new List<(Entity Base, EInteger Power)>();
Entity constant = Number.Integer.One;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -118,5 +118,19 @@ public void AnImaginaryMobiusPowerIsSettled(string integrand)
return;
DifferentiatesBack(integrand);
}

/// <summary>
/// A root above the bar and numbers below it: under the tangent <c>1 + i u</c> beside
/// <c>1 + u^2</c> shares the root <c>u = i</c> with it, and that was taken out only where a
/// symbol stood below the bar, so <c>a + i a tan(x)</c> was answered and
/// <c>1 + i tan(x)</c> declined.
/// https://github.com/asc-community/AngouriMath/issues/1788
/// </summary>
[Theory]
[InlineData("sqrt(c + d*tan(x))/(1 + i*tan(x))")]
[InlineData("sqrt(c + d*tan(x))/(2 + 2*i*tan(x))")]
[InlineData("sqrt(c + d*tan(x))/(1 - i*tan(x))")]
[InlineData("(c + d*tan(x))^(3/2)/(1 + i*tan(x))")]
public void ARootOverANumberTimesAnImaginaryTangentSum(string integrand) => DifferentiatesBack(integrand);
}
}
Loading