Symbolic Algebra and Mathematics with Xcas

Symbolic Algebra and Mathematics with Xcas

Symbolic algebra and Mathematics with Xcas Renée De Graeve, Bernard Parisse University of Grenoble I 2 c 2002, 2007 Renée De Graeve, Bernard Parisse [email protected] [email protected] Contents 1 Index 17 2 The CAS functions 27 2.1 Symbolic constants : e pi infinity i ............ 27 2.2 Booleans .............................. 27 2.2.1 The values of a boolean : true false ......... 27 2.2.2 Tests : ==, !=, >, >=, <, =< ........... 27 2.2.3 Boolean operators : or xor and not ......... 28 2.2.4 Transform a boolean expression as a list : exp2list . 29 2.2.5 Evaluate booleans : evalb ................ 29 2.3 Operators bit to bit ......................... 30 2.3.1 Operators bitor, bitxor, bitand ......... 30 2.3.2 Hamming distance bit to bit : hamdist .......... 31 2.4 Strings ................................ 31 2.4.1 Character and string : " .................. 31 2.4.2 First character, middle and end of a string : head mid tail ............................ 32 2.4.3 Concatenation of a sequence of words : cumSum ..... 32 2.4.4 ASCII code of a character : ord .............. 33 2.4.5 ASCII code of a string : asc ................ 33 2.4.6 String defined by the ASCII codes of its characters : char 34 2.4.7 Find a character in a string : inString ......... 34 2.4.8 Concat objects into a string : cat ............. 35 2.4.9 Add an object to a string : + ................ 35 2.4.10 Transform an integer into a string : cat + ........ 36 2.4.11 Transform a string into a number : expr ......... 36 2.5 Write an integer in a b basis: convert .............. 37 2.6 Integers (and Gaussian Integers) .................. 38 2.6.1 The factorial : factorial ................ 38 2.6.2 GCD : gcd igcd ..................... 39 2.6.3 GCD : Gcd ......................... 40 2.6.4 GCD of a list of integers : lgcd .............. 40 2.6.5 The least common multiple : lcm ............. 41 2.6.6 Decomposition into prime factors : ifactor ....... 41 2.6.7 List of prime factors : ifactors ............. 41 2.6.8 Matrix of factors : maple_ifactors .......... 42 2.6.9 The divisors of a number : idivis divisors ..... 42 3 4 CONTENTS 2.6.10 The integer Euclidean quotient : iquo intDiv ..... 42 2.6.11 The integer Euclidean remainder : irem remain smod mods mod % ....................... 43 2.6.12 Euclidean quotient and euclidean remainder of two inte- gers : iquorem ...................... 44 2.6.13 Test of evenness : even .................. 44 2.6.14 Test of oddness : odd ................... 45 2.6.15 Test of pseudo-primality : is_pseudoprime ...... 45 2.6.16 Test of primality : is_prime isprime isPrime . 46 2.6.17 The smallest pseudo-prime greater than n : nextprime . 47 2.6.18 The greatest pseudo-prime less than n : prevprime . 47 2.6.19 The n-th prime number : ithprime ........... 47 2.6.20 Bézout’s Identity : iegcd igcdex ........... 48 2.6.21 Solving au+bv=c in Z: iabcuv .............. 48 2.6.22 Chinese remainders : ichinrem, ichrem ....... 48 2.6.23 Chinese remainders for lists of integers : chrem ..... 50 2.6.24 Solving a2 + b2 = p in Z : pa2b2 ............ 51 2.6.25 The Euler indicatrix : euler phi ............ 51 2.6.26 Legendre symbol : legendre_symbol ......... 51 2.6.27 Jacobi symbol : jacobi_symbol ............ 52 2.7 Combinatory analysis ........................ 53 2.7.1 Factorial : factorial ! ................ 53 2.7.2 Binomial coefficients : binomial comb nCr ..... 53 2.7.3 Arrangements : perm nPr ................ 54 2.7.4 Random integers : rand .................. 54 2.8 Rationals .............................. 54 2.8.1 Transform a floating point number into a rational : exact float2rational .................... 54 2.8.2 Integer and fractional part : propfrac propFrac . 55 2.8.3 Numerator of a fraction after simplification : numer getNum .......................... 56 2.8.4 Denominator of a fraction after simplification : denom getDenom ......................... 56 2.8.5 Numerator and denominator of a fraction : f2nd fxnd . 57 2.8.6 Simplification of a pair of integers : simp2 ........ 57 2.8.7 Continued fraction representation of a real : dfc ..... 57 2.8.8 Transform a continued fraction representation into a real : dfc2f ........................... 59 2.8.9 The n-th Bernoulli number : bernoulli ........ 61 2.8.10 Access to PARI/GP commands: pari ........... 61 2.9 Real numbers ............................ 61 2.9.1 Eval a real at a given precision : evalf and Digits, DIGITS) .......................... 61 2.9.2 Usual infixed functions on reals : +,-,*,/,ˆ ..... 63 2.9.3 Usual prefixed functions on reals : rdiv ......... 64 2.9.4 n-th root : root ...................... 65 2.9.5 Error function : erf .................... 65 2.9.6 Complementary error function: erfc ........... 66 CONTENTS 5 2.9.7 The Γ function : Gamma .................. 67 2.9.8 The β function : Beta ................... 68 2.9.9 Derivatives of the DiGamma fonction : Psi ........ 68 2.9.10 The ζ function : Zeta ................... 69 2.9.11 Airy functions : Airy_Ai and Airy_Bi ......... 69 2.10 Permutations ............................ 70 2.10.1 Random permutation : randperm ............ 71 2.10.2 Decomposition as a product of disjoint cycles : permu2cycles ...................... 71 2.10.3 Product of disjoint cycles to permutation: cycles2permu 71 2.10.4 Transform a cycle into permutation : cycle2perm . 72 2.10.5 Transform a permutation into a matrix : permu2mat . 72 2.10.6 Checking for a permutation : is_permu ......... 72 2.10.7 Checking for a cycle : is_cycle ............. 73 2.10.8 Product of two permutations : p1op2 ........... 73 2.10.9 Composition of a cycle and a permutation : c1op2 . 74 2.10.10 Composition of a permutation and a cycle : p1oc2 . 74 2.10.11 Product of two cycles : c1oc2 .............. 74 2.10.12 Signature of a permutation : signature ......... 75 2.10.13 Inverse of a permutation : perminv ........... 75 2.10.14 Inverse of a cycle : cycleinv .............. 75 2.10.15 Order of a permutation : permuorder .......... 75 2.10.16 Group generated by two permutations : groupermu . 76 2.11 Complex numbers .......................... 76 2.11.1 Usual complex functions : +,-,*,/,ˆ ......... 76 2.11.2 Real part of a complex number : re real ........ 76 2.11.3 Imaginary part of a complex number : im imag ..... 77 2.11.4 Write a complex as re(z)+i*im(z) : evalc ..... 77 2.11.5 Modulus of a complex number : abs ........... 77 2.11.6 Argument of a complex number : arg ........... 77 2.11.7 The normalized complex number : normalize unitV 78 2.11.8 Conjuguate of a complex number : conj ......... 78 2.11.9 Multiplication by the complex conjugate : mult_c_conjugate .................. 78 2.11.10 Barycenter of complex numbers : barycentre ..... 79 2.12 Algebraic expressions ........................ 79 2.12.1 Evaluate an expression : eval ............... 79 2.12.2 Evaluate algebraic expressions : evala .......... 80 2.12.3 Prevent evaluation : quote hold ’ ........... 80 2.12.4 Force evaluation : unquote ................ 80 2.12.5 Distributivity : expand fdistrib ........... 80 2.12.6 Canonical form : canonical_form ........... 81 2.12.7 Multiplication by the conjugate quantity : mult_conjugate .................... 81 2.12.8 Separation of variables : split .............. 82 2.12.9 Factorisation : factor .................. 82 2.12.10 Complex factorisation : cFactor ............. 84 2.12.11 Zeros of an expression : zeros .............. 84 6 CONTENTS 2.12.12 Complex zeros of an expression : cZeros ........ 85 2.12.13 Normal form : normal .................. 86 2.12.14 Simplify : simplify ................... 86 2.12.15 Normal form for rational fractions : ratnormal ..... 87 2.12.16 Substitue a variable by a value : subst .......... 87 2.12.17 Substitue a variable by a value (Maple and Mupad compat- ibility) : subs ....................... 89 2.12.18 Evaluate a primitive at boundaries: preval ....... 90 2.12.19 Sub-expression of an expression : part .......... 90 2.13 Values of un ............................. 91 2.13.1 Array of values of a sequence : tablefunc ....... 91 2.13.2 Table of values and graph of a recurrent sequence : tableseq and plotseq ....................... 91 2.14 Operators or infixed functions ................... 92 2.14.1 Usual operators :+, -, *, /, ˆ ........... 92 2.14.2 Xcas operators ...................... 92 2.14.3 Define an operator: user_operator .......... 93 2.15 Functions and expressions with symbolic variables ........ 94 2.15.1 Difference between function and expression ........ 94 2.15.2 Transform an expression into a fonction : unapply . 94 2.15.3 Top and leaves of an expression : sommet feuille op 95 2.16 Functions .............................. 97 2.16.1 Context-dependant functions. ............... 97 2.16.2 Usual functions ....................... 98 2.16.3 Defining algebraic functions ................ 99 2.16.4 Composition of two functions: @ .............. 101 2.16.5 Repeted function composition: @@ ............. 102 2.16.6 Define a fonction with the history : as_function_of . 102 2.17 Derivation and applications. .................... 104 2.17.1 Functional derivative : function_diff ........ 104 2.17.2 Length of an arc : arcLen ................ 105 2.17.3 Maximum and minimum of an expression: fMax fMin . 106 2.17.4 Table of values and graph : tablefunc and plotfunc 106 2.17.5 Derivative and partial derivative .............. 107 2.18 Integration .............................. 109 2.18.1 Antiderivative and definite integral : integrate int Int ............................. 109 2.18.2 Discrete summation: sum ................. 111 2.18.3 Riemann sum : sum_riemann

View Full Text

Details

  • File Type
    pdf
  • Upload Time
    -
  • Content Languages
    English
  • Upload User
    Anonymous/Not logged-in
  • File Pages
    369 Page
  • File Size
    -

Download

Channel Download Status
Express Download Enable

Copyright

We respect the copyrights and intellectual property rights of all users. All uploaded documents are either original works of the uploader or authorized works of the rightful owners.

  • Not to be reproduced or distributed without explicit permission.
  • Not used for commercial purposes outside of approved use cases.
  • Not used to infringe on the rights of the original creators.
  • If you believe any content infringes your copyright, please contact us immediately.

Support

For help with questions, suggestions, or problems, please contact us