Calculus
Sin(x)
Sin(x) : Calculate sinus of x.
Cos(x)
Cos(x) : Calculate cosinus of x.
Tan(x)
Tan(x) : Calculate tangent of x.
ArcSin(x)
ArcSin(x) : Calculate arc-sinus of x.
ArcCos(x)
ArcCos(x) : Calculate arc-cosinus of x.
ArcTan(x)
ArcTan(x) : Calculate acr-tangent of x.
Exp(x)
Exp(x) : Calculate e^x.
Ln(x)
Ln(x) : Calculate natural logarithm of x.
Sqrt(x)
Sqrt(x) : calculate the square root of x.
Abs(x)
Abs(x) : calculate the absolute value of x.
Complex(x,y)
This represents a complex number x+I*y.
Re(z)
Return real part of complex number z.
Im(z)
Return imaginary part of complex number z.
I
This is the pure imaginary number I (for which i*I=-1).
You can type 2+I*3, which would evaluate to
Complex(2,3). Re and Im return the real and
imaginary parts of a number respectively.
n!
Factorial. n! evaluates to n*(n-1)*(n-2)*....*1.
Bin(n,m)
Bin(n,m) evaluates to n!/(n!*(n-m)!)
Sum(var,from,to,body) and Sum({list})
Sum(var,from,to,body) :
Sum does a summation over "body", setting variable "var"
from "from" upto and including "to", incrementing it by 1 each
time.
Sum({list}) : calculate the sum of the elements in a list.
Example : Sum({1,2,3}) evaluates to 6.
Average({list})
Average({list}) : calculate the average of the elements in a list.
Example : Average({1,2,3}) evaluates to 2.
Factorize(var,from,to,body) and Factorize({list})
Factorize(var,from,to,body) :
Factorize does a factorization over "body", setting variable "var"
from "from" upto and including "to", incrementing it by 1 each
time.
Factorize({list}) : calculate the product of the elements in a list.
Example : Factorize({1,2,3}) evaluates to 6.
Min(x,y), Min({...}), Max(x,y) and Max({...})
Min and Max return the minimum and maximum value of their
arguments respectively. Min and max can either be called with
two numbers as arguments, or with a list of numbers.
IsZero(x)
IsZero(x) : Returns wether x is zero or not.
IsRational(r)
IsRational(r) : Rational numbers are anything like a/b, or 2/5.
Numer(r)
Numer(r) : Return numerator of a rational number.
Denom(r)
Denom(r) : Return denominator of a rational number.
N(r) and N(r,digits)
N(r) : Rational numbers and other analytic functions (Sin, Cos, etc.)
are not evaluated
into floating point numbers, as it is usually the exact answer the user
is after. By using N these functions will be evaluated into
floating point numbers.
Use N(r,digits) to do the calculation using the specified
number of digits after the decimal. For example N(Pi,50) would evaluate pi to 50 digits.
Commutator(a,b)
Commutator(a,b) :
Return "a b - b a". For numbers and such this is
zero, for matrices in general it isn't.
Taylor(var,var0,order)function
Taylor(var,var0,order)function :
Return the Taylor series expansion of function "function", with
respect to variable "var", around "var=var0", upto order "order".
InverseTaylor(var,value,degree) func
InverseTaylor(var,value,degree) func : build a taylor series expansion
of the inverse of function func, with respect to variable var around value, upto
degree. InverseTaylor uses the function ReversePoly to perform the
task.
ReversePoly(f,g,var,newvar,degree)
ReversePoly(f,g,var,newvar,degree) :
Given polynomials f(var) and h(var), determine a polynomial
h(newvar) for which h(f(var)) = g(var). The resulting polynomial
will be of degree degree. The only requirement is that the
first derivative of f should not be zero.
This function is used to determine the taylor series expansion of
a function: if g(var)=var, then h(f(var))=var, so h will be the
inverse of f.
Newton(function,variable,initial,accuracy)
Newton(function,variable,initial,accuracy) :
Find a zero of "function", as a function of "variable",
starting around value "initial", and continuing until
the value for "variable" is maximally "accuracy" away
from the correct value.
D(variable)expression
D(variable) expression :
Calculate analytic derivative of an expression. "D(x) Sin(x);"
"Cos(x);".
The D operator is also threaded:
"D({x,y,z}) Sin(x*y)" will return {Cos(x*y)*y,Cos(x*y)*x,0}
Alternatively, you can call D with "D(variable,n)expression".
In that case the n-th derivative will be taken.
Diverge(vector, basis)
Diverge(vector, basis) : Calculate the divergence of
a vector.
Example: "Diverge(FillList(x*y,3),{x,y,z})" will return
{y,x,0}
Curl(vector, basis)
Curl(vector, basis) : Calculate the curl of a vector.
Example: "Curl(FillList(x*y,3),{x,y,z})" will return
{x,-y,y-x}
Integrate(var,from,to) body
Integrate(var,from,to) body : integrate body over variable var=from
to var=to. Currently, only polynomials can be integrated.
Simplify(expr)
Simplify(expr) : Simplify tries to simplify an expression as much
as possible.
Rationalize(expr)
Rationalize(expr) : convert every real number in expr into a rational
number.
Conjugate(expr)
Conjugate(expr) : return the conjugate of expr (given that all
variables are real or integer).
Solve(expr1==expr2,variable)
Solve(expr1==expr2,variable) :
A very simple solver. It can for now solve expressions where the variable
to be solved for only occurs once.
"Solve(a+x*y==z,x);" would evaluate to "(z-a)/y".
Solve can solve simple sets of equations. Pass the equations in a list,
as well as the variables to be solved for. The solver will then use
SuchThat, in combination with Eliminate, to simplify the equations.
This suffices for all linear equations and a large group of simple
non-linear equations.
When the variable argument receives a list of variables to solve for,
Solve returns a list of results, with each result being a solution
to the set of equations.
SuchThat(function,var)
SuchThat(function,var) : try to find a simple expression for variable var,
given the equality function=0. This function basically only handles
expressions where the variable var only occurs once. It does its work
by applying the inverse of the top function, until the variable is
reached.
Eliminate(var,replace,function)
Eliminate(var,replace,function) : replace all instances of
var in function with relpace
and call Simplify on the resulting expression.
PSolve(expr,var)
PSolve(expr) : solve expr=0 with respect to variable var, treating
it expr as a polynomial. It currently solves upto degree 2.
Pi()
Pi() : Returns pi to the current precision.
Fibonacci(n)
Fibonacci(n) : Calculate Fibonacci number "n".
Random()
Random() : Returns a random number between 0 and 1.
VarList(expression)
VarList(expression) : Returns a list with all the variables
"expression" depends on. Example: "VarList(Sin(x));" should
return "{x};".
Limit(variable,value) function
Limit(variable,value)function : determine the
value "function" converges to when "variable"
goes to "value" from positive infinity.
Examples :
"Limit(x,0) Sin(x)/x;" evaluates to "1", and
"Limit(x,0) (Sin(x)-Tan(x))/(x^3);" evaluates to "-1/2".
TrigSimpCombine(expression)
TrigSimpCombine(expression) :
This is the module that does the trigonometric simplification:
Cos(...)*Sin(...) -> Cos(...)+Sin(...)
It also tries to simplify the resulting expression as much as possible,
trying to combine all like terms.
LagrangeInterpolant({xlist},{ylist},var)
LagrangeInterpolant({xlist},{ylist},var) :
given a set of points (x_i,y_i) with all nonzero y_i, find the
polynomial that goes through these points. The first argument
passed to the function should be the list of x_i values, the
second one should be the list of y_i values, and the third
argument should be the variable used to build up the polynomial.
This routine uses the Lagrange interpolant formula to build up the
polynomial. For three terms this is:
In> PrettyForm(LagrangeInterpolant(MakeVector(x,3),MakeVector(y,3),x))
y1 * ( x - x2 ) * ( x - x3 ) y2 * ( x - x1 ) * ( x - x3 )
---------------------------- + ----------------------------
( x1 - x2 ) * ( x1 - x3 ) ( x2 - x1 ) * ( x2 - x3 )
y3 * ( x - x1 ) * ( x - x2 )
+ ----------------------------
( x3 - x1 ) * ( x3 - x2 )
Out> True;
|