Here are my thoughts:
Couldn't we utilize the same trick used in section 2.8
"Riboo's Algorithm for Real Rational Functions"?
From my observations, most (if not all) rootSum has the
following structure:
rootSum(p(a), a*log(q(a)+f(x))), where p,q are polynomials
and f is a general function.
{
rootSum(p(a), a*log(q(a)*g(x)+f(x))) can be written as
rootSum(p(a), a*log(q(a)+f(x)/g(x))+a*log(g(x)))
}
So if p, q have real (this condition can be relaxed?) coefficients, then
rootSum(p(a), a*log(q(a)+f(x))) =
rootSum(p(a) | real? a, a*log(q(a)+f(x))) +
rootSum((u,v), 1/2*u*log((A(u,v) + f(x))^2 + B(u,v)^2)) +
rootSum((u,v), 1/2*v*atan((A(u,v) + f(x))/B(u,v)))
{where u+%i*v is complex root of p(a). q(u+%i*v)= A(u,v) + %i*B(u,v)}
Not that the summation is over all of v, not limited to positive v.
So, then take the limit on x:
The atan is finite, so whether the rootSum is finite depends on the
rootSum part.
If f(x) goes to +infinity, then the rootSum is going to infinity too,
the sign is determined by
rootSum(p(a), a * log(f(x))), which is coefficient(p(a), degree(p) - 1),
which is equal to 0 most of the time?
If f(x) goes to -infinity, well, isn't integrate(1/x,x) is log(abs(x))?
If the rootSum comes from real integral, then taking logs on negative
value could be avoided by abs.
- Qian
On 11/22/23 22:31, Waldek Hebisch wrote:
On Wed, Nov 22, 2023 at 04:35:30AM +0100, Waldek Hebisch wrote:
On Wed, Nov 22, 2023 at 08:20:30AM +0800, Qian Yun wrote:
Can you give a concrete example that limit fails to do
rootSum? Also, is limit on rootSum generally solvable?
A little correction and addition to previous post.
But cases like above should be doable with moderate effort. Namely,
log(x - c) = log(x)*log(1 - c/x)
the second term goes to 1 when x goes to infinity, and we can
write asymptitic expansion of log(x - c). For single term we
get complex coefficients, but rootSum has property that coeficients
of expansion are again rootSum-s and give real values. So
given
\sum_{p(c) = 0} c*log(x - c)
we can compute its asymptotic expansion when x goes to infinity.
In case of convergent integral real parts will give 0. So value
is decided by imaginary parts, that is argument of logs, but this
also goes to 0. A bit more tricky is case when x goes to -infinity.
We can write this as log(-x - c). As first approximation, we
rewrite it as log(-1) + log(x + c). The log(x + c) parts can be
handled as before. The log(-1) part requires extra care, it is
%i*%pi when imaginary part of c is positive and -%i*%pi when imaginary
part of c is negative. So we need to compute
\sum_{Im(c) > 0} c - sum_{Im(c) < 0} c
Multiplied by %i this is real algebraic number and in principle
we should be able to compute its minimal polynomial. If p
has degree 2*k, than degree of minimal polynomial may be
as high as binomial(2*k, k)/2. In first relevant case, that is k=2,
Should be binomial(2*k, k)
degree will be 3 or less, so quite managable. When degree is 3,
^ 6
there is one real root and two complex ones.
2 real roots and 4 complex ones. Actually, in this case when
r is a root also -r is a root. We need to choose positive
real root.
In more general case we may have some rational function of c before
log, the computation should go on with little changes.
ATM most troubling part is how to choose correct root. I expect
two real roots but it is not clear which one is the roght one.
The above is most general integral of rational function over
real numbers, that is when we split polynomials into linear
factors over complex numbers. In practice we get logs of
polynomials of degree bigger than 1. Splitting into linear
factors theoreticaly should work, but is quite heavy. ATM I have
no significantly better idea.
AFAICS splitting is not needed. Just knowing degree d we know
that split will have form
P(x) = \prod((x - c[i]), i = 1..d)
which as before gives 0 in the limit. For limit when x goes to
minus infinity we may observe that it is minus the corresponding
definite integral over the real line. So we can differentiate
to recover the integrand and use residue method to compute
integral over the real line. AFAICS the residue method is
equivalent to computing sum that we considered above, so looks
doable.
There is information loss, for P(x) of even degree trying to
compute limit when x goes to minus infinity by computing
limit of expression built from -x when x goes to plus infinity
leads to wrong result. So it seems that we need special handling
in definite integration code. Also, for limit at finite point
we get rootSum which may be tricky to correctly evaluate
numerically: we need to use correct brach of log and once
polynomial has degree bigger than 1 principal branch may
be wrong.
--
You received this message because you are subscribed to the Google Groups "FriCAS -
computer algebra system" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/fricas-devel/f93bf683-f7af-4208-81e7-f2804bcf9a62%40gmail.com.