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.

-- 
                              Waldek Hebisch

-- 
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/ZV4Q0cdWEKSQsfXk%40fricas.org.

Reply via email to