# Commands supported by KAlgebra

## plus

- Name: plus

- Description: Addition

- Parameters: plus(... parameters, ...)

- Example: x->x+2

## times

- Name: times

- Description: Multiplication

- Parameters: times(... parameters, ...)

- Example: x->x*2

## minus

- Name: minus

- Description: Subtraction. Will remove all values from the first one.

- Parameters: minus(... parameters, ...)

- Example: x->x-2

## divide

- Name: divide

- Description: Division

- Parameters: divide(par1, par2)

- Example: x->x/2

## quotient

- Name: quotient

- Description: Quotient

- Parameters: quotient(par1, par2)

- Example: x->quotient(x, 2)

## power

- Name: power

- Description: Power

- Parameters: power(par1, par2)

- Example: x->x^2

## root

- Name: root

- Description: Root

- Parameters: root(par1, par2)

- Example: x->root(x, 2)

## factorial

- Name: factorial

- Description: Factorial. factorial(n)=n!

- Parameters: factorial(par1)

- Example: x->factorial(x)

## and

- Name: and

- Description: Boolean and

- Parameters: and(... parameters, ...)

- Example: x->piecewise { and(x>-2, x<2) ? 1, ? 0 }

## or

- Name: or

- Description: Boolean or

- Parameters: or(... parameters, ...)

- Example: x->piecewise { or(x>2, x>-2) ? 1, ? 0 }

## xor

- Name: xor

- Description: Boolean xor

- Parameters: xor(... parameters, ...)

- Example: x->piecewise { xor(x>0, x<3) ? 1, ? 0 }

## not

- Name: not

- Description: Boolean not

- Parameters: not(par1)

- Example: x->piecewise { not(x>0) ? 1, ? 0 }

## gcd

- Name: gcd

- Description: Greatest common divisor

- Parameters: gcd(... parameters, ...)

- Example: x->gcd(x, 3)

## lcm

- Name: lcm

- Description: Least common multiple

- Parameters: lcm(... parameters, ...)

- Example: x->lcm(x, 4)

## rem

- Name: rem

- Description: Remainder

- Parameters: rem(par1, par2)

- Example: x->rem(x, 5)

## factorof

- Name: factorof

- Description: The factor of

- Parameters: factorof(par1, par2)

- Example: x->factorof(x, 3)

## max

- Name: max

- Description: Maximum

- Parameters: max(... parameters, ...)

- Example: x->max(x, 4)

## min

- Name: min

- Description: Minimum

- Parameters: min(... parameters, ...)

- Example: x->min(x, 4)

## lt

- Name: lt

- Description: Less than. lt(a,b)=a<b

- Parameters: lt(par1, par2)

- Example: x->piecewise { x<4 ? 1, ? 0 }

## gt

- Name: gt

- Description: Greater than. gt(a,b)=a>b

- Parameters: gt(par1, par2)

- Example: x->piecewise { x>4 ? 1, ? 0 }

## eq

- Name: eq

- Description: Equal. eq(a,b) = a=b

- Parameters: eq(par1, par2)

- Example: x->piecewise { x=4 ? 1, ? 0 }

## neq

- Name: neq

- Description: Not equal. neq(a,b)=a≠b

- Parameters: neq(par1, par2)

- Example: x->piecewise { x!=4 ? 1, ? 0 }

## leq

- Name: leq

- Description: Less or equal. leq(a,b)=a≤b

- Parameters: leq(par1, par2)

- Example: x->piecewise { x<=4 ? 1, ? 0 }

## geq

- Name: geq

- Description: Greater or equal. geq(a,b)=a≥b

- Parameters: geq(par1, par2)

- Example: x->piecewise { x>=4 ? 1, ? 0 }

## implies

- Name: implies

- Description: Boolean implication

- Parameters: implies(par1, par2)

- Example: x->piecewise { implies(x<0, x<3) ? 1, ? 0 }

## approx

- Name: approx

- Description: Approximation. approx(a)=a±n

- Parameters: approx(par1, par2)

- Example: x->piecewise { approx(x, 4) ? 1, ? 0 }

## abs

- Name: abs

- Description: Absolute value. abs(n)=|n|

- Parameters: abs(par1)

- Example: x->abs(x)

## floor

- Name: floor

- Description: Floor value. floor(n)=⌊n⌋

- Parameters: floor(par1)

- Example: x->floor(x)

## ceiling

- Name: ceiling

- Description: Ceil value. ceil(n)=⌈n⌉

- Parameters: ceiling(par1)

- Example: x->ceiling(x)

## sin

- Name: sin

- Description: Function to calculate the sine of a given angle

- Parameters: sin(par1)

- Example: x->sin(x)

## cos

- Name: cos

- Description: Function to calculate the cosine of a given angle

- Parameters: cos(par1)

- Example: x->cos(x)

## tan

- Name: tan

- Description: Function to calculate the tangent of a given angle

- Parameters: tan(par1)

- Example: x->tan(x)

## sec

- Name: sec

- Description: Secant

- Parameters: sec(par1)

- Example: x->sec(x)

## csc

- Name: csc

- Description: Cosecant

- Parameters: csc(par1)

- Example: x->csc(x)

## cot

- Name: cot

- Description: Cotangent

- Parameters: cot(par1)

- Example: x->cot(x)

## sinh

- Name: sinh

- Description: Hyperbolic sine

- Parameters: sinh(par1)

- Example: x->sinh(x)

## cosh

- Name: cosh

- Description: Hyperbolic cosine

- Parameters: cosh(par1)

- Example: x->cosh(x)

## tanh

- Name: tanh

- Description: Hyperbolic tangent

- Parameters: tanh(par1)

- Example: x->tanh(x)

## sech

- Name: sech

- Description: Hyperbolic secant

- Parameters: sech(par1)

- Example: x->sech(x)

## csch

- Name: csch

- Description: Hyperbolic cosecant

- Parameters: csch(par1)

- Example: x->csch(x)

## coth

- Name: coth

- Description: Hyperbolic cotangent

- Parameters: coth(par1)

- Example: x->coth(x)

## arcsin

- Name: arcsin

- Description: Arc sine

- Parameters: arcsin(par1)

- Example: x->arcsin(x)

## arccos

- Name: arccos

- Description: Arc cosine

- Parameters: arccos(par1)

- Example: x->arccos(x)

## arctan

- Name: arctan

- Description: Arc tangent

- Parameters: arctan(par1)

- Example: x->arctan(x)

## arccot

- Name: arccot

- Description: Arc cotangent

- Parameters: arccot(par1)

- Example: x->arccot(x)

## arccosh

- Name: arccosh

- Description: Hyperbolic arc cosine

- Parameters: arccosh(par1)

- Example: x->arccosh(x)

## arccsc

- Name: arccsc

- Description: Arc cosecant

- Parameters: arccsc(par1)

- Example: x->arccsc(x)

## arccsch

- Name: arccsch

- Description: Hyperbolic arc cosecant

- Parameters: arccsch(par1)

- Example: x->arccsch(x)

## arcsec

- Name: arcsec

- Description: Arc secant

- Parameters: arcsec(par1)

- Example: x->arcsec(x)

## arcsech

- Name: arcsech

- Description: Hyperbolic arc secant

- Parameters: arcsech(par1)

- Example: x->arcsech(x)

## arcsinh

- Name: arcsinh

- Description: Hyperbolic arc sine

- Parameters: arcsinh(par1)

- Example: x->arcsinh(x)

## arctanh

- Name: arctanh

- Description: Hyperbolic arc tangent

- Parameters: arctanh(par1)

- Example: x->arctanh(x)

## exp

- Name: exp

- Description: Exponent (e^x)

- Parameters: exp(par1)

- Example: x->exp(x)

## ln

- Name: ln

- Description: Base-e logarithm

- Parameters: ln(par1)

- Example: x->ln(x)

## log

- Name: log

- Description: Base-10 logarithm

- Parameters: log(par1)

- Example: x->log(x)

## conjugate

- Name: conjugate

- Description: Conjugate

- Parameters: conjugate(par1)

- Example: x->conjugate(x*i)

## arg

- Name: arg

- Description: Arg

- Parameters: arg(par1)

- Example: x->arg(x*i)

## real

- Name: real

- Description: Real

- Parameters: real(par1)

- Example: x->real(x*i)

## imaginary

- Name: imaginary

- Description: Imaginary

- Parameters: imaginary(par1)

- Example: x->imaginary(x*i)

## sum

- Name: sum

- Description: Summatory

- Parameters: sum(par1 : var=from..to)

- Example: x->x*sum(t*t:t=0..3)

## product

- Name: product

- Description: Productory

- Parameters: product(par1 : var=from..to)

- Example: x->product(t+t:t=1..3)

## diff

- Name: diff

- Description: Differentiation

- Parameters: diff(par1 : var)

- Example: x->(diff(x^2:x))(x)

## card

- Name: card

- Description: Cardinal

- Parameters: card(par1)

- Example: x->card(vector { x, 1, 2 })

## scalarproduct

- Name: scalarproduct

- Description: Scalar product

- Parameters: scalarproduct(... parameters, ...)

- Example: x->scalarproduct(vector { 0, x }, vector { x, 0 })[1]

## selector

- Name: selector

- Description: Select the par1-th element of par2 list or vector

- Parameters: selector(par1, par2)

- Example: x->scalarproduct(vector { 0, x }, vector { x, 0 })[1]

## union

- Name: union

- Description: Joins several items of the same type

- Parameters: union(... parameters, ...)

- Example: x->union(list { 1, 2, 3 }, list { 4, 5, 6 })[rem(floor(x), 5)+3]

## forall

- Name: forall

- Description: For all

- Parameters: forall(par1 : var)

- Example: x->piecewise { forall(t:t@list { true, false, false }) ? 1, ? 0 }

## exists

- Name: exists

- Description: Exists

- Parameters: exists(par1 : var)

- Example: x->piecewise { exists(t:t@list { true, false, false }) ? 1, ? 0 }

## map

- Name: map

- Description: Applies a function to every element in a list

- Parameters: map(par1, par2)

- Example: x->map(x->x+x, list { 1, 2, 3, 4, 5, 6 })[rem(floor(x), 5)+3]

## filter

- Name: filter

- Description: Removes all elements that don't fit a condition

- Parameters: filter(par1, par2)

- Example: x->filter(u->rem(u, 2)=0, list { 2, 4, 3, 4, 8, 6 })[rem(floor(x), 5)+3]

## transpose

- Name: transpose

- Description: Transpose

- Parameters: transpose(par1)

- Example: x->transpose(matrix { matrixrow { 1, 2, 3, 4, 5, 6 } })[rem(floor(x), 5)+3][1]