AngouriMath
AngouriMath.Functions.Algebra
Classes within the AngouriMath.Functions.Algebra namespace
AntiderivativeBreaks
Summary
The points strictly inside a numeric range where an antiderivative can stop being
continuous, so that a definite integral is taken through it piece by piece.
Remarks
F(b) - F(a) is the integral only whereF is continuous on[a, b] . A pole
of the integrand between the bounds is a point whereF is not even defined: the
integral of1/x^2 over[-1, 1] came back as-1/x at 1 less-1/x at -1, which is-2 , a negative answer for a positive integrand whose integral
diverges. An antiderivative can also jump where the integrand is continuous, and the
answer through it is then wrong by the jump:arccot(x) jumps at 0 in this library's
convention, and a half-angle substitution writestan(x/2) .
The places read are where a node of the antiderivative stops being continuous: the zeros
of a denominator, of a base raised to a negative power, of a logarithm's argument, of the
argument ofsgn ,arccot ,arcsec andarccsc , and the zeros of the
cosine or the sine under a tangent, secant, cotangent or cosecant of a linear argument.
Where one of them cannot be listed -- a root with a symbol in it, a periodic argument
that is not linear, more breaks than MostBreaks -- the caller is told so,
and integrates as it did before.
A break is carried as its exact point, where the one-sided limits are taken, and its
decimal value, which only orders the breaks and places them in the range.
https://github.com/asc-community/AngouriMath/issues/1508
AsymptoticSeries
Summary
A power series inw aroundw -> 0+ , truncated at a known exponent, whose
coefficients are arbitrary expressions not containingw .
Remarks
This is what Gruntz's algorithm expands in, and it is not a Taylor series: the
exponents may be negative and fractional, and the coefficients are symbolic rather
than numeric. What is wanted from it in the end is only the leading term, but the
leading terms of a sum can cancel -- which is the whole point of the algorithm, since
e^(x + e^-x) - e^x cancels to every order when its two parts are expanded separately
-- so the series has to be carried far enough to see past the cancellation, and how
far that is is not known in advance. The caller raises the order until a leading term
survives.
The value of log(w) is supplied from outside rather than left as a logarithm of
a symbol. Gruntz chooses w as an exponential, so its logarithm is an ordinary
expression in x, and expanding a logarithm needs it: without it the constant term of
log(c * w^e) cannot be told from zero.
BreakpointIntegration
Summary
A definite integral whose integrand can jump inside the range, split at the jumps. A
piecewise breaks where a case's condition changes truth;floor(x) and
ceil(x) break at every whole number. Between two breakpoints the piecewise is one
of its cases and the step is one constant, so the pieces integrate through an
antiderivative and add.
Remarks
F(b) - F(a) is the integral only whereF is continuous on[a, b] , and
an antiderivative found with the piecewise's cases or the floor taken as constants is
continuous between two jumps and not across one. Taken across one it answered
integral(x - floor(x), x, 0, 3) with0 and the tent map's integral over
[0, 1] with1 , where they are3/2 and1/2 ; with a symbolic
bound it answered(n - floor(n))^3 / 3 , and with a piecewise it handed back a
piecewise that still mentioned the integration variable. None of that happens here: an
integrand with a break never goes through an antiderivative between two bounds.
Finitely many breakpoints -- a piecewise whose conditions compare the variable with
numbers -- are collected, the range is cut at the ones inside it, and on each piece the
piecewise is replaced by the case that holds at the piece's midpoint, which is exact
because the condition has no other place to change. A condition that compares the
variable with something symbolic, or a bound that is symbolic, is declined: the pieces
depend on where the jumps fall, and answering across them is what this exists to stop.
A piecewise whose conditions do not mention the variable is a constant here and goes
through the antiderivative as one.
Infinitely many, evenly spaced -- a floor or a ceiling of the variable -- are the
same split written as a sum: on[n, n + 1) the floor isn , the ceiling
n + 1 ,x isn + t witht over[0, 1) , and the integral
over whole bounds is a sum overn of an integral overt with no step in it,
which the summation's closed forms answer;+oo is allowed as the upper bound. A
numeric bound that is not whole contributes the piece up to the nearest whole number,
on which the step is one constant. The fractional partx - floor(x) is substituted
as a unit, since written out it arrives asn + t - n , and a term subtracted from
itself simplifies to a conditional zero rather than to nothing
(#1174).
Offered only where every piece then resolves; an integral rewritten as an unevaluated sum
of unevaluated integrals is not an answer. Question I.2 of
#1212, and the
review of #1215,
which asked for the general mechanism rather than the floor's special case.
CubeRootLogarithmAnsatz
Summary
A rational function ofx and one cube rooty = P(x)^(1/3) of a polynomial,
integrated by an ansatz over logarithms ofL - y for linearL , their
conjugates, and a rational part iny andy^2 .
Remarks
The curve y^3 = P(x) has no rational parametrisation for a cubicP , so no
substitution makes these rational; the ones that are elementary at all -- Welz's
x/((1 + x)(1 - x^3)^(1/3)) ,1/(x^3 - 3x^2 + 7x - 5)^(1/3) ,
(x - 1)/((x + 1)(2 + x^3)^(1/3)) -- are integrated by logarithms of
L(x) - y , withL linear, and of their conjugatesL - w y for the
cube roots of unityw , which pair intoln(L^2 + L y + y^2) and
arctan((2L + y)/(sqrt(3) y)) . The norm(L - y)(L - wy)(L - w^2 y) = L^3 - P is where the logarithm has its poles, so theL that can occur are the ones
whose cube agrees withP at the places the integrand has poles: the linear
function through two points of the curve, or tangent to it at one. Each of those is
a candidate here -- the tangent at a rational pole, at infinity, and at a root of
P ; the line through a pole and a root, or two poles -- and for an irreducible
quadratic factorQ of the denominator withP constant moduloQ ,
the cube roots of that constant times a cube root of unity ofQ[x]/(Q) , which
is whereln(2^(1/3) - y) ,ln(2^(1/3) x + y) and
ln(2^(1/3)(x - 1) - y) in Welz's answers over1 - x + x^2 come from.
The constants those bring in are cube roots of rationals, 2^(1/3) most often,
so the coefficients live inQ(c) withc^3 rational; the linear system is
solved in that field exactly, as polynomials inc reduced moduloc^3 - m ,
rather than numerically -- a symbol forc would not be told from zero at
c^3 - 2 , and a floatingc would give floating coefficients. One such
constant per integrand; two independent ones would need their compositum and are
declined. With symbols in the coefficients and every constant rational, the general
symbolic solver is used instead.
The identity sum c_k g_k' = f is an identity in the function field
Q(x)[y]/(y^3 - P) : everything is brought over one denominator inx , the
numerators reduced byy^3 = P toA + B y + C y^2 , and the three
coefficient polynomials inx matched term by term. The answer is checked against
the integrand at sampled points before it is returned.
https://github.com/asc-community/AngouriMath/issues/718
EquationSolver
Gruntz
Summary
Gruntz's algorithm for the limit of an expression as x tends to positive infinity,
after D. Gruntz, "On Computing Limits in a Symbolic Manipulation System", ETH 1996.
Remarks
The idea is to work out which subexpressions grow fastest, rewrite the expression in
terms of a single one of them, and read the answer off the leading term of the power
series that leaves. Two functions are in the same comparability class when
log|f| / log|g| tends to something finite and non-zero, and the set of subexpressions
in the fastest class present is the mrv set. Every member of it can be written as a
power of any other member times something slower, so one member is picked -- turned
upside down if need be, so that it tends to zero -- and everything is written in terms
of it. What is left is a series in that one quantity, and the sign of the leading
exponent says whether the limit is zero, infinite, or the limit of the leading
coefficient, which is a smaller problem of the same kind.
This answers the limits that defeat term-by-term expansion because the terms cancel to
every order. lim x -> +oo e^(x + e^(-x)) - e^x is the standard one: expanding the two
exponentials separately gives two divergent series whose difference cancels entirely,
while rewriting the whole expression in w = e^(-x) gives (e^w - 1)/w, whose leading
term is 1.
The scope here is the exp-log functions: what can be built from x and the rationals
with the four operations, exp and log. That is the class the algorithm is proved for,
because those functions are eventually monotone and so comparable at all. Anything
else -- a sine, an unknown function, a factorial -- makes this decline rather than
guess, since sin(x) has no limit at infinity and no comparability class either.
IndefiniteIntegralSolver
IntegralPatterns
Integration
LimitFunctional
LimitSolvers
OrdinaryDifferentialEquation
Summary
The first-order linear ordinary differential equation, solved by its integrating factor.
#241Remarks
For y' + f(x) y = g(x) , multiplying through bym = e^(int f dx) makes the left
side the derivative ofm y — which is the whole method, since integrating both sides
then givesm y = int (m g) dx . Nothing here is a heuristic: where the two integrals
come out, the answer is exact, and where either does not this declines.
The unknown is an Application. A bare Variable cannot
stand for a function ofx :derivative(y, x) is0 , becausey does
not containx and the library is right about that. Writtenapply(y, x) it is
an application that does not reduce, and its derivative stays symbolic — which is exactly
what an equation about an unknown function needs.
Linearity is checked, not assumed. The coefficients are read off by differentiating
with respect to the unknown and its derivative, which is only valid if the equation really
is linear in them — so the reading is put back together and compared with what it came
from. An equation that is not linear fails that comparison and is declined rather than
answered wrongly.
RothsteinTrager
Summary
The integral of a rational function with rational coefficients, whatever its
denominator: the Hermite reduction for the rational part of the answer, and the
Rothstein–Trager resultant for the logarithmic part, written in real terms after Rioboo.
Remarks
The partial-fraction rules answer a denominator that factors over the rationals, and
a biquadratic one over the reals, and stop there: Bronstein's
(6 - 3x^2 + x^4)/(4 + 5x^2 - 5x^4 + x^6) has a denominator irreducible over
Q whose real factors carry the roots of a cubic, and its antiderivative is
arctan(x (1 - 3x^2 + x^4)/2) and two more arctangents of linears, with no root
of that cubic anywhere in it. The logarithmic part of the integral ofA/D , with
D squarefree, issum c ln(gcd(D, A - c D')) over the rootsc of the
resultantR(t) = res_x(D, A - t D') , and the residuesc are what decide the
field the answer needs, not the roots ofD : here they are±i/2 and
±i , and the answer is overQ with ani that pairs into arctangents.
This takes the rational part first by the Hermite reduction, then the resultant, its
squarefree decomposition -- a root of multiplicityi is a residue shared by
i roots ofD , and the gcd for it has degreei -- and the
irreducible factors of each squarefree part overQ . A linear factor is a
rational residue and a logarithm; a quadratic one is a pair of conjugate residues
a ± w withw^2 rational, and the gcd is computed inQ(w) : for
w real the pair is two logarithms with a root in them, and forw = i b it
isa ln(P^2 + b^2 Q^2) + b LogToAtan(P, b Q) , Rioboo's continuous arctangent
form. A factor of higher degree puts the residues in a field this does no arithmetic in,
and those logarithms are written as a sum over the roots of the factor of the denominator
they belong to,sum(A(r)/D'(r) ln(x - r), r in { r : E(r) = 0 }) (https://github.com/asc-community/AngouriMath/issues/1285).
Bronstein, Symbolic Integration I, §2.2 (HermiteReduce), §2.5
(IntRationalLogPart) and §2.8 (LogToReal, LogToAtan). The resultant is taken as a
Sylvester determinant rather than from a subresultant remainder sequence, so the gcd
is computed for each residue in its own field instead of being read off the
sequence -- that is the classical Rothstein–Trager rather than Lazard–Rioboo–Trager,
affordable here because the fields are of degree at most two. The answer is checked
against the integrand at sampled points before it is returned.
https://github.com/asc-community/AngouriMath/issues/718
SquareRootLogarithmAnsatz
Summary
A rational function ofx and one square rooty = sqrt(P(x)) of a quadratic,
a cubic or a quartic, integrated by an ansatz over logarithms ofA - B y and
arctangents ofA/(B y) for polynomialsA andB , and a rational
part iny .
Remarks
The curve y^2 = P(x) is elliptic for a squarefree cubic or quarticP , so no
substitution makes these rational; the ones that are elementary at all -- Welz's
(1 + x)/((x - 2) sqrt(1 + x^3)) , which is-(2/3) atanh((1 + x)^2/(3 sqrt(1 + x^3))) ,
Bronstein'sx/sqrt(x^4 + 10x^2 - 96x - 71) -- are integrated by logarithms of
A - B y . The norm(A - By)(A + By) = A^2 - B^2 P is where such a logarithm
has its poles, so theA andB that can occur are the ones for which
A - By vanishes at the places the integrand has poles: at a rational pole
a withP(a) a square,A/B agrees with a branch ofy to some
order there, which is a Padé approximant of the branch's series -- Welz's
(1 + x)^2/3 is the second-order Taylor polynomial ofsqrt(1 + x^3) at
2 , where the norm(1 + x)(2 - x)^3 has its triple root -- and at infinity
likewise for a quartic with a square leading coefficient, which is Bronstein's. Where
P(a) is the negative of a square the branch is imaginary, the conjugate pair of
logarithms is one arctangent ofA/(B y) , and the norm isA^2 + B^2 P .
Each Padé approximant at each place, for a few orders, is a candidate; the identity
sum c_k g_k' = f is one inQ(x)[y]/(y^2 - P) , brought over one denominator
and matched coefficient by coefficient, and solved exactly over the rationals.
An irreducible quadratic factor of the denominator is a pair of conjugate places, at
which the branch begins with a linealpha + beta x over the rationals or a
Q(sqrt(d)) of its own, lifted to any power of the factor; what such a candidate
contributes to the system is the conjugate difference of its logarithms over
sqrt(d) , which is rational, so that candidates over different fields sit in one
system over the rationals. For a quadraticP the curve is rational and Euler's
substitutions answer in principle, but through a rational function whose residues can
lie in a field of degree four -- Timofeev's(3 + x)/((1 + x^2) sqrt(1 + x + x^2)) -- and here it is a logarithm and an arctangent of(1 +- x)/(sqrt(2) y) . A
rational pole whereP is neither a square nor the negative of one wants the field
of its square root, and is left for now. The answer is checked against the integrand at
sampled points before it is returned.
https://github.com/asc-community/AngouriMath/issues/718
Angouri © 2019-2023 · Project's repo · Site's repo · Octicons · Transparency · 4405 pages online