Sage
Welcome to Sage
Volume (65%) Hide Volume
Topics
Mathematical Notation
Sage supports mathematical notation using MathJax, a cross-browser JavaScript library that displays math notation in web browsers, using MathML, LaTeX, and AsciiMath markup.

AsciiMath

Use the [=] tag for AsciiMath notation…

[=]d^n/dx^n (x^n) = n![end]

The above produces…


~XR0znX{d^n/dx^n (x^n) = n!}XR0znX~


Read on for details about AsciiMath.

Operation Symbols

Code Symbol
+

~XR0znX{+}XR0znX~

 
-

~XR0znX{-}XR0znX~

 
*

~XR0znX{*}XR0znX~

 
**

~XR0znX{**}XR0znX~

 
***

~XR0znX{***}XR0znX~

 
//

~XR0znX{//}XR0znX~

 
\\

~XR0znX{\\}XR0znX~

 
xx

~XR0znX{xx}XR0znX~

 
-:

~XR0znX{-:}XR0znX~

 
|><

~XR0znX{|><}XR0znX~

 
><|

~XR0znX{><|}XR0znX~

 
|><|

~XR0znX{|><|}XR0znX~

 
@

~XR0znX{@}XR0znX~

 
o+

~XR0znX{o+}XR0znX~

 
ox

~XR0znX{ox}XR0znX~

 
o.

~XR0znX{o.}XR0znX~

 
sum

~XR0znX{sum}XR0znX~

 
prod

~XR0znX{prod}XR0znX~

 
^^

~XR0znX{^^}XR0znX~

 
^^^

~XR0znX{^^^}XR0znX~

 
vv

~XR0znX{vv}XR0znX~

 
vvv

~XR0znX{vvv}XR0znX~

 
nn

~XR0znX{nn}XR0znX~

 
nnn

~XR0znX{nnn}XR0znX~

 
uu

~XR0znX{uu}XR0znX~

 
uuu

~XR0znX{uuu}XR0znX~

 

Miscellaneous Symbols

Code Symbol
2/3

~XR0znX{2/3}XR0znX~

 
2^3

~XR0znX{2^3}XR0znX~

 
a_i

~XR0znX{a_i}XR0znX~

 
sqrt x

~XR0znX{sqrt x}XR0znX~

 
root(3)(x)

~XR0znX{root(3)(x)}XR0znX~

 
int

~XR0znX{int}XR0znX~

 
oint

~XR0znX{oint}XR0znX~

 
del

~XR0znX{del}XR0znX~

 
grad

~XR0znX{grad}XR0znX~

 
+-

~XR0znX{+-}XR0znX~

 
O/

~XR0znX{O/}XR0znX~

 
oo

~XR0znX{oo}XR0znX~

 
aleph

~XR0znX{aleph}XR0znX~

 
:.

~XR0znX{:.}XR0znX~

 
:'

~XR0znX{:'}XR0znX~

 
|...|

~XR0znX{|...|}XR0znX~

 
|cdots|

~XR0znX{|cdots|}XR0znX~

 
vdots

~XR0znX{vdots}XR0znX~

 
ddots

~XR0znX{ddots}XR0znX~

 
|\ |

~XR0znX{|\ |}XR0znX~

 
|quad|

~XR0znX{|quad|}XR0znX~

 
/_

~XR0znX{/_}XR0znX~

 
frown

~XR0znX{frown}XR0znX~

 
/_\

~XR0znX{/_\}XR0znX~

 
diamond

~XR0znX{diamond}XR0znX~

 
square

~XR0znX{square}XR0znX~

 
|__

~XR0znX{|__}XR0znX~

 
__|

~XR0znX{__|}XR0znX~

 
|~

~XR0znX{|~}XR0znX~

 
~|

~XR0znX{~|}XR0znX~

 
CC

~XR0znX{CC}XR0znX~

 
NN

~XR0znX{NN}XR0znX~

 
QQ

~XR0znX{QQ}XR0znX~

 
RR

~XR0znX{RR}XR0znX~

 
ZZ

~XR0znX{ZZ}XR0znX~

 
"hello"

~XR0znX{"hello"}XR0znX~

 

Relation Symbols

Code Symbol
=

~XR0znX{=}XR0znX~

 
!=

~XR0znX{!=}XR0znX~

 
<

~XR0znX{<}XR0znX~

 
>

~XR0znX{>}XR0znX~

 
<=

~XR0znX{<=}XR0znX~

 
>=

~XR0znX{>=}XR0znX~

 
mlt

~XR0znX{mlt}XR0znX~

 
<

~XR0znX{<}XR0znX~

 
m

~XR0znX{m}XR0znX~

 
-<

~XR0znX{-<}XR0znX~

 
-<=

~XR0znX{-<=}XR0znX~

 
>-

~XR0znX{>-}XR0znX~

 
>-=

~XR0znX{>-=}XR0znX~

 
in

~XR0znX{in}XR0znX~

 
!in

~XR0znX{!in}XR0znX~

 
sub

~XR0znX{sub}XR0znX~

 
sup

~XR0znX{sup}XR0znX~

 
sube

~XR0znX{sube}XR0znX~

 
supe

~XR0znX{supe}XR0znX~

 
-=

~XR0znX{-=}XR0znX~

 
~=

~XR0znX{~=}XR0znX~

 
~~

~XR0znX{~~}XR0znX~

 
prop

~XR0znX{prop}XR0znX~

 

Logical Symbols

Code Symbol
and

~XR0znX{and}XR0znX~

 
or

~XR0znX{or}XR0znX~

 
not

~XR0znX{not}XR0znX~

 
=>

~XR0znX{=>}XR0znX~

 
if

~XR0znX{if}XR0znX~

 
<=>

~XR0znX{<=>}XR0znX~

 
AA

~XR0znX{AA}XR0znX~

 
EE

~XR0znX{EE}XR0znX~

 
_|_

~XR0znX{_|_}XR0znX~

 
TT

~XR0znX{TT}XR0znX~

 
|--

~XR0znX{|--}XR0znX~

 
|==

~XR0znX{|==}XR0znX~

 

Grouping Brackets

Code Symbol
(

~XR0znX{(}XR0znX~

 
)

~XR0znX{)}XR0znX~

 
[

~XR0znX{[}XR0znX~

 
]

~XR0znX{]}XR0znX~

 
{

~XR0znX{{}XR0znX~

 
}

~XR0znX{}}XR0znX~

 
(:

~XR0znX{(:}XR0znX~

 
:)

~XR0znX{:)}XR0znX~

 
<<

~XR0znX{<<}XR0znX~

 
>>

~XR0znX{>>}XR0znX~

 
{: x )

~XR0znX{{: x )}XR0znX~

 
( x :}

~XR0znX{( x :}}XR0znX~

 
abs(x)

~XR0znX{abs(x)}XR0znX~

 
floor(x)

~XR0znX{floor(x)}XR0znX~

 
ceil(x)

~XR0znX{ceil(x)}XR0znX~

 
norm(vecx)

~XR0znX{norm(vecx)}XR0znX~

 

Note: {: and :} are invisible brackets, as shown above. They often match with a visible bracket, though when used together, they make an invisible element.
For example, {::}_(\ \ 92)^238U yields ~XR0znX{{::}_(\ \ 92)^238U}XR0znX~ .

Accents

Code Symbol
hat x

~XR0znX{hat x}XR0znX~

 
bar x

~XR0znX{bar x}XR0znX~

 
ul x

~XR0znX{ul x}XR0znX~

 
vec x

~XR0znX{vec x}XR0znX~

 
tilde x

~XR0znX{tilde x}XR0znX~

 
dot x

~XR0znX{dot x}XR0znX~

 
ddot x

~XR0znX{ddot x}XR0znX~

 
overset(x)(=)

~XR0znX{overset(x)(=)}XR0znX~

 
underset(x)(=)

~XR0znX{underset(x)(=)}XR0znX~

 
ubrace(1+2)

~XR0znX{ubrace(1+2)}XR0znX~

 
obrace(1+2)

~XR0znX{obrace(1+2)}XR0znX~

 
overarc(AB)

~XR0znX{overarc(AB)}XR0znX~

 
color(red)(x)

~XR0znX{color(red)(x)}XR0znX~

 
cancel(x)

~XR0znX{cancel(x)}XR0znX~

 

Greek Letters

Code Symbol
alpha

~XR0znX{alpha}XR0znX~

 
beta

~XR0znX{beta}XR0znX~

 
gamma

~XR0znX{gamma}XR0znX~

 
Gamma

~XR0znX{Gamma}XR0znX~

 
delta

~XR0znX{delta}XR0znX~

 
Delta

~XR0znX{Delta}XR0znX~

 
epsilon

~XR0znX{epsilon}XR0znX~

 
varepsilon

~XR0znX{varepsilon}XR0znX~

 
zeta

~XR0znX{zeta}XR0znX~

 
eta

~XR0znX{eta}XR0znX~

 
theta

~XR0znX{theta}XR0znX~

 
Theta

~XR0znX{Theta}XR0znX~

 
vartheta

~XR0znX{vartheta}XR0znX~

 
iota

~XR0znX{iota}XR0znX~

 
kappa

~XR0znX{kappa}XR0znX~

 
lambda

~XR0znX{lambda}XR0znX~

 
Lambda

~XR0znX{Lambda}XR0znX~

 
mu

~XR0znX{mu}XR0znX~

 
nu

~XR0znX{nu}XR0znX~

 
xi

~XR0znX{xi}XR0znX~

 
Xi

~XR0znX{Xi}XR0znX~

 
pi

~XR0znX{pi}XR0znX~

 
Pi

~XR0znX{Pi}XR0znX~

 
rho

~XR0znX{rho}XR0znX~

 
sigma

~XR0znX{sigma}XR0znX~

 
Sigma

~XR0znX{Sigma}XR0znX~

 
tau

~XR0znX{tau}XR0znX~

 
upsilon

~XR0znX{upsilon}XR0znX~

 
phi

~XR0znX{phi}XR0znX~

 
Phi

~XR0znX{Phi}XR0znX~

 
varphi

~XR0znX{varphi}XR0znX~

 
chi

~XR0znX{chi}XR0znX~

 
psi

~XR0znX{psi}XR0znX~

 
Psi

~XR0znX{Psi}XR0znX~

 
omega

~XR0znX{omega}XR0znX~

 
Omega

~XR0znX{Omega}XR0znX~

 

Font Commands

Code Symbol
bb "AaBbCc"

~XR0znX{bb "AaBbCc"}XR0znX~

 
bbb "AaBbCc"

~XR0znX{bbb "AaBbCc"}XR0znX~

 
cc "AaBbCc"

~XR0znX{cc "AaBbCc"}XR0znX~

 
tt "AaBbCc"

~XR0znX{tt "AaBbCc"}XR0znX~

 
fr "AaBbCc"

~XR0znX{fr "AaBbCc"}XR0znX~

 
sf "AaBbCc"

~XR0znX{sf "AaBbCc"}XR0znX~

 

Standard Functions

sin, cos, tan, sec, csc, cot, arcsin, arccos, arctan, sinh, cosh, tanh, sech, csch, coth, exp, log, ln, det, dim, mod, gcd, lcm, lub, glb, min, max, f, g.

Special Cases

Matrices:
[[a,b],[c,d]] yields ~XR0znX{[[a,b],[c,d]]}XR0znX~

Column vectors:
((a),(b)) yields ~XR0znX{((a),(b))}XR0znX~

Augmented matrices:
[[a,b,|,c],[d,e,|,f]] yields ~XR0znX{[[a,b,|,c],[d,e,|,f]]}XR0znX~

Matrices can be used for layout:
{(2x,+,17y,=,23),(x,-,y,=,5):} yields ~XR0znX{{(2x,+,17y,=,23),(x,-,y,=,5):}}XR0znX~

Complex subscripts:
lim_(N->oo) sum_(i=0)^N yields ~XR0znX{lim_(N->oo) sum_(i=0)^N}XR0znX~

Subscripts must come before superscripts:
int_0^1 f(x)dx yields ~XR0znX{int_0^1 f(x)dx}XR0znX~

Derivatives:
f'(x) = dy/dx yields ~XR0znX{f'(x) = dy/dx}XR0znX~

For variables other than x, y, z, or t, you will need grouping symbols:
(dq)/(dp) for ~XR0znX{(dq)/(dp)}XR0znX~

Underbraces:
ubrace(1+2+3+4)_("4 terms") yields ~XR0znX{ubrace(1+2+3+4)_("4 terms")}XR0znX~

Overbraces:
obrace(1+2+3+4)^("4 terms") yields ~XR0znX{obrace(1+2+3+4)^("4 terms")}XR0znX~

Prescripts:
{::}_(\ \ 92)^238U yields ~XR0znX{{::}_(\ \ 92)^238U}XR0znX~

Forced spaces:
(backslash followed by a space) yields a non-breaking space.
Example: a\ b yields ~XR0znX{a\ b}XR0znX~ but a b yields ~XR0znX{a b}XR0znX~

Stacking: use stackrel to stack elements:
stackrel"def"= yields ~XR0znX{stackrel"def"=}XR0znX~

Note - Angle Brackets

When using AsciiMath in Sage, there is no need to surround < and > characters with spaces, unlike when using AsciiMath in regular HTML pages. Sage automatically escapes the angle brackets.


For more details on the AsciiMath notation, visit https://asciimath.org/.

LaTeX

Use the [mathi] and [mathd] tags for LaTeX notation.

The [mathi] tag is for inline notation…

Einstein's famous [mathi]E = mc^2[end] discovery.

The above produces…


Einstein's famous ~XR0znX(E = mc^2)XR0znX~ discovery.


In contrast, the [mathd] tag is for "display" notation…

Einstein's famous [mathd]E = mc^2[end] discovery.

The above produces…


Einstein's famous ~XR0znX[E = mc^2]XR0znX~ discovery.


For details on the LaTeX notation, visit https://www.latex-project.org/.

MathML

Use the [mathml] tag for MathML notation…

The area of a circle is [mathml] <mi>&pi;</mi> <mo>&InvisibleTimes;</mo> <msup> <mi>r</mi> <mn>2</mn> </msup> [end]

The above produces…


The area of a circle is π r 2


For details on the MathML notation, visit https://www.w3.org/TR/MathML/ or https://www.iso.org/standard/58439.html.

Last Modified: 10/24 10:44:32 am
In this article (top)  View article's Sage markup
10/24 10:44:32 am