Wolfram_Mathematica_Notations
Wolfram_Mathematica_Notations
Basic Syntax
Notation Meaning
x=y Assigns the value y to the variable x.
x := y Delayed assignment; y is evaluated every
time x is used.
== Tests equality between two expressions.
!= Tests inequality between two expressions.
-> Rule, replaces expressions on the left with
those on the right.
: Specifies a pattern; e.g., x_ matches any
expression.
_ Matches any single expression (wildcard).
__ Matches one or more expressions.
___ Matches zero or more expressions.
/. Replaces parts of an expression using rules.
; Suppresses output.
, Separates elements in lists, function
arguments, etc.
(* ... *) Comments.
Arithmetic Operators
Notation Meaning
+ Addition.
- Subtraction.
* Multiplication.
/ Division.
^ Power.
// Postfix application; e.g., expr // f is f[expr].
Logical Operators
Notation Meaning
&& Logical AND.
|| Logical OR.
! Logical NOT.
True / False Boolean values.
Special Characters
Notation Meaning
\[Pi] Symbol for π.
\[Infinity] Symbol for infinity.
\[Sum] Summation operator.
\[Integral] Integral operator.
Mathematical Functions
Notation Meaning
Sin[x], Cos[x], etc. Trigonometric functions.
Exp[x] Exponential function e^x.
Log[x] Natural logarithm of x.
Sqrt[x] Square root of x.
Control Structures
Notation Meaning
If[cond, trueExpr, falseExpr] If cond is true, evaluate trueExpr,
otherwise falseExpr.
While[cond, body] Repeats body while cond is true.
For[start, cond, incr, body] Traditional for-loop structure.
Do[body, {i, n}] Repeats body n times, incrementing i from
1 to n.
Set Operations
Notation Meaning
Union[a, b] Union of sets a and b.
Intersection[a, b] Intersection of sets a and b.
Complement[a, b] Elements in a but not in b.
Differentiation and Integration
Notation Meaning
D[f[x], x] Derivative of f[x] with respect to x.
Integrate[f[x], x] Indefinite integral of f[x] with respect to x.
Integrate[f[x], {x, a, b}] Definite integral of f[x] from a to b.
Linear Algebra
Notation Meaning
Det[matrix] Determinant of a matrix.
Inverse[matrix] Inverse of a matrix.
Eigenvalues[matrix] Eigenvalues of a matrix.
Dot[v1, v2] Dot product of vectors v1 and v2.