Groups | Search | Server Info | Login | Register


Groups > comp.soft-sys.math.maple > #1373

Re: Bug in series expansion

Newsgroups comp.soft-sys.math.maple
Date 2023-04-18 13:27 -0700
References <40b863b3-7245-4937-af21-cc995aa42b14n@googlegroups.com>
Message-ID <fb245a7b-dfc8-4dc9-b260-3e111c08a9b9n@googlegroups.com> (permalink)
Subject Re: Bug in series expansion
From acer <maple@rogers.com>

Show all headers | View raw


On Tuesday, April 18, 2023 at 6:32:00 AM UTC-4, peter....@gmail.com wrote:
> restart; 
> 
> egf := (1 + x*exp(x*z+z))/(x + 1); 
> egf1 := (1 + x*exp(x*z)*exp(z))/(x + 1); 
> 
> # Maple believes that both expressions are equal: 
> 
> simplify(egf - egf1); 
> 
> # If you expand the exponential gf, it works with 'egf': 
> 
> c := n -> expand(n!*coeff(series(egf, z, 9), z, n)): 
> for n from 0 to 6 do seq(coeff(c(n), x, k), k = 0..n) od; 
> 
> # but not if you use 'egf1' instead of 'egf' in c: 
> # Error, unable to compute coeff

Your use of `expand` is inadequate in that case. Using `normal` instead of `expand`, both cases work.

egf := (1 + x*exp(x*z+z))/(x + 1):
egf1 := (1 + x*exp(x*z)*exp(z))/(x + 1):

simplify(egf - egf1);
                               0

c := n -> normal(n!*coeff(series(egf, z, 9), z, n)):
for n from 0 to 6 do seq(coeff(c(n), x, k), k = 0..n) od;
                               1

                              0, 1

                            0, 1, 1

                           0, 1, 2, 1

                         0, 1, 3, 3, 1

                        0, 1, 4, 6, 4, 1

                     0, 1, 5, 10, 10, 5, 1

c := n -> normal(n!*coeff(series(egf1, z, 9), z, n)):
for n from 0 to 6 do seq(coeff(c(n), x, k), k = 0..n) od;
                               1

                              0, 1

                            0, 1, 1

                           0, 1, 2, 1

                         0, 1, 3, 3, 1

                        0, 1, 4, 6, 4, 1

                     0, 1, 5, 10, 10, 5, 1

Back to comp.soft-sys.math.maple | Previous | NextPrevious in thread | Next in thread | Find similar


Thread

Bug in series expansion "peter....@gmail.com" <peter.luschny@gmail.com> - 2023-04-18 03:31 -0700
  Re: Bug in series expansion acer <maple@rogers.com> - 2023-04-18 13:27 -0700
    Re: Bug in series expansion "peter....@gmail.com" <peter.luschny@gmail.com> - 2023-04-19 04:42 -0700
      Re: Bug in series expansion acer <maple@rogers.com> - 2023-04-19 07:03 -0700
        Re: Bug in series expansion "peter....@gmail.com" <peter.luschny@gmail.com> - 2023-04-19 12:03 -0700
        Re: Bug in series expansion "peter....@gmail.com" <peter.luschny@gmail.com> - 2023-05-01 00:56 -0700

csiph-web