--Copyright The Numerical Algorithms Group Limited 1991.

)cl all

taylor(n +-> 1/factorial(n),x = 0)      -- expansion of exp(x) at x = 0
taylor(n +-> (-1)**(n-1)/n,x = 1,1..)   -- expansion of log(x) at x = 1
taylor(n +-> (-1)**(n-1)/n,x = 1,1..6)  -- truncated expansion of log(x)

laurent(m +-> m**2,x = 7,-2..)          -- infinite Laurent expansion
laurent(m +-> m**2,x = 7,-2..5)         --   finite Laurent expansion

puiseux(i +-> (-1)**((i-1)/2)/factorial(i),x = 0,1..,2)  -- sin(x) at x = 0
puiseux(i +-> (-1)**(i/2)/factorial(i),x = 0,0..,2)      -- cos(x) at x = 0
-- puiseux(i +-> (-1)**((i-1)/2)/factorial(i),x = 0,1..9,2) -- truncated sin(x)
-- interpretor needs help here
puiseux(i +-> (-1)**((i-1)/2)/factorial(i),x = 0,1..9/1,2) -- truncated sin(x)

puiseux(j +-> j,x = 8,-4/3..,1/2)
puiseux(j +-> j,x = 8,-4/3..1/6,1/2)

-- same computations using expressions instead of functions

taylor(1/factorial(n),n,x = 0)      -- expansion of exp(x) at x = 0
taylor((-1)**(n-1)/n,n,x = 1,1..)   -- expansion of log(x) at x = 1
taylor((-1)**(n-1)/n,n,x = 1,1..6)  -- truncated expansion of log(x)

laurent(m**2,m,x = 7,-2..)          -- infinite Laurent expansion
laurent(m**2,m,x = 7,-2..5)         --   finite Laurent expansion

puiseux((-1)**((i-1)/2)/factorial(i),i,x = 0,1..,2)  -- sin(x) at x = 0
puiseux((-1)**(i/2)/factorial(i),i,x = 0,0..,2)      -- cos(x) at x = 0
-- puiseux((-1)**((i-1)/2)/factorial(i),i,x = 0,1..9,2) -- truncated sin(x)
-- interpretor needs help here
puiseux((-1)**((i-1)/2)/factorial(i),i,x = 0,1..9/1,2) -- truncated sin(x)

puiseux(j,j,x = 8,-4/3..,1/2)
puiseux(j,j,x = 8,-4/3..1/6,1/2)

-- all of the above commands should still work when the functions 'taylor',
-- 'laurent', and 'puiseux' are replaced by 'series':

series(n +-> 1/factorial(n),x = 0)      -- expansion of exp(x) at x = 0
series(n +-> (-1)**(n-1)/n,x = 1,1..)   -- expansion of log(x) at x = 1
series(n +-> (-1)**(n-1)/n,x = 1,1..6)  -- truncated expansion of log(x)

series(m +-> m**2,x = 7,-2..)          -- infinite Laurent expansion
series(m +-> m**2,x = 7,-2..5)         --   finite Laurent expansion

series(i +-> (-1)**((i-1)/2)/factorial(i),x = 0,1..,2)  -- sin(x) at x = 0
series(i +-> (-1)**(i/2)/factorial(i),x = 0,0..,2)      -- cos(x) at x = 0
-- series(i +-> (-1)**((i-1)/2)/factorial(i),x = 0,1..9,2) -- truncated sin(x)
-- interpretor needs help here
series(i +-> (-1)**((i-1)/2)/factorial(i),x = 0,1..9/1,2) -- truncated sin(x)

series(j +-> j,x = 8,-4/3..,1/2)
series(j +-> j,x = 8,-4/3..1/6,1/2)

-- same computations using expressions instead of functions

series(1/factorial(n),n,x = 0)      -- expansion of exp(x) at x = 0
series((-1)**(n-1)/n,n,x = 1,1..)   -- expansion of log(x) at x = 1
series((-1)**(n-1)/n,n,x = 1,1..6)  -- truncated expansion of log(x)

series(m**2,m,x = 7,-2..)          -- infinite Laurent expansion
series(m**2,m,x = 7,-2..5)         --   finite Laurent expansion

series((-1)**((i-1)/2)/factorial(i),i,x = 0,1..,2)  -- sin(x) at x = 0
series((-1)**(i/2)/factorial(i),i,x = 0,0..,2)      -- cos(x) at x = 0
-- series((-1)**((i-1)/2)/factorial(i),i,x = 0,1..9,2) -- truncated sin(x)
-- interpretor needs help here
series((-1)**((i-1)/2)/factorial(i),i,x = 0,1..9/1,2) -- truncated sin(x)

series(j,j,x = 8,-4/3..,1/2)
series(j,j,x = 8,-4/3..1/6,1/2)
