File r34.1/xlog/tps.log artifact dc13c89f67 part of check-in d9e362f11e


Sat May 30 16:26:29 PDT 1992
REDUCE 3.4.1, 15-Jul-92 ...

1: 1: 
2: 2: 
(TPS)

3: 3: 
Time: 85 ms

4: 4: % Author: Alan Barnes <barnesa@uhura.aston.ac.uk>

psexplim 8;


6

% expand as far as 8th power (default is 6)

cos!-series:=ps(cos x,x,0);


                     1    2     1     4      1     6       1      8
COS-SERIES := {1 - (---)*X  + (----)*X  - (-----)*X  + (-------)*X
                     2          24          720          40320
                    9
               + O(X )}

sin!-series:=ps(sin x,x,0);


                     1    3      1     5      1      7      9
SIN-SERIES := {X - (---)*X  + (-----)*X  - (------)*X  + O(X )}
                     6          120          5040

atan!-series:=ps(atan x,x,0);


                      1    3     1    5     1    7      9
ATAN-SERIES := {X - (---)*X  + (---)*X  - (---)*X  + O(X )}
                      3          5          7

tan!-series:=ps(tan x,x,0);


                     1    3     2     5     17     7      9
TAN-SERIES := {X + (---)*X  + (----)*X  + (-----)*X  + O(X )}
                     3          15          315


cos!-series*tan!-series;


       1    3      1     5      1      7      9
{X - (---)*X  + (-----)*X  - (------)*X  + O(X )}
       6          120          5040
        % should series for sin(x)
df(cos!-series,x);


          1    3      1     5      1      7      9
{ - X + (---)*X  - (-----)*X  + (------)*X  + O(X )}
          6          120          5040
              % series for sin(x) again

cos!-series/atan!-series;


  (-1)     1         77     3     313     5     104539     7
{X     - (---)*X - (-----)*X  + (------)*X  - (---------)*X
           6         360          3024          1814400
      9
 + O(X )}


ps(cos!-series/atan!-series,x,0);


  (-1)     1         77     3     313     5     104539     7
{X     - (---)*X - (-----)*X  + (------)*X  - (---------)*X
           6         360          3024          1814400
      9
 + O(X )}
       % should be expanded


tmp:=ps(1/(1+x^2),x,infinity);


         (-2)    (-4)    (-6)    (-8)      (-9)
TMP := {X     - X     + X     - X     + O(X    )}

df(tmp,x);


       (-3)      (-5)      (-7)      (-9)
{ - 2*X     + 4*X     - 6*X     + O(X    )}

ps(df(1/(1+x^2),x),x,infinity);


       (-3)      (-5)      (-7)      (-9)
{ - 2*X     + 4*X     - 6*X     + O(X    )}


tmp*x;


  (-2)    (-4)    (-6)    (-8)      (-9)
{X     - X     + X     - X     + O(X    )}
*X
  % not expanded as a single power series
ps(tmp*x,x,infinity);


  (-1)    (-3)    (-5)    (-7)      (-9)
{X     - X     + X     - X     + O(X    )}
   % now expanded

ps(1/(a*x-b*x^2),x,a/b);


                                      2                 3
       1           (-1)     B        B                 B            2
[{ - (---)*(X - X0)     + (----) - (----)*(X - X0) + (----)*(X - X0)
       A                     2        3                 4
                            A        A                 A

      4                  5                  6
     B            3     B            4     B            5
 - (----)*(X - X0)  + (----)*(X - X0)  - (----)*(X - X0)  + 
      5                  6                  7
     A                  A                  A
     7                  8                  9
    B            6     B            7     B             8
  (----)*(X - X0)  - (----)*(X - X0)  + (-----)*(X - X0)
     8                  9                  10
    A                  A                  A
             9                A
 + O((X - X0) )}  where X0 = ---]
                              B
   % pole at expansion point

ps(cos!-series*x,x,2);



{(2*COS(2)) - (2*SIN(2) - COS(2))*(X - 2) - (SIN(2) + COS(2))*(X - 2)

2     2*SIN(2) - 3*COS(2)          3     2*SIN(2) + COS(2)          4
  + (---------------------)*(X - 2)  + (-------------------)*(X - 2)
               6                                12

     2*SIN(2) - 5*COS(2)          5     3*SIN(2) + COS(2)          6
 - (---------------------)*(X - 2)  - (-------------------)*(X - 2)
             120                               360

     2*SIN(2) - 7*COS(2)          7     4*SIN(2) + COS(2)          8
 + (---------------------)*(X - 2)  + (-------------------)*(X - 2)
            5040                              20160
            9
 + O((X - 2) )}


tmp:=ps(x/atan!-series,x,0);


              1    2     4     4     44     6      428     8
TMP := {1 + (---)*X  - (----)*X  + (-----)*X  - (-------)*X
              3          45          945          14175
             9
        + O(X )}

tmp1:=ps(atan!-series/x,x,0);


               1    2     1    4     1    6     1    8      9
TMP1 := {1 - (---)*X  + (---)*X  - (---)*X  + (---)*X  + O(X )}
               3          5          7          9

tmp*tmp1;


1
               % should be 1, of course


cos!-sin!-series:=ps(cos sin!-series,x,0);


                         1    2     5     4     37     6
COS-SIN-SERIES := {1 - (---)*X  + (----)*X  - (-----)*X  + 
                         2          24          720
                       457     8      9
                    (-------)*X  + O(X )}
                      40320

% cos(sin(x))
tmp:=cos!-sin!-series^2;


             2     2    4     14    6     37     8      9
TMP := {1 - X  + (---)*X  - (----)*X  + (-----)*X  + O(X )}
                   3          45          315

tmp1:=ps((sin(sin!-series))^2,x,0);


          2     2    4     14    6     37     8      9
TMP1 := {X  - (---)*X  + (----)*X  - (-----)*X  + O(X )}
                3          45          315

tmp+tmp1;


        9
{1 + O(X )}
               % sin^2 + cos^2
psfunction tmp1;


           2
SIN(SIN(X))

% function represented by power series tmp1

tmp:=tan!-series^2;


         2     2    4     17    6     62     8      9
TMP := {X  + (---)*X  + (----)*X  + (-----)*X  + O(X )}
               3          45          315

psdepvar tmp;


X

% in case we have forgotten the dependent variable
psexpansionpt tmp;


0
      % .... or the expansion point
psterm(tmp,6);


 17
----
 45
  % select 6th term

tmp1:=ps(1/(cos x)^2,x,0);


              2     2    4     17    6     62     8      9
TMP1 := {1 + X  + (---)*X  + (----)*X  + (-----)*X  + O(X )}
                    3          45          315

tmp1-tmp;


        9
{1 + O(X )}
       % sec^2-tan^2

ps(int(e^(x^2),x),x,0);


       1    3     1     5     1     7      9
{X + (---)*X  + (----)*X  + (----)*X  + O(X )}
       3          10          42
 % integrator not called
tmp:=ps(1/(y+x),x,0);


          1       1          1     2     1     3     1     4
TMP := {(---) - (----)*X + (----)*X  - (----)*X  + (----)*X  - 
          Y        2          3           4           5
                  Y          Y           Y           Y
           1     5     1     6     1     7     1     8      9
         (----)*X  + (----)*X  - (----)*X  + (----)*X  + O(X )}
            6           7           8           9
           Y           Y           Y           Y

ps(int(tmp,y),x,0);


            1          1      2      1      3      1      4
{LOG(Y) + (---)*X - (------)*X  + (------)*X  - (------)*X  + 
            Y            2             3             4
                      2*Y           3*Y           4*Y
     1      5      1      6      1      7      1      8      9
  (------)*X  - (------)*X  + (------)*X  - (------)*X  + O(X )}
       5             6             7             8
    5*Y           6*Y           7*Y           8*Y
     % integrator called on each coefficient

pscompose(cos!-series,sin!-series);


       1    2     5     4     37     6      457     8      9
{1 - (---)*X  + (----)*X  - (-----)*X  + (-------)*X  + O(X )}
       2          24          720          40320

% power series composition cos(sin(x)) again
cos!-sin!-series;


       1    2     5     4     37     6      457     8      9
{1 - (---)*X  + (----)*X  - (-----)*X  + (-------)*X  + O(X )}
       2          24          720          40320

% should be same as previous result
psfunction cos!-sin!-series;


COS(SIN(X))


tmp:=ps(log x,x,1);


                    1          2     1          3     1          4
TMP := {(X - 1) - (---)*(X - 1)  + (---)*(X - 1)  - (---)*(X - 1)  + 
                    2                3                4
           1          5     1          6     1          7
         (---)*(X - 1)  - (---)*(X - 1)  + (---)*(X - 1)  - 
           5                6                7
           1          8            9
         (---)*(X - 1)  + O((X - 1) )}
           8

tmp1:=pscompose(tmp, cos!-series);


              1    2     1     4     1     6      17     8
TMP1 := { - (---)*X  - (----)*X  - (----)*X  - (------)*X
              2          12          45          2520
              9
         + O(X )}

% power series composition of log(cos(x))
df(tmp1,x);


          1    3     2     5     17     7      9
{ - X - (---)*X  - (----)*X  - (-----)*X  + O(X )}
          3          15          315


psreverse tan!-series;


       1    3     1    5     1    7      9
{X - (---)*X  + (---)*X  - (---)*X  + O(X )}
       3          5          7

% should be series for atan y
atan!-series;


       1    3     1    5     1    7      9
{X - (---)*X  + (---)*X  - (---)*X  + O(X )}
       3          5          7

tmp:=ps(e^x,x,0);


                  1    2     1    3     1     4      1     5
TMP := {1 + X + (---)*X  + (---)*X  + (----)*X  + (-----)*X  + 
                  2          6          24          120
            1     6      1      7       1      8      9
         (-----)*X  + (------)*X  + (-------)*X  + O(X )}
           720          5040          40320

psreverse tmp;


             1          2     1          3     1          4
{(X - 1) - (---)*(X - 1)  + (---)*(X - 1)  - (---)*(X - 1)  + 
             2                3                4
    1          5     1          6     1          7     1          8
  (---)*(X - 1)  - (---)*(X - 1)  + (---)*(X - 1)  - (---)*(X - 1)
    5                6                7                8
            9
 + O((X - 1) )}

% NB expansion of log y  in powers of (y-1)

end;

5: 5: 
Time: 1462 ms

6: 6: 
Quitting
Sat May 30 16:26:31 PDT 1992


REDUCE Historical
REDUCE Sourceforge Project | Historical SVN Repository | GitHub Mirror | SourceHut Mirror | NotABug Mirror | Chisel Mirror | Chisel RSS ]