Symbolic algebra and Mathematics with Xcas

# Symbolic algebra and Mathematics with Xcas ### Renée De Graeve, Bernard Parisse1, Jay Belanger2 Sections written by Luka Marohnić3

© 2002, 2007 Renée De Graeve, Bernard Parisse
`renee.degraeve@wanadoo.fr`
`bernard.parisse@ujf-grenoble.fr`

# Contents

# Chapter 1 Index

# Index

, 6.1.4 ’, 6.12.4 ’*’, 6.16.1 ’+’, 6.16.1 ’-’, 6.16.1 ’/’, 6.16.1 (), 5.3.1, 6.12.19, 6.39.1 *, 6.8.2, 6.10.1, 6.16.1, 6.34.4, 6.38.3, 6.41.5, 6.42.7, 6.45.3 *=, 5.4.5 +, 6.3.12, 6.3.13, 6.8.2, 6.10.1, 6.16.1, 6.34.2, 6.38.3, 6.39.9, 6.42.3, 6.45.2, 13.6.3 +=, 5.4.5, 5.4.5 +infinity, 5.2 ,, 6.39.8 -, 6.8.2, 6.10.1, 6.16.1, 6.34.3, 6.38.3, 6.42.4, 6.45.2, 13.6.3 -=, 5.4.5 ->, 5.5.1, 6.15.1 -inf, 5.2 -infinity, 5.2 .*, 6.42.5, 6.45.8 .+, 6.42.3, 6.45.2 .-, 6.42.4, 6.45.2 .., 6.37.1 ./, 6.42.6, 6.45.9 .^, 6.45.10 .xcasrc, 3.5.10 /, 6.8.2, 6.10.1, 6.16.1, 6.34.8, 6.34.11, 6.38.3, 6.47.2 //, 4.2, 12.2.1 /=, 5.4.5 ::=, 6.44.6 :;, 4.1, 4.1 :=, 5.4.2, 5.5.1, 6.15.1, 6.44.6, 12.2.8 <, 6.1.2 =, 5.4.2 =<, 5.4.3, 6.1.2, 6.44.6, 12.2.8 ==, 6.1.2 =>, 5.4.2, 5.5.1, 6.23.26, 11.1.4, 12.2.8 >, 6.1.2 >=, 6.1.2 ?:, 6.1.3 [ ], 6.41.1 [[]], 6.39.6 [], 6.39.6, 6.39.10, 6.40 6.14.1, 6.16.4 6.14.1, 6.16.5 $, 6.14.1, 6.39.2 %, 6.5.9, 6.14.1, 6.34, 6.35 %%%{ %%%}, 6.27.2 %{ %}, 5.3.2, 6.41.1 %e, 5.2 %i, 5.2 %pi, 5.2 &*, 6.45.3 &&, 6.1.4 &^, 6.45.7 ^, 6.8.2, 6.10.1, 6.34.9, 6.45.7 _, 11.1.1, 11.2.1 {}, 12.1.2 !, 6.6.1 !=, 6.1.4 ", 6.3.1 \n, 6.3.2 Airy_Ai, 6.8.19 Airy_Bi, 6.8.19 a2q, 6.54.2 abcuv, 6.28.10 about, 5.4.8, 6.26.1 abs, 6.10.4, 6.16.2, 13.14.10 abscissa, 13.13.2, 14.12.1 accumulate_head_tail, 9.1.11 acos, 6.16.2 acos2asin, 6.23.7 acos2atan, 6.23.8 acosh, 6.16.2 acot, 6.16.2 acsc, 6.16.2 add, 6.40.24 additionally, 5.4.8 additionally, 5.4.8 addtable, 6.26.2, 6.26.2 adjoint_matrix, 6.48.10 affix, 13.13.1 algsubs, 6.12.21 algvar, 6.59.4 altitude, 13.7.9 and, 5.4.8, 6.1.4 angle, 13.14.4, 14.12.9 angle_radian, 3.5.3 angleat, 13.14.1 angleatraw, 13.14.1 animate, 8.21.1 animate3d, 8.21.2 animation, 8.21.3 ans, 4.4 append, 6.40.11 apply, 6.40.28 approx, 10.2 approx_mode, 3.5.4 arc, 13.11.2 arccos, 6.16.2 arccosh, 6.16.2 archive, 5.4.6 arcLen, 6.19.2 arcsin, 6.16.2 arcsinh, 6.16.2 arctan, 6.16.2 arctanh, 6.16.2 area, 8.9, 13.14.6 areaat, 13.14.1 areaatraw, 13.14.1 areaplot, 8.10, 13.14.5 arg, 6.10.4, 13.14.11 args, 12.4.1 array, 6.23.26 as_function_of, 6.16.6 asc, 6.3.8 asec, 6.16.2 asin, 6.16.2 asin2acos, 6.23.9 asin2atan, 6.23.10 asinh, 6.16.2 assert, 12.2.4 assign, 5.4.2 assume, 5.4.8, 6.26.1, 12.1.3, 13.5 at, 6.39.6, 6.39.7, 6.44.5 atan, 6.16.2 atan2acos, 6.23.12 atan2asin, 6.23.11 atanh, 6.16.2 atrig2ln, 6.23.22 augment, 6.40.13, 6.44.3 auto_correlation, 15.2.7 autosimplify, 6.12.15 axes, 8.3.2 Beta, 6.8.16 Binary, 6.14.2 BlockDiagonal, 6.44.2 bar_plot, 9.1.14 bareiss, 6.47.4 bartlett_hann_window, 15.2.13 barycenter, 6.10.8, 13.6.10, 14.4.6 base, 6.4.2 basis, 6.47.9 batons, 9.2.2 begin, 12.1.7 bernoulli, 6.7.9 betad, 9.4.12 betad_cdf, 9.4.12 betad_icdf, 9.4.12 bezier, 8.15 binary, 6.4.1 binomial, 6.6.2, 9.4.3 binomial_cdf, 9.4.3 binomial_icdf, 9.4.3 bisection_solver, 10.4.1 bisector, 13.7.11 bit_depth, 15.1.6 bitand, 6.2.1 bitor, 6.2.1 bitxor, 6.2.1 black, 8.3.1 blackman_harris_window, 15.2.14 blackman_window, 15.2.15 blockmatrix, 6.44.3 blue, 8.3.1 bohman_window, 15.2.16 boolean, 6.1.1 border, 6.44.3 box_constraints, 6.38.9 boxcar, 15.2.1 boxwhisker, 6.42.9, 6.45.16, 9.1.8 break, 12.3.6, 12.5.1 breakpoint, 12.5.1 brent_solverbrent_solver, 10.4.2 bvpsolve, 10.3.7 Celsius2Fahrenheit, 11.1.5 Ci, 6.8.7 Circle, 13.11.3 ClrDraw, 12.4.9 ClrGraph, 12.4.9 ClrIO, 12.2.6 CopyVar, 5.4.7 CST, 5.4.10 c1oc2, 6.9.9 c1op2, 6.9.9 camembert, 9.1.15 canonical_form, 6.12.7 cap_flat_line, 8.3.1 cap_round_line, 8.3.1 cap_square_line, 8.3.1 cas_setup, 3.5.10 case, 12.3.2 cat, 6.3.11, 6.3.13 catch, 12.4.11 cauchy, 9.4.14 cauchy_cdf, 9.4.14 cauchy_icdf, 9.4.14 cauchyd, 9.4.14 cauchyd_cdf, 9.4.14 cauchyd_icdf, 9.4.14 cd, 5.6.1 cdf, 9.4.20 ceil, 6.16.2 center, 13.6.12 center2interval, 6.37.3 centered_cube, 14.17.2 centered_tetrahedron, 14.17.1 cfactor, 3.5.5, 6.12.10 cfsolve, 10.4, 10.5 changebase, 6.47.8 channel_data, 15.1.7 channels, 15.1.6 char, 6.3.9 charpoly, 6.48.7 chinrem, 6.28.11 chisquare, 9.4.9 chisquare_cdf, 9.4.9 chisquare_icdf, 9.4.9 chisquaret, 9.5.4 cholesky, 6.49.1 chrem, 6.5.21 circle, 13.11.1, 14.10 circumcircle, 13.11.5 classes, 9.1.9 coeff, 6.27.7 coeffs, 6.27.7 col, 6.44.5 colDim, 6.45.19 coldim, 6.45.19 collect, 6.27.16 colNorm, 6.50.5 colnorm, 6.50.5 color, 13.3.3 color, 8.3.1 , 10.4.2 colSwap, 6.45.11 colspace, 6.47.14 colswap, 6.45.11 comb, 6.6.2, 6.6.2 combine, 6.25.2 comDenom, 6.32.7 comment, 4.2 comments, 4.2, 12.2.1 common_perpendicular, 14.5.8 companion, 6.48.11 compare, 12.2.5 complex, 12.2.5 complex_mode, 3.5.5 complex_variables, 3.5.6 complexroot, 6.29.2 concat, 6.40.13, 6.44.3 cone, 14.15.1 confrac, 6.7.7 conic, 6.54.6 conj, 6.10.6 conjugate_equation, 6.22.5 conjugate_gradient, 6.54.4 cont, 12.5.1 contains, 6.38.7, 6.41.2 content, 6.27.14 contourplot, 8.11 convert, 6.4.2, 6.23.26, 6.27.6, 6.27.25, 6.38.8, 11.1.4 convertir, 6.23.26, 6.27.25 convex, 6.21.8 convexhull, 13.10.5 convolution, 15.2.8 coordinates, 13.13.4, 14.12.4 copy, 5.4.4, 12.2.9 correlation, 9.2.1 cos, 6.16.2 cos, 6.23.26, 6.25.2 cos2sintan, 6.23.16 cosh, 6.16.2 cosine_window, 15.2.17 cot, 6.16.2 cote, 14.12.3 count, 6.40.25, 6.45.12 count_eq, 6.40.21, 6.45.13 count_inf, 6.40.22, 6.45.14 count_sup, 6.40.23, 6.45.15 courbe_polaire, 8.16 covariance, 9.2.1 covariance_correlation, 9.2.1 cpartfrac, 6.32.9 crationalroot, 6.29.8 createwav, 15.1.1 cross, 6.42.8 cross_correlation, 15.2.6 cross_point, 8.3.1 cross_ratio, 13.17.2 crossP, 6.42.8 crossproduct, 6.42.8 cSolve, 6.55.6 csc, 6.16.2 cube, 14.16.1 cumSum, 6.3.6, 6.40.26, 6.45.5 cumulated_frequencies, 9.1.13 curl, 6.21.5 curvature, 7.2 curve, 10.3.5 cyan, 8.3.1 cycle2perm, 6.9.5 cycleinv, 6.9.12 cycles2permu, 6.9.4 cyclotomic, 6.28.12 cylinder, 14.15.3 Delete, 6.14.2 DelFold, 5.6.3 DelVar, 5.4.9 Det, 6.35.5 DIGITS, 3.5.1, 6.8.1, 10.2 Digits, 3.5.1, 6.8.1, 10.2 Dirac, 6.8.10 Disp, 12.2.6 DispG, 3.7.3, 12.4.9 DispHome, 12.4.9 DOM_COMPLEX, 12.2.5 DOM_FLOAT, 12.2.5 DOM_FUNC, 12.2.5 DOM_IDENT, 12.2.5 DOM_INT, 12.2.5 DOM_LIST, 12.2.5 DOM_RAT, 12.2.5 DOM_STRING, 12.2.5 DOM_SYMBOLIC, 12.2.5 DrawFunc, 8.4 DrawParm, 8.14, 8.14.2 DrawPol, 8.16 DrawSlp, 8.7.6 DrwCtour, 8.11 dash_line, 8.3.1 dashdot_line, 8.3.1 dashdotdot_line, 8.3.1 dayofweek, 6.60 debug, 12.5.1 debugger, 12.1.7 default, 12.3.2 degree, 6.27.8 del, 5.4.9 delcols, 6.44.6 delrows, 6.44.6 deltalist, 6.40.31 denom, 6.7.4, 6.32.4 densityplot, 8.12 derive, 6.19.4, 6.21.1 deriver, 6.19.4, 6.21.1 deSolve, 6.57.1 desolve, 6.57.1 det, 6.34.15, 6.47.4 det_minor, 6.47.5 dfc, 6.7.7 dfc2f, 6.7.8 diag, 6.44.2 diff, 6.19.4, 6.21.1 dim, 6.45.17 directories, 5.6 display, 13.3.3 display, 8.3.1 distance, 13.14.2, 14.12.7 distance2, 13.14.3, 14.12.8 distanceat, 13.14.1 distanceatraw, 13.14.1 div, 6.5.8 divergence, 6.21.4 divide, 6.28.4 divis, 6.28.1 division_point, 13.17.1 divisors, 6.5.7 divpc, 6.36.1 dnewton_solverdnewton_solver, 10.5.1 do, 12.3.3 dodecahedron, 14.17.4 domain, 6.17.1 dot, 6.42.7 dot_paper, 13.2.4 dotP, 6.42.7 dotprod, 6.42.7 double, 12.2.5 droit, 6.55.5 dsolve, 6.57.1 duration, 15.1.6 Ei, 6.8.5 ERROR, 12.4.11 EXPR, 12.2.5 e, 5.2 e2r, 6.27.5 egcd, 6.28.9 egv, 6.48.3 egvl, 6.48.2 eigenvals, 6.48.1 eigenvalues, 6.48.2 eigenvectors, 6.48.3 eigenvects, 6.48.3 eigVc, 6.48.3 eigVl, 6.48.2 element, 13.6.15 elif, 12.3.1 eliminate, 6.12.22 ellipse, 13.12.1, 14.11.1 else, 12.3.1 end, 12.1.7, 12.3.1 end_for, 12.3.3 endfunction, 12.1.2 envelope, 13.18.2 epsilon, 6.59.1 epsilon2zero, 6.59.1 equal, 6.55.1 equal2diff, 6.55.2 equal2list, 6.55.3 equation, 13.13.7, 14.12.5 equilateral_triangle, 13.8.4, 14.7.4 erase, 13.2.1 erf, 6.8.11 erfc, 6.8.12 error, 12.4.11 euler, 6.5.24 euler_gamma, 5.2 euler_lagrange, 6.22.2 eval, 6.12.1 eval_level, 6.12.2 evala, 6.12.3 evalb, 6.1.7 evalc, 6.10.3 evalf, 5.4.8, 6.7.1, 6.8.1, 6.59.6, 10.2 evalm, 6.45.1 even, 6.5.11 evolute, 7.2 exact, 6.7.1, 6.59.7 exbisector, 13.7.12 excircle, 13.11.6 exp, 6.16.2 exp, 6.23.26, 6.25.2 exp2list, 6.1.5 exp2pow, 6.24.8 exp2trig, 6.23.13 expand, 6.12.6 expexpand, 6.24.2 expln, 6.23.26 exponential, 9.4.15 exponential_cdf, 9.4.15 exponential_icdf, 9.4.15 exponential_regression, 9.2.5 exponential_regression_plot, 9.2.5 exponentiald, 9.4.15 exponentiald_cdf, 9.4.15 exponentiald_icdf, 9.4.15 export_mathml, 3.7.7 expr, 6.3.14, 12.4.6 expression, 12.2.5 expression editor, 4.3 expression tree, 4.3.2 extract_measure, 13.14.1 extrema, 6.53.2 ezgcd, 6.28.7 FALSE, 6.1.1 Factor, 6.35.4 Fahrenheit2Celsius, 11.1.5 FUNC, 12.2.5 f2nd, 6.7.5, 6.32.5 faces, 14.16.7 factor, 6.12.10, 6.34.14, 6.34.19 factor_xn, 6.27.13 factorial, 6.6.1 factoriser, 6.34.14 factors, 6.27.18 false, 6.1.1 falsepos_solver, 10.4.3 fclose, 12.4.4 fcoeff, 6.33.2 fdistrib, 6.12.6 feuille, 6.15.3 fieldplot, 8.18 filled, 8.3.1 findhelp, 3.3 fisher, 9.4.10 fisher_cdf, 9.4.10 fisher_icdf, 9.4.10 fisherd, 9.4.10 fitdistr, 9.4.23 flatten, 6.40.14 float2rational, 6.7.1, 6.59.7 floor, 6.16.2 fMax, 6.19.3 fMin, 6.19.3 foldl, 6.40.30 foldr, 6.40.30 fopen, 12.4.4 for, 12.3.3 format, 12.4.8 fourier, 6.26.2 fourier_an, 6.26.1 fourier_bn, 6.26.1 fourier_cn, 6.26.1 fPart, 6.16.2 fprint, 12.4.4 frac, 6.16.2 fracmod, 6.34.12 frame_2d, 13.2.3 frame_3d, 14.3.1 frames, 13.3.2 frames, 8.21.1 frequences, 9.1.12 frequences_cumulees, 9.1.13 frequencies, 9.1.12 frobenius_norm, 6.50.1 from, 12.3.3 froot, 6.33.1 fsolve, 10.4, 10.5 fullparfrac, 6.23.26 func, 12.2.5 funcplot, 8.4, 14.15.5 function, 12.1.2 function_diff, 6.19.1 fxnd, 6.7.5, 6.32.5 Gamma, 6.8.13 Gcd, 6.5.1, 6.28.5, 6.28.6, 6.35.3 GetFold, 5.6.3 GF, 6.34.18 Graph, 8.4 gammad, 9.4.11 gammad_cdf, 9.4.11 gammad_icdf, 9.4.11 gauche, 6.55.4 gauss, 6.54.3 gauss_seidel_linsolve, 6.56.8 gaussian_window, 15.2.18 gaussjord, 6.56.3 gaussquad, 10.3.4 gbasis, 6.31.1 gcd, 6.5.1, 6.28.5, 6.34.13 gcdex, 6.28.9 genpoly, 6.31.4 geometric, 9.4.13 geometric_cdf, 9.4.13 geometric_icdf, 9.4.13 getDenom, 6.7.4, 6.32.3 getKey, 12.2.3 getNum, 6.7.3, 6.32.1 getType, 12.2.5 giac, 2.2.2, 2.2.5 gl_material, 8.3.1 gl_quaternion, 8.3.2 gl_rotation, 8.3.2 gl_shownames, 8.3.2 gl_texture, 8.3.2, 13.3.2 gl_texture, 8.3.1 gl_x, 8.3.2 gl_x_axis_name, 8.3.2 gl_x_axis_unit, 8.3.2 gl_x_tick, 8.3.2 gl_y, 8.3.2 gl_y_axis_name, 8.3.2 gl_y_axis_unit, 8.3.2 gl_y_tick, 8.3.2 gl_z, 8.3.2 gl_z_axis_name, 8.3.2 gl_z_axis_unit, 8.3.2 gl_z_tick, 8.3.2 goto, 12.3.8 grad, 6.21.1 gramschmidt, 6.54.5 graph2tex, 3.7.3 graph3d2tex, 3.7.3 graphe_suite, 8.17 greduce, 6.31.2 green, 8.3.1 grid_paper, 13.2.6 groupermu, 6.9.14 Heaviside, 6.8.9 hadamard, 6.45.8 half_cone, 14.15.2 half_line, 13.7.2, 14.5.2 halftan, 6.23.19 halftan_hyp2exp, 6.23.20 halt, 12.5.1 hamdist, 6.2.2 hamming_window, 15.2.19 hann_poisson_window, 15.2.20 hann_window, 15.2.21 harmonic_conjugate, 13.17.4 harmonic_division, 13.17.3 has, 6.59.5 hasard, 9.3.1 head, 6.3.5, 6.39.4 hermite, 6.30.2 hessenberg, 6.48.12 hessian, 6.21.3 heugcd, 6.28.7 hexadecimal, 6.4.1 hexagon, 13.10.1, 14.9.1 hidden_name, 8.3.1 highpass, 15.2.10 hilbert, 6.44.2 histogram, 9.1.10 histogramme, 9.1.10 hold, 6.12.4 homothety, 13.15.5, 14.14.5 horner, 6.27.19 hybrid_solverhybrid_solver, 10.5.2 hybridj_solverhybridj_solver, 10.5.5 hybrids_solverhybrids_solver, 10.5.3 hybridsj_solverhybridsj_solver, 10.5.6 hyp2exp, 6.24.1 hyperbola, 13.12.2, 14.11.2 IFTE, 6.1.3 Input, 12.2.2 InputStr, 12.2.2 Int, 6.20.1 Inverse, 6.35.6 i, 5.2 i[], 6.38.1 iabcuv, 6.5.20 ibasis, 6.47.10 ibpdv, 6.20.5 ibpu, 6.20.5 icas, 2.2.2 icdf, 9.4.21 ichinrem, 6.5.21 ichrem, 6.5.21 icomp, 6.5.27 icosahedron, 14.17.5 id, 6.16.2 identifier, 12.2.5 identity, 6.44.2 idivis, 6.5.7 idn, 6.44.2 iegcd, 6.5.19 if, 12.3.1 ifactor, 6.5.4 ifactors, 6.5.5 ifourier, 6.26.2 ifte, 6.1.3 igamma, 6.8.15 igcd, 6.5.1 igcdex, 6.5.19 ihermite, 6.48.13 ilaplace, 6.57.2 im, 6.10.2 imag, 6.10.2 image, 6.47.11 implicitdiff, 6.19.5 implicitplot, 8.13 in, 12.5.1 in_ideal, 6.31.3 incircle, 13.11.4 indets, 6.59.2 inequationplot, 8.8 inf, 5.2 infinity, 5.2 input, 12.2.2 inString, 6.3.10 insert, 6.40.10 int, 6.20.1 intDiv, 6.5.8 integer, 6.26.1, 12.2.5 integer, 5.4.8 integrate, 6.20.1 inter, 13.6.7, 14.4.4 interactive_odeplot, 8.20 interactive_plotode, 8.20 internal directories, 5.6.3 interp, 6.27.29 intersect, 6.38.6, 6.41.4 interval, 6.23.26 interval2center, 6.37.2 inv, 6.34.11, 6.34.16, 6.47.2 inverse, 6.34.16 inversion, 13.15.7, 14.14.7 invisible_point, 8.3.1 invlaplace, 6.57.2 invztrans, 6.58.2 iPart, 6.16.2 iquo, 6.5.8 iquorem, 6.5.10 iratrecon, 6.34.12 irem, 6.5.9 is_collinear, 13.16.2, 14.13.6 is_concyclic, 13.16.3, 14.13.7 is_conjugate, 13.16.14 is_coplanar, 14.13.2 is_cospherical, 14.13.8 is_cycle, 6.9.8 is_element, 13.16.1, 14.13.1 is_equilateral, 13.16.5, 14.13.9 is_harmonic, 13.16.15 is_harmonic_circle_bundle, 13.16.17 is_harmonic_line_bundle, 13.16.16 is_inside, 13.16.4 is_isosceles, 13.16.6, 14.13.10 is_orthogonal, 13.16.13, 14.13.5 is_parallel, 13.16.11, 14.13.3 is_parallelogram, 13.16.10, 14.13.14 is_permu, 6.9.7 is_perpendicular, 13.16.12, 14.13.4 is_prime, 6.5.14 is_pseudoprime, 6.5.13 is_rectangle, 13.16.7, 14.13.11 is_rhombus, 13.16.9, 14.13.13 is_square, 13.16.8, 14.13.12 ismith, 6.48.14 isobarycenter, 13.6.11, 14.4.7 isolve, 6.5.23 isom, 6.51.1 isopolygon, 13.10.2, 14.9.2 | isosceles_triangle, 13.8.2, 14.7.2 isPrime, 6.5.14 isprime, 6.5.14 JordanBlock, 6.44.2 jacobi_equation, 6.22.4 jacobi_linsolve, 6.56.7 jacobi_symbol, 6.5.26 jordan, 6.48.5 jusqua, 12.3.4 kde, 9.4.22 ker, 6.47.12 kernel, 6.47.12 kernel_density, 9.4.22 kill, 12.5.1 kolmogorovd, 9.4.17 kolmogorovt, 9.5.5 kovacicsols, 6.57.3 LaTeX, 3.7.1 LIST, 12.2.5 Li, 6.8.6 Line, 13.7.3 LineHorz, 8.7.2 LineTan, 8.7.4 LineVert, 8.7.3 LQ, 6.49.4 LSQ, 6.56.9 LU, 6.49.6 l1norm, 6.42.1, 6.50.5, 6.50.6 l2norm, 6.42.1, 6.50.2, 6.50.6 label, 12.3.8 labels, 8.3.2 lagrange, 6.27.29 lagrange, 6.47.4 laguerre, 6.30.3 laplace, 6.26.2, 6.57.2 laplacian, 6.21.2 latex, 3.7.1 lcm, 6.5.3, 6.28.8 lcoeff, 6.27.10 ldegree, 6.27.9 left, 6.3.4, 6.15.3, 6.38.2, 6.40.6, 6.55.4 legend, 13.3.3 legend, 8.3.2 legendre, 6.30.1 legendre_symbol, 6.5.25 length, 6.3.3, 6.39.3 lgcd, 6.5.2 lhs, 6.55.4 ligne_polygonale, 9.2.3 limit, 6.18 lin, 6.24.4 line, 8.7.1, 13.7.1, 14.5.1 line_inter, 13.6.6, 14.4.3 line_paper, 13.2.5 line_segments, 14.16.8 line_width_1, 8.3.1 line_width_2, 8.3.1 line_width_3, 8.3.1 line_width_4, 8.3.1 line_width_5, 8.3.1 line_width_6, 8.3.1 line_width_7, 8.3.1 linear_interpolate, 9.2.3 linear_regression, 9.2.4 linear_regression_plot, 9.2.4 linfnorm, 6.50.4 linsolve, 6.56.6 linsolve, 6.47.4 list, 6.23.26 list2exp, 6.1.6 list2mat, 6.40.32 listplot, 9.2.3 lists, 6.40 lll, 6.49.9 ln, 6.16.2 ln, 6.23.26, 6.25.2 lname, 6.59.2 lncollect, 6.24.5 lnexpand, 6.24.3 load, 5.6.2 local, 12.1.2 locus, 13.18.1 log, 6.16.2 log, 6.25.2 log10, 6.16.2 logarithmic_regression, 9.2.6 logarithmic_regression_plot, 9.2.6 logb, 6.16.2 logistic_regression, 9.2.9 logistic_regression_plot, 9.2.9 loi_normal, 9.4.7 lowpass, 15.2.9 lpsolve, 6.52.2 lsq, 6.56.9 lu, 6.49.5 lvar, 6.59.3 MAT, 12.2.5 Maple, 3.7.8 MathML, 3.7.4 magenta, 8.3.1 make_symbol, 12.4.5 makelist, 6.40.2, 12.4.2 makemat, 6.44.4 makesuite, 6.39.10 map, 6.40.28 maple2xcas, 3.7.8 maple_ifactors, 6.5.6 markov, 9.4.24 mat2list, 6.40.33 mathml, 3.7.4 matpow, 6.48.6 matrix, 6.44.4 matrix, 6.23.26 matrix_norm, 6.50.6 max, 6.16.2 maximize, 6.53.1 maxnorm, 6.42.1, 6.50.3 mean, 6.42.9, 6.45.16, 9.1.1 median, 6.42.9, 6.45.16, 9.1.5 median_line, 13.7.8 member, 6.41.2 mgf, 9.4.19 mid, 6.3.5, 6.39.7 midpoint, 6.38.4, 13.6.9, 14.4.5 min, 6.16.2 minimax, 6.53.4 minimize, 6.53.1 minor_det, 6.47.4 minus, 6.41.5 mkisom, 6.51.2 mksa, 11.1.3 mod, 6.5.9, 6.35 modgcd, 6.28.7 mods, 6.5.9 moving_average, 15.2.11 mRow, 6.45.11 mRowAdd, 6.45.11 mul, 6.40.27 mult_c_conjugate, 6.10.7 mult_conjugate, 6.12.8 multinomial, 9.4.5 mustache, 9.1.8 NewFold, 5.6.3 NONE, 12.2.5 NUM, 12.2.5 Nullspace, 6.47.13 nCr, 6.6.2 ncols, 6.45.19 nDeriv, 10.3.2 negbinomial, 9.4.4 negbinomial_cdf, 9.4.4 negbinomial_icdf, 9.4.4 newList, 6.40.3 newMat, 6.44.2 newton, 10.3.1 newton_solvernewton_solver, 10.4.4 newtonj_solvernewtonj_solver, 10.5.4 nextperm, 6.9.2 nextprime, 6.5.15 nInt, 10.3.3 nlpsolve, 6.53.3 nodisp, 4.1, 13.4 noise removal, 15.2.28 nop, 6.39.10 nops, 6.39.3 norm, 6.42.1, 6.42.1, 6.50.2, 6.50.6 normal, 6.12.13, 6.34.1, 6.34.2, 6.34.3, 6.34.4, 6.34.9 normal_cdf, 9.4.7 normal_icdf, 9.4.7 normald, 9.4.7 normald_cdf, 9.4.7 normald_icdf, 9.4.7 normalize, 6.10.5, 6.42.2, 13.14.12 normalt, 9.5.2 not, 6.1.4 nPr, 6.6.3 nprimes, 6.5.18 nrows, 6.45.18 nSolve, 10.4 nstep, 13.3.2 nstep, 8.4 nuage_points, 9.2.2 nullspace, 6.47.12 numdiff, 6.19.6 numer, 6.7.3, 6.32.2 Output, 12.2.2 Ox_2d_unit_vector, 13.2.3 Ox_3d_unit_vector, 14.3.1 Oy_2d_unit_vector, 13.2.3 Oy_3d_unit_vector, 14.3.1 Oz_3d_unit_vector, 14.3.1 octahedron, 14.17.3 octal, 6.4.1 odd, 6.5.12 odeplot, 8.19 odesolve, 10.3.5, 10.3.6 op, 6.15.3, 6.39.10 open_polygon, 13.10.4, 14.9.4 or, 5.4.8, 6.1.4 ord, 6.3.7 order_size, 6.36.2 ordinate, 13.13.3, 14.12.2 orthocenter, 13.6.8 orthogonal, 14.5.7 osculating_circle, 7.2 output, 12.2.2 Pause, 12.4.10 PIC, 12.2.5 Postfix, 6.14.2 Prefix, 6.14.2 Psi, 6.8.17 p1oc2, 6.9.9 p1op2, 6.9.9 pa2b2, 6.5.22 pade, 6.36.5 parabola, 13.12.3, 14.11.3 parallel, 13.7.5, 14.5.5 parallelepiped, 14.16.3 parallelogram, 13.9.4, 14.8.4 parameq, 13.13.8, 14.12.6 paramplot, 8.14, 8.14.2, 14.15.6 parfrac, 6.23.26 pari, 6.7.10 part, 6.12.24 partfrac, 6.32.9 partfrac, 6.23.26 parzen_window, 15.2.22 pcar, 6.48.7 pcar_hessenberg, 6.48.8 pcoef, 6.27.23 pcoeff, 6.27.23 perimeter, 13.14.7 perimeterat, 13.14.1 perimeteratraw, 13.14.1 perm, 6.6.3 perminv, 6.9.11 permu2cycles, 6.9.3 permu2mat, 6.9.6 permuorder, 6.9.13 perpen_bisector, 13.7.10, 14.6.2 perpendicular, 13.7.6, 14.5.6 peval, 6.27.12 phi, 6.5.24 pi, 5.2 piecewise, 6.1.3 piecewise defined functions, 6.1.3 pivot, 6.56.5 plane, 14.6.1 playsnd, 15.1.4, 15.1.13 plot, 8.5 plot3d, 8.6 plotarea, 8.10, 13.14.5 plotcontour, 8.11 plotdensity, 8.12 plotfield, 8.18 plotfunc, 8.4 plotimplicit, 8.13 plotinequation, 8.8 plotlist, 9.2.3 plotode, 8.19 plotparam, 8.14, 8.14.2 plotpolar, 8.16 plotseq, 8.17 plotspectrum, 15.1.10 plotwav, 15.1.9 plus_point, 8.3.1 pmin, 6.11.2, 6.48.9 point, 13.6.2, 14.4.1 point2d, 13.6.4 point3d, 14.4.2 point_milieu, 8.10 point_point, 8.3.1 point_polar, 13.6.5 point_width_1, 8.3.1 point_width_2, 8.3.1 point_width_3, 8.3.1 point_width_4, 8.3.1 point_width_5, 8.3.1 point_width_6, 8.3.1 point_width_7, 8.3.1 poisson, 9.4.6 poisson_cdf, 9.4.6 poisson_icdf, 9.4.6 poisson_window, 15.2.23 polar, 13.17.5 polar_coordinates, 13.13.6 polar_point, 13.6.5 polarplot, 8.16 pole, 13.17.5 poly1, 6.27.1 poly2symb, 6.27.4 polyEval, 6.27.12 polygon, 13.10.3, 14.9.3 polygonplot, 9.2.3 polyhedron, 14.16.5 polynom, 6.23.26, 6.27.25 polynomial_regression, 9.2.8 polynomial_regression_plot, 9.2.8 poslbdLMQ, 6.29.6 posubLMQ, 6.29.5 potential, 6.21.6 pow2exp, 6.24.7 power_regression, 9.2.7 power_regression_plot, 9.2.7 powermod, 6.34.10 powerpc, 13.11.7 powexpand, 6.24.6 powmod, 6.34.10 prepend, 6.40.12 preval, 6.12.23 prevperm, 6.9.2 prevprime, 6.5.16 primpart, 6.27.15 print, 12.2.6 printpow, 12.2.7 prism, 14.16.4 product, 6.40.27, 6.45.6, 6.45.8 program, 12.1.5 projection, 13.15.8, 14.14.8 proot, 10.6 propFrac, 6.7.2 propfrac, 6.7.2, 6.32.8 psrgcd, 6.28.7 ptayl, 6.27.20 purge, 5.4.8, 5.4.9, 6.26.1, 12.1.3 pwd, 5.6.1 pyramid, 14.16.2 QR, 6.49.3 Quo, 6.28.2, 6.35.1 q2a, 6.54.1 qr, 6.49.2 quadric, 6.54.8 quadrilateral, 13.9.5, 14.8.5 quandrant1, 8.3.1 quandrant2, 8.3.1 quandrant3, 8.3.1 quandrant4, 8.3.1 quantile, 6.42.9, 6.45.16, 9.1.7 quartile1, 9.1.6 quartile3, 9.1.6 quartiles, 6.42.9, 6.45.16, 9.1.6 quest, 4.4 quo, 6.28.2, 6.34.5 quorem, 6.28.4, 6.34.7 quote, 6.3.1, 6.12.4 RandSeed, 9.3.2 REDIM, 6.44.6 REPLACE, 6.44.6 Rem, 6.28.3, 6.35.2 Rref, 6.35.7 r2e, 6.27.4 radical_axis, 13.11.8 radius, 13.14.9 rand, 9.3.1 randbetad, 9.3.11 randbinomial, 9.3.3 randchisquare, 9.3.8 randexp, 9.3.13 randfisher, 9.3.9 randgammad, 9.3.10 randgeometric, 9.3.12 randint, 9.3.1 randMat, 9.3.16 randmarkov, 9.4.25 randmatrix, 9.3.16 randmultinomial, 9.3.4 randNorm, 9.3.6 randnorm, 9.3.6 random, 9.3.1 random_variable, 9.3.14 randPoly, 6.27.26 randperm, 6.9.1 randpoisson, 9.3.5 randpoly, 6.27.26 randseed, 9.3.2 randstudent, 9.3.7 randvar, 9.3.14 randvector, 9.3.15 range, 6.40.4 rank, 6.47.6 ranm, 6.27.28, 9.3.16 rat_jordan, 6.48.4 ratinterp, 6.27.34 rational, 12.2.5 rational_det, 6.47.4 rationalroot, 6.29.7 ratnormal, 6.12.16 rdiv, 6.8.3 re, 6.10.2 read, 5.6.2 readrgb, 15.3.2 readwav, 15.1.2, 15.1.11 real, 6.10.2, 12.2.5 realroot, 6.29.1 reciprocation, 13.17.6 rect, 15.2.2 rectangle, 13.9.3, 14.8.3 rectangle_droit, 8.10 rectangle_gauche, 8.10 rectangular_coordinates, 13.13.5 red, 8.3.1 redim, 6.44.6 reduced_conic, 6.54.7 reduced_quadric, 6.54.9 ref, 6.56.2 reflection, 13.15.3, 14.14.3 regroup, 6.12.12 rem, 6.28.3, 6.34.6 remain, 6.5.9 remove, 6.40.9 reorder, 6.27.27 repeat, 12.3.4 repeter, 12.3.4 replace, 6.44.6 resample, 15.1.8 residue, 6.36.4 resoudre, 6.12.10, 6.21.1, 8.7.7 restart, 5.4.9 resultant, 6.28.14 return, 12.1.2 reverse_rsolve, 6.56.10 revert, 6.36.3 revlist, 6.40.15 rhombus, 13.9.2, 14.8.2 rhombus_point, 8.3.1 rhs, 6.55.5 riemann_window, 15.2.24 right, 6.3.4, 6.15.3, 6.38.2, 6.40.6, 6.55.5 right_triangle, 13.8.3, 14.7.3 risch, 6.20.2 rm_a_z, 5.4.9 rm_all_vars, 5.4.9 rmbreakpoint, 12.5.1 rmbrk, 12.5.1 rms, 15.2.5 rmwatch, 12.5.1 rmwtch, 12.5.1 romberg, 10.3.3 root, 6.8.4 rootof, 6.27.21 roots, 6.27.22 rotate, 6.40.16 rotation, 13.15.4, 14.14.4 round, 6.16.2 row, 6.44.5 rowAdd, 6.45.11 rowDim, 6.45.18 rowdim, 6.45.18 rowNorm, 6.50.4 rownorm, 6.50.4 rowSwap, 6.45.11 rowspace, 6.47.15 rowswap, 6.45.11 rref, 6.34.17, 6.56.3 rsolve, 6.13.3 SCALE, 6.45.11 SCALEADD, 6.45.11 SCHUR, 6.48.12 SetFold, 5.6.3 Si, 6.8.8 SortA, 6.40.19 SortD, 6.40.20 STR, 12.2.5 Store, 5.4.2 SVL, 6.49.7 sample, 9.3.1 samplerate, 15.1.6 scalar_product, 6.42.7 scalarProduct, 6.42.7 scale, 6.45.11 scaleadd, 6.45.11 scatterplot, 9.2.2 sec, 6.16.2 secant_solversecant_solver, 10.4.5 segment, 13.7.3, 13.7.4, 14.5.3 select, 6.40.5 semi_augment, 6.44.3 seq, 6.39.2 seq[], 5.3.1, 6.39.1 seqplot, 8.17 seqsolve, 6.13.2 series, 6.36.2 set[], 5.3.2, 6.41.1 shift, 6.40.17 shift_phase, 6.23.3 shuffle, 6.9.1 sign, 6.16.2 signature, 6.9.10 similarity, 13.15.6, 14.14.6 simp2, 6.7.6, 6.32.6 simplex_reduce, 6.52.1 simplify, 6.12.14, 6.23.5 simult, 6.56.4 sin, 6.16.2 sin, 6.23.26, 6.25.2 sin2costan, 6.23.15 sinc, 15.2.4 sincos, 6.23.13 sincos, 6.23.26 single_inter, 13.6.6, 14.4.3 sinh, 6.16.2 size, 6.3.3, 6.39.3 sizes, 6.40.1 slope, 13.14.8 slopeat, 13.14.1 slopeatraw, 13.14.1 smith, 6.48.15 smod, 6.5.9 snedecor, 9.4.10 snedecor_cdf, 9.4.10 snedecor_icdf, 9.4.10 snedecord, 9.4.10 solid_line, 8.3.1 solve, 6.12.10, 6.21.1, 6.55.6, 8.7.7 sommet, 6.15.3 sort, 6.40.18 soundsec, 15.1.14 specnorm, 6.50.6 sphere, 14.15.4 spline, 6.27.31 split, 6.12.9 spreadsheet, 4.5 sq, 6.16.2 sqrfree, 6.27.17 sqrt, 6.16.2 square, 13.9.1, 14.8.1 square_point, 8.3.1 srand, 9.3.2 sst, 12.5.1 sst_in, 12.5.1 star_point, 8.3.1 stdDev, 9.1.4 stddev, 6.42.9, 6.45.16 stddevp, 6.42.9, 9.1.4 stdev, 9.1.3 steffenson_solver, 10.4.6 step, 12.3.3 stereo2mono, 15.1.5 sto, 5.4.2 string, 12.2.5, 12.4.7 string, 6.23.26 student, 9.4.8 student_cdf, 9.4.8 student_icdf, 9.4.8 studentd, 9.4.8 studentt, 9.5.3 sturm, 6.28.13 sturmab, 6.28.13 sturmseq, 6.28.13 subexpression, 4.3.2 subexpressions, 4.3.2, 4.3.3 subMat, 6.44.5 subs, 6.12.20 subsop, 6.40.7, 6.44.6 subst, 6.12.18 subtype, 12.2.5 sum, 6.20.3, 6.40.24, 6.45.4 sum_riemann, 6.20.4 supposons, 5.4.8 suppress, 6.40.8 surd, 6.16.2 svd, 6.49.8 svl, 6.49.7 swapcol, 6.45.11 swaprow, 6.45.11 switch, 12.3.2 switch_axes, 13.2.2 sylvester, 6.28.14 symb2poly, 6.27.5 symbol, 12.1.3 symmetry, 14.14.3 syst2mat, 6.56.1 TeXmacs, 2.2.4 TRUE, 6.1.1 table, 6.43 tablefunc, 6.13.1 tableseq, 6.13.4 tabvar, 6.17.2 tail, 6.3.5, 6.39.5 tan, 6.16.2 tan, 6.23.26 tan2cossin2, 6.23.18 tan2sincos, 6.23.14 tan2sincos2, 6.23.17 tangent, 8.7.5, 13.7.7, 14.6.3 tanh, 6.16.2 taylor, 6.36.2 tCollect, 6.23.4 tchebyshev1, 6.30.4 tchebyshev2, 6.30.5 tcoeff, 6.27.11 tcollect, 6.23.4 tExpand, 6.25.1 tetrahedron, 14.16.2 texpand, 6.25.1 textinput, 12.2.2 then, 12.3.1 thickness, 13.3.2 thiele, 6.27.33 threshold, 15.2.12 throw, 12.4.11 title, 8.3.2 tlin, 6.23.2 to, 12.3.3 tpsolve, 6.52.3 trace, 6.47.3, 13.18.3 tran, 6.47.1 translation, 13.15.2, 14.14.2 transpose, 6.47.1 trapeze, 8.10 tri, 15.2.3 triangle, 13.8.1, 14.7.1 triangle_paper, 13.2.7 triangle_point, 8.3.1 triangle_window, 15.2.25 trig, 6.25.2 trig2exp, 6.23.21 trigcos, 6.23.24 trigexpand, 6.23.1 triginterp, 6.27.30 trigsimplify, 6.23.6 trigsin, 6.23.23 trigtan, 6.23.25 trn, 6.47.7 true, 6.1.1 trunc, 6.16.2 truncate, 6.27.24 try, 12.4.11 tsimplify, 6.24.9 tstep, 13.3.2 tukey_window, 15.2.26 tuple, 6.41.5 type, 12.2.5 Unary, 6.14.2 Unquoted, 12.4.4 UTPC, 9.4.9 UTPF, 9.4.10 UTPN, 9.4.7 UTPT, 9.4.8 ufactor, 11.1.6 ugamma, 6.8.14 unapply, 6.15.2 unarchive, 5.4.6 unfactored, 8.13 uniform, 9.4.2 uniform_cdf, 9.4.2 uniform_icdf, 9.4.2 uniformd, 9.4.2 uniformd_cdf, 9.4.2 uniformd_icdf, 9.4.2 union, 6.38.5, 6.41.3 unitV, 6.10.5, 6.42.2 unquote, 6.12.5 until, 12.3.4 user_operator, 6.14.2 usimplify, 11.1.7 ustep, 13.3.2 VAR, 12.2.5 VARS, 5.4.9, 5.6.3 VAS, 6.29.3 VAS_positive, 6.29.4 valuation, 6.27.9 vandermonde, 6.44.2 variable, 5.4.1 variance, 6.42.9, 6.45.16, 9.1.2 vector, 12.2.5, 13.7.4, 14.5.4 vectors, 6.40 version, 2.2.5 vertices, 13.6.13, 14.16.6 vertices_abc, 13.6.13 vertices_abca, 13.6.14 vpotential, 6.21.7 vstep, 13.3.2 WAIT, 12.4.10 watch, 12.5.1 weibull, 9.4.16 weibull_cdf, 9.4.16 weibull_icdf, 9.4.16 weibulld, 9.4.16 weibulld_cdf, 9.4.16 weibulld_icdf, 9.4.16 welch_window, 15.2.27 when, 6.1.3, 6.1.3 while, 12.3.5 white, 8.3.1 widget_size, 3.5.10 wilcoxonp, 9.4.18 wilcoxons, 9.4.18 wilcoxont, 9.4.18 write, 12.4.3 writergb, 15.3.4 writewav, 15.1.3, 15.1.12 wz_certificate, 6.6.4 Xcas, 2.2.1, 3 xcas.rc, 3.5.10 xcas_mode, 3.5.2, 3.5.10 xml_print, 3.7.6 xor, 6.1.4 xstep, 13.3.2 xstep, 8.4 xyztrange, 3.5.10 yellow, 8.3.1 ystep, 13.3.2 ystep, 8.4 Zeta, 6.8.18 zeros, 6.12.11 zip, 6.40.29 zstep, 13.3.2 zstep, 8.4 ztrans, 6.58.1

# Chapter 2 Introduction

## 2.1 Notations used in this manual

In this manual, the information that you enter is typeset in typewriter font. User input typically takes one of three forms:

- Commands that you enter on the command line.
  For example, to compute the sin of π/4, you can type
  sin(pi/4)
- Commands requiring a prefix key.
  These are indicated by separating the prefix key and the standard key with a plus +. For example, to exit an Xcas session, you can type the control key along with the q key, which will be denoted
  Ctrl+Q
- Menu commands.
  When denoting menu items, submenus are connected using ▸. For example, from within Xcas you can choose the File menu, then choose the Open submenu, and then choose the File item. This will be indicated by
  File ▸ Open ▸ File

When describing entering a command, specific values that you enter for arguments are in typewriter font, while argument placeholders that should be replaced by actual values are in italics. Optional arguments will be enclosed by angle brackets. For example, you can find the derivative of an expression with the diff command (see Section 6.19.4), which takes the form diff(expr ⟨,x⟩]) where expr is an expression and x is a variable or list of variables. If the optional variable is omitted, then it will default to x. A specific example is diff(x*sin(x),x).

The index uses different typefaces for different parts of the language. The commands themselves are written with normal characters, command options are written in italics and values of commands or options are written in typewriter font. For example (as you will see later), you can draw a blue parabola with the command

plotfunc(x^2,color = blue)

In the index, you will see

- plotfunc, the command, written in normal text.
- color, the command option, written in italics.
- blue, the value given to the option, written in typewriter font.

## 2.2 Interfaces for the giac library

The giac library is a C++ mathematics library. It comes with two interfaces you can use directly; a graphical interface and a command-line interface. All interfaces can do symbolic and numeric calculations, use giac’s programming language, and have a built in help function.

The graphical interface is called Xcas, and is the most full-featured interface. Xcas has additional help features to make it easy to use, plus it has a built-in spreadsheet, it can do dynamic geometry and it can do turtle graphics. The output given by this interface is typeset; for example:
Input:

sqrt(1/2)

Output:

√ |
2
2

The command-line interface can be run inside a terminal, and in a graphical environment can also draw graphs. The output given by this interface is in text form; for example:
Input:

sqrt(1/2)

Output:

sqrt(2)/2

There is also a web version, which can be run through a javascript-enabled browser (it works best with Firefox), either over the internet or from local files. Other programs (for example, TeXmacs) have interfaces for the command-line version. Some of these interfaces, such as the two mentioned here, typeset their output.

- The Xcas interface
- The command-line interface: icas giac
- The Firefox interface
- The TeXmacs interface
- Checking the version of giac that you are using: version giac

# Chapter 3 The Xcas interface

## 3.1 The entry levels

The Xcas interface can run several independent calculation sessions, each session will be contained in a separate tab. Before you understand the Xcas interface, it would help to be familiar with the components of a session.

Each session can have any number of input levels. Each input level will have a number to the left of it; the number is used to identify the level. Each level can have one of the following:

- A command line.
  This is the default; you can open a new command line with Alt+N.
  You can enter a giac command (or a series of commands separated by semicolons) on a command line and send it to be evaluated by hitting enter. The result will then be displayed, and another command line will appear. You can also scroll through the command history with Ctrl+Up and Ctrl+Down.

  If the output is a number or an expression, then it will appear in blue text in a small area below the input region; this area will be an expression editor (see Section 4.3). There will be a scrollbar and a small M to the right of this area; the M is a menu which gives you various options.

  If the output is a graphic, then it will appear in a graphing area below the input region. To the right of the graphic will be a control panel which you can use to manipulate the graphic (see Section 8.2).

- An expression editor.
  See Section 4.3. You can open an expression editor with Alt+E.
- A two-dimensional geometry screen.
  See Section 8.2. You can open a two-dimensional geometry screen with Alt+G. This level will have a screen, as well as a control panel, menus and a command line to control the screen.
- A three-dimensional geometry screen.
  See Section 8.2. You can open a three-dimensional geometry screen with Alt+H. This level will have a screen, as well as a control panel, menus and a command line to control the screen.
- A turtle graphics screen.
  You can open a turtle graphics screen with Alt+D. This level will have a screen, as well as a program editor and command line.
- A spreadsheet.
  See Section 4.5. You can open a spreadsheet with Alt+T. A spreadsheet can open a graphic screen.
- A program editor.
  See Section 12.1.1. You can open a program editor with Alt+P.
- A comment line.
  See Section 4.2. You can open a comment line with Alt+C.

Levels can be moved up and down in a session, or even moved to a different session.

The level containing the cursor is the current level. The current level can be evaluated or re-evaluated by typing enter.

You can select a level (for later operations) by clicking on the number in the white box to the left of the level. Once selected, the box containing the number turns black. You can select a range of levels by clicking on the number for the beginning level, and then holding the shift key while you click on the number for the ending level.

You can copy the instructions in a range of levels by selecting the range, and then clicking the middle mouse button on the number of the target level.

## 3.2 The starting window

When you first start Xcas, you get a largely blank window.

The first row will consist of the main menus; you can save and load Xcas sessions, configure Xcas and its interface and run various commands with entries from these menus.

The second row will contains tabs; one tab for each session that you are running in Xcas. Each tab will have the name of its session, or Unnamed if the session has no name. The first time you start Xcas, there will be only one session, which will be unnamed.

The third row will contain various buttons.

- The first button, ?, opens the help index (The same as the Help▸Index menu entry; see Section 3.3). If there is a command on the command line, the help index will open at this command.
- The second button, Save, saves the session in a file. The first time you click on it you will be prompted for a file name ending in .xws in which to save the session. The button will be pink if the session is not saved or if it has changed since the last change, it will be green once the session is saved. The name in the title will be the name of the file used to save the session.
- The third button, which in the picture above is
  Config: exact real RAD 12 xcas 6.2148M,
  is a status line indicating the current Xcas configuration (see Section 3.5). If the session is unsaved, it will begin with Config:; if the session is saved in a file filename.xws, this button will begin with Config filename.xws:. Other information on this status line:
  1. exact or approx
     This tells you whether Xcas will give you exact values, such as √2, when possible or gives you decimal approximations, such as 1.4142135. (See Section 3.5.4.)
  2. real, cplx or CPLX.
     When this shows real (for example), then Xcas will by default only find real solutions of equations. When this shows cplx, then Xcas will find complex solutions of equations. When this shows CPLX, then Xcas will regard variables as complex; for example, it won’t simplify re(z) (the real part of the variable z) to z. (See sections 3.5.5 and 3.5.6.)
  3. RAD or DEG.
     This tells you whether angles, as in trigonometric arguments, are measured in radians or degrees. (See Section 3.5.3.)
  4. An integer.
     This tells you how many significant digits will be used in floating point calculations. (See Section 3.5.1.)
  5. xcas, python ^=**, python ^=xor, maple, mupad, or ti89.
     This tells you what syntax Xcas will use. Xcas can be set to emulate the languages of Python, Maple, MuPAD, or the TI89 series of calculators. (See Section 3.5.2.)
  6. The last item tells you how much memory Xcas is using.
  Clicking on this status line button opens a window where you can configure the settings shown on this line as well as some other settings; you can also open the window with the menu item Cfg▸CAS Configuration (see Section 3.5.7).
- The fourth button, STOP (in red), is used to halt a computation which is running on too long.
- The fifth button, Kbd, toggles an on-screen scientific keyboard at the bottom of the window.
  Along the right hand side of the keyboard are some keys that can be used to change the keyboard.
  - The X key hides the keyboard, just like pressing the Kbd button again.
  - The cmds key toggles a menu bar at the bottom of the screen which can be used as an alternate menu or persistent submenu. This bar will contain buttons home, <<, some menu titles, >>, var, cust and X.

    The << and >> buttons scroll through menu items. Clicking on one of the menu buttons will perform the appropriate action or replace the menu items by its submenu items. When submenu items appear, there will also be a BACK button to return to the previous menu. Clicking on the home button returns the menu buttons to the main menu.

    After the menu buttons is a var button. This replaces the menu buttons by buttons representing the variables that you have defined. After that is a cust button, which displays commands that you store in a list variable CST (see section 5.4.10).

    The last button, X, closes the menu bar.

  - The msg key brings up a message window at the bottom of the window which will give you helpful messages; for example, if you save a graphic, it will tell you the name of the file it is saved in and how to include it in a LATEX file.
  - The abc key toggles the keyboard between the scientific keyboard and an alphabetic keyboard.
- The fifth button, X, closes the current session.

## 3.3 Getting help

Xcas is an extensive program, but using it is simplified with several different ways of getting help. The help menu (see section 3.4.4) has several submenus for various forms of help, some of which are mentioned below.

- - Tooltips
  - HTML help
  - The help index
  - findhelp

## 3.4 The menus

The menus provide different ways to work with Xcas and its sessions, as well as ways of inserting functions and constants into the current session. Selecting a menu item corresponding to a function or constant brings up the help index (see section 3.3) with the chosen function or constant selected.

- The File menu
- The Edit menu
- The Cfg menu
- The Help menu
- The Toolbox menu
- The Expression menu
- The Cmds menu
- The Prg menu
- The Graphic menu
- The Geo menu
- The Spreadsheet menu
- The Phys menu
- The Highschool menu
- The Turtle menu

## 3.5 Configuring Xcas

- The number of significant digits: Digits DIGITS
- The language mode: xcas_mode
- The units for angles: angle_radian
- Exact or approximate values: approx_mode
- Complex numbers: cfactor complex_mode
- Complex variables: complex_variables
- Configuring the computations
- Configuring the graphics
- More configuration
- The configuration file: widget_size cas_setup xcas_mode xyztrange

## 3.6 Printing and saving

- Saving a session
- Saving a spreadsheet
- Saving a program
- Printing a session

## 3.7 Translating to other computer languages

Xcas can translate a session, or parts of a session, to other computer languages; notably LATEX and MathML.

- Translating an expression to LATEX: latex
- Translating the entire session to LATEX
- Translating graphical output to LATEX: graph2tex graph3d2tex
- Translating an expression to MathML: mathml
- Translating a spreadsheet to MathML
- Indent an XML string: xml_print
- Export to presentation or content MathML: export_mathml
- Translating a Maple file to Xcas: maple2xcas

# Chapter 4 Entry in Xcas

## 4.1 Suppressing output: nodisp :;

If you enter a command into Xcas, the result will appear in the output box below the input. If you enter

a:= 2+2

then

4

will appear in the output box.

The nodisp command is used to evaluate an expression and suppress the output.

- nodisp takes one argument:
  expr, an expression.
- nodisp(expr) evaluates expr but displays Done in place of the result.

Example.
Input:

nodisp(a:= 2+2)

Output:

Done

and a will be set to 4.

An alternate way of suppressing the output is to end the input with :;.

Example.
Input:

b:= 3+3:;

Output:

Done

and b will be set to 6.

## 4.2 Entering comments: comment

You can annotate an Xcas session by adding comments. You can enter a comment on the current line at any time by typing Alt+C. The line will appear in green text and conclude when you type Enter. Comments are not evaluated and so have no output. If you have started entering a command when you begin a comment, the command line with the start of the command will be pushed down so that you can finish it when you complete the comment.

You can open the browser using a comment line by entering the web address beginning with the @ sign. If you enter the comment line

The Xcas homepage is at
@www-fourier.ujf-grenoble.fr/~parisse/giac.html

then the browser will open to the Xcas home page.

To add a comment to a program, rather than a session, you can use the comment command.

- comment takes one argument:
  str, a string.
- comment(str) makes str a comment.

Alternatively, any part of a program between // and the end of the line is a comment. So both

bs():= {comment("Hello"); return "Hi there!";}

and

bs():= { // Hello
return "Hi there!";}

are programs with the comment "Hello".

## 4.3 Editing expressions

You can enter expressions on the command line, but Xcas also has a built-in expression editor that you can use to enter expressions in two dimensions, the way they normally look when typeset. When you have an expression in the editor, you can also manipulate subexpressions apart from the entire expression.

- Entering expressions in the editor: an example
- Subexpressions
- Manipulating subexpressions

## 4.4 Previous results: ans

The ans command returns the results of previous commands.

- ans takes one optionaly argument:
  Optionally, n, an integer (the number of the command beginning with 0).
- ans(⟨ n⟩ ) returns the corresponding result; in particular, ans(-1) returns the previous result.

Example.
If the first command that you enter is:
Input:

2+5

resulting in
Output:

7

then later references to ans(0) will evaluate to 7.

Note that the argument to ans doesn’t correspond to the line number in Xcas. For one thing, the line numbers begin at 1. What’s more, if you go back and re-evaluate a previous line, then that will become part of the commands that ans keeps track of.

If you give ans a negative number, then it counts backwards from the current input. To get the latest output, for example, you can use ans(-1). With no argument, ans() will also return the latest output.

Similarly, the quest command returns the previous inputs. Since these will often be simplified to be the same as the output, quest(n) sometimes has the same value as ans(n).

You can also use Ctrl plus the arrow keys to scroll through previous inputs. With the cursor on the command line, Ctrl+uparrow will go backwards in the list of previous commands and display them on the current line, and Ctrl+downarrow will go forwards.

## 4.5 Spreadsheet

- Opening a spreadsheet
- The spreadsheet window

# Chapter 5 CAS building blocks

## 5.1 Numbers

Xcas works with both real and complex numbers. The real numbers can be integers, rational numbers, floating point numbers or symbolic constants.

You can enter an integer by simply typing the digits.
Input:

1234321

Output:

1234321

Alternatively, you can enter an integer in binary (base 2) by prefixing the digits (0 through 1) with 0b, in octal (base 8) by prefixing the digits (0 through 7) with 0 or 0o, and in hexadecimal (base 16) by prefixing the digits (0 through 9 and a through f) with 0x. (See Section 6.4.1.)
Input:

0xab12

Output:

43794

You can enter a rational number as the ratio of two integers.
Input:

123/45

Output:

41
15

The result will be put in lowest terms. If the top is a multiple of the bottom, the result will be an integer.
Input:

123/3

Output:

41

A floating point number is regarded as an approximation to a real number. You can enter a floating point number by writing it out with a decimal point.
Input:

123.45

Output:

123.45

You can also enter a floating point number by entering a sequence of digits, with an optional decimal point, followed by e and then an integer, where the e represents “times 10 to the following power.”
Input:

1234e3

Output:

1234000.0

Floating point numbers with a large number of digits will be printed with e notation; you can control how other floats are displayed (see Section 3.5.7, item 7). An integer or rational number can be converted to a floating point number with evalf (see Section 6.8.1).

A complex number is a number of the form a+bi, where a and b are real numbers. The numbers a and b will be the same type of real number; one type will be converted to the other type if necessary (an integer can be converted to a rational number or a floating point number, and a rational number can be converted to a floating point number).
Input:

3 + 1.1i

Output:

3+1.1i

## 5.2 Symbolic constants: e pi infinity inf i euler_gamma

Xcas has the standard constants given by built-in symbols, given in the following table.

Symbol | Value
e (or %e) | the number exp(1)
pi (or %pi) | the number π
infinity | unsigned ∞
+infinity (or inf) | +∞
-infinity (or -inf) | −∞
i (or %i) | the complex number i
euler_gamma | Euler’s constant γ; namely, limn→∞(∑k=1n − ln(n))

Since these numbers cannot be written exactly as standard decimal numbers, they are necessarily left unevaluated in exact results (see Section 3.5.4).
Input:

2*pi

Output:

2π

Input:

2.0*pi

Output:

6.28318530718

You can also use evalf (see Section 6.8.1), for example, to approximate one of the real-valued constants to as many decimal places as you want.
Input:

evalf(pi,50)

Output:

3.1415926535897932384626433832795028841971693993751

## 5.3 Sequences, sets and lists

- Sequences: seq[] ()
- Sets: set[]
- Lists: [ ]
- Accessing elements

## 5.4 Variables

- Variable names
- Assigning values: := => = assign sto Store
- Assignment by reference: =<
- Copying lists: copy
- Incrementing variables: += -= *= /=
- Storing and recalling variables and their values: archive unarchive
- Copying variables: CopyVar
- Assumptions on variables: about additionally assume purge supposons and or
- Unassigning variables: VARS purge DelVar del restart rm_a_z rm_all_vars
- The CST variable

## 5.5 Functions

- Defining functions

## 5.6 Directories

- Working directories: pwd cd
- Reading files: read load
- Internal directories: NewFold SetFold GetFold DelFold VARS

# Chapter 6 The CAS functions

## 6.1 Booleans

- Boolean values: true false
- Tests: == != > >= < =<
- Defining functions with boolean tests: ifte ?: when
- Boolean operators: or xor and not
- Transforming a boolean expression to a list: exp2list
- Transforming a list into a boolean expression: list2exp
- Evaluating booleans: evalb

## 6.2 Bitwise operators

- Basic operators: bitor bitxor bitand
- Bitwise Hamming distance: hamdist

## 6.3 Strings

- Characters and strings: "
- The newline character: \n
- The length of a string: size length
- The left and right parts of a string: left right
- First character, middle and end of a string: head mid tail
- Concatenation of a sequence of words: cumSum
- ASCII code of a character: ord
- ASCII code of a string: asc
- String defined by the ASCII codes of its characters: char
- Finding a character in a string: inString
- Concatenating objects into a string: cat
- Adding an object to a string: +
- Transforming a real number into a string: cat +
- Transforming a string into a number: expr

## 6.4 Writing an integer in a different base

- Writing an integer in base 2, 8 or 16
- Writing an integer in an arbitrary base b: convert

## 6.5 Integers (and Gaussian Integers)

Xcas can manage integers with unlimited precision, such as the following (see Section 6.6.1):
Input:

factorial(100)

Output:

9332621544394415268169923885626670049071596826438162
1468592963895217599993229915608941463976156518286253
697920827223758251185210916864000000000000000000000000

Gaussian integers are numbers of the form a+ib, where a and b are in ℤ. For most functions in this section, you can use Gaussian integers in place of integers.

- GCD: gcd igcd Gcd
- GCD of a list of integers: lgcd
- The least common multiple: lcm
- Decomposition into prime factors: ifactor
- List of prime factors: ifactors
- Matrix of factors: maple_ifactors
- The divisors of a number: idivis divisors
- The integer Euclidean quotient: iquo intDiv div
- The integer Euclidean remainder: irem remain smod mods mod %
- Euclidean quotient and Euclidean remainder of two integers: iquorem
- Test of evenness: even
- Test of oddness: odd
- Test of pseudo-primality: is_pseudoprime
- Test of primality: is_prime isprime isPrime
- The smallest pseudo-prime greater than n: nextprime
- The greatest pseudo-prime less than n: prevprime
- The nth pseudo-prime number: ithprime
- The number of pseudo-primes less than or equal to n: nprimes
- Bézout’s Identity: iegcd igcdex
- Solving au+bv=c in ℤ: iabcuv
- Chinese remainders: ichinrem ichrem chrem
- Solving a2+b2=p in ℤ: pa2b2
- Solving Diophantine equations: isolve
- The Euler indicatrix: euler phi
- Legendre symbol: legendre_symbol
- Jacobi symbol: jacobi_symbol
- Listing all compositions of an integer into k parts: icomp

## 6.6 Combinatorial analysis

- Factorial: factorial !
- Binomial coefficients: binomial comb nCr
- Permutations: perm nPr
- Wilf-Zeilberger pairs: wz_certificate

## 6.7 Rational numbers

- Transform a floating point number into a rational: exact float2rational
- Integer and fractional part: propfrac propFrac
- Numerator of a fraction after simplification: numer getNum
- Denominator of a fraction after simplification: denom getDenom
- Numerator and denominator of a fraction: f2nd fxnd
- Simplifying a pair of integers: simp2
- Continued fraction representation of a real: dfc
- Transforming a continued fraction representation into a real: dfc2f
- The n-th Bernoulli number: bernoulli
- Accessing to PARI/GP commands: pari

## 6.8 Real numbers

- Evaluating a real at a given precision: evalf Digits DIGITS
- The standard infixed operators on real numbers: + - * / ^
- Prefixed division on reals: rdiv
- n-th root: root
- The exponential integral function: Ei
- The logarithmic integral function: Li
- The cosine integral function: Ci
- The sine integral function: Si
- The Heaviside function: Heaviside
- The Dirac distribution: Dirac
- Error function: erf
- Complementary error function: erfc
- The Γ function: Gamma
- The upper incomplete γ function: ugamma
- The lower incomplete γ function: igamma
- The β function: Beta
- Derivatives of the DiGamma function: Psi
- The ζ function: Zeta
- Airy functions: Airy_Ai and Airy_Bi

## 6.9 Permutations

A permutation p of size n is a bijection from [0..n−1] to [0..n−1] and is represented by the list: [p(0),p(1),p(2)… p(n−1)].
For example, the permutation p represented by [1,3,2,0] is the function from [0,1,2,3] to [0,1,2,3] defined by:

p(0)=1, p(1)=3, p(2)=2, p(3)=0

A cycle c of size p, represented by the list [a0,…,ap−1] (0≤ ak≤ n−1), is the permutation such that

c(ai)=ai+1 for (i=0..p−2), c(ap−1)=a0, c(k)=k otherwise

For example, the cycle c represented by the list [3,2,1] is the permutation c defined by c(3)=2, c(2)=1, c(1)=3, c(0)=0 (i.e. the permutation represented by the list [0,3,1,2]).

- Random permutation: randperm shuffle
- Previous and next permutation: prevperm nextperm
- Decomposing a permuation into a product of disjoint cycles: permu2cycles
- Product of cycles to permutation: cycles2permu
- Transforming a cycle into a permutation: cycle2perm
- Transforming a permutation into a matrix: permu2mat
- Checking for a permutation: is_permu
- Checking for a cycle: is_cycle
- Product of two permutations: p1op2 c1op2 p1oc2 c1oc2
- Signature of a permutation: signature
- Inverse of a permutation: perminv
- Inverse of a cycle: cycleinv
- Order of a permutation: permuorder
- The group generated by two permutations: groupermu

## 6.10 Complex numbers

Note that complex numbers, as well as being numbers, are used to represent points in the plane (see Section 13.6.2). Some functions and operators which work on complex numbers also work on points.

- The usual complex operators: + - * / ^
- The real and imaginary parts of a complex number: re real im imag
- Writing a complex number z in rectangular form: evalc
- The modulus and argument of a complex number: abs arg
- The normalized complex number: normalize unitV
- Conjugate of a complex number: conj
- Multiplication by the complex conjugate: mult_c_conjugate
- Barycenter of complex numbers: barycenter

## 6.11 Algebraic numbers

- Definition
- Minimum polynomial of an algebraic number: pmin

## 6.12 Algebraic expressions

- Evaluating an expression: eval
- Changing the evaluation level: eval_level
- Evaluating algebraic expressions: evala
- Preventing evaluation: quote hold ’
- Forcing evaluation: unquote
- Distribution: expand fdistrib
- Canonical form: canonical_form
- Multiplication by the conjugate quantity: mult_conjugate
- Separation of variables: split
- Factoring: factor cfactor
- Zeros of an expression: zeros
- Regrouping expressions: regroup
- Normal form: normal
- Simplifying: simplify
- Automatic simplification: autosimplify
- Normal form for rational functions: ratnormal
- Substituting a variable by a value: |
- Substituting a variable by a value: subst
- Substituting a variable by a value: ()
- Substituting a variable by a value (Maple and Mupad compatibility): subs
- Substituting a subexpression by another expression: algsubs
- Eliminating one or more variables from a list of equations: eliminate
- Evaluating a primitive at boundaries: preval
- Sub-expression of an expression: part

## 6.13 Values of a sequence un

- Array of values of a sequence : tablefunc
- Values of a recurrence relation or a system: seqsolve
- Values of a recurrence relation or a system: rsolve
- Table of values and graph of a recurrent sequence: tableseq

## 6.14 Operators or infixed functions

An operator is an infixed function. For example, the arithmetic functions +, -, *, /, and ^ are operators. (See Section 6.8.2 and Section 6.10.1.)

- Xcas operators: $ %
- Defining an operator: user_operator

## 6.15 Functions and expressions with symbolic variables

- The difference between a function and an expression
- Transforming an expression into a function: unapply
- Top and leaves of an expression: sommet feuille op left right

## 6.16 Functions

- Context-dependent functions.
  - The + operator
  - The -,* and / operators
- Standard functions
- Defining algebraic functions
  - Defining a function from ℝp to ℝq
  - Defining families of function from ℝp−1 to ℝq using a function from ℝp to ℝq
- Composing functions: @
- Repeated function composition: @@
- Defining a function with history: as_function_of

## 6.17 Getting information about functions from ℝ to ℝ

- The domain of a function: domain
- Table of variations of a function: tabvar

## 6.18 Limits: limit

The limit command computes limits, both at numbers and infinities, and in the real case it can compute one-sided limits.

- limit takes three mandatory and one optional argument.
  - expr, an expression.
  - x, the name of a variable.
  - a, the limit point.
  - Optionally, side (either 0, -1 or 1), to specify which side to take a one-sided limit (by default side=0).
- limit(expr,x,a ⟨,side⟩) returns the limit of expr as x approaches a.
  - If side is 0 (the default), then the ordinary limit is returned.
  - If side is -1, then the limit from the left (x<a) is returned.
  - If side is 1, then the limit from the right (x>a) is returned.

Remark:
It is also possible to put x=a as argument instead of x,a; limit(expr,var=pt[,side]) is equivalent to limit(expr,var,pt[,side]).

Examples.

- Input:
  limit(1/x,x,0,-1)
  or:
  limit(1/x,x=0,-1)
  Output:

  −∞

- Input:
  limit(1/x,x,0,1)
  or:
  limit(1/x,x=0,1)
  Output:

  +∞

- Input:
  limit(1/x,x,0,0)
  or:
  limit(1/x,x,0)
  or:
  limit(1/x,x=0)
  Output:

  ∞

  (Note that ∞ or infinity without an explicit + or - represents unsigned infinity.) Hence, abs(1/x) approaches +∞ when x approaches 0.

Exercises.

- Find, for n>2, the limit as x approaches 0 of:

  ntan(x)−tan(nx)
  sin(nx)−nsin(x)

  Input:
  limit((n*tan(x)-tan(n*x))/(sin(n*x)-n*sin(x)),x=0)
  Output:

  2

- Find the limit as x approaches +∞ of

  √
  x+ |
  √
  x+ | √ |
  x
  | − | √ |
  x

  Input:
  limit(sqrt(x+sqrt(x+sqrt(x)))-sqrt(x),x=+infinity)
  Output:

  1
  2

- Find the limit as x approaches 0 of

  √ |
  1+x+x2/2
  | −exp(x/2)
  (1−cos(x))sin(x)

  Input:
  limit((sqrt(1+x+x^2/2)-exp(x/2))/((1-cos(x))*sin(x)),x,0)
  Output:

  − |
  1
  6

## 6.19 Derivation and applications

- Functional derivative: function_diff
- Length of an arc: arcLen
- Maximum and minimum of an expression: fMax fMin
- Derivatives and partial derivatives
- Implicit differentiation: implicitdiff
- Numerical differentiation: numdiff

## 6.20 Integration

- Antiderivative and definite integral: integrate int Int
- Primitive and definite integral: risch
- Discrete summation: sum
- Riemann sum: sum_riemann
- Integration by parts
  - ibpdv
  - ibpu
- Change of variables: subst
- Integrals and limits

## 6.21 Multivariate calculus

- Gradient: derive deriver diff grad
- Laplacian: laplacian
- Hessian matrix: hessian
- Divergence: divergence
- Rotational: curl
- Potential: potential
- Conservative flux field: vpotential
- Determining where a function is convex: convex

## 6.22 Calculus of variations

- The Brachistochrone Problem
- Euler-Lagrange equation(s): euler_lagrange
- Solution of the Brachistochrone Problem
- Jacobi equation: jacobi_equation
- Finding conjugate points: conjugate_equation
- An example: Finding the surface of revolution with minimal area

## 6.23 Trigonometry

Xcas can evaluate the trigonometric functions in either radians or degrees (see Section 6.16.2). It can also manipulate them algebraically.

- Expanding a trigonometric expression: trigexpand
- Linearizing a trigonometric expression: tlin
- Increasing the phase by π/2 in a trigonometric expression: shift_phase
- Putting together sine and cosine of the same angle: tcollect tCollect
- Simplifying: simplify
- Simplifying trigonometric expressions: trigsimplify
- Transforming arccos into arcsin: acos2asin
- Transforming arccos into arctan: acos2atan
- Transforming arcsin into arccos: asin2acos
- Transforming arcsin into arctan: asin2atan
- Transforming arctan into arcsin: atan2asin
- Transforming arctan into arccos: atan2acos
- Transforming complex exponentials into sin and cos: sincos exp2trig
- Transforming tan(x) into sin(x)/cos(x): tan2sincos
- Transforming sin(x) into cos(x)*tan(x): sin2costan
- Transforming cos(x) into sin(x)/tan(x): cos2sintan
- Rewriting tan(x) in terms of sin(2x) and cos(2x): tan2sincos2
- Rewriting tan(x) in terms of cos(2x) and sin(2x): tan2cossin2
- Rewriting sin, cos, tan in terms of tan(x/2): halftan
- Rewriting trigonometric functions in terms of tan(x/2) and hyperbolic functions in terms of exp(x): halftan_hyp2exp
- Transforming trigonometric functions into complex exponentials : trig2exp
- Transforming inverse trigonometric functions into logarithms: atrig2ln
- Simplifying and expressing preferentially with sines: trigsin
- Simplifying and expressing preferentially with cosines: trigcos
- Simplifying and expressing preferentially with tangents: trigtan
- Rewriting an expression with different options: convert convertir =>

## 6.24 Exponentials and Logarithms

- Rewriting hyperbolic functions as exponentials: hyp2exp
- Expanding exponentials: expexpand
- Expanding logarithms: lnexpand
- Linearizing exponentials: lin
- Collecting logarithms: lncollect
- Expanding powers: powexpand
- Rewriting a power as an exponential: pow2exp
- Rewriting exp(n*ln(x)) as a power: exp2pow
- Simplifying complex exponentials: tsimplify

## 6.25 Rewriting transcendental and trigonometric expressions

- Expanding transcendental and trigonometric expressions: texpand tExpand
- Combining terms of the same type: combine

## 6.26 Fourier transformation

- Fourier coefficients: fourier_an and fourier_bn or fourier_cn
  - fourier_an
  - fourier_bn
  - fourier_cn
- Continuous Fourier Transform: fourier ifourier addtable
- Discrete Fourier Transform and the Fast Fourier Transform
  - The properties of the Discrete Fourier Transform
  - Applications
- An exercise with fft

## 6.27 Polynomials

- Polynomials of a single variable: poly1
- Polynomials of several variables: %%%{ %%%}
- Apply a function to the internal sparse format of a polynomial: map
- Converting to a symbolic polynomial: r2e poly2symb
- Converting from a symbolic polynomial: e2r symb2poly
- Transforming a polynomial in internal format into a list, and conversely: convert
- Coefficients of a polynomial: coeff coeffs
- Polynomial degree: degree
- Polynomial valuation: valuation ldegree
- Leading coefficient of a polynomial: lcoeff
- Trailing coefficient degree of a polynomial: tcoeff
- Evaluating polynomials: peval polyEval
- Factoring xn in a polynomial: factor_xn
- GCD of the coefficients of a polynomial: content
- Primitive part of a polynomial: primpart
- Factoring: collect
- Square-free factorization: sqrfree
- List of factors: factors
- Evaluating a polynomial: horner
- Rewriting in terms of the powers of (x-a): ptayl
- Computing with the exact root of a polynomial: rootof
- Exact roots of a polynomial: roots
- Coefficients of a polynomial defined by its roots: pcoeff pcoef
- Truncating to order n: truncate
- Converting a series expansion into a polynomial: convert convertir
- Random polynomial: randpoly randPoly
- Changing the order of variables: reorder
- Random lists: ranm
- Lagrange polynomial: lagrange interp
- Trigonometric interpolation: triginterp
- Natural splines: spline
  - Definition
  - Theorem
  - Types of spline functions
- Natural interpolation: spline
- Rational interpolation: thiele
- Rational interpolation without poles: ratinterp

## 6.28 Arithmetic and polynomials

Polynomials are represented by expressions or by lists of coefficients in decreasing power order. In the first case, for instructions requiring a main variable (like extended gcd computations), the variable used by default is x if not specified. For coefficients in ℤ/nℤ, use % n for each coefficient of the list or apply it to the entire expression defining the polynomial.

- The divisors of a polynomial: divis
- Euclidean quotient: quo Quo
- Euclidean remainder: rem Rem
- Quotient and remainder: quorem divide
- GCD of two polynomials with the Euclidean algorithm: gcd Gcd
- GCD of two polynomials with the Euclidean algorithm: Gcd
- Choosing the GCD algorithm of two polynomials: ezgcd heugcd modgcd psrgcd
- LCM of two polynomials: lcm
- Bézout’s Identity: egcd gcdex
- Solving au+bv=c over polynomials: abcuv
- Chinese remainders: chinrem
- Cyclotomic polynomial: cyclotomic
- Sturm sequences and number of sign changes of P on (a, b]: sturm sturmseq sturmab
- Sylvester matrix of two polynomials and resultant: sylvester resultant

## 6.29 Exact bounds for roots of a polynomial

- Exact bounds for real roots of a polynomial: realroot
- Exact bounds for complex roots of a polynomial: complexroot
- Exact bounds for real roots of a polynomial: VAS
- Exact bounds for positive real roots of a polynomial: VAS_positive
- An upper bound for the positive real roots of a polynomial: posubLMQ
- A lower bound for the positive real roots of a polynomial: poslbdLMQ
- Exact values of rational roots of a polynomial: rationalroot
- Exact values of the complex rational roots of a polynomial: crationalroot

## 6.30 Orthogonal polynomials

- Legendre polynomials: legendre
- Hermite polynomial: hermite
- Laguerre polynomials: laguerre
- Tchebychev polynomials of the first kind: tchebyshev1
- Tchebychev polynomial of the second kind: tchebyshev2

## 6.31 Gröbner basis and Gröbner reduction

- Gröbner basis: gbasis
- Gröbner reduction: greduce
- Testing if a polynomial or list of polynomials belongs to an ideal given by a Gröbner basis: in_ideal
- Building a polynomial from its evaluation: genpoly

## 6.32 Rational functions

- Numerator: getNum
- Numerator after simplification: numer
- Denominator: getDenom
- Denominator after simplification: denom
- Numerator and denominator: f2nd fxnd
- Simplifying: simp2
- Common denominator: comDenom
- Polynomial and fractional part: propfrac
- Partial fraction expansion: partfrac cpartfrac

## 6.33 Exact roots and poles

- Roots and poles of a rational function: froot
- Rational function given by roots and poles: fcoeff

## 6.34 Computing in ℤ/pℤ or in ℤ/pℤ[x]

The way to compute over ℤ/pℤ or over ℤ/pℤ[x] depends on the syntax mode:

- In Xcas mode, an object n over ℤ/pℤ is written n % p.
  The representation is the symmetric representation:
  11%13 returns -2%13.

  Examples.

  - An integer n in ℤ/13ℤ
    n:=12%13.
  - a vector V in ℤ/13ℤ
    V:=[1,2,3]%13 or V:=[1%13,2%13,3%13].
  - a matrix A in ℤ/13ℤ
    A:=[[1,2,3],[2,3,4]]%13 or
    A:=[[1%13,2%13,3%13],[[2%13,3%13,4%13]].
  - a polynomial A in ℤ/13ℤ[x] in symbolic representation
    A:=(2*x^2+3*x-1)%13 or
    A:=2%13*x^2+3%13*x-1%13.
  - a polynomial A in ℤ/13ℤ[x] in list representation
    A:=poly1[1,2,3]%13 or A:=poly1[1%13,2%13,3%13].

  To recover an object o with integer coefficients instead of modular coefficients, input o % 0. For example:
  Input:

  o:=4%7;:
  o%0

  Output:

  −3

  Remark. Most Xcas functions that work on integers or polynomials with integer coefficients will often work the same on ℤ/pℤ or ℤ/pℤ[x], with the obvious exception that the input and output will be modular. They will be listed in the remaining subsections. For some commands in ℤ/pℤ or in ℤ/pℤ[x], p must be a prime integer.

- In Maple mode, integers modulo p are represented like usual integers instead of using specific modular integers. To avoid confusion with normal commands, modular commands are written with a capital letter (inert form) and followed by the mod command.

  The Maple commands will be discussed in Section 6.35.

- Expanding and reducing: normal
- Addition in ℤ/pℤ or in ℤ/pℤ[x]: +
- Subtraction in ℤ/pℤ or in ℤ/pℤ[x]: -
- Multiplication in ℤ/pℤ or in ℤ/pℤ[x]: *
- Euclidean quotient : quo
- Euclidean remainder: rem
- Euclidean quotient and euclidean remainder: quorem
- Division in ℤ/pℤ or in ℤ/pℤ[x]: /
- Power in ℤ/pℤ and in ℤ/pℤ[x]: ^
- Computing an mod p: powmod powermod
- Inverse in ℤ/pℤ: inv inverse /
- Rebuilding a fraction from its value modulo p: fracmod iratrecon
- GCD in ℤ/pℤ[x]: gcd
- Factoring over ℤ/pℤ[x]: factor factoriser
- Determinant of a matrix in ℤ/pℤ: det
- Inverse of a matrix with coefficients in ℤ/pℤ: inv inverse
- Row reduction to echelon form in ℤ/pℤ: rref
- Construction of a Galois field: GF
- Factoring a polynomial with coefficients in a Galois field: factor

## 6.35 Computing in ℤ/pℤ[x] using Maple syntax

You can set Xcas to work in Maple mode rather than native Xcas mode (see Section 3.5.2).

- Euclidean quotient: Quo
- Euclidean remainder: Rem
- GCD in ℤ/pℤ[x]: Gcd
- Factoring in ℤ/pℤ[x]: Factor
- Determinant of a matrix with coefficients in ℤ/pℤ: Det
- Inverse of a matrix in ℤ/pℤ: Inverse
- Row reduction to echelon form in ℤ/pℤ: Rref

## 6.36 Taylor and asymptotic expansions

- Dividing by increasing power order: divpc
- Series expansion: taylor series
- The inverse of a series: revert
- The residue of an expression at a point: residue
- Padé expansion: pade

## 6.37 Ranges of values

- Definition of a range of values: ..
- Center of a range of values: interval2center
- Ranges of values defined by their center: center2interval

## 6.38 Intervals

- Defining intervals: i[]
- The endpoints of an interval: left right
- Interval arithmetic: + - * /
- The midpoint of an interval: midpoint
- The union of intervals: union
- The intersection of intervals: intersect
- Testing if an object is in an interval: contains
- Converting a number into an interval: convert
- Converting box constraints from matrix to interval form: box_constraints

## 6.39 Sequences and lists

- Defining a sequence or a list: seq[ ] ()
- Making a sequence or a list: seq $
- Length of a sequence or list: size nops length
- Getting the first element of a sequence or list: head
- Getting a sequence or list without the first element: tail
- Getting an element of a sequence or a list: [] [[]] at
- Finding a subsequence or a sublist
- Concatenating two sequences: ,
- The + operator applied on sequences and lists
- Transforming sequences into lists and lists into sequences: [] nop op makesuite

## 6.40 Operations on lists

- Sizes of a list of lists: sizes
- Making a list with a function: makelist
- Making a list with zeros: newList
- Making a list of integers: range
- Selecting elements of a list: select
- The left and right portions of a list: left right
- Modifying the elements of a list: subsop
- Removing an element in a list: suppress
- Removing elements of a list: remove
- Inserting an element into a list or a string: insert
- Appending an element at the end of a list: append
- Prepending an element at the beginning of a list: prepend
- Concatenating two lists or a list and an element: concat augment
- Flattening a list: flatten
- Reversing order in a list: revlist
- Rotating a list: rotate
- Shifting the elements of a list: shift
- Sorting: sort
- Sorting a list by increasing order: SortA
- Sorting a list by decreasing order: SortD
- Number of elements equal to a given value: count_eq
- Number of elements smaller than a given value: count_inf
- Number of elements greater than a given value: count_sup
- Sum of elements of a list: sum add
- Sum of list (or matrix) elements transformed by a function: count
- Cumulated sum of the elements of a list: cumSum
- Product: product mul
  - Product of values of an expression: product
  - Product of elements of a list: product
- Applying a function of one variable to the elements of a list: map apply
- Applying a bivariate function to the elements of two lists: zip
- Folding operators: foldl foldr
- List of differences of consecutive terms: deltalist
- Making a matrix with a list: list2mat
- Making a list with a matrix: mat2list

## 6.41 Operations on sets and lists

- Defining a set or list: set[ ] %{ %}
- Testing if a value is in a list or a set: member contains
- Union of two sets or of two lists: union
- Intersection of two sets or of two lists: intersect
- Difference of two sets or of two lists: minus
  - Cartesian products
  - Defining an n-tuple: tuple
  - The Cartesian product of two sets: *

## 6.42 Functions for vectors

- Norms of a vector: maxnorm l1norm l2norm norm
- Normalizing a vector: normalize unitV
- Term by term sum of two lists: + .+
- Term by term difference of two lists: - .-
- Term by term product of two lists: .*
- Term by term quotient of two lists: ./
- Scalar product : scalar_product * dotprod dot dotP scalar_Product
- Cross product: cross crossP crossproduct
- Statistics on lists: mean variance stddev stddevp median quantile quartiles boxwhisker

## 6.43 Tables with strings as indices: table

A table is a map (associative container) used to store information associated to indices which are much more general than integers, such as strings or sequences. For example, you can use one to store a table of phone numbers indexed by names.

In Xcas, the indices in a table may be any kind of Xcas objects. Access is done by a binary search algorithm, where the sorting function first sorts by type then uses an order for each type (e.g. < for numeric types, lexicographic order for strings, etc.)

The table command creates a table.

- table takes an unspecified number of arguments:
  seq, a list or sequence of equalities of the form index_name=element_value.
- table(seq) returns a table. The elements of the table can be retrieved using index bracket notation; If T is the name of the table, then T(index_name) returns element_value.

Example.
Input:

T:=table(3=-10,"a"=10,"b"=20,"c"=30,"d"=40):;

Input:

T["b"]

Output:

20

Input:

T[3]

Output:

−10

Remark.
Tables can be created and the elements of a table can be changed using the := assignment.

- If T is a symbolic variable then the assignment T(index_name:=element_value will create a table T with one element.
- If n is an integer, then the assignment T(n):=obj will do the following:
  - If the variable T was assigned to a list or a sequence, then the nth element of T is modified.
  - if the variable T was not assigned, a table T is created with one entry (corresponding to the index n). Note that after the assignment T is not a list, despite the fact that n is an integer.

## 6.44 Matrices

- Matrices
- Special matrices
  - Identity matrix: idn identity
  - Zero matrix: newMat
  - Diagonals of matrices and diagonal matrices: BlockDiagonal diag
  - Jordan block: JordanBlock
  - Hilbert matrix: hilbert
  - Vandermonde matrix: vandermonde
- Combining matrices
  - Making a matrix with a list of matrices: blockmatrix
  - Making a matrix from two matrices: semi_augment
  - Making a matrix from two matrices: augment concat
  - Appending a column to a matrix: border
- Creating a matrix with a formula or function: makemat matrix
- Getting the parts of a matrix
  - Accessing parts of a matrix: [] at
  - Extracting rows or columns of a matrix (Maple compatibility): row col
  - Extracting a sub-matrix of a matrix (TI compatibility): subMat
- Modifying matrices
  - Modifying matrix elements by assignment: :=
  - Modifying matrix elements by reference: ::= =<
  - Modifying an element or a row of a matrix: subsop
  - Removing rows or columns of a matrix: delrows delcols
  - Resizing a matrix or vector: REDIM redim
  - Replacing part of a matrix or vector: REPLACE replace
  - Applying a function to the elements of a matrix: apply

## 6.45 Arithmetic and matrices

- Evaluating a matrix: evalm
- Addition and subtraction of two matrices: + - .+ .-
- Multiplication of two matrices: * &*
- Addition of elements of a column of a matrix: sum
- Cumulated sum of elements of each column of a matrix: cumSum
- Multiplication of elements of each column of a matrix: product
- Power of a matrix: ^ &^
- Hadamard product: hadamard product .*
- Hadamard division: ./
- Hadamard power: .^
- The elementary row operations
  - Adding a row to another row: rowAdd
  - Multiplying a row by an expression: mRow scale SCALE
  - Adding k times a row to an another row: mRowAdd scaleadd SCALEADD
  - Exchanging two rows: rowSwap rowswap swaprow
  - Exchanging two columns: colSwap colswap swapcol
- Counting the elements of a matrix satisfying a property: count
- Counting the elements equal to a given value: count_eq
- Counting the elements smaller than a given value: count_inf
- Counting the elements greater than a given value: count_sup
- Statistics functions acting on column matrices: mean stddev variance median quantile quartiles boxwhisker
- Dimension of a matrix: dim
- Number of rows: rowdim rowDim nrows
- Number of columns: coldim colDim ncols

## 6.46 Sparse matrices

- Defining sparse matrices
- Operations on sparse matrices

## 6.47 Linear algebra

- Transpose of a matrix: tran transpose
- Inverse of a matrix: inv /
- Trace of a matrix: trace
- Determinant of a matrix: det
- Determinant of a sparse matrix: det_minor
- Rank of a matrix: rank
- Transconjugate of a matrix: trn
- Equivalent matrix: changebase
- Basis of a linear subspace : basis
- Basis of the intersection of two subspaces: ibasis
- Image of a linear function: image
- Kernel of a linear function: kernel nullspace ker
- Kernel of a linear function: Nullspace
- Subspace generated by the columns of a matrix: colspace
- Subspace generated by the rows of a matrix: rowspace

## 6.48 Matrix reduction

- Eigenvalues: eigenvals
- Eigenvalues: egvl eigenvalues eigVl
- Eigenvectors: egv eigenvectors eigenvects eigVc
- Rational Jordan matrix: rat_jordan
- Jordan normal form: jordan
- Powers of a square matrix: matpow
- Characteristic polynomial: charpoly
- Characteristic polynomial using Hessenberg algorithm: pcar_hessenberg
- Minimal polynomial: pmin
- Adjoint matrix: adjoint_matrix
- Companion matrix of a polynomial: companion
- Hessenberg matrix reduction: hessenberg SCHUR
- Hermite normal form: ihermite
- Smith normal form in ℤ: ismith
- Smith normal form: smith

## 6.49 Matrix factorizations

Note that most matrix factorization algorithms are implemented numerically, only a few of them will work symbolically.

- Cholesky decomposition: cholesky
- QR decomposition: qr
- QR decomposition (for TI compatibility): QR
- LQ decomposition (HP compatible): LQ
- LU decomposition: lu
- LU decomposition (for TI compatibility): LU
- Singular values (HP compatible): SVL svl
- Singular value decomposition: svd
- Short basis of a lattice: lll

## 6.50 Different matrix norms

See Section 6.42.1 for different norms on vectors.

- The Frobenius norm: frobenius_norm
- ℓ2 matrix norm: norm l2norm
- ℓ∞ matrix norm: maxnorm
- Matrix row norm: rownorm rowNorm
- Matrix column norm: colnorm colNorm l1norm
- The operator norm of a matrix: matrix_norm l1norm l2norm norm specnorm linfnorm
  - Operator norms
  - Computing operator norms

## 6.51 Isometries

An isometry of ℝn is a distance-preserving map. In ℝ2, the isometries are made up of:

- reflection across a line.
- rotation about a point.
- translation.

In ℝ3, the isometries are made up of:

- reflection across a plane.
- rotation about a line.
- translation.

An isometry is direct if it preserves orientation (it doesn’t involve a reflection), otherwise it is indirect.

An n× n matrix A determines an isometry of the function f:ℝn→ℝn by f(x) = Ax) is an isometry. Such isometries fix the origin, so they can’t involve translation, can only rotate about the origin, and the line or plane of reflection will pass through the origin.

An isometry in ℝ2 can be characterized by:

- The angle of rotation (for a direct isometry) or a normal to the line of reflection (for an indirect isometry).
- +1 or -1 to indicate whether it is direct or indirect; +1 for direct and -1 for indirect.

An isometry in ℝ3 can be characterized by:

- The direction of an axis of rotation.
- The angle of rotation (for a direct isometry) or a normal to the plane of reflection (for an indirect isometry).
- +1 or -1 to indicate whether it is direct or indirect; +1 for direct and -1 for indirect.

- Recognizing an isometry: isom
- Finding the matrix of an isometry: mkisom

## 6.52 Linear Programming

Linear programming problems involve maximizing a linear functionals under linear equality or inequality constraints. The simplest case can be solved directly by the so-called simplex algorithm. Most cases require you to solve an auxiliary linear programming problem to find an initial vertex for the simplex algorithm.

- Simplex algorithm: simplex_reduce
  - The simple case
  - The simplex method
  - simplex_reduce
  - Reducing a more complicated case to the simple case
  - The general case
- Solving general linear programming problems: lpsolve
  - Solving an LP problem in symbolic form
  - Solving an LP problem in matrix form
  - Solving MIP (Mixed Integer Programming) problems
  - Solving problems in floating-point arithmetic
  - Loading a problem from a file
- Solving the transportation problems: tpsolve

## 6.53 Nonlinear optimization

- Global extrema: minimize maximize
- Local extrema: extrema
- Local derivative-free optimization: nlpsolve
- Minimax polynomial approximation: minimax

## 6.54 Quadratic forms

- Matrix of a quadratic form: q2a
- Transforming a matrix into a quadratic form: a2q
- Reducing a quadratic form: gauss
- The conjugate gradient algorithm: conjugate_gradient
- Gram-Schmidt orthonormalization: gramschmidt
- Graph of a conic: conic
- Conic reduction: reduced_conic
- Graph of a quadric: quadric
- Quadric reduction: reduced_quadric

## 6.55 Equations

- Defining an equation: equal
- Transforming an equation into a difference: equal2diff
- Transforming an equation into a list: equal2list
- The left member of an equation: left gauche lhs
- The right member of an equation: right droit rhs
- Solving equation(s): solve cSolve

## 6.56 Linear systems

The augmented matrix of the system A · X=b is either the matrix obtained by gluing the column vector b to the right of the matrix A (as with border(A,tran(b))), representing A · X=b, or the matrix obtained by gluing the column vector −b to the right of the matrix A, representing A· x − b = 0.

- Matrix of a system: syst2mat
- Gauss reduction of a matrix: ref
- Gauss-Jordan reduction: rref gaussjord
- Solving AX=b: simult
- Step by step Gauss-Jordan reduction of a matrix: pivot
- Linear system solving: linsolve
- Solving a linear system using the Jacobi iteration method: jacobi_linsolve
- Solving a linear system using the Gauss-Seidel iteration method: gauss_seidel_linsolve
- The least squares solution of a linear system: LSQ lsq
- Finding linear recurrences: reverse_rsolve

## 6.57 Differential equations

This section is limited to symbolic (or exact) solutions of differential equations. For numeric solutions of differential equations, see odesolve (Section 10.3.5). For graphic representation of solutions of differential equations, see plotfield (Section 8.18), plotode (Section 8.19) and interactive_plotode (Section 8.20).

- Solving differential equations: desolve deSolve dsolve
- Laplace transform and inverse Laplace transform: laplace ilaplace invlaplace
- Solving linear homogeneous second-order ODE with rational coefficients: kovacicsols

## 6.58 The Z-transform

- The Z-transform of a sequence: ztrans
- The inverse Z-transform of a rational function: invztrans

## 6.59 Other functions

- Replacing small values by 0: epsilon2zero
- List of variables: lname indets
- List of variables and of expressions: lvar
- List of variables of an algebraic expressions: algvar
- Testing if a variable is in an expression: has
- Numeric evaluation: evalf
- Rational approximation: float2rational exact

## 6.60 The day of the week: dayofweek

The dayofweek command finds the day of the week for any date after 15 October, 1582.

- dayofweek takes as arguments three arguments:
  - d, an integer representing the day of the month.
  - m, an integer representing the month.
  - y, an integer representing the year.
  The date represented should be after 15 October 1582.
- dayofweek(d,m,y) returns an integer from 0 to 6; 0 representing Sunday, 1 representing Monday, etc.

Examples.

- Input:
  dayofweek(1,10,2014)
  Output:

  3

  This means that 1 October, 2014 was a Wednesday.
- Input:
  dayofweek(15,10,1582)
  Output:

  5

  This indicates that 15 October 1582 was on a Friday.

The Gregorian calendar, the calendar used by most of the world, was introduced on 15 October 1582. Before that, the Julian calendar was used, which had a leap year every four years and so used years with an average of 365.25, which is slightly off from the actual value of about 365.242 days. To deal with this, the Gregorian calendar was introduced, where a leap year is a year which is divisible by 4, but not divisible by 100 unless it is also divisible by 400. This gives an average length of year that is accurate to within 1 day every 3000 years.

Many countries switched from the Julian calendar to the Gregorian calendar after 4 October 1582 in the Julian calendar, and the next day was 15 October 1582.

# Chapter 7 Metric properties of curves

## 7.1 The center of curvature

Let Γ be a curve in space parameterized by a continuously differentiable function, and M0 be a point on the curve. The curve will have an arclength parameterization; namely, it can be parameterized by a function M(s), where M(0) = M0 and |s| is the length of the curve from M0 to M(s), in the direction of the curve if s>0 and the opposite direction if s<0.

For such a Γ, the vector T(s) = M′(s) will be the unit tangent to the curve at M(s), and N(s) = T′(s) will be perpendicular to the tangent. The circle through M(s) with center at M(s) + N(s) is called the osculating circle to Γ at M(s). Informally, the osculating circle is the circle through M(s) which most closely approximates Γ. The set of all centers of curvature is another curve, called the evolute of Γ.

The radius of the osculating circle is |N(s)| and is called the radius of curvature of Γ at M(s). The reciprocal of this is called the curvature of Γ at M(s).

## 7.2 Computing the curvature and related values: curvature osculating_circle evolute

A curve can be described in Xcas with a parametrization or with a curve object. Various curve objects are described in chapters 13 and 14. The commands in this section can work with curves described either way. You can get the equation of a curve object with the equation command (see Section 13.13.7).

The curvature command finds the curvature of a curve. The curve can be given as an object or by a parameterization.

To find the curvature from a parameterization:

- curvature takes two mandatory arguments and one optional argument:
  - C, a curve.
  - t, the parameter of the curve.
  - Optionally, t0, a value of the parameter.
- curvature(C,t ⟨, t0⟩) returns the curvature of the curve; if t0 is given, the curvature is given at the point it specifies, otherwise the curvature is given as a function of the parameter.

To find the curvature from a curve object:

- curvature takes two arguments:
  - C, a curve.
  - p, a point on the curve.
- curvature(C,p) returns the curvature of C at the point p.

Examples.

- Input:
  trigsimplify(curvature([5*cos(t),5*sin(t)],t))
  Output:

  1
  5

- Input:
  curvature([2*cos(t),3*sin(t)],t)
  Output:

  ⎛ ⎝ | 6 cos2t+6 sin2t | ⎞ ⎠ | √ |
  9 cos2t+4 sin2t
  ⎛ ⎝ | 9 cos2t+4 sin2t | ⎞ ⎠ | 2

- Input:
  curvature([2*cos(t),3*sin(t)],t,pi/2)
  Output:

  3
  4

- Input:
  curvature(plot(x^2),point(1,1))
  (see Section 8.5 and Section 13.6.2.) Output:

  2
  25
  |  | √ |
  5

The osculating_circle command finds and draws the osculating circle of a curve.

To find the osculating circle from a parameterization:

- osculating_circle takes three arguments:
  - C, a curve.
  - t, the parameter of the curve.
  - t0, a value of the parameter.
- osculating_circle(C,t,t0) draws and returns the osculating circle of the curve at the point specified by t0.

To find the osculating circle from a curve object:

- osculating_circle takes two arguments:
  - C, a curve.
  - p, a point on the curve.
- osculating_circle(C,p) draws and returns the osculating circle of C at the point p.

Examples.

- Input:
  osculating_circle(plot(x^2),point(1,1))
  Output:
- Input:
  equation(osculating_circle(plot(x^2),point(1,1)))
  Output:

  ⎛ ⎝ | x+4 | ⎞ ⎠ | 2+ | ⎛ ⎜ ⎜ ⎝ | y− |
  7
  2
  | ⎞ ⎟ ⎟ ⎠ |
  2
  | = |
  125
  4

- Input:
  equation(osculating_circle([t^2,t^3],t,1))
  Output:

  ⎛ ⎜ ⎜ ⎝ | x+ |
  11
  2
  | ⎞ ⎟ ⎟ ⎠ |
  2
  | + | ⎛ ⎜ ⎜ ⎝ | y− |
  16
  3
  | ⎞ ⎟ ⎟ ⎠ |
  2
  | = |
  2197
  36

The evolute command finds and draws the evolute of a curve.

To find the evolute from a parameterization:

- evolute takes two arguments:
  - C, a curve.
  - t, the parameter of the curve.
- evolute(C,t) draws and returns the evolute of the curve.

To find the evolute from a curve object:

- evolute takes one argument:
  C, a curve.
- evolute(C) draws and returns the evolute of C.

Examples.

- Input:
  evolute(plot(x^2))
  Output:
- Input:
  equation(evolute(plot(x^2)))
  Output:

  27 x2−16 y3+24 y2−12 y+2=0

- Input:
  equation(evolute([t^2,t],t))
  Output:

  16 x3−24 x2+12 x−27 y2−2=0

# Chapter 8 Graphs

## 8.1 Generalities

Most graph instructions take expressions as arguments. A few exceptions (mostly Maple-compatibility instructions) also accept functions. Some optional arguments, like color, thickness, can be used as optional attributes in all graphic instructions. They are described below.

If a graph depends on a user-defined function, you may want to define the function when the parameter is a formal variable. For this, it can be useful to test the type of the parameter while the function is being defined. (See Chapter Section 12 for information about programming in Xcas.)

For example, suppose f and g are defined by:

`f(x):= {`
`if (type(x)!=DOM_FLOAT) return 'f'(x);`
`while(x>0){ x--;}`
`return x;`
`}`

and

`g(x):= {`
`while(x>0){ x--;}`
`return x;`
`}:;`

Graphing these (see Section 8.4.1):
Input:

F:= plotfunc(f(x))
G:= plotfunc(g(x))

they will both produce the same graph. However, the graphic G won’t be reusable. Entering:
Input:

F

reproduces the graph, but entering:
Input:

G

produces the error:
Output:

"Unable to eval test in loop: x>0.0
Error: Bad Argument Value Error:
Bad Argument Value"

Internally, F and G contain the formal expressions f(x) and g(x), respectively. When Xcas tries to evaluate F and G, x has no value and so the test x > 0 produces an error in g(x), but the line `if (type(x)!=DOM_FLOAT) return 'f'(x);` avoids this problem in f(x).

## 8.2 The graphic screen

A graphic screen, either two- or three-dimensional as appropriate, automatically opens in response to a graphic command. Alternatively, you can open a graphic screen with its own command line with keystrokes; Alt-g for a two-dimensional screen and Alt-h for a three-dimensional screen. The graphic screen will have an array of buttons at the top right.

- There will be red arrows for moving the image in the x direction.
- There will be green arrows for moving the image in the y direction.
- There will be blue arrows for zooming in and out in a two-dimensional screen, and moving the image in the z direction in a three-dimensional screen.
- There will be in and out buttons for zooming in and out.
- There will be a _|_ button to orthonormalize the graphic.
- There will be a ▸| button to start and stop animations.
- There will be an auto button to do automatic scaling.
- There will be a cfg button which will bring up a configuration screen (see Section 3.5.7).
- There will be an M button which brings up a menu. The menu has submenus:
  - View which has entries which do the same as the buttons.
  - Trace for working with traces.
  - Animation for working with animations.
  - 3-d for working with three-dimensional graphics.
  - Export/Print to export and print the graphic.

The image can also be moved in the screen by clicking and dragging with the mouse. Scrolling with the mouse will also zoom the images.

## 8.3 Graph and geometric objects attributes

There are two kinds of attributes for graphs and geometric objects: global attributes of a graphic scene and individual attributes.

- Individual attributes
- Global attributes

## 8.4 Graph of a function: plotfunc funcplot DrawFunc Graph

- 2-d graph
- 3-d graph
  - Two variable functions
  - 3-d graph with rainbow colors
  - 4-d graph

## 8.5 2d graph for Maple compatibility: plot

The plot command is a Maple-compatible way to draw the graph of a one-variable function.

- plot takes one mandatory argument and two optional arguments:
  - func, a function or an expression involving one variable.
  - Optionally, var the name of the variable in the expression (if func is an expression), which can also specify a range of values var=a..b (by default it is x). If func is a function, the optional second argument can simply be a range a..b for the variable.
  - Optionally, opt, which can be xstep=n to specify the discretization step or nstep=n to specify the number of points used to graph.
- plot(expr ⟨ ,var, opt⟩) draws the graph.

Examples.

- Input:
  plot(x^2-2,x)
  Output:
- Input:
  plot(x^2-2,xstep=1)
  or:
  plot(x^2-2,x,xstep=1)
  Output:
- Input:
  plot(x^2-2,x=-2..3,nstep=30)
  Output:

## 8.6 3d surfaces for Maple compatibility plot3d

The plot3d command is a Maple-compatible way to draw a surface. It can plot the graph of a function of two variables or a surface given by a parameterization.

To draw the graph of a function:

- plot3d takes three arguments:
  - func, a function or an expression involving two variables.
  - x and y, the names of the variable in the expression (if func is an expression) which can also specify a range of values for each variable.

    If func is a function, this argument is optional, and are the ranges a..b for the variables.

    If the ranges are not given, the default values are taken from the graph configuration (see Section 3.5.8).

- plot3d(func,x,y) draws the graph.

Example.
Input:

plot3d(x*y,x,y)

Output:

To draw a parameterized surface:

- plot3d takes one mandatory argument and two optional arguments:
  - funcs, a list of three functions or three expressions involving two variables.
  - u and v, the names of the variable in the expression (if funcs is a list of expressions), which can also specify a range of values for each variable.

    If funcs is a list of functions, this argument is optional, and are the ranges a..b for the variables.

    If the ranges are not given, the default values are taken from the graph configuration (see Section 3.5.8).

- plot3d(funcs,u,v) draws the surface.

Examples.

- Input:
  plot3d([v*cos(u),v*sin(u),v],u,v)
  Output:
- Input:
  plot3d([v*cos(u),v*sin(u),v],u=0..pi,v=0..3)
  Output:

## 8.7 Graph of a line and tangent to a graph

- Drawing a line: line
- Drawing a 2D horizontal line: LineHorz
- Drawing a 2D vertical line: LineVert
- Tangent to a 2D graph: LineTan
- Tangent to a 2D graph: tangent
- Plotting a line with a point and the slope: DrawSlp
- Intersection of a 2D graph with the axis

## 8.8 Graphing inequalities with two variables: plotinequation inequationplot

The plotinequation command plots the region of the plane where given inequalities hold.

- plotinequation takes two arguments:
  - ineqs, a list of inequalities in two variables.
  - vars, a list of variables var or variables var=a..b with their ranges of values. Note that if the ranges are not specified, Xcas takes the default values of X-,X+,Y-,Y+ defined in the general graphic configuration (Cfg▸Graphic configuration, see Section 3.5.8).
- plotinequation(ineqs,vars) draws the points of the plane whose coordinates satisfy the inequalities ineqs.

Examples.

- Input:
  plotinequation(x^2-y^2<3, [x=-2..2,y=-2..2],xstep=0.1,ystep=0.1)
  Output:
- Input:
  plotinequation([x+y>3,x^2<y], [x-2..2,y=-1..10],xstep=0.2,ystep=0.2)
  Output:

## 8.9 The area under a curve: area

The area command approximates the area under a graph.

- area takes four arguments:
  - expr, an expression f(x).
  - var=a..b, the variable with a range.
  - n, a positive integer.
  - method, the approximation method to use, which can be one of:
    - trapezoid
    - left_rectangle
    - right_rectangle
    - middle_point
    - simpson
    - rombergt (Romberg with the trapezoid method)
    - rombergm (Romberg with the midpoint method)
    - gauss15 (The 15 point Gaussian quadrature)
- area(expr,var=a..b,n,method) returns an approximation to the area under the graph over the given interval, using the specified method with n subdivisions (or 2n subdivisions for rombert, rombergm and gauss15).

Examples.

- Input:
  area(x^2,x=0..1,8,trapezoid)
  Output:

  0.3359375

- Input:
  area(x^2,x=0..1,8,rombergm)
  Output:

  0.333333333333

- Input:
  area(x^2,x=0..1,3,gauss15)
  Output:

  0.333333333333

- Input:
  area(x^2,x=0..1)
  Output:

  1
  3

## 8.10 Graphing the area below a curve: plotarea areaplot

The plotarea command draws the area below a graph.
areaplot is a synonym for plotarea.

- plotarea takes two mandatory arguments and two optional arguments:
  - expr, an expression representing the function to graph.
  - var=a..b, the variable and the range of values.
  - Optionally, n.
  - Optionally, method, a method to approximate the region under the graph, which can be one of:
    - trapezoid
    - rectangle_left
    - rectangle_right
    - middle_point
- plotarea(expr,var=a..b) draws and shades the area between the graph of expr and the y-axis for a < var < b.
- plotarea(expr,var=a..b ⟨, n, method⟩) draws and shades the region used by the numeric approximation method method for area between the graph of expr and the y-axis for a < var < b, when [a,b] is cut into n equal parts, along with the graph in red.

Examples.

- Input:
  plotarea(sin(x),x=0..2*pi)
  Output:
- Input:
  plotarea(x^2,x=0..1,5,trapezoid)
  Output:
  Input:
  plotarea((x^2,x=0..1,5,middle_point)
  Output:

## 8.11 Contour lines: plotcontour contourplot DrwCtour

The plotcontour command draws contour lines for functions of two variables.
DrwCtour and contourplot are synonyms for plotcontour.

- plotcontour takes two mandatory arguments and one optional argument:
  - expr, an expression involving two variables.
  - vars, a list of the two variables.
  - Optionally, values, a list of values of the contour lines to draw; expr=value, for value in values (by default, [−10,−8,…,8,10]).
- plotcontour(expr,vars ⟨, values⟩) draws the contour lines expr=value for value in values.

Examples.

- Input:
  plotcontour(x^2+y^2,[x=-3..3,y=-3..3],[1,2,3], display=[green,red,black]+[filled$3])
  Output:
- Input:
  plotcontour(x^2-y^2,[x,y])
  Output:

If you want to draw the surface in 3-d representation, you can use plotfunc (see Section 8.4.2).
Input:

plotfunc(x^2-y^2,[x,y])

Output:

## 8.12 2-d graph of a 2-d function with colors: plotdensity densityplot

The plotdensity command draws the graph of a function of two variables in the plane where the values of z are represented by the rainbow colors.
densityplot is a synonym for plotdensity.

- plotdensity takes two mandatory arguments and three optional arguments:
  - expr, an expression of two variables.
  - vars, a list of the variables and their ranges.
  - Optionally, z=a..b, the range of z to correspond to the full rainbow (by default, it is deduced from the minimum and maximum value of expr on the discretization.
  - Optionally, xstep, which can be xstep=n to specify the discretization step in the x direction.
  - Optionally, ystep, which can be ystep=m to specify the discretization step in the y direction.
  - Instead of xstep and ystep, you could use the option nstep=n to specify the number of points used to graph.
- plotdensity(expr,vars ⟨z=a..b,xstep,ystep⟩) draws the graph of expr in the plane where the values of z are represented by the rainbow colors.

Remark: A rectangle representing the scale of colors will be displayed below the graph.

Example.
Input:

plotdensity(x^2-y^2,[x=-2..2,y=-2..2], xstep=0.1,ystep=0.1)

Output:

## 8.13 Implicit graph: plotimplicit implicitplot

The plotimplicit command draws curves or surfaces defined by an implicit expression or equation. If the option unfactored is given as the last argument, the original expression is taken unmodified. Otherwise, the expression is normalized, then replaced by the factorization of the numerator of its normalization.

Each factor of the expression corresponds to a component of the implicit curve or surface. For each factor, Xcas tests if it is of total degree less or equal to 2, in which case conic or quadric is called. Otherwise the numeric implicit solver is called.

Optional step and ranges arguments may be passed to the numeric implicit solver, note that they are dismissed for each component that is a conic or a quadric.

implicitplot is a synonym for plotimplicit.

- 2D implicit curve
- 3D implicit surface

## 8.14 Parametric curves and surfaces: plotparam paramplot DrawParm

The plotparam command draws parametric curves and surfaces.
paramplot and DrawParm are synonyms for plotparam.

- 2D parametric curve
- 3D parametric surface: plotparam paramplot DrawParm

## 8.15 Bezier curves: bezier

The Bezier curve with the control points P0,P1,…,Pn is the curve parameterized by ∑j=0n (

n,j
t

)j (1−t)n−j Pj. bezier plots Bezier curves.

- bezier takes an unspecified number of arguments:
  - controls, a sequence of control points.
  - plot, the symbol.
- bezier(controls,plot) plots the Bezier curve with the given control points.

Examples.

- Input:
  bezier(1,1+i,2+i,3-i,plot)
  Output:
- Input:
  bezier(point(0,0,0),point(1,1,0),point(0,1,1),plot)
  Output:

To get the parameterization of the curve, you can use the parameq command (see Section 13.13.8).

Examples.

- Input:
  parameq(bezier(1,1+i,2+i,3-i))
  Output:

  ⎛ ⎝ | 1−t | ⎞ ⎠ | 3+3 t | ⎛ ⎝ | 1−t | ⎞ ⎠ | 2 | ⎛ ⎝ | 1+i | ⎞ ⎠ | +3 t2 | ⎛ ⎝ | 1−t | ⎞ ⎠ | ⎛ ⎝ | 2+i | ⎞ ⎠ | +t3 | ⎛ ⎝ | 3−i | ⎞ ⎠

- Input:
  parameq(bezier(point([0,0,0]),point([1,1,0]),point([0,1,1])))
  Output:

  ⎡ ⎣ | 2 t | ⎛ ⎝ | 1−t | ⎞ ⎠ | ,2 t | ⎛ ⎝ | 1−t | ⎞ ⎠ | +t2,t2 | ⎤ ⎦

## 8.16 Defining curves in polar coordinates: plotpolar polarplot DrawPol courbe_polaire

The plotpolar command draws a curve given in polar coordinates.
polarplot, DrawPol and courbe_polaire are synonyms for plotpolar.

- polarplot takes two arguments:
  - expr, an expression involving a variable (which will represent the angle).
  - var, the variable. This can optionally include the range var=a..b.
  - Optionally, tstep=n to specify the discretization.
  polarplot(expr,var ⟨,tstep=n⟩) draws the curve defined by ρ=expr for θ=var; in Cartesian coordinates that is the curve (expr cosvar),expr sin(var)).

Examples.

- Input
  plotpolar(t,t)
  Output:
- Input:
  plotpolar(t,t,tstep=1)
  or:
  plotpolar(t,t=0..10,tstep=1)
  Output:

## 8.17 Graphing recurrent sequences: plotseq seqplot graphe_suite

The plotseq command draws the process of finding the terms of a recurrent sequence.
seqplot and graphe_suite are synonyms for plotseq.

- plotseq takes :
  - expr, an expression depending on a variable.
  - var=a, the variable and a beginning value. (If var=x, then the variable name can be omitted.) The a value can be replaced by a list of three elements, [a,x−,x+] where x−..x+ will be passed as the range of the variable for the graph computation.
  - n, the ending value of the variable.
- plotseq(expr,var=a,n) draws the line y=x, the graph of y=expr, and the n first terms of the recurrent sequence defined by: u0=a, un=f(un−1) where f is the function determined by expr.

Example.
Input:

plotseq(sqrt(1+x),x=[3,0,5],5)

Output:

## 8.18 Tangent field: plotfield fieldplot

The plotfield command draws the tangent field of a differential equation or a vector field.
fieldplot is a synonym for plotfield.

To draw the tangent field of a differential equation:

- plotfield takes two mandatory arguments and one optional argument:
  - expr, an expression depending on two variables, a time variable and a dependent variable.
  - vars, a list of the two variables [t,y], where t is the time variable and y is the dependent variable. The variables can optionally include their ranges; [t=a..b,y=c..d].
  - Optionally, ystep=n to specify the discretization.
- plotfield(expr,vars ⟨,ystep=n⟩) draws the tangent field of the differential equation y′=f(t,y).

Example.
Input:

plotfield(4*sin(t*y),[t=0..2,y=-3..7])

Output:

To draw a vector field:

- plotfield takes two mandatory arguments and two optional arguments:
  - V, a list of two expressions involving two variables.
  - vars, a list of the two variables. The variables can optionally include their ranges var=a..b.
  - Optionally, xstep=n to specify the discretization of the first variable.
  - Optionally, ystep=m to specify the discretization of the second variable.
- plotfield(V,vars ⟨ ,xstep=n,ystep=m⟩) draws the vector field given by V.

Example.
Input:

plotfield(5*[-y,x],[x=-1..1,y=-1..1])

Output:

## 8.19 Plotting a solution of a differential equation: plotode odeplot

The plotode command draws solutions of differential equations.

- plotode takes three mandatory arguments and one optional argument:
  - expr an expression depending on two or three variables, a time variable and one or two dependent variables.
  - vars, a list of the time variable and the dependent variable. The time variable can optionally have a range of values, such as t=a..b. The dependent variable can also be a vector of size two.
  - init, the initial values of the variables.
  - Optionally, for when there are two dependent variables, plane, the symbol, to draw the solution in the plane.
- plotode(expr,vars,init) draws the solution of the differential equation y′=expr (where y is the dependent variable) passing through the initial point init.

To compute the values of the solutions, see Section 10.3.5.

Examples.

- Input:
  plotode(sin(t*y),[t,y],[0,1])
  Output:
- Input:
  S:=plotode([h-0.3*h*p, 0.3*h*p-p], [t,h,p],[0,0.3,0.7])
  Output:
- Input (for a 2-d graph in the plane):
  S:=odeplot([h-0.3*h*p, 0.3*h*p-p], [t,h,p],[0,0.3,0.7],plane)
  Output:

## 8.20 Interactive plotting of solutions of a differential equation: interactive_plotode interactive_odeplot

The interactive_plotode command draws interactive tangent fields of differential equations.
interactive_odeplot is a synonym for interactive_plotode.

- interactive_plotode takes two arguments:
  - expr an expression depending on two or three variables, a time variable and one or two dependent variables.
  - vars, a list of the time variable and the dependent variable.
- interactive_plotode(expr,vars) draws the tangent field of the differential equation y′=expr (where y is the dependent variable) in a new window. In this window, one can click on a point to get the plot of the solution of y′=expr passing through this point.

  You can further click to display several solutions. To stop, press the Esc key.

Example.
Input:

interactive_plotode(sin(t*y),[t,y])

Output:

Solutions of the differential equation can be plotted by clicking on an initial point.

## 8.21 Animated graphs (2D, 3D or "4D")

Xcas can display animated 2D, 3D or "4D" graphs. This is done first by computing a sequence of graphic objects, then after completion, by displaying the sequence in a loop. To stop or start again the animation, click on the button ▸ ∣ (to the left of Menu).

- - Animation of a 2D graph: animate
  - Animation of a 3D graph: animate3d
  - Animation of a sequence of graphic objects: animation

  # Chapter 9 Statistics

  ## 9.1 One variable statistics

  Xcas has several functions to perform statistics; the data is typically given as a list of numbers, such as A:= [0,1,2,3,4,5,6,7,8,9,10,11]. This particular list will be used in several examples. Section 6.45.16 will discuss statistics on matrices.

  - The mean: mean
  - Variance: variance
  - Standard deviation: stdev
  - The population standard deviation: stddevp stdDev
  - The median: median
  - Quartiles: quartiles quartile1 quartile3
  - Quantiles: quantile
  - The boxwhisker: boxwhisker mustache
  - Classes: classes
  - Histograms: histogram histogramme
  - Accumulating terms: accumulate_head_tail
  - Frequencies: frequencies frequences
  - Cumulative frequencies: cumulated_frequencies frequences_cumulees
  - Bar graphs: bar_plot
  - Pie charts: camembert

  ## 9.2 Two variable statistics

  - Covariance and correlation: covariance correlation covariance_correlation
  - Scatterplots: scatterplot nuaged_points batons
  - Polygonal paths: polygonplot ligne_polygonale linear_interpolate listplot plotlist
  - Linear regression: linear_regression linear_regression_plot
  - Exponential regression: exponential_regression exponential_regression_plot
  - Logarithmic regression: logarithmic_regression logarithmic_regression_plot
  - Power regression: power_regression power_regression_plot
  - Polynomial regression: polynomial_regression polynomial_regression_plot
  - Logistic regression: logistic_regression logistic_regression_plot

  ## 9.3 Random numbers

  - Producing uniformly distributed random numbers: rand random alea hasard sample
  - Initializing the random number generator: srand randseed RandSeed
  - Producing random numbers with the binomial distribution: randbinomial
  - Producing random numbers with a multinomial distribution: randmultinomial
  - Producing random numbers with a Poisson distribution: randpoisson
  - Producing random numbers with a normal distribution: randnorm randNorm
  - Producing random numbers with Student’s distribution: randstudent
  - Producing random numbers with the χ2 distribution: randchisquare
  - Producing random numbers with the Fisher-Snédécor distribution: randfisher
  - Producing random numbers with the gamma distribution: randgammad
  - Producing random numbers with the beta distribution: randbetad
  - Producing random numbers with the geometric distribution: randgeometric
  - Producing random numbers with the exponential distribution: randexp
  - Random variables: random_variable randvar
  - Make a random vector or list: randvector
  - Producing random matrices: randmatrix ranm randMat

  ## 9.4 Density and distribution functions

  - Distributions and inverse distributions
  - The uniform distribution
    - The probability density function for the uniform distribution: uniform uniformd
    - The cumulative distribution function for the uniform distribution: uniform_cdf uniformd_cdf
    - The inverse distribution function for the uniform distribution: uniform_icdf uniformd_icdf
  - The binomial distribution
    - The probability density function for the binomial distribution: binomial
    - The cumulative distribution function for the binomial distribution: binomial_cdf
    - The inverse distribution function for the binomial distribution: binomial_icdf
  - The negative binomial distribution
    - The probability density function for the negative binomial distribution: negbinomial
    - The cumulative distribution function for the negative binomial distribution: negbinomial_cdf
    - The inverse distribution function for the negative binomial distribution: negbinomial_icdf
  - The multinomial probability function: multinomial
  - The Poisson distribution
    - The probability density function for the Poisson distribution: poisson
    - The cumulative distribution function for the Poisson distribution: poisson_cdf
    - The inverse distribution function for the Poisson distribution: poisson_icdf
  - Normal distributions
    - The probability density function for a normal distribution: normald loi_normal
    - The cumulative distribution function for normal distributions: normal_cdf normald_cdf
    - The inverse distribution function for normal distributions: normal_icdf normald_icdf
    - The upper tail cumulative function for normal distributions: UTPN
  - Student’s distribution
    - The probability density function for Student’s distribution: student studentd
    - The cumulative distribution function for Student’s distribution: student_cdf
    - The inverse distribution function for Student’s distribution: student_icdf
    - The upper tail cumulative function for Student’s distribution: UTPT
  - The χ2 distribution
    - The probability density function for the χ2 distribution: chisquare
    - The cumulative distribution function for the χ2 distribution: chisquare_cdf
    - The inverse distribution function for the χ2 distribution: chisquare_icdf
    - The upper tail cumulative function for the χ2 distribution: UTPC
  - The Fisher-Snédécor distribution
    - The probability density function for the Fisher-Snédécor distribution: fisher fisherd snedecor snedecord
    - The cumulative distribution function for the Fisher-Snédécor distribution: fisher_cdf snedecor_cdf
    - The inverse distribution function for the Fisher-Snédécor distribution: fisher_icdf snedecor_icdf
    - The upper tail cumulative function for the Fisher-Snédécor distribution: UTPF
  - The gamma distribution
    - The probability density function for the gamma distribution: gammad
    - The cumulative distribution function for the gamma distribution: gammad_cdf
    - The inverse distribution function for the gamma distribution: gammad_icdf
  - The beta distribution
    - The probability density function for the beta distribution: betad
    - The cumulative distribution function for the beta distribution: betad_cdf
    - The inverse distribution function for the beta distribution: betad_icdf
  - The geometric distribution
    - The probability density function for the geometric distribution: geometric
    - The cumulative distribution function of the geometric distribution: geometric_cdf
    - The inverse distribution function for the geometric distribution: geometric_icdf
  - The Cauchy distribution
    - The probability density function for the Cauchy distribution: cauchy cauchyd
    - The cumulative distribution function for the Cauchy distribution: cauchy_cdf cauchyd_cdf
    - The inverse distribution function for the Cauchy distribution: cauchy_icdf cauchyd_icdf
  - The exponential distribution
    - The probability density function for the exponential distribution: exponential exponentiald
    - The cumulative distribution function for the exponential distribution: exponential_cdf exponentiald_cdf
    - The inverse distribution function for the exponential distribution: exponential_icdf exponentiald_icdf
  - The Weibull distribution
    - The probability density function for the Weibull distribution: weibull weibulld
    - The cumulative distribution function for the Weibull distribution: weibull_cdf weibulld_cdf
    - The inverse distribution function for the Weibull distribution: weibull_icdf weibulld_icdf
  - The Kolmogorov-Smirnov distribution: kolmogorovd
  - The Wilcoxon or Mann-Whitney distribution
    - The Wilcoxon test polynomial: wilcoxonp
    - The Wilcoxon/Mann-Whitney statistic: wilcoxons
    - The Wilcoxon or Mann-Whitney test: wilcoxont
  - Moment generating functions for probability distributions: mgf
  - Cumulative distribution functions: cdf
  - Inverse distribution functions: icdf
  - Kernel density estimation: kernel_density kde
  - Distribution fitting by maximum likelihood: fitdistr
  - Markov chains: markov
  - Generating a random walks: randmarkov

  ## 9.5 Hypothesis testing

  - General
  - Testing the mean with the Z test: normalt
  - Testing the mean with the T test: studentt
  - Testing a distribution with the χ2 distribution: chisquaret
  - Testing a distribution with the Kolmogorov-Smirnov distribution: kolmogorovt

  # Chapter 10 Numerical computations

  Real numbers may have an exact representation (e.g. rationals, symbolic expressions involving square roots or constants like π, …) or approximate representation, which means that internally the real is represented by a rational (with a denominator that is a power of the basis of the representation) close to the real. Inside Xcas, the standard scientific notation is used for approximate representation; that is a mantissa (with a point as decimal separator) optionally followed by the letter e and an integer exponent.

  Note that the real number 10−4 is an exact number but 1e−4 is an approximate representation of this number.

  ## 10.1 Floating point representation.

  This section discusses how real numbers are represented.

  - Digits
  - Representation by hardware floats
  - Examples of representations of normalized floats
  - Difference between the representation of (3.1-3) and of 0.1

  ## 10.2 Approximate evaluation: evalf approx Digits

  The evalf command evalf or approx, if possible, evaluates to a numeric approximation (see Section 6.8.1). The approximation is to Digits digits (see Section 3.5.1), this can be changed with an optional second argument.

  Examples.

  - Input:
    evalf(sqrt(2))
    Output: (Assuming that in the cas configuration (Cfg menu) Digits=7, so hardware floats are used, and 7 digits are displayed)

    1.414214

  - You can change the number of digits in a command line by assigning the variable DIGITS or Digits.
    Input:

    DIGITS:=20
    evalf(sqrt(2))

    Output:

    1.4142135623730950488

  - Input:
    evalf(10^-5)
    Output:

    1e-05

  - Input:
    evalf(10^15)
    Output:

    1e+15

  - Input:
    evalf(sqrt(2))*10^-5
    Output:

    1.41421356237e-05

  ## 10.3 Numerical algorithms

  - Approximating solution of an equation: newton
  - Approximating computation of the derivative number: nDeriv
  - Approximating computation of integrals: romberg nInt
  - Approximating integrals with an adaptive Gaussian quadrature at 15 points: gaussquad
  - Approximating solutions of y’=f(t,y): odesolve
  - Approximating solutions of the system v’=f(t,v): odesolve
  - Approximating solutions of nonlinear second-order boundary value problems: bvpsolve

  ## 10.4 Solving equations with fsolve nSolve cfsolve

  The fsolve command can solve equations or systems of equations. This section will discuss solving equations; systems will be discussed in the next section.

  The cfsolve command is the complex version of fsolve, with the same arguments. The only difference is that cfsolve gives numeric solutions over the complex numbers, even if Xcas is not in complex mode (see Section 3.5.5). fsolve will return complex roots, but only in complex mode.

  fsolve solves numeric equations of the form:

  f(x)=0, x ∈ (a,b)

  Unlike solve (Section 6.55.6) or proot (Section 10.6), it is not limited to polynomial equations.
  nSolve is a synonym for fsolve.

  - fsolve takes one mandatory argument and three optional arguments:
    - eqn, an equation involving one variable.
    - Optionally, var, the variable (by default x).
    - Optionally, init, an initial approximation or range.
    - Optionally, algorithm, the name of an iterative algorithm to be used by the GSL solver.
  - fsolve(eqn,var,init ⟨,algorithm⟩) returns an approximate solution to the equation.

  Examples.

  - Input (in real mode):
    fsolve(x^3-1,x)
    Output:

    1.0

  - Input (in complex mode):
    fsolve(x^3-1,x)
    Output:

    ⎡ ⎣ | −0.5−0.866025403784i,−0.5+0.866025403784i,1.0 | ⎤ ⎦

  - Input (in any mode):
    cfsolve(x^3-1,x)
    Output:

    ⎡ ⎣ | −0.5−0.866025403784 i,−0.5+0.866025403784 i,1.0 | ⎤ ⎦

  - Input:
    fsolve(sin(x)=2)
    Output:

    ⎡ ⎣ | ⎤ ⎦

  - Input:
    cfsolve(sin(x)=2)
    Output:

    ⎡ ⎣ | 1.57079632679−1.31695789692 i,1.57079632679+1.31695789692 i | ⎤ ⎦

  The different values of algorithm are explained in the rest of this section.

  - fsolve with the option bisection_solver
  - fsolve with the option brent_solver
  - fsolve with the option falsepos_solver
  - fsolve with the option newton_solver
  - fsolve with the option secant_solver
  - fsolve with the option steffenson_solver

  ## 10.5 Solving systems with fsolve and cfsolve

  The previous section discussed using fsolve to solve equations. This section will discuss systems of equations.

  As before, the cfsolve command is the complex version of fsolve, with the same arguments. The only difference is that cfsolve gives numeric solutions over the complex numbers, even if Xcas is not in complex mode (see Section 3.5.5). fsolve will return complex roots, but only in complex mode.

  For solving systems of equations:

  - fsolve takes three mandatory arguments and one optional argument:
    - eqns, a list of equations (or expressions, considered to be equal to zero) to solve.
    - vars, a list of the variables.
    - init, a list initial values for the variables.
    - Optionally, method, the method to use. The possible methods are:
      - dnewton_solver
      - hybrid_solver
      - hybrids_solver
      - newtonj_solver
      - hybridj_solver
      - hybridsj_solver
  - fsolve(eqns,vars,init ⟨,method⟩) returns an approximate solution to eqns.

  Examples.

  - Input (in real mode):
    fsolve([x^2+y+1,x+y^2-1],[x,y])
    Output:

    ⎡ ⎢ ⎣ |
    0.0 | −1.0
    −0.453397651516 | −1.2055694304
    | ⎤ ⎥ ⎦

  - Input (in complex mode):
    fsolve([x^2+y+1,x+y^2-1],[x,y])
    Output:

    ⎡ ⎢ ⎢ ⎢ ⎣ |
    0.0 | −1.0
    0.226698825758−1.46771150871 i | 1.1027847152+0.665456951153 i
    0.226698825758+1.46771150871 i | 1.1027847152−0.665456951153 i
    −0.453397651516 | −1.2055694304
    | ⎤ ⎥ ⎥ ⎥ ⎦

  - Input (in any mode):
    cfsolve([x^2+y+1,x+y^2-1],[x,y])
    Output:

    ⎡ ⎢ ⎢ ⎢ ⎣ |
    0.0 | −1.0
    0.226698825758−1.46771150871 i | 1.1027847152+0.665456951153 i
    0.226698825758+1.46771150871 i | 1.1027847152−0.665456951153 i
    −0.453397651516 | −1.2055694304
    | ⎤ ⎥ ⎥ ⎥ ⎦

  - Input:
    cfsolve([x^2+y+2,x+y^2+2],[x,y])
    Output:

    ⎡ ⎢ ⎢ ⎢ ⎣ |
    0.5+1.65831239518 i | 0.5−1.65831239518 i
    0.5−1.65831239518 i | 0.5+1.65831239518 i
    −0.5+1.32287565553 i | −0.5+1.32287565553 i
    −0.5−1.32287565553 i | −0.5−1.32287565553 i
    | ⎤ ⎥ ⎥ ⎥ ⎦

  The methods are inherited from the GSL. The methods whose names end with j_solver use the jacobian matrix, the rest use approximations for the derivatives.

  All methods use an iteration of Newton kind

  xn+1=xn− |
  f(xn)
  f′(xn)

  The four methods hybrid*_solver use also a method of gradient descent when the Newton iteration would make a too large of a step. The length of the step is computed without scaling for hybrid_solver and hybridj_solver or with scaling (computed from f′(xn)) for hybrids_solver and hybridsj_solver.

  The rest of this section will cover the various method options.

  - fsolve with the option dnewton_solver
  - fsolve with the option hybrid_solver
  - fsolve with the option hybrids_solver
  - fsolve with the option newtonj_solver
  - fsolve with the option hybridj_solver
  - fsolve with the option hybridsj_solver

  ## 10.6 Numeric roots of a polynomial: proot

  The proot command numerically finds the roots of a squarefree polynomial.

  - proot takes one argument:
    P, a squarefree polynomial, either in symbolic form or as a list of polynomial coefficients (written by decreasing order).
  - proot(P) returns a list of the numeric roots of P.

  Examples.

  - Input: Find the numeric roots of P(x)=x3+1:
    Input:
    proot([1,0,0,1])
    or:
    proot(x^3+1)
    Output:

    ⎡ ⎣ | −1.0,0.5−0.866025403784 i,0.5+0.866025403784 i | ⎤ ⎦

  - Find the numeric roots of x2−3:
    Input:
    proot([1,0,-3])
    or:
    proot(x^2-3)
    Output:

    ⎡ ⎣ | −1.73205080757,1.73205080757 | ⎤ ⎦

  ## 10.7 Numeric factorization of a matrix: cholesky qr lu svd

  Matrix numeric factorizations of

  - Cholesky,
  - QR,
  - LU,
  - svd,

  are described in Section 6.49.

  # Chapter 11 Unit objects and physical constants

  ## 11.1 Unit objects

  - Notation of unit objects
  - Computing with units
  - Converting units into MKSA units: mksa
  - Converting units: convert =>
  - Converting between Celsius and Fahrenheit: Celsius2Fahrenheit Fahrenheit2Celsius
  - Factoring a unit: ufactor
  - Simplifying units: usimplify

  ## 11.2 Constants

  - Notation of physical constants

  # Chapter 12 Programming

  A program that you write for Xcas might be longer than one line; the first section discusses how you can enter it.

  ## 12.1 Functions, programs and scripts

  - The program editor
  - Functions: function endfunction { } local return
  - Local variables
  - Default values of the parameters
  - Programs
  - Scripts
  - Code blocks

  ## 12.2 Basic instructions

  - Comments: //
  - Input: input Input InputStr textinput output Output
  - Reading a single keystroke: getKey
  - Checking conditions: assert
  - Checking the type of the argument: type subtype compare getType
  - Printing: print Disp ClrIO
  - Displaying exponents: printpow
  - Infixed assignments: => := =<
  - Assignment by copying: copy
  - The difference between := and =<

  ## 12.3 Control structures

  - if statements: if then else end elif
  - The switch statement: switch case default
  - The for loop: for from to step do end_for
  - The repeat loop: repeat until
  - The while loop: while
  - Breaking out a loop: break
  - Going to the next iteration of a loop: continue
  - Changing the order of execution: goto label

  ## 12.4 Other useful instructions

  - Defining a function with a variable number of arguments: args
  - Assignments in a program
  - Writing variable values to a file: write
  - Writing output to a file: fopen fclose fprint
  - Using strings as names: make_symbol
  - Using strings as commands: expr
  - Converting an expression to a string: string
  - Converting a real number into a string: format
  - Working with the graphics screen: DispG DispHome ClrGraph ClrDraw
  - Pausing a program: Pause WAIT
  - Dealing with errors: try catch throw error ERROR

  ## 12.5 Debugging

  - Starting the debugger: debug sst in sst_in cont kill break breakpoint halt rmbrk rmbreakpoint watch rmwtch

  # Chapter 13 Two-dimensional Graphics

  ## 13.1 Introduction

  - Points, vectors and complex numbers

  ## 13.2 Basic commands

  - Clearing the DispG screen: erase
  - Toggling the axes: switch_axes
  - Drawing unit vectors in the plane: Ox_2d_unit_vector Oy_2d_unit_vector frame_2d
  - Drawing dotted paper: dot_paper
  - Drawing lined paper: line_paper
  - Drawing grid paper: grid_paper
  - Drawing triangular paper: triangle_paper

  ## 13.3 Display features of graphics

  - Graphic features
  - Parameters for changing features
    - Parameters for local features
    - Parameters for global features
  - Commands for global display features
    - Adding a legend: legend
    - Changing various features:display color

  ## 13.4 Defining geometric objects without drawing them: nodisp

  The nodisp command defines an object without displaying it.

  - nodisp takes one argument:
    command, a command to create an object.
  - nodisp(command) creates the object withouth drawing it.

  Setting a variable to a graphic object draws the object.

  Examples.

  - Input:
    C:= point(1+i)
    Output:
    Input:
    nodisp(C:= point(1+i))
    Here, the point C is defined but not displayed. It is equivalent to following the command with :;,
    Input:
    C:= point(1+i):;
    To define a point as above and display it without the label, enter the point’s name;
    Input:
    C
    Output:
    Alternatively, you can get the same effect by defining the point within an eval statement:
    Input:
    eval(C:= point(1+i))
    To later display the point with a label, use the legend command:
    Input:
    legend(C,"C")
    or:
    point(affix(C),legend="C")
    Output:
    In this case, the string "C" can be replaced with any other string as a label. Alternatively, redefine the variable as itself:
    Input:
    C:= C
    prints C with its label.

  ## 13.5 Geometric demonstrations: assume

  Variables should be unspecified to demonstrate a general geometric result, but need to have specific values when drawing. There are a couple of different approaches to deal with this.

  One approach is to use the assume command (see Section 5.4.8). If a variable is assumed to have a value, then that value will be used in graphics but the variable will still be unspecified for calculations. For example: Input:

  assume(a = 2.1)
  A:= point(a + i)

  Output:

  but the variable a will still be treated as a variable in calculations:
  Input:

  distance(0,A)

  Output:

  √ |
  ⎛ ⎝ | −a | ⎞ ⎠ | 2+1

  Another approach would be to use the point or pointer mode in a geometry screen. If there isn’t a geometry screen showing, the command Alt-G or the Geo▸New figure 2d menu will open a screen. Clicking on the Mode button right above the graphic screen and choosing pointer or point will put the screen in pointer or point mode. If a point is defined and displayed, such as with A:= point(2.1 + i), then clicking on the name of the point (A in this case) with the right mouse button will bring up a configuration screen. As long as there is a point defined with non-symbolic values, there will be a symb box on the configuration screen. Selecting the symb box and choosing OK will be equivalent to the commands:

  assume(Ax=[2.1,-8.16901408451,8.16901408451])
  assume(Ay = [1, -5.0, 5.0]

  This will bring up two lines beneath the arrows to the right of the screen which can be used to change the assumed values of Ax and Ay. Also, the point A will be redefined as point(Ax,Ay).

  ## 13.6 Points in the plane

  - Points and complex numbers
  - The point in the plane: point
  - The difference and sum of two points in the plane:+ -
  - Defining random points in the plane: point2d
  - Points in polar coordinates: polar_point point_polar
  - Finding a point of intersection of two objects in the plane: single_inter line_inter
  - Finding the points of intersection of two geometric objects in the plane: inter
  - Finding the orthocenter of a triangle in the plane: orthocenter
  - Finding the midpoint of a segment in the plane: midpoint
  - The barycenter in the plane: barycenter
  - The isobarycenter of n points in the plane: isobarycenter
  - The center of a circle in the plane: center
  - The vertices of a polygon in the plane: vertices vertices_abc
  - The vertices of a polygon in the plane, closed: vertices_abca
  - A point on a geometric object in the plane: element

  ## 13.7 Lines in plane geometry

  - Lines and directed lines in the plane: line
  - Half-lines in the plane: half_line
  - Line segments in the plane: segment Line
  - Vectors in the plane: segment vector
  - Parallel lines in the plane: parallel
  - Perpendicular lines in the plane: perpendicular
  - Tangents to curves in the plane: tangent
  - The median of a triangle in the plane: median_line
  - The altitude of a triangle: altitude
  - The perpendicular bisector of a segment in the plane: perpen_bisector
  - The angle bisector: bisector
  - The exterior angle bisector: exbisector

  ## 13.8 Triangles in the plane

  See Section 14.7 for triangles in space.

  - Arbitrary triangles in the plane: triangle
  - Isosceles triangles in the plane: isosceles_triangle
  - Right triangles in the plane: right_triangle
  - Equilateral triangles in the plane: equilateral_triangle

  ## 13.9 Quadrilaterals in the plane

  See Section 14.8 for quadrilaterals in space.

  - Squares in the plane: square
  - Rhombuses in the plane: rhombus
  - Rectangles in the plane: rectangle
  - Parallelograms in the plane: parallelogram
  - Arbitrary quadrilaterals in the plane: quadrilateral

  ## 13.10 Other polygons in the plane

  See Section 14.9 for polygons in space.

  - Regular hexagons in the plane: hexagon
  - Regular polygons in the plane: isopolygon
  - General polygons in the plane: polygon
  - Polygonal lines in the plane: open_polygon
  - Convex hulls: convexhull

  ## 13.11 Circles

  - Circles and arcs in the plane: circle
  - Circular arcs: arc
  - Circles (TI compatibility): Circle
  - Inscribed circles: incircle
  - Circumscribed circles: circumcircle
  - Excircles: excircle
  - The power of a point relative to a circle: powerpc
  - The radical axis of two circles: radical_axis

  ## 13.12 Other conic sections

  - The ellipse in the plane: ellipse
  - The hyperbola in the plane: hyperbola
  - The parabola in the plane: parabola

  ## 13.13 Coordinates in the plane

  - The affix of a point or vector: affix
  - The abscissa of a point or vector in the plane: abscissa
  - The ordinate of a point or vector in the plane: ordinate
  - The coordinates of a point, vector or line in the plane: coordinates
  - The rectangular coordinates of a point: rectangular_coordinates
  - The polar coordinates of a point: polar_coordinates
  - The Cartesian equation of a geometric object in the plane: equation
  - The parametric equation of a geometric object in the plane: parameq

  ## 13.14 Measurements

  - Measurement and display: distanceat distanceatraw angleat angleatraw areaat areaatraw perimeterat perimeteratraw slopeat slopeatraw extract_measure
  - The distance between objects in the plane: distance
  - The length squared of a segment in the plane: distance2
  - The measure of an angle in the plane: angle
  - The graphical representation of the area of a polygon: plotarea areaplot
  - The area of a polygon: area
  - The perimeter of a polygon: perimeter
  - The slope of a line: slope
  - The radius of a circle: radius
  - The length of a vector: abs
  - The angle of a vector: arg
  - Normalize a complex number: normalize

  ## 13.15 Transformations

  - General remarks
  - Translations in the plane: translation
  - Reflections in the plane: reflection
  - Rotation in the plane: rotation
  - Homothety in the plane: homothety
  - Similarity in the plane: similarity
  - Inversion in the plane: inversion
  - Orthogonal projection in the plane: projection

  ## 13.16 Properties

  - Checking if a point is on an object in the plane: is_element
  - Checking if three points are collinear in the plane: is_collinear
  - Checking if four points are concyclic in the plane: is_concyclic
  - Checking if a point is in a polygon or circle: is_inside
  - Checking if an object is an equilateral triangle in the plane: is_equilateral
  - Checking if an object in the plane is an isosceles triangle: is_isosceles
  - Checking if an object in the plane is a right triangle or a rectangle: is_rectangle
  - Checking if an object in the plane is a square: is_square
  - Checking if an object in the plane is a rhombus: is_rhombus
  - Checking if an object in the plane is a parallelogram: is_parallelogram
  - Checking if two lines in the plane are parallel: is_parallel
  - Checking if two lines in the plane are perpendicular: is_perpendicular
  - Checking if two circles in the plane are orthogonal: is_orthogonal
  - Checking if elements are conjugates: is_conjugate
  - Checking if four points form a harmonic division: is_harmonic
  - Checking if lines are in a bundle: is_harmonic_line_bundle
  - Checking if circles are in a bundle: is_harmonic_circle_bundle

  ## 13.17 Harmonic division

  - Finding a point dividing a segment in the harminic ratio k: division_point
  - The cross ratio of four collinear points: cross_ratio
  - Harmonic division: harmonic_division
  - The harmonic conjugate: harmonic_conjugate
  - Pole and polar: pole polar
  - The polar reciprocal: reciprocation

  ## 13.18 Loci and envelopes

  - Loci: locus
    - The locus of points depending on points on a curve.
    - The envelope of a family of lines which depend on points on a curve.
  - Envelopes: envelope
  - The trace of a geometric object: trace

  # Chapter 14 Three-dimensional Graphics

  ## 14.1 Introduction

  The Alt+H command brings up a display screen for three-dimensional graphics. This screen has its own menu and command lines.

  This screen also automatically appears whenever there is a three-dimensional graphic command.

  The plane of vision for a three-dimensional graphic screen is perpendicular to the observer’s line of vision. The plane of vision is also indicated by dotted lines showing its intersection with the parallelepiped. The axis of vision for a three-dimensional graphic screen is

  The three-dimensional graphic screen starts with the image of a parallelepiped bounding the graphics and vectors in the x, y and z directions. At the top of the screen is the equation of the plane of vision, which is a plane perpendicular to the observer’s line of vision. The plane of vision is shown graphically with dotted lines indicating where it intersects the plane of vision.

  Clicking in the graphic screen outside of the parallelepiped and dragging the mouse moves the x, y and z directions relative to the observer; these directions are also changed with the x, X, y, Y, z and Z keys. Scrolling the mouse wheel moves the plane of vision along the line of vision. The in and out buttons on the graphic screen menu zoom in and out of the picture.

  The graphical features available for two-dimensional graphics (see Section 13.3) are also available for three-dimensional graphics, but to see the points the markers must be squares with width (point_width) at least 3.

  The graphic screen menu has a cfg button which brings up a configuration screen. Among other things, this screen has

  - An Ortho proj button, which determines whether the drawing uses orthogonal projection or perspective projection.
  - A Lights button, which determines whether the objects are lit or not; the locations of eight points for lighting are set using the buttons L1, …, L7, which specify the points with homogeneous coordinates.
  - A Show axis button, which determines whether or not the outlining parallelepiped is visible.

  ## 14.2 Changing the view

  The depictions of three-dimensional objects are made with a coordinate system Oxyz, where the x axis is horizontal and directed right, the y axis is vertical and directed up, and the z axis is perpendicular to the screen and directed out of the screen. The depictions can be transformed by changing to a different coordinate system by setting a quaternion (see Section 13.3.2).

  ## 14.3 The axes

  - Drawing unit vectors: Ox_3d_unit_vector Oy_3d_unit_vector Oz_3d_unit_vector frame_3d

  ## 14.4 Points in space

  - Defining a point in three-dimensions: point
  - Defining a random point in three-dimensions: point3d
  - Finding an intersection point of two objects in space: single_inter line_inter
  - Finding the intersection points of two objects in space: inter
  - Finding the midpoint of a segment in space: midpoint
  - Finding the barycenter of a set of points in space: barycenter
  - Finding the isobarycenter of a set of points in space: isobarycenter

  ## 14.5 Lines in space

  - Lines and directed lines in space: line
  - Half lines in space: half_line
  - Segments in space: segment
  - Vectors in space: vector
  - Parallel lines and planes in space: parallel
  - Perpendicular lines and planes in space: perpendicular
  - Planes orthogonal to lines and lines orthogonal to planes in space: orthogonal
  - Common perpendiculars to lines in space: common_perpendicular

  ## 14.6 Planes in space

  See also sections 14.5.6 and 14.5.7 for planes perpendicular and orthogonal to lines and planes.

  - Planes in space: plane
  - The bisector plane in space: perpen_bisector
  - Tangent planes in space: tangent

  ## 14.7 Triangles in space

  - Drawing triangles in space: triangle
  - Isosceles triangles in space: isosceles_triangle
  - Right triangles in space: right_triangle
  - Equilateral triangles in space: equilateral_triangle

  ## 14.8 Quadrilaterals in space

  See Section 13.9 for quadrilaterals in the plane.

  - Squares in space: square
  - Rhombuses in space: rhombus
  - Rectangles in space: rectangle
  - Parallelograms in space: parallelogram
  - Arbitrary quadrilaterals in space: quadrilateral

  ## 14.9 Polygons in space

  See Section 13.10 for polygons in the plane.

  - Hexagons in space: hexagon
  - Regular polygons in space: isopolygon
  - General polygons in space: polygon
  - Polygonal lines in space: open_polygon

  ## 14.10 Circles in space: circle

  See Section 13.11.1 for circles in the plane.

  The circle command returns and draws a circle. It can take its arguments in various ways.

  Three points.

  - circle takes three arguments:
    A,B,C, three points.
  - circle(A,B,C) returns and draws the circle in plane ABC with a diameter AB.

  Example.
  Input:

  circle(point(0,0,1),point(0,1,0),point(0,2,2))

  Output:

  Two points and a vector.

  - circle takes three points:
    - C, a point (which can be given by its coordinates).
    - v, a vector.
    - A, a point (which can be given by its coordinates).
  - circle(C,v,A) returns and draws the circle in plane C(C+v)C with center C and containing C+v.

  Example.
  Input:

  circle(point(0,0,1),vector(0,1,0),point(0,2,2))

  Output:

  ## 14.11 Conics in space

  - Ellipses in space: ellipse
  - Hyperbolas in space: hyperbola
  - Parabolas in space: parabola

  ## 14.12 Three-dimensional coordinates

  - The abscissa of a three-dimensional point: abscissa
  - The ordinate of a three-dimensional point: ordinate
  - The cote of a three-dimensional point: cote
  - The coordinates of a point, vector or line in space: coordinates
  - The Cartesian equation of an object in space: equation
  - The parametric equation of an object in space: parameq
  - The length of a segment in space: distance
  - The length squared of a segment in space: distance2
  - The measure of an angle in space: angle

  ## 14.13 Properties

  - Checking if an object in space is on another object: is_element
  - Checking if points and/or lines in space are coplanar: is_coplanar
  - Checking if lines and/or planes in space are parallel: is_parallel
  - Checking if lines and/or planes in space are perpendicular: is_perpendicular
  - Checking if two lines or two spheres in space are orthogonal: is_orthogonal
  - Checking if points in space are collinear: is_collinear
  - Checking if points in space are concyclic: is_concyclic
  - Checking if points in space are cospherical: is_cospherical
  - Checking if an object in space is an equilateral triangle: is_equilateral
  - Checking if an object in space is an isosceles triangle: is_isosceles
  - Checking if an object in space is a right triangle or a rectangle: is_rectangle
  - Checking if an object in space is a square: is_square
  - Checking if an object in space is a rhombus: is_rhombus
  - Checking if an object in space is a parallelogram: is_parallelogram

  ## 14.14 Transformations in space

  - General remarks
  - Translation in space: translation
  - Reflection in space with respect to a plane, line or point: reflection symmetry
  - Rotation in space: rotation
  - Homothety in space: homothety
  - Similarity in space: similarity
  - Inversion in space: inversion
  - Orthogonal projection in space: projection

  ## 14.15 Surfaces

  - Cones: cone
  - Half-cones: half_cone
  - Cylinders: cylinder
  - Spheres: sphere
  - The graph of a function of two variables: funcplot
  - The graph of parametric equations in space: paramplot

  ## 14.16 Solids

  - Cubes: cube
  - Tetrahedrons: tetrahedron pyramid
  - Parallelepipeds: parallelepiped
  - Prisms: prism
  - Polyhedra: polyhedron
  - Vertices: vertices
  - Faces: faces
  - Edges: line_segments

  ## 14.17 Platonic solids

  To specify a Platonic solid, Xcas works with the center, a vertex and a third point to specify a plane of symmetry. To speed up calculations, it may be useful to use approximate calculations, which can be ensured with the evalf command. For example, instead of:
  Input:

  centered_cube([0,0,0],[3,2,1],[1,1,0])

  it would typically be better to use:
  Input:

  centered_cube(evalf([0,0,0],[3,2,1],[1,1,0]))
  - Centered tetrahedra: centered_tetrahedron
  - Centered cubes: centered_cube
  - Octahedra: octahedron
  - Dodecahedra: dodecahedron
  - Icosahedra: icosahedron

  # Chapter 15 Multimedia

  ## 15.1 Audio Tools

  Xcas has commands for working with audio objects. An audio object is a vector consisting of:

  - The first element is itself a list consisting of:
    - The number of channels (generally 1 for mono and 2 for stereo).
    - The number of bits (generally 16).
    - The sampling frequency (44100 for a CD quality sound).
    - The number of bytes (excluding the header); i.e., the number of seconds times the sampling frequency times the number of bits/8 times the number of channels.
  - The second element is another list of digital sound data for each channel.

  Xcas can read and write audio objects as files on your computer; these files will be in the wav (Waveform Audio File) format.

  For creating and playing audio objects, there are:

  - createwav, for creating audio objects (see Section 15.1.1).
  - playsnd, for playing audio objects (see Section 15.1.4).

  For reading and writing audio files, there are:

  - readwav, for reading audio files from disk and creating audio objects (see Section 15.1.2).
  - writewav, for writing audio files to disk from audio objects (see Section 15.1.3).

  For manipulating audio objects, there are:

  - stereo2mono, to convert a multichannel audio clip to a single channel (see Section 15.1.5).
  - resample, to change the sample rate (see Section 15.1.8).

  For getting information from an audio object, there are:

  - channels, to find the number of channels (see Section 15.1.6).
  - bit_depth, to find the number of bits in each sample value (see Section 15.1.6).
  - samplerate, to find the number of samples per second (see Section 15.1.6).
  - duration, to find the duration of the audio in seconds (see Section 15.1.6).
  - channel_data, to extract a sample from an audio (see Section 15.1.7).
  - plotwav, to visualize a waveform (see Section 15.1.9).
  - plotspectrum, to visualize the power spectra (see Section 15.1.10).
  - Creating audio clips: createwav
  - Reading wav files from disk: readwav
  - Writing wav files to disk: writewav
  - Audio playback: playsnd
  - Averaging channel data: stereo2mono
  - Audio clip properties: channels bit_depth samplerate duration
  - Extracting samples from audio clips: channel_data
  - Changing the sampling rate: resample
  - Visualizing waveforms: plotwav
  - Visualizing power spectra: plotspectrum
  - Reading a wav file: readwav
  - Writing a wav file: writewav
  - Listening to a digital sound: playsnd
  - Preparing digital sound data: soundsec

  ## 15.2 Signal Processing

  - Boxcar function: boxcar
  - Rectangle function: rect
  - Triangle function: tri
  - Cardinal sine function: sinc
  - Root mean square: rms
  - Cross-correlation of two signals: cross_correlation
  - Auto-correlation of a signal: auto_correlation
  - Convolution of two signals or functions: convolution
  - Low-pass filtering: lowpass
  - High-pass filtering: highpass
  - Apply a moving average filter to a signal: moving_average
  - Performing thresholding operations on an array: threshold
  - Bartlett-Hann window function: bartlett_hann_window
  - Blackman-Harris window function: blackman_harris_window
  - Blackman window function: blackman_window
  - Bohman window function: bohman_window
  - Cosine window function: cosine_window
  - Gaussian window function: gaussian_window
  - Hamming window function: hamming_window
  - Hann-Poisson window function: hann_poisson_window
  - Hann window function: hann_window
  - Parzen window function: parzen_window
  - Poisson window function: poisson_window
  - Riemann window function: riemann_window
  - Triangular window function: triangle_window
  - Tukey window function: tukey_window
  - Welch window function: welch_window
  - An example: static noise removal by spectral subtraction

  ## 15.3 Images