MathGroup Archive 1999

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: infuriating Series[] question

  • To: mathgroup at smc.vnet.net
  • Subject: [mg17289] Re: [mg17226] infuriating Series[] question
  • From: "Andrzej Kozlowski" <andrzej at tuins.ac.jp>
  • Date: Fri, 30 Apr 1999 23:22:24 -0400
  • Sender: owner-wri-mathgroup at wolfram.com

First of all you obviously must have done something slightly different from
what you have described. If you set

In[1]:=
 g[x_] := Series[ f[x], {x,0,10} ]

and then enter, as you say,

In[2]:=
g[10h]
General::ivar: 10 h is not a valid variable.
Out[2]=
Series[f[10 h], {10 h, 0, 10}]

Which is not at all what you wrote  (at least in Mathematica 3.01). So I assume you
meant:

In[3]:=
g[x]/.x->10h
Out[3]=
                                 2    (3)          3
                    f''[0] (10 h)    f   [0] (10 h)
f[0] + f'[0] 10 h + -------------- + --------------- +
                          2                 6

   (4)          4    (5)          5    (6)          6
  f   [0] (10 h)    f   [0] (10 h)    f   [0] (10 h)
  --------------- + --------------- + --------------- +
        24                120               720

   (7)          7    (8)          8    (9)          9
  f   [0] (10 h)    f   [0] (10 h)    f   [0] (10 h)
  --------------- + --------------- + --------------- +
       5040              40320            362880

   (10)          10
  f    [0] (10 h)            11
  ----------------- + O[10 h]
       3628800

which indeed looks like what you have been complaining about. It is true you
can't apply any usual algebraic transformations to this but that's becasuse
this is not a polynomial expression. The answer is: convert it to a
polynomial with Normal and then use Expand:

In[4]:=
Expand[Normal[%]]
Out[4]=
                                        3  (3)
                        2          500 h  f   [0]
f[0] + 10 h f'[0] + 50 h  f''[0] + -------------- +
                                         3

        4  (4)            5  (5)             6  (6)
  1250 h  f   [0]   2500 h  f   [0]   12500 h  f   [0]
  --------------- + --------------- + ---------------- +
         3                 3                 9

          7  (7)              8  (8)
  125000 h  f   [0]   156250 h  f   [0]
  ----------------- + ----------------- +
         63                  63

           9  (9)               10  (10)
  1562500 h  f   [0]   1562500 h   f    [0]
  ------------------ + --------------------
         567                   567

--
Andrzej Kozlowski
Toyama International University
JAPAN
http://sigma.tuins.ac.jp
http://eri2.tuins.ac.jp


----------
>From: Peter Jay Salzman <psalzman at landau.ucdavis.edu>
To: mathgroup at smc.vnet.net
>To: mathgroup at smc.vnet.net
>Subject: [mg17289] [mg17226] infuriating Series[] question
>Date: Mon, Apr 26, 1999, 2:20 PM
>

> Dear all,
>
> I'm trying to develop very high order difference equations, and want to use
> Mathematica to save me from calculating tons of quantities like 5^10 / 7!
>
> If I define:
>    g[x_] := Series[ f[x], {x,0,10} ]
>
> And try to compute stuff like:
>
>    g[5*h] or g[10*h]
>
> It gives me the right answer, but i get terms like
>
>    f'''''[0] * (5 x)^(10) / 10!
>
> The whole point in using Mathematica is so that I don't have to calculate
things
> which look like 5^10 / 10!   (that's factorial, of course, not me being
> emphatic).
>
> Even when I try things like // Simplify or // FullSimplify, Mathematica
refuses to
> simplify these rational coefficients.   One thing I've learned is that
Mathematica
> can do anything -- but figuring out how to do the something is often
> completely not obvious to a nominal user like me.
>
> Can someone tell me the secret here?
>
> Pete
>
> --
> NEWS FLASH:   Just compiled a new kernel 2.2.6!  YEAH!!!
> ----------------------------------------------------------------
> http://landau.ucdavis.edu/psalzman   psalzman at landau.ucdavis.edu
> One world, one web, one program. -- Microsoft Ad Campaign
> Ein Volk, ein Reich, ein Fuhrer. -- Nazi Ad Campaign
> <=>+/\/-=Prevent world domination, Install Linux today!=-\/\+<=>
> ----------------------------------------------------------------
>   The best way to accelerate a win95 system is at 9.81 m/s^2
>
> 


  • Prev by Date: Bezier Splines ???
  • Next by Date: Active Table??
  • Previous by thread: Re: Bezier Splines ???
  • Next by thread: Re: infuriating Series[] question