1 minute Arithmetic Analysis  Geometry Statistics Menus, icons,... 
Mathematical Objects Linear algebra Functions 2D Graphics Combinatorics
WIRIS ++ Equations and systems of equations  Progressions 3D Graphics  Units of measurement
Mathematical Objects 

Mathematical expressions are primarily based on numbers, variables, mathematical operations and functions. The first two are explained in this chapter: numbers and variables. It also addresses other objects that are more sophisticated, which can be created with wiris, such as polynomials and equations. Some other mathematical objects are explained in the following chapters: Geometry and Wiris ++.

>>fast   
 Numbers  integers rational numbers irrationals
decimals complex numbers  
 Variables  Assigning and defining of values to variables
 Other objects  polynomials equations and inequalities lists
vectors and matrices mathematical expressions  


 Numbers

The types of numbers we can construct are:



integers: an integer is created entering its digits in base 10. If we want a negative number we place the symbol - in front. Integers can have as many digits as the user wishes. To get an idea, calculate 264 or 100!. More information on Integer.


rational numbers: Rational numbers are created as a fraction from two integers, with the icon or with the symbol /. There are two functions associated with rational numbers numerator and denominator. If q is a rational number, then numerator(q) and denominator(q) give us, respectively, the numerator and the denominator of the irreducible fraction equivalent to q. More information on Rational.


irrationals: Irrational numbers that can be manipulated by wiris are: π, e, radicals such as the square root of 2, and combinations of radicals. By combination we mean their addition, subtraction, multiplication or division. More information on Irrational.


decimals: a decimal number is created separating the whole number part and the decimal with a point. More information on Float.


complex numbers: a complex number can be created by performing mathematical operations with the imaginary number i (which can be created using the icon or with the identifier i_) and with the real numbers. It is also possible to use the polar function to create them. Some functions related to complex numbers are real_part, imaginary_part, argument, norm or conjugate. More information on Complex.


 Variables

In mathematics, and in the wiris interface, variables are names, with or without a value. A name is a string of alphanumeric characters which begins with a letter, such as x, y, x1, x2, HAL or alpha. On the other hand 2x or 3ab are not names, because they begin with a digit.

wiris differentiates between lower and upper case letters. Thus x and X are different variables, as are f1 and F1.





Assigning and defining of values to variables 

To give a variable a value use the operators = and :=.

  • If = is used, the variable takes the value of the expression to the right of the equals at that moment.
  • On the other hand, if :=is used, the variable takes the instantaneous value of the expression to the right of the :=. Therefore, if the value to the right of the expression changes, the value of the variable will also change.
If the := sign is used, it can be said that the value of the variable has been defined, and if the = sign is used, it can be said that a value is assigned to the variable.

If a value has been assigned or defined for a variable and the user wishes to clear the variable, the clear command can be used.



 Other objects


polynomials: A polynomial is created using certain mathematical operations (addition, subtraction and multiplication) between numbers and variables. To evaluate a polynomial for a given value use the function evaluate. Two more important commands are: roots and factor which, as their names suggest, allow the user to find roots of a polynomial and to factor one, respectively. More information on Polynomial.


equations and inequalities: The symbols required to define and work with equations and inequalities are set out in the following table. wiris has icons that are used to write these expressions (this produces the best typographical quality), but they can also be entered using the keyboard or with a keystroke combination.



type Symbol Icon Keyboard
equation NOTE 1 =  
equation == Ctrl + =
Not equal to != Ctrl + !
inequality >  
>= Ctrl + Shift + >
<  
<= Ctrl + <


An equation (inequality) is created by separating two expressions with the equals (not equal to) symbol. The expressions to the left and right of an equals sign (or an inequality symbol) are called the left and right terms, respectively.

If the user enters the sign ? NOTE 2 to the right of an equation or inequality wiris will respond letting the user know whether the equality or inequality is true or false.

NOTE 1To enter an equation it is normally sufficient to use the symbol =. Where there is any possible confusion over the assignation you must use the symbol ==.

NOTE 2The sign ? must be preceded by a blank space since ? is a valid character for creating identifiers.



lists: A list is a sequence within curly brackets. The curly brackets can be entered using the keys { and } or the icon . If the curly brackets are created using the icon, they will be of variable size, the size adapting to the content. The keystroke combinations Ctrl + { and Ctrl + } also create variable size curly brackets.

There are two commands that support working with lists:

  • length, determines the number of elements in a list.
  • sort, sorts a list made up of objects that can be ordered.




Vertical lists 

Lists can also be displayed vertically, and in that case will be referred to as vertical lists. These lists have the same properties as horizontal lists but their elements are shown one above the other. Thus, no commas are needed to separate them. Use the icon to create vertical lists and the keystroke combination Shift + Enter to create a new row.

Hereafter, the manual will discuss how to manipulate lists in a simple way and how they are used to solve systems. More information on List.



vectors and matrices: a vector is a sequence enclosed in square brackets, which we can create with the keys [, ], with the icon , separating its elements with commas, or using the icon . If the square brackets are created with the icons, the size of the square brackets will adjust to the size of the contents. The same result can be obtained with keystroke combinations Ctrl + [ and Ctrl + ]

A matrix is a vector formed from vectors of the same size. Each of these vectors corresponds to a row of the matrix.

The icons and explained in detail in the chapter Menus, icons,..., enable easy creation of vectors and matrices.

To learn more about how the program works with vectors and matrices, see chapter Linear algebra.





Manipulating lists, vectors and matrices  

Subscripts are created using the icon and they are the principal tool for manipulating vectors and matrices; in particular, to extract and change their elements.

Given a list or a vector v and a whole number i, vi is the ith component of v, as long as 1<=i<=length(v).

As every matrix is a vector of vectors, if A is a matrix, then Ai is its ith row and Ai,j ( or Aij ) thejth element in the ith row (assuming that it exists).

An alternative but equivalent notation is to use the period, such that the expression An is the same as A.n, and Ai,j is the same as A.i.j. Along the same lines, if v is a vector, v.i is the ith component of v.

To change the value of a component in a list, vector or matrix, the syntax explained in the previous subsection can be used, and it can be assigned a new value with the operator = .



mathematical expressions: Mathematical objects which are not of any of the types above will be considered mathematical expressions of type Expression.

Some examples of this type of object are

sin(x), sin(x)2+cos(x)2 or f(x)

The command simplify calculates an expression equivalent to the one given but simplified as far as possible.

mathsformore.com powered by WIRIS

©2003 maths for more sl. All rights reserved. Legal notice