Rosetta

  • October 2019
  • PDF

This document was uploaded by user and they confirmed that they have the permission to share it. If you are author or own the copyright of this book, please report to us by using this DMCA report form. Report DMCA


Overview

Download & View Rosetta as PDF for free.

More details

  • Words: 6,498
  • Pages: 33
1

Rosetta Translations 1.1

Introduction

The following is a collection of synonyms for various operations in the computer algebra systems Aldor, Axiom, CoCoA, Derive, DoCon, GAP, Giac, GiNaC, Gmp, Macsyma, Magnus, Maple, Mathcad, Mathematica, Maxima, MuPAD, Octave, Pari, Reduce, Sumˆit, Singular and Yacas. This collection does not attempt to be comprehensive, but hopefully it will be useful in giving an indication of how to translate between the syntaxes used by the different systems in many common situations. Note that a blank entry means either (a) that there may be an exact translation of a particular operation for the indicated system, but we don’t know what it is or (b) there is no exact translation but it may still be possible to work around this lack with a related functionality. While commercial systems are not provided on this CD the intent of the Rosetta effort is to make it possible for experienced Computer Algebra users to experiment with other systems. Thus the commands for commercial systems are included to allow users of those systems to translate. The tables do not cover the full range of functionality and are slanted in favor of general purpose, interactive systems. Some of these systems are special purpose and do not support a lot of the functionality of the more general purpose systems. Where they do support an interpreter the commands are provided. Some systems are primarily development tools rather than interpreters and are not represented in some tables. Originally written by Michael Wester. Modified for Rosetta by Timothy Daly, Alexander Hulpke (GAP), Hans Schoenemann (Singular) and Serge Mechveliani (DoCon). Based on material originally published in Computer Algebra Systems: A Practical Guide edited by Michael J. Wester, John Wiley & Sons, Chichester, United Kingdom, ISBN 0-471-98353-5, xvi+436 pages, 1999.

1.2

System availability

System Aldor Axiom CLN CoCoA Derive DoCon GAP Giac GiNaC Gmp Macsyma Magnus Maxima Maple Mathcad Mathematica Mpfr MuPAD Ntl Octave Pari Reduce Singular Sumˆit Yacas

License BSD open source GPL unknown commercial open source GPL GPL GPL GPL commercial GPL GPL commercial commercial commercial GPL commercial GPL GPL GPL commercial Singular GPL

Status available pending Rosetta Rosetta available available Rosetta Rosetta Rosetta Rosetta dead Rosetta Rosetta available available available Rosetta available Rosetta Rosetta Rosetta available Rosetta pending Rosetta

Web Location http://www.aldor.org http://home.earthlink.net/˜jgg964/axiom.html ftp://ftp.ilog.fr/pub/Users/haible/gnu http://cocoa.dima.unige.it http://www.mathware.com http://www.haskell.org/docon http://www.gap-system.org/˜gap http://www-fourier.ujf-grenoble.fr/˜parisse/giac us.html http://www.ginac.de/Download.html http://www.swox.com/gmp unavailable http://zebra.sci.ccny.cuny.edu/web http://www.ma.utexas.edu/maxima.html http://www.maplesoft.com http://www.mathcad.com http://www.wolfram.com http://www.loria.fr/equipes/polka http://www.mupad.de http://shoup.net/ntl http://www.octave.org http://www.parigp-home.de http://www.zib.de/Symbolik/reduce http://www.singular.uni-kl.de http://www-sop.inria.fr/cafe/Manuel.Bronstein http://yacas.sourceforge.net

Based on material originally published in Computer Algebra Systems: A Practical Guide edited by Michael J. Wester, John Wiley & Sons, Chichester, United Kingdom, ISBN 0-471-98353-5, xvi+436 pages, 1999.

System Aldor Axiom CLN CoCoA Derive DoCon GAP Giac GiNaC Gmp Macsyma Magnus Maxima Maple Mathcad Mathematica Mpfr MuPAD Ntl Octave Pari Reduce Singular Sumˆit Yacas

1.3

Type library development General Purpose arb. prec. arithmetic Commutative Algebra General Purpose General Purpose Group Theory C++ algebra library C++ algebra library arb. prec. arithmetic General Purpose Infinite Group Theory General Purpose General Purpose General Purpose General Purpose arb. prec. arithmetic General Purpose Number Theory library Numerical Computing Number Theory General Purpose Polynomial Computations ODE and Diff. eqns General Purpose

Interpreted, Compiled, Library compiler and library interp and compiled library

interpreted interpreted library library library

library library

library

Programming and Miscellaneous

System GCL GnuPlot Haskell Readline TeXmacs

License GPL GPL GPL GPL GPL

Status Rosetta Rosetta Rosetta Rosetta Rosetta

Web Location http://www.gnu.org/software/gcl http://www.gnuplot.org http://www.haskell.org http://prep.ai.mit.edu/pub/gnu/readline http://www.texmacs.org

Based on material originally published in Computer Algebra Systems: A Practical Guide edited by Michael J. Wester, John Wiley & Sons, Chichester, United Kingdom, ISBN 0-471-98353-5, xvi+436 pages, 1999.

Axiom CoCoA Derive DoCon GAP Giac GiNaC Macsyma Magnus Maple Mathcad Mathematica Maxima MuPAD Octave Pari Reduce Singular Yacas

Unix/Microsoft user initialization file ~/axiom.input ~/init.coc ~/userinit.coc derive.ini ~ /.ghci (interactive system init.) ~/.gaprc GAP.RC ~/.xcasrc ~/macsyma-init.macsyma

mac-init.mac

~/.mapleinit

maplev5.ini

~/init.m ~/macsyma-init.macsyma ~/.mupadinit

init.m mac-init.mac \mupad\bin\userinit.mu

~/.gprc ~/.reducerc ~/.singularrc

reduce.rc ~/.singularrc

Describe keyword Axiom CoCoA Derive DoCon GAP Giac GiNaC Macsyma Magnus Maple Mathcad Mathematica Maxima MuPAD Octave Pari Reduce Singular Yacas

H.Command("");

Find keywords containing pattern )what operations pattern Man("keyword");

?keyword ?keyword

??keyword

describe("keyword")$

apropos("pattern");

?keyword [F1] ?keyword describe("keyword")$ ?keyword help -i keyword

?pattern 1 [Shift][F1] ?*pattern* apropos("pattern"); ?*pattern*

?keyword;

?*pattern*;

1 Only if the pattern is not a keyword and then the matches are simplistic.

Based on material originally published in Computer Algebra Systems: A Practical Guide edited by Michael J. Wester, John Wiley & Sons, Chichester, United Kingdom, ISBN 0-471-98353-5, xvi+436 pages, 1999.

Axiom CoCoA Derive DoCon Giac GAP Macsyma Magnus Maple Mathcad Mathematica Maxima MuPAD Octave Pari Reduce Singular Yacas

Axiom CoCoA Derive DoCon Giac GAP Macsyma Magnus Maple Mathcad Mathematica Maxima MuPAD Octave Pari Reduce Singular Yacas

Comment -- comment -- comment "comment"

Line continuation input input inputinput; input ~input

Prev. expr. % It

Case sensitive Yes Yes No

Variables assumed real real

/* comment */ inputinput; # comment input\input /* comment */ inputinput;

ans() last %

Yes Yes No

real no assumption real

# comment Text Region (* comment *) /* comment */ # comment # ##

inputinput;

%

Yes

complex

inputinput inputinput; inputinput;

% % %

Yes No Yes Yes

complex real complex

% comment // comment

inputinput; inputinput;

ws

No Yes

complex none

Load a file )read "file" )quiet << ’MySession’ [Transfer Load Derive]

Time a command )set messages time on Time T := F();

Quit )quit Quit; or [Quit]

read("file"): Read("file"); load("file")$

always on time; (also see Runtime();) showtime: all$

Ctrl-D/[Quit] quit; quit();

read("file"): File: Open Document << file load("file")$ read("file"): load file

readlib(showtime): on; Timing[command] showtime: all$ time(command); tic(); cmd ; toc()

quit File: Exit Quit[] quit(); quit quit or exit

in "file"$ < "file";

on time; timer=1;

quit; quit;

Based on material originally published in Computer Algebra Systems: A Practical Guide edited by Michael J. Wester, John Wiley & Sons, Chichester, United Kingdom, ISBN 0-471-98353-5, xvi+436 pages, 1999.

Ciao;

Axiom CoCoA Derive DoCon Giac GAP Macsyma Magnus Maple Mathcad Mathematica Maxima MuPAD Octave Pari Reduce Singular Yacas

Axiom CoCoA Derive DoCon Giac GAP Macsyma Magnus Maple Mathcad Mathematica Maxima MuPAD

Octave Pari Reduce Singular Yacas

2 Only

Display output input input; input

Suppress output input; var:= input

Substitution: f (x, y) → f (z, w) subst(f(x, y), [x = z, y = w]) Subst(F,[z,w]); [Manage Substitute]

input input; input;

nodisp(input) input;; input$

subst(f(x, y), [x, y],[z, w]); Value(f,[x,y],[z,w]);2 subst([x = z, y = w], f(x, y));

input;

input:

subs({x = z, y = w}, f(x, y));

input input; input; input

input; input$ input: input;

f[x, y] /. {x -> z, y -> w} subst([x = z, y = w], f(x, y)); subs(f(x, y), [x = z, y = w]);

input; input;

input$ default

sub({x = z, y = w}, f(x, y)); substitute(f,x,z,y,w)

Set set [1, 2] Set([1,2]) {1, 2}

List [1, 2] [1, 2] [1, 2]

Matrix matrix([[1, 2],[3, 4]]) Mat[[1,2],[3,4]]; [[1,2], [3,4]]

set[1,2] Set([1,2]) [1, 2]

[1, 2] [1, 2] [1, 2]

[[1,2], [3,4]] [[1,2], [3,4]]3 matrix([1, 2], [3, 4])

{1, 2}

[1, 2]

{1, 2} [1, 2] {1, 2}

{1, 2} [1, 2] [1, 2]

matrix([[1, 2], [3, 4]]) Math: Matrices {{1, 2}, {3, 4}} matrix([1, 2], [3, 4]) export(Dom): export(linalg): matrix:= ExpressionField(normal)): matrix([[1, 2], [3, 4]])

{1, 2}

{1, 2}

mat((1, 2), (3, 4))

if f is a rational function involving the variables x and y. are special compressed matrices over finite fields

3 There

Based on material originally published in Computer Algebra Systems: A Practical Guide edited by Michael J. Wester, John Wiley & Sons, Chichester, United Kingdom, ISBN 0-471-98353-5, xvi+436 pages, 1999.

Axiom CoCoA Derive DoCon Giac GAP Macsyma Magnus Maple Mathcad Mathematica Maxima MuPAD Octave Pari Reduce Singular Yacas

Axiom CoCoA Derive DoCon Giac GAP Macsyma Magnus Maple Mathcad Mathematica Maxima MuPAD Octave Pari Reduce Singular Yacas

Equation x = 0 x = 0

List element l . 2 L[2] l SUB 2

Matrix element m(2, 3) L[2,3] m SUB 2 SUB 3

Length of a list #l Len(L) DIMENSION(l)

x = 0 x = 0 x = 0

l[2] l[2] l[2]

m[2, 3] m[2][3] m[2, 3]

size(l) Length(l) length(l)

x = 0

m[2, 3] M[2,3 m[[2, 3]] m[2, 3] m[2, 3]

nops(l)

x == 0 x = 0 x = 0

l[2] l[2 l[[2]] l[2] l[2]

x = 0 x == 0

part(l, 2) l[2]

m(2, 3) m[2, 3]

length(l) size(l)

Length[l] length(l) nops(l)

Prepend/append an element to a list cons(e, l) concat(l, e) Concat([E1],L1) Append(L, E) APPEND([e], l) APPEND(l, [e])

Append two append(l1, Concat(L1, APPEND(l1,

prepend(l,e) Concatenation([e],l) cons(e, l)

append(l,e) Add(l,e) endcons(e, l)

concat(l1,l2) Append(l1, l2) append(l1, l2)

[e, op(l)]

[op(l), e]

[op(l1), op(l2)]

Prepend[l, e] cons(e, l) [e, op(l)]

Append[l, e] endcons(e, l) append(l, e)

Join[l1, l2] append(l1, l2) l1 . l2

e . l insert(l,e,1)

append(l, e) insert(l, e, size(l)+1)

append(l1, l2) l1+l2

Based on material originally published in Computer Algebra Systems: A Practical Guide edited by Michael J. Wester, John Wiley & Sons, Chichester, United Kingdom, ISBN 0-471-98353-5, xvi+436 pages, 1999.

lists l2) L2) l2)

Axiom CoCoA Derive DoCon Giac GAP Macsyma Magnus Maple Mathcad Mathematica Maxima MuPAD Octave Pari Reduce

Singular

Matrix column dimension ncols(m) Len(ColumnVectors(M)) DIMENSION(m SUB 1)

Convert a list into a column vector transpose(matrix([l])) Transposed(Mat(Vector([l]))) [l]`

size(mat[0]) Length(mat[1]) mat ncols(m)

tran([l]) objects are identical transpose(matrix(l))

linalg[coldim](m)

linalg[transpose](matrix([l]))

Dimensions[m][[2]] mat ncols(m) linalg::ncols(m)

Transpose[{l}] transpose(matrix(l)) transpose(matrix([l])) 4

load package(linalg)$ column dim(m)

matrix v(length(l), 1)$ for i:=1:length(l) do v(i, 1):= part(l, i) vector v; for(int i=1;i<=size(l);i++) { v[i]=l[i]; }

ncols(m)

Yacas

4 See

the definition of matrix above.

Based on material originally published in Computer Algebra Systems: A Practical Guide edited by Michael J. Wester, John Wiley & Sons, Chichester, United Kingdom, ISBN 0-471-98353-5, xvi+436 pages, 1999.

Axiom CoCoA Derive DoCon Giac GAP Macsyma Magnus Maple Mathcad Mathematica Maxima MuPAD Octave Pari Reduce Singular

Convert a column vector into a list [v(i, 1) for i in 1..nrows(v)] V:=ColumnVectors(M); List(V[1]); v` SUB 1 tran(v)[0] objects are identical part(transpose(v), 1) op(convert(linalg[transpose](v), listlist)) Flatten[v] part(transpose(v), 1) [op(v)]

load package(linalg)$ for i:=1:row dim(v) collect(v(i, 1)) list l; for(int i; i<=size(v);i++) { l[i]=v[i]; }

Yacas

Axiom CoCoA Derive DoCon Giac GAP Macsyma Magnus Maple Mathcad Mathematica Maxima MuPAD Octave Pari Reduce Singular Yacas

5 Some

True true TRUE TRUE

False false FALSE FALSE

And and AND AND

Or or OR OR

Not not NOT NOT

Equal = = =

Not equal ~= <> /=

1 true true

0 false5 false

&& and and

|| or or

! not not

== = =

!= <> #

true

false

and

or

not

=

<>

True true true

False false false

&& and and

|| or or

! not not

== = =

!= # <>

t 1

nil 0

and and

or or

not not

= ==

neq <>

commands may also return fail to indicate failure.

Based on material originally published in Computer Algebra Systems: A Practical Guide edited by Michael J. Wester, John Wiley & Sons, Chichester, United Kingdom, ISBN 0-471-98353-5, xvi+436 pages, 1999.

Axiom CoCoA Derive DoCon Giac GAP Macsyma Magnus Maple Mathcad Mathematica Maxima MuPAD Octave Pari Reduce Singular Yacas

Axiom CoCoA Derive DoCon Giac GAP Macsyma Magnus Maple Mathcad Mathematica Maxima MuPAD Octave Pari Reduce Singular Yacas

If+then+else statements if then else if then else If Then Elsif Then Else End IF( , , IF( , , ))

Strings (concatenated) concat(["x", "y"]) Concat("x","y") "xy"

if ( ){ ; } else { ; } if then elif then else fi if then else if then else

"x"+"y" Concatenation("x","y") concat("x", "y")

if

"x" . "y"

then

elif

then

else

fi

If[ , , If[ , , ]] if then else if then else if then elif then else end if

"x" <> "y" concat("x", "y") "x" . "y"

if then else if if ( ) { } else {

"xy" or "x"+"y"

then }

else

mkid(x, y)

Simple loop and Block for i in 1..n repeat ( x; y ) For I:=1 To N Do End; VECTOR([x, y], i, 1, n)

Generate the list [1, 2, . . . , n] [f(i) for i in 1..n] List(1..10) VECTOR(f(i), i, 1, n)

for (;;){ } for i in [1..n] do od; for i:1 thru n do (x, y);

makelist(f,1,10) [1..n] or [1,2..n] makelist(f(i), i, 1, n);

for i from 1 to n do x; y od;

[f(i) $ i = 1..n];

Do[x; y, {i, 1, n}] for i:1 thru n do (x, y); for i from 1 to n do x; y end for;

Table[f[i], {i, 1, n}] makelist(f(i), i, 1, n); [f(i) $ i = 1..n];

for i:=1:n do <<x; y>>; for(int i=n;i>0;i--) { x;y; }

for i:=1:n collect f(i); list l; for(int i=n;i>0;i--)

Based on material originally published in Computer Algebra Systems: A Practical Guide edited by Michael J. Wester, John Wiley & Sons, Chichester, United Kingdom, ISBN 0-471-98353-5, xvi+436 pages, 1999.

Axiom CoCoA Derive DoCon Giac GAP Macsyma Magnus Maple Mathcad Mathematica Maxima MuPAD Octave Pari Reduce Singular

Complex loop iterating on a list for x in [2, 3, 5] while x**2 < 10 repeat output(x) For X In [2, 3, 5] Do While X^2 < 10 Do PrintLn(X) End; End; l:=[2,3,5]; for (j:=0;(j<size(l)) && (l[j]^2<10);j++){ print(l[j]); } for x in [2, 3, 5] do while x^2<10 do Print(x);od;od; for x in [2, 3, 5] while x^2 < 10 do print(x)$ for x in [2, 3, 5] while x^2 < 10 do print(x) od: For[l l = for x for x end

= {2, 3, 5}, l != {} && l[[1]]^2 < 10, Rest[l], Print[l[[1]]] ] in [2, 3, 5] while x^2 < 10 do print(x)$ in [2, 3, 5] do if x^2 < 10 then print(x) end if for:

for each x in {2, 3, 5} do if x^2 < 10 then write(x)$ for(l=list(2,3,5);size(l>0;l=delete(l,1)) { if(l[1]^ 2<10) { l[1];}}

Yacas

y:= f(x) Y:= F(x); y:= f(x)

Function definition f(x, y) == x*y F(X,Y):=X*Y; f(x, y):= x*y

y:= f(x) y:= f(x); y: f(x);

f(x,y):= x*y f:=function(x, y) return x*y; end; f(x, y):= x*y;

y:= f(x);

f:= proc(x, y) x*y end;

y = f[x] y: f(x); y:= f(x);

f[x , y ]:= x*y f(x, y):= x*y; f:= proc(x, y) begin x*y end proc;

Clear[y, f] remvalue(y)$ y:= NIL: f:= NIL:

y:= f(x); y=f(x);

procedure f(x, y); x*y; proc f(x,y)

clear y, f; kill y,f;

Assignment

Axiom CoCoA Derive DoCon Giac GAP Macsyma

Clear vars and funs )clear properties y f

Delete Y; y:= f:= purge(y) no symbolic variables remvalue(y)$ remfunction(f)$

Magnus Maple Mathcad Mathematica Maxima MuPAD Octave Pari Reduce Singular Yacas

Based on material originally published in Computer Algebra Systems: A Practical Guide edited by Michael J. Wester, John Wiley & Sons, Chichester, United Kingdom, ISBN 0-471-98353-5, xvi+436 pages, 1999.

remfunction(f)$ y:= ’y’: f:= ’f’:

Axiom CoCoA Derive DoCon Giac GAP Macsyma Magnus Maple Mathcad Mathematica Maxima MuPAD Octave Pari Reduce Singular Yacas

Axiom CoCoA Derive DoCon Giac GAP Macsyma Magnus Maple Mathcad Mathematica Maxima MuPAD Octave Pari Reduce Singular

Function definition with a local variable f(x) == (local n; n:= 2; n*x) Define F(X) N:=2; Return N*; End; f(x):={ local n; n:=2; return(n*x); } f:=function(x) local n; n:=2;return n*x; end; f(x):= block([n], n: 2, n*x); f:= proc(x) local n; n:= 2; n*x end; f[x ]:= Module[{n}, n = 2; n*x] f(x):= block([n], n: 2, n*x); f:= proc(x) local n; begin n:= 2; n*x end proc;

procedure f(x); begin scalar n; n:= 2; return(n*x) end; proc f(int x) { int n=2; return(n*x); }

Return unevaluated symbol e:= x*y; ’e

Define a function from an expression function(e, f, x, y)

e:= x*y

f(x, y):== e

’e

e:=x*y quote(e) No unevaluated symbols6 e: x*y$ ’e;

define(f(x, y), e);

e:= x*y:

f:= unapply(e, x, y);

’e’;

f:=program([x,y],[0,0],e)

e = x*y; HoldForm[e] e: x*y$ ’e; e:= x*y: hold(e);

f[x , y ] = e define(f(x, y), e); f:= hold(func)(e, x, y);

e:= x*y$ string e="x*y";

for all x, y let f(x, y):= e; proc f(x,y) { execute("return("+e+");");}

Yacas

6 Variables can be assigned to generators of a suitable free object, for example x:=X(Rationals,"x"); or f:=FreeGroup(2);x:=f.1;.

Based on material originally published in Computer Algebra Systems: A Practical Guide edited by Michael J. Wester, John Wiley & Sons, Chichester, United Kingdom, ISBN 0-471-98353-5, xvi+436 pages, 1999.

Fun. of an indefinite number of args Axiom CoCoA Derive DoCon Giac GAP Macsyma Magnus Maple Mathcad Mathematica Maxima MuPAD Octave Pari Reduce Singular Yacas

LST l:= l lst():= { print(args); } lst:=function(args) end; lst([l]):= l;

’+’([1,2]) Sum([1,2]) apply("+", [1, 2])

lst:=proc() [args[1..nargs]] end;

convert([1, 2], `+`)

lst[l ]:= {l} lst([l]):= l; lst:= proc(l) begin [args()] end proc;

Apply[Plus, {1, 2}] apply("+", [1, 2]) plus(op([1, 2]))

proc f(list #) {

Derive DoCon Giac GAP Macsyma Magnus Maple Mathcad Mathematica Maxima MuPAD Octave Pari Reduce Singular Yacas 7 procedure

xapply(+, {1, 2}) 7

}

Apply a fun. to a list of its args reduce(f, l) Call(Function("F"),l)

Axiom CoCoA

Apply “+” to sum a list reduce(+, [1, 2]) Sum([1,2]);

Map an anonymous function onto a list map(x +-> x + y, [1, 2]) L:=[]; Foreach I In [1,2] Do Append(L,Call(Function("F"),I); End; x:= [1, 2] VECTOR(x SUB i + y, i, 1, DIMENSION(x))

map(f,l) List(l,f) apply(f, l)

NA (C++) List([1,2],x->x+y) map(lambda([x], x + y), [1, 2])

f(op(l))

map(x -> x + y, [1, 2])

Apply[f, l] apply(f, l) f(op(l))

Map[# + y &, {1, 2}] map(lambda([x], x + y), [1, 2]) map([1, 2], func(x + y, x))

xapply(f, l)

for each x in {1, 2} collect x + y

xapply(f, lst); lisp(f . cdr(lst))$

Based on material originally published in Computer Algebra Systems: A Practical Guide edited by Michael J. Wester, John Wiley & Sons, Chichester, United Kingdom, ISBN 0-471-98353-5, xvi+436 pages, 1999.

Axiom

CoCoA Derive DoCon Giac GAP Macsyma

Magnus Maple

Mathcad Mathematica Maxima

MuPAD

Octave Pari Reduce

Pattern matching: f (3y) + f (zy) → 3f (y) + f (zy) f:= operator(’f); ( rule f((n | integer?(n)) * x) == n*f(x) )( f(3*y) + f(z*y))

NA/C++ matchdeclare(n, integerp, x, true)$ defrule(fnx, f(n*x), n*f(x))$ apply1(f(3*y) + f(z*y), fnx); map(proc(q) local m; if match(q = f(n*y), y, ’m’) and type(rhs(op(m)), integer) then subs(m, n * f(y)) else q fi end, f(3*y) + f(z*y)); f[3*y] + f[z*y] /. f[n Integer * x ] -> n*f[x] matchdeclare(n, integerp, x, true)$ defrule(fnx, f(n*x), n*f(x))$ apply1(f(3*y) + f(z*y), fnx); d:= domain("match"): d::FREEVARIABLE:= TRUE: n:= new(d, "n", func(testtype(m, DOM INT), m)): x:= new(d, "x", TRUE): map(f(3*y) + f(z*y), proc(q) local m; begin m:= match(q, f(n*x)); if m = FAIL then q else subs(hold("n" * f("x")), m) end if end proc);

operator f; f(3*y) + f(z*y) where {f(~n * ~x) => n*f(x) when fixp(n)};

Singular Yacas

Based on material originally published in Computer Algebra Systems: A Practical Guide edited by Michael J. Wester, John Wiley & Sons, Chichester, United Kingdom, ISBN 0-471-98353-5, xvi+436 pages, 1999.

Define a new infix operator and then use it Axiom CoCoA Derive DoCon GAP Giac Macsyma Magnus Maple Mathcad Mathematica Maxima MuPAD Octave Pari Reduce Singular Yacas

One can overload existing infix operators for ones own purposes C++ (loadable module) infix("~")$ "~"(x, y):= sqrt(x^2 + y^2)$ 3 ~ 4; `&~`:= (x, y) -> sqrt(x^2 + y^2):

x \[Tilde] y := Sqrt[x^2 + y^2]; 3 \[Tilde] 4 infix("~")$ "~"(x, y):= sqrt(x^2 + y^2)$ 3 ~ 4; tilde:= proc(x, y) begin sqrt(x^2 + y^2) end proc: 3 &tilde 4;

infix |$

procedure |(x, y); sqrt(x^2 + y^2)$

Main expression operator 8

Axiom CoCoA Derive DoCon Giac GAP Macsyma Magnus Maple Mathcad Mathematica Maxima MuPAD Octave Pari Reduce

3 &~ 4;

1st operand kernels(e) . 1

3 | 4;

List of expression operands kernels(e) various9

sommet(e) feuille(e)[0] feuille(e) There are no formal unevaluated expressions part(e, 0) part(e, 1) args(e) op(0, e)

op(1, e)

[op(e)]

Head[e] part(e, 0) op(e, 0)

e[[1]] part(e, 1) op(e, 1)

ReplacePart[e, List, 0] args(e) [op(e)]

part(e, 0)

part(e, 1)

for i:=1:arglength(e) collect part(e, i)

Singular Yacas

8 The following commands work only on expressions that consist of a single level (e.g., x + y + z but not a/b + c/d). 9 TERMS, FACTORS, NUMERATOR, LHS, etc.

Based on material originally published in Computer Algebra Systems: A Practical Guide edited by Michael J. Wester, John Wiley & Sons, Chichester, United Kingdom, ISBN 0-471-98353-5, xvi+436 pages, 1999.

Axiom CoCoA Derive DoCon Giac GAP Macsyma Magnus Maple Mathcad Mathematica Maxima MuPAD Octave Pari Reduce Singular Yacas

Axiom CoCoA Derive DoCon GAP Giac Macsyma Magnus Maple Mathcad Mathematica Maxima MuPAD Octave Pari Reduce Singular

Print text and results output(concat(["sin(", string(0), ") = ", string(sin(0))])); PrintLn "Does Sin exist?"; "sin(0)" = sin(0) print("sin",0,") =",sin(0)) Print("There is no sin, but factors(10)= ",Factors(10), "\n") print("sin(", 0, ") =", sin(0))$ printf("sin(%a) = %a\n", 0, sin(0)): Print[StringForm["sin(``) = ``", 0, Sin[0]]]; print("sin(", 0, ") =", sin(0))$ print(Unquoted, "sin(".0.")" = sin(0)):

write("sin(", 0, ") = ", sin(0))$ "sin(",0,") =", sin(0);

Generate FORTRAN outputAsFortran(e)

Generate TEX/LATEX outputAsTex(e) Latex(e);

[Transfer Save Fortran]

fortran(e)$ or gentran(eval(e))$

Print(LaTeX(e)); C++ gen2tex tex(e);

fortran([e]);

latex(e);

FortranForm[e] fortran(e)$ or gentran(eval(e))$ generate::fortran(e);

TexForm[e] tex(e); generate::TeX(e);

on fort; e; off fort; or load package(gentran)$ gentran e;

load package(tri)$ on TeX; e; off TeX; LIB "latex.lib"; texobj(e);

Yacas

Based on material originally published in Computer Algebra Systems: A Practical Guide edited by Michael J. Wester, John Wiley & Sons, Chichester, United Kingdom, ISBN 0-471-98353-5, xvi+436 pages, 1999.

Import two space separated columns of integers from file Axiom CoCoA Derive DoCon Giac GAP Macsyma Magnus Maple Mathcad Mathematica Maxima MuPAD Octave Pari Reduce Singular Yacas

[Transfer Load daTa] (from file.dat) NA (C++) xy: read num data to matrix("file", nrows, 2)$ xy:= readdata("file", integer, 2): xy = ReadList["file", Number, RecordLists -> True] xy: read num data to matrix("file", nrows, 2)$

Based on material originally published in Computer Algebra Systems: A Practical Guide edited by Michael J. Wester, John Wiley & Sons, Chichester, United Kingdom, ISBN 0-471-98353-5, xvi+436 pages, 1999.

Export two space separated columns of integers to file10 )set output algebra "file" (creates file.spout) for i in 1..n repeat output( concat([string(xy(i, 1)), " ", string(xy(i, 2))]) ) )set output algebra console xy [Transfer Print Expressions File] (creates file.prt)

Axiom

Derive CoCoA DoCon Giac GAP Macsyma Magnus Maple Mathcad Mathematica

Maxima MuPAD Octave Pari Reduce Singular

NA (C++) PrintTo("file");for i in [1..n] do AppendTo("file",xy[i][1]," ",xy[i][2],"\n");od; writefile("file")$ for i:1 thru n do print(xy[i, 1], xy[i, 2])$ closefile()$ writedata("file", xy); outfile = OpenWrite["file"]; Do[WriteString[outfile, xy[[i, 1]], " ", xy[[i, 2]], "\n"], {i, 1, n}] Close[outfile]; writefile("file")$ for i:1 thru n do print(xy[i, 1], xy[i, 2])$ closefile()$ fprint(Unquoted, Text, "file", ("\n", xy[i, 1], xy[i, 2]) $ i = 1..n):

out "file"; for i:=1:n do write(xy(i, 1), " ", xy(i, 2)); shut "file"; link l=":w file";(open(l); for(int i=1;i<=n;i++) { write(l,xy[i,1]," ",xy[i,2]); } close(l);

Yacas

1.4

Mathematics and Graphics

Since GAP aims at discrete mathematics, it does not provide much of the calculus functionality listed in the following section. 10 Some

editing of file will be necessary for all systems but Maple and Mathematica.

Based on material originally published in Computer Algebra Systems: A Practical Guide edited by Michael J. Wester, John Wiley & Sons, Chichester, United Kingdom, ISBN 0-471-98353-5, xvi+436 pages, 1999.

Axiom CoCoA Derive DoCon GAP Giac Macsyma Magnus Maple Mathcad Mathematica Maxima MuPAD Octave Pari Reduce Singular Yacas

Axiom CoCoA Derive DoCon Giac GAP Macsyma Magnus Maple Mathcad Mathematica Maxima MuPAD Octave Pari Reduce Singular Yacas



21/3 2**(1/3)

e %e

π %pi

i %i

+∞ %plusInfinity

#e

pi

#i

inf

2 sqrt(2) Isqrt(2) SQRT(2)

e %e

pi %pi

E(4) i %i

infinity +infinity inf

ER(2)11 sqrt(2) sqrt(2)

2^(1/3) 2^(1/3)

exp(1)

Pi

I

infinity

sqrt(2)

2^(1/3)

E %e E

Pi %pi PI

I %i I

Infinity inf infinity

Sqrt[2] sqrt(2) sqrt(2)

2^(1/3) 2^(1/3) 2^(1/3)

e

pi

i

infinity

sqrt(2)

2^(1/3)

2^(1/3)

Euler’s constant

Natural log log(x)

Arctangent atan(x)

n! factorial(n)

euler gamma

LOG(x)

ATAN(x)

n!

-psi(1)

atan(x)

%gamma

log(x) LogInt(x,base) log(x)

atan(x)

factorial(n) Factorial(n) n!

gamma

log(x)

arctan(x)

n!

EulerGamma %gamma EULER

Log[x] log(x) ln(x)

ArcTan[x] atan(x) atan(x)

n! n! n!

Euler Gamma

log(x)

atan(x)

factorial(n)

11 ER

represents special cyclotomic numbers and is not a root function.

Based on material originally published in Computer Algebra Systems: A Practical Guide edited by Michael J. Wester, John Wiley & Sons, Chichester, United Kingdom, ISBN 0-471-98353-5, xvi+436 pages, 1999.

Axiom CoCoA Derive DoCon GAP Giac Macsyma Magnus Maple Mathcad Mathematica Maxima MuPAD Octave Pari Reduce Singular Yacas

Axiom CoCoA Derive DoCon GAP Giac Macsyma Magnus Maple Mathcad Mathematica Maxima MuPAD Octave Pari Reduce Singular

Legendre polynomial legendreP(n, x)

Chebyshev poly. of the 1st kind chebyshevT(n, x)

LEGENDRE P(n, x)

CHEBYCHEV T(n, x)

legendre(n) legendre p(n, x)

tchebyshev1(n) chebyshev t(n, x)

orthopoly[P](n, x)

orthopoly[T](n, x)

LegendreP[n, x] legendre p(n, x) orthpoly::legendre(n, x)

ChebyshevT[n, x] chebyshev t(n, x) orthpoly::chebyshev1(n, x)

LegendreP(n, x)

ChebyshevT(n, x)

Fibonacci number fibonacci(n)

Elliptic integral of the 1st kind

FIBONACCI(n)

ELLIPTIC E(phi, k^2)

Fibonacci(n) fib(n)

elliptic e(phi, k^2)

combinat[fibonacci](n)

EllipticE(sin(phi), k)

Fibonacci[n] fib(n) numlib::fibonacci(n)

EllipticE[phi, k^2] elliptic e(phi, k^2)

EllipticE(phi, k^2) LIB "general.lib"; fibonacci(n);

Yacas

Based on material originally published in Computer Algebra Systems: A Practical Guide edited by Michael J. Wester, John Wiley & Sons, Chichester, United Kingdom, ISBN 0-471-98353-5, xvi+436 pages, 1999.

Axiom CoCoA Derive DoCon GAP Giac Macsyma Magnus Maple Mathcad Mathematica Maxima MuPAD Octave Pari Reduce Singular Yacas

Γ(x) Gamma(x)

ψ(x) psi(x)

Cosine integral real(Ei(%i*x))

Bessel fun. (1st ) besselJ(n, x)

GAMMA(x)

PSI(x)

CI(x)

BESSEL J(n, x)

gamma(x) gamma(x)

psi(x) psi[0](x)

cos int(x)

bessel j[n](x)

GAMMA(x)

Psi(x)

Ci(x)

BesselJ(n, x)

Gamma[x] gamma(x) gamma(x)

PolyGamma[x] psi[0](x) psi(x)

CosIntegral[x] cos int(x)

BesselJ[n, x] bessel j[n](x) besselJ(n, x)

Gamma(x)

Psi(x)

Ci(x)

BesselJ(n, x)

Hypergeometric fun. 2 F1 (a, b; c; x) Axiom CoCoA Derive DoCon GAP Giac Macsyma Magnus Maple Mathcad Mathematica Maxima MuPAD Octave Pari Reduce Singular Yacas

Dirac delta

GAUSS(a, b, c, x)

Unit step fun.

STEP(x)

hgfred([a, b], [c], x)

delta(x)

unit step(x)

hypergeom([a, b], [c], x)

Dirac(x)

Heaviside(x)

HypergeometricPFQ[{a,b},{c},x] hgfred([a, b], [c], x)

<< Calculus`DiracDelta` delta(x) unit step(x) dirac(x) heaviside(x)

hypergeometric({a, b}, {c}, x)

Based on material originally published in Computer Algebra Systems: A Practical Guide edited by Michael J. Wester, John Wiley & Sons, Chichester, United Kingdom, ISBN 0-471-98353-5, xvi+436 pages, 1999.

Define |x| via a piecewise function Axiom CoCoA Derive DoCon GAP Giac Macsyma Magnus Maple Mathcad Mathematica Maxima MuPAD

a(x):= -x*CHI(-inf, x, 0) + x*CHI(0, x, inf)

a(x):= -x*unit step(-x) + x*unit step(x)$ a:= x -> piecewise(x < 0, -x, x): << Calculus`DiracDelta` a[x ]:= -x*UnitStep[-x] + x*UnitStep[x] a(x):= -x*unit step(-x) + x*unit step(x)$ a:= proc(x) begin -x*heaviside(-x) + x*heaviside(x) end proc:

Octave Pari Reduce Singular Yacas

Axiom CoCoA Derive DoCon GAP Giac Macsyma Magnus Maple Mathcad Mathematica Maxima MuPAD Octave Pari Reduce Singular Yacas

Assume x is real

Remove that assumption

x :epsilon Real

x:=

assume(x,real) declare(x, real)$

purge(x) remove(x, real)$

assume(x, real);

x:= ’x’:

x/: Im[x] = 0; declare(x, real)$ assume(x, Type::RealNum):

Clear[x] remove(x, real)$ unassume(x, Type::RealNum):

Based on material originally published in Computer Algebra Systems: A Practical Guide edited by Michael J. Wester, John Wiley & Sons, Chichester, United Kingdom, ISBN 0-471-98353-5, xvi+436 pages, 1999.

Axiom CoCoA Derive DoCon GAP Giac Macsyma Magnus Maple Mathcad Mathematica Maxima MuPAD Octave Pari Reduce Singular Yacas

Axiom CoCoA Derive DoCon GAP Giac Macsyma Magnus Maple Mathcad Mathematica Maxima MuPAD Octave Pari Reduce Singular Yacas

12 This

Assume 0 < x ≤ 1

Remove that assumption

x :epsilon (0, 1]

x:=

assume(x>0 && x<=1) assume(x > 0, x <= 1)$

purge(x) forget(x > 0, x <= 1)$

assume(x > 0); additionally(x <= 1);

x:= ’x’:

Assumptions -> 0 < x <= 1 12 assume(x > 0, x <= 1)$ assume(x > 0): assume(x <= 1):

forget(x > 0, x <= 1)$ unassume(x):

Basic simplification of an expression e simplify(e) or normalize(e) or complexNormalize(e) e e simplify(e) ratsimp(e) or

radcan(e)

simplify(e) Simplify[e] or FullSimplify[e] ratsimp(e) or radcan(e) simplify(e) or normal(e)

e

is an option for Integrate.

Based on material originally published in Computer Algebra Systems: A Practical Guide edited by Michael J. Wester, John Wiley & Sons, Chichester, United Kingdom, ISBN 0-471-98353-5, xvi+436 pages, 1999.

Axiom CoCoA Derive

DoCon Giac GAP Macsyma Magnus Maple Mathcad Mathematica Maxima MuPAD Octave Pari Reduce

Use an unknown function f:= operator(’f); f(x)

Numerically evaluate an expr. exp(1) :: Complex Float

f(x):= f(x)

Precision:= Approximate APPROX(EXP(1)) Precision:= Exact

f(x) f(x)

evalf(exp(1)) EvalF(123/456) sfloat(exp(1));

f(x)

evalf(exp(1));

f[x] f(x) f(x)

N[Exp[1]] sfloat(exp(1)); float(exp(1));

operator f;

f(x)

on rounded; off rounded;

exp(1);

Singular Yacas

Axiom CoCoA Derive DoCon GAP Giac Macsyma Magnus Maple Mathcad Mathematica Maxima MuPAD Octave Pari Reduce Singular Yacas

n mod m rem(n, m)

Solve e ≡ 0 mod m for x solve(e = 0 :: PrimeField(m), x)

MOD(n, m)

SOLVE MOD(e = 0, x, m)

n mod m n % m mod(n, m)

solve using finite fields

n mod m

msolve(e = 0, m)

Mod[n, m] mod(n, m) n mod m

Solve[{e == 0, Modulus == m}, x] modulus: m$ solve(e = 0, x) solve(poly(e = 0, [x], IntMod(m)), x)

on modular; setmod m$ n n mod m

load package(modsr)$ on modular; setmod m$ m solve(e = 0, x)

modulus: m$

solve(e = 0, x)

Based on material originally published in Computer Algebra Systems: A Practical Guide edited by Michael J. Wester, John Wiley & Sons, Chichester, United Kingdom, ISBN 0-471-98353-5, xvi+436 pages, 1999.

Axiom CoCoA Derive DoCon GAP Giac Macsyma Magnus Maple Mathcad Mathematica Maxima MuPAD Octave Pari Reduce Singular Yacas

Axiom CoCoA Derive DoCon GAP Giac Macsyma Magnus Maple Mathcad Mathematica Maxima MuPAD Octave Pari Reduce Singular Yacas

Put over common denominator a/b + c/d

Expand into separate fractions (a*d + b*c)/(b*d) :: MPOLY([a], FRAC POLY INT)

FACTOR(a/b + c/d, Trivial)

EXPAND((a*d + b*c)/(b*d))

a/b+c/d normal(a/b + c/d) xthru(a/b + c/d)

expand((a*d + b*c)/(b*d))

normal(a/b + c/d)

expand((a*d + b*c)/(b*d))

Together[a/b + c/d] xthru(a/b + c/d) normal(a/b + c/d)

Apart[(a*d + b*c)/(b*d)] expand((a*d + b*c)/(b*d)) expand((a*d + b*c)/(b*d))

a/b + c/d a/b + c/d

on div; (a*d + b*c)/(b*d) (a*d + b*c)/(b*d)

Manipulate the root of a polynomial a:= rootOf(x**2 - 2); a**2

x:=X(Rationals,"x"); a:=RootOfDefiningPolynomial(AlgebraicExtension(Rationals,x^2-2)); a^2 x:=rootof([1,0],[1,0,-2]) algebraic:true$ tellrat(a^2 - 2)$ rat(a^2); a:= RootOf(x^2 - 2):

simplify(a^2);

a = Root[#^2 - 2 &, 2] a^2 algebraic:true$ tellrat(a^2 - 2)$

load package(arnum)$

rat(a^2);

defpoly(a^2 - 2);

a^2;

Based on material originally published in Computer Algebra Systems: A Practical Guide edited by Michael J. Wester, John Wiley & Sons, Chichester, United Kingdom, ISBN 0-471-98353-5, xvi+436 pages, 1999.

Axiom CoCoA Derive

DoCon Giac GAP Macsyma Magnus Maple Mathcad Mathematica Maxima MuPAD Octave Pari Reduce

Noncommutative multiplication

Solve a pair of equations solve([eqn1, eqn2], [x, y])

x :epsilon Nonscalar y :epsilon Nonscalar x . y

SOLVE([eqn1, eqn2], [x, y])

NA * x . y

solve([eqn1, eqn2], [x, y])

x &* y

solve({eqn1, eqn2}, {x, y})

x ** y x . y

Solve[{eqn1, eqn2}, {x, y}] solve([eqn1, eqn2], [x, y]) solve({eqn1, eqn2}, {x, y})

operator x, y; noncom x, y; x() * y()

solve({eqn1, eqn2}, {x, y})

Singular

solve([eqn1, eqn2], [x, y])

LIB "solve.lib"; solve(ideal(eqn1,eqn2));

Yacas

Axiom CoCoA Derive DoCon GAP Giac Macsyma Magnus Maple Mathcad Mathematica Maxima MuPAD Octave Pari Reduce

Decrease/increase angles in trigonometric functions simplify(normalize(sin(2*x))) Trigonometry:= Expand sin(2*x)

Trigonometry:= Collect 2*sin(x)*cos(x)

texpand(sin(2*x)) trigexpand(sin(2*x))

tlin(2*sin(x)*cos(x)) trigreduce(2*sin(x)*cos(x))

expand(sin(2*x))

combine(2*sin(x)*cos(x))

TrigExpand[Sin[2*x]] trigexpand(sin(2*x)) expand(sin(2*x))

TrigReduce[2*Sin[x]*Cos[x]] trigreduce(2*sin(x)*cos(x)) combine(2*sin(x)*cos(x), sincos)

load package(assist)$ trigexpand(sin(2*x))

trigreduce(2*sin(x)*cos(x))

Singular Yacas Based on material originally published in Computer Algebra Systems: A Practical Guide edited by Michael J. Wester, John Wiley & Sons, Chichester, United Kingdom, ISBN 0-471-98353-5, xvi+436 pages, 1999.

Axiom CoCoA Derive DoCon GAP Giac Macsyma Magnus Maple Mathcad Mathematica Maxima MuPAD Octave Pari Reduce Singular Yacas

Axiom CoCoA Derive DoCon GAP Giac Macsyma Magnus Maple Mathcad Mathematica Maxima MuPAD Octave Pari Reduce Singular Yacas

Gr¨ obner basis groebner([p1, p2, ...]) GBasis(Ideal(p1, p2, ...));

gbasis([p1,p2,...],[x,y,...]) grobner([p1, p2, ...]) Groebner[gbasis]([p1, p2, ...], plex(x1, x2, ...)) GroebnerBasis[{p1, p2, ...}, {x1, x2, ...}] grobner([p1, p2, ...]) groebner::gbasis([p1, p2, ...])

load package(groebner)$ groebner({p1, p2, ...}) groebner(ideal(p1,p2 ...)) √ Factorization of e over i = −1 factor(e, [rootOf(i**2 + 1)]) FACTOR(e, Complex) Factors(GaussianIntegers,e) factor(e) in complex mode gfactor(e); or factor(e, i^2 + 1); factor(e, I); Factor[e, Extension -> I] gfactor(e); or factor(e, i^2 + 1); QI:= Dom::AlgebraicExtension(Dom::Rational, i^2 + 1); QI::name:= "QI": Factor(poly(e, QI));

on complex, factor; e; off complex, factor; ring C=(0,i),x,dp;minpoly=i2+1;factorize(e);

Based on material originally published in Computer Algebra Systems: A Practical Guide edited by Michael J. Wester, John Wiley & Sons, Chichester, United Kingdom, ISBN 0-471-98353-5, xvi+436 pages, 1999.

Axiom CoCoA Derive DoCon GAP Giac Macsyma Magnus Maple Mathcad Mathematica Maxima MuPAD Octave Pari Reduce Singular Yacas

Axiom CoCoA Derive DoCon GAP Giac Macsyma Magnus Maple Mathcad Mathematica Maxima MuPAD Octave Pari Reduce Singular Yacas

Real part real(f(z))

Convert a complex expr. to rectangular form complexForm(f(z))

RE(f(z))

f(z)

(f(z)+GaloisCyc(f(z),-1))/2 re(f(z)) realpart(f(z))

re(f(z))+i*im(f(z)) rectform(f(z))

Re(f(z))

evalc(f(z))

Re[f[z]] realpart(f(z)) Re(f(z))

ComplexExpand[f[z]] rectform(f(z)) rectform(f(z))

repart(f(z)) repart(f(z)) * repart(f(z)) + i*impart(f(z))

repart(f(z)) + i*impart(f(z))

Matrix addition A + B A + B; A + B

Matrix multiplication A * B A * B; A . B

Matrix transpose transpose(A) Transposed(A); A`

A + B A + B A + B

A * B A * B A . B

TransposedMat(A) tran(A) transpose(A)

evalm(A + B)

evalm(A &* B)

linalg[transpose](A)

A + B A + B A + B

A . B A . B A * B

Transpose[A] transpose(A) transpose(A)

A + B A + B

A * B A * B

tp(A) transpose(A)

Based on material originally published in Computer Algebra Systems: A Practical Guide edited by Michael J. Wester, John Wiley & Sons, Chichester, United Kingdom, ISBN 0-471-98353-5, xvi+436 pages, 1999.

Axiom CoCoA Derive DoCon GAP Giac Macsyma Magnus Maple Mathcad Mathematica Maxima

Solve the matrix equation Ax = b solve(A, transpose(b)) . 1 . particular :: Matrix

SolutionMat(TransposedMat(A),b) NA rref(tran(concat(tran(A),[b]))) or inv(A)*b xx: genvector(’x, mat nrows(b))$ x: part(matlinsolve(A . xx = b, xx), 1, 2) x:= linalg[linsolve](A, b) x = LinearSolve[A, b] xx: genvector(’x, mat nrows(b))$ x: part(matlinsolve(A . xx = b, xx), 1, 2)

MuPAD Octave Pari Reduce Singular Yacas

Axiom CoCoA

Derive DoCon GAP Giac Macsyma Magnus Maple Mathcad Mathematica Maxima MuPAD Octave Pari Reduce Singular Yacas

n Sum: i=1 f (i) sum(f(i), i = 1..n) L:=[]; Foreach I In 1..N Do Append(L,F(I)); End; Sum(L); SUM(f(i), i, 1, n)

n Product: i=1 f (i) product(f(i), i = 1..n) L:=[]; Foreach I in 1..N Do Append(L,F(I)); End; Product(L); PRODUCT(f(i), i, 1, n)

Sum([1..n],f) sum(1/j,j,1..n) closedform( sum(f(i), i, 1, n))

Product([1..n],f) NA closedform( product(f(i), i, 1, n))

sum(f(i), i = 1..n)

product(f(i), i = 1..n)

Sum[f[i], {i, 1, n}] closedform( sum(f(i), i, 1, n)) sum(f(i), i = 1..n)

Product[f[i], {i, 1, n}] closedform( product(f(i), i, 1, n)) product(f(i), i = 1..n)

sum(f(i), i, 1, n)

prod(f(i), i, 1, n)

Based on material originally published in Computer Algebra Systems: A Practical Guide edited by Michael J. Wester, John Wiley & Sons, Chichester, United Kingdom, ISBN 0-471-98353-5, xvi+436 pages, 1999.

Axiom CoCoA Derive DoCon GAP Giac Macsyma Magnus Maple Mathcad Mathematica Maxima MuPAD Octave Pari Reduce Singular Yacas

Limit: limx→0− f (x) limit(f(x), x = 0, "left")

Taylor/Laurent/etc. series series(f(x), x = 0, 3)

LIM(f(x), x, 0, -1)

TAYLOR(f(x), x, 0, 3)

limit(f(x),x=0,-1) limit(f(x), x, 0, minus)

series(f(x),x=0,3) taylor(f(x), x, 0, 3)

limit(f(x), x = 0, left)

series(f(x), x = 0, 4)

Limit[f[x], x->0, Direction->1] limit(f(x), x, 0, minus) limit(f(x), x = 0, Left)

Series[f[x],{x, 0, 3}] taylor(f(x), x, 0, 3) series(f(x), x = 0, 4)

limit!-(f(x), x, 0)

taylor(f(x), x, 0, 3)

Differentiate: ddxf (x,y) dy 2 D(f(x, y), [x, y], [1, 2])

1 Integrate: 0 f (x) dx integrate(f(x), x = 0..1)

DIF(DIF(f(x, y), x), y, 2)

INT(f(x), x, 0, 1)

diff(f(x,y),[x,y],[1,2]) diff(f(x, y), x, 1, y, 2)

integrate(f(x),x,0,1) integrate(f(x), x, 0, 1)

diff(f(x, y), x, y$2)

int(f(x), x = 0..1)

D[f[x, y], x, {y, 2}] diff(f(x, y), x, 1, y, 2) diff(f(x, y), x, y$2)

Integrate[f[x], {x, 0, 1}] integrate(f(x), x, 0, 1) int(f(x), x = 0..1)

df(f(x, y), x, y, 2) diff(diff(diff(f,x),y),y)

int(f(x), x, 0, 1)

3

Axiom CoCoA Derive DoCon GAP Giac Macsyma Magnus Maple Mathcad Mathematica Maxima MuPAD Octave Pari Reduce Singular Yacas

Based on material originally published in Computer Algebra Systems: A Practical Guide edited by Michael J. Wester, John Wiley & Sons, Chichester, United Kingdom, ISBN 0-471-98353-5, xvi+436 pages, 1999.

Axiom CoCoA Derive DoCon GAP Giac Macsyma Magnus Maple Mathcad Mathematica Maxima MuPAD Octave Pari Reduce

Laplace transform laplace(e, t, s)

Inverse Laplace transform inverseLaplace(e, s, t)

LAPLACE(e, t, s)

laplace(e,t,s) laplace(e, t, s)

ilaplace(e,s,t) ilt(e, s, t)

inttrans[laplace](e,t,s)

inttrans[invlaplace](e,s,t)

<< Calculus`LaplaceTransform` LaplaceTransform[e, t, s] InverseLaplaceTransform[e,s,t] laplace(e, t, s) ilt(e, s, t) transform::laplace(e,t,s) transform::ilaplace(e, s, t)

load package(laplace)$ laplace(e, t, s)

load package(defint)$ invlap(e, t, s)

Singular Yacas

Axiom CoCoA Derive DoCon GAP Giac Macsyma Magnus Maple Mathcad Mathematica Maxima MuPAD Octave Pari Reduce Singular Yacas

Solve an ODE (with the initial condition y  (0) = 1) solve(eqn, y, x) APPLY IC(RHS(ODE(eqn, x, y, y )), [x, 0], [y, 1])

desolve([y’+y=sin(x),y’(0)=1],x,y) ode ibc(ode(eqn, y(x), x), x = 0, diff(y(x), x) = 1) dsolve({eqn, D(y)(0) = 1}, y(x)) DSolve[{eqn, y’[0] == 1}, y[x], x] ode ibc(ode(eqn, y(x), x), x = 0, diff(y(x), x) = 1) solve(ode({eqn, D(y)(0) = 1}, y(x)))

odesolve(eqn, y(x), x)

Based on material originally published in Computer Algebra Systems: A Practical Guide edited by Michael J. Wester, John Wiley & Sons, Chichester, United Kingdom, ISBN 0-471-98353-5, xvi+436 pages, 1999.

Define the differential operator L = Dx + I and apply it to sin x DD : LODO(Expression Integer, e +-> D(e, x)) := D(); L:= DD + 1; L(sin(x))

Axiom CoCoA Derive DoCon GAP Giac Macsyma Magnus Maple Mathcad Mathematica Maxima MuPAD Octave Pari Reduce Singular Yacas

Axiom CoCoA Derive DoCon GAP Giac Macsyma Magnus Maple Mathcad Mathematica Maxima MuPAD Octave Pari Reduce Singular

NA load(opalg)$

L: (diffop(x) - 1)$

id:= x -> x:

L:= (D + id):

L(sin(x));

L(sin)(x);

L = D[#, x]& + Identity; Through[L[Sin[x]]] load(opalg)$ L: (diffop(x) - 1)$ L(sin(x)); L:= (D + id): L(sin)(x);

2D plot of two separate curves overlayed draw(x, x = 0..1); draw(acsch(x), x = 0..1); [Plot Overlay]

plotfunc(x,x); plotfunc(sin(x),x); plot(x, x, 0, 1)$ plot(acsch(x), x, 0, 1)$ plot({x, arccsch(x)}, x = 0..1): Plot[{x, ArcCsch[x]}, {x, 0, 1}]; plot(x, x, 0, 1)$ plot(acsch(x), x, 0, 1)$ plotfunc(x, acsch(x), x = 0..1):

load package(gnuplot)$ plot(y = x, x = (0 .. 1))$ plot(y = acsch(x), x = (0 .. 1))$ LIB "surf.lib"; plot(((x+3)^ 3+2*(x+3)^ 2-y^ 2)*(x^ 3-y^ 2)*((x-3)^ 3-2*(x-3)^ 2-y^ 2));13

Yacas

13 Singularcan

only plot polynomial objects

Based on material originally published in Computer Algebra Systems: A Practical Guide edited by Michael J. Wester, John Wiley & Sons, Chichester, United Kingdom, ISBN 0-471-98353-5, xvi+436 pages, 1999.

Axiom CoCoA Derive DoCon GAP Giac Macsyma Magnus Maple Mathcad Mathematica Maxima MuPAD Octave Pari Reduce Singular Yacas

14 Singularcan

Simple 3D plotting draw(abs(x*y), x = 0..1, y = 0..1); [Plot Overlay]

plotfunc(abs(x*y),[x,y],[0,1],[0,1]) plot3d(abs(x*y), x, 0, 1, y, 0, 1)$ plot3d(abs(x*y), x = 0..1, y = 0..1): Plot3D[Abs[x*y], {x, 0, 1}, {y, 0, 1}]; plot3d(abs(x*y), x, 0, 1, y, 0, 1)$ plotfunc(abs(x*y), x = 0..1, y = 0..1):

load package(gnuplot)$ plot(z = abs(x*y), x = (0 .. 1), y = (0 .. 1))$ LIB "surf.lib"; plot(z^ 2-x^ 2*y);14

only plot polynomial objects

Based on material originally published in Computer Algebra Systems: A Practical Guide edited by Michael J. Wester, John Wiley & Sons, Chichester, United Kingdom, ISBN 0-471-98353-5, xvi+436 pages, 1999.

Related Documents