Maths Commands in LaTeX - GeeksforGeeks

20 Jun, 2020
LATEX is a document preparation system for producing professional-looking documents. LaTeX is widely used for the communication and publication of scientific documents in many fields, including mathematics, statistics, computer science, engineering, physics, etc. It also has a prominent role in the preparation and publication of books and articles that contain complex multilingual materials, such as Sanskrit and Greek.
So in this post we have discussed the most used TEX commands used for Maths.
Fractions:Instead of writing fractions as A / B we will use below syntaxSyntax :\frac{numerator}{denominator}
Example –\frac{a+1}{b+1}
OUTPUT:Nth power:Instead of writing powers as x ^ n which is not clear as if it is xor or power so we will use below syntaxSyntax:x^y
Example –x^2
OUTPUT:Nth root:Instead of writing roots as x^(1/N) which is not clear as if it is xor or root so we will use below syntaxSyntax:\sqrt[N]{27}
Example –\sqrt[3]{27}
OUTPUT:MatricesInstead of writing matrices as [[1, x, x^2], [1, y, y^2][1, z, z^2]] which is not very clear use below syntaxSyntax:\begin{matrix}
    1 & x & x^2 \\
    1 & y & y^2 \\
    1 & z & z^2 \\
\end{matrix}
Example –\begin{matrix}
    1 & x & x^2 \\
    1 & y & y^2 \\
    1 & z & z^2 \\
\end{matrix}
OUTPUT:Definitions by cases (piecewise function) is a function defined by multiple sub-functions, each sub-function applying to a certain interval of the main function’s domain, a sub-domain.Syntax: f(n) =
\begin{cases}
n/2,  & \text{if $n$ is even} \\
n+1, & \text{if $n$ is odd}
\end{cases}
Example – f(n) =
\begin{cases}
n/2,  & \text{if $n$ is even} \\
n+1, & \text{if $n$ is odd}
\end{cases}
OUTPUT:System of equations is a function defined by multiple sub-functions, each sub-function applying to a certain interval of the main function’s domain, a sub-domain.Syntax: \left\{ 
\begin{array}{c}
a_1x+b_1y+c_1z=d_1 \\ 
a_2x+b_2y+c_2z=d_2 \\ 
a_3x+b_3y+c_3z=d_3
\end{array}
\right. 
Example – \left\{ 
\begin{array}{c}
a_1x+b_1y+c_1z=d_1 \\ 
a_2x+b_2y+c_2z=d_2 \\ 
a_3x+b_3y+c_3z=d_3
\end{array}
\right. 
OUTPUT:Summation is the addition of a sequence of any kind of numbers, called addends or summands; the result is their sum or total.Syntax:\sum_{i=0}^n i^2
Example –\sum_{i=0}^n i^2
OUTPUT:subscriptsis a character that is set slightly below the normal line of type.Syntax:\log_2 x
Example –\log_2 x
OUTPUT:floor is the function that takes as input a real number and gives as output the greatest integer less than or equal to, denoted.Syntax:\lfloor n \rfloor
Example –\lfloor 2.2 \rfloor
OUTPUT:ceil function maps to the least integer greater than or equal to, denoted.Syntax:\lceil n \rcei
Example –\lceil 2.5 \rceil
OUTPUT:Some Combined examples :Example –Use\sum_{i=0}^n i^2 = \frac{(n^2+n)(2n+1)}{6}for Example –Use\left(\frac{\sqrt x}{y^3}\right)for Example –Use\Biggl(\biggl(\Bigl(\bigl((n)\bigr)\Bigr)\biggr)\Biggr)for Example –Use\sqrt[3]{\frac xy}for 
Fractions:Instead of writing fractions as A / B we will use below syntaxSyntax :\frac{numerator}{denominator}
Example –\frac{a+1}{b+1}
OUTPUT:
\frac{numerator}{denominator}

Example –
\frac{a+1}{b+1}

OUTPUT:
Nth power:Instead of writing powers as x ^ n which is not clear as if it is xor or power so we will use below syntaxSyntax:x^y
Example –x^2
OUTPUT:
x^y

Example –
x^2

OUTPUT:
Nth root:Instead of writing roots as x^(1/N) which is not clear as if it is xor or root so we will use below syntaxSyntax:\sqrt[N]{27}
Example –\sqrt[3]{27}
OUTPUT:
\sqrt[N]{27}

Example –
\sqrt[3]{27}

OUTPUT:
MatricesInstead of writing matrices as [[1, x, x^2], [1, y, y^2][1, z, z^2]] which is not very clear use below syntaxSyntax:\begin{matrix}
    1 & x & x^2 \\
    1 & y & y^2 \\
    1 & z & z^2 \\
\end{matrix}
Example –\begin{matrix}
    1 & x & x^2 \\
    1 & y & y^2 \\
    1 & z & z^2 \\
\end{matrix}
OUTPUT:
\begin{matrix}
    1 & x & x^2 \\
    1 & y & y^2 \\
    1 & z & z^2 \\
\end{matrix}

Example –
\begin{matrix}
    1 & x & x^2 \\
    1 & y & y^2 \\
    1 & z & z^2 \\
\end{matrix}

OUTPUT:
Definitions by cases (piecewise function) is a function defined by multiple sub-functions, each sub-function applying to a certain interval of the main function’s domain, a sub-domain.Syntax: f(n) =
\begin{cases}
n/2,  & \text{if $n$ is even} \\
n+1, & \text{if $n$ is odd}
\end{cases}
Example – f(n) =
\begin{cases}
n/2,  & \text{if $n$ is even} \\
n+1, & \text{if $n$ is odd}
\end{cases}
OUTPUT:
Syntax:
 f(n) =
\begin{cases}
n/2,  & \text{if $n$ is even} \\
n+1, & \text{if $n$ is odd}
\end{cases}

Example –
 f(n) =
\begin{cases}
n/2,  & \text{if $n$ is even} \\
n+1, & \text{if $n$ is odd}
\end{cases}

OUTPUT:
System of equations is a function defined by multiple sub-functions, each sub-function applying to a certain interval of the main function’s domain, a sub-domain.Syntax: \left\{ 
\begin{array}{c}
a_1x+b_1y+c_1z=d_1 \\ 
a_2x+b_2y+c_2z=d_2 \\ 
a_3x+b_3y+c_3z=d_3
\end{array}
\right. 
Example – \left\{ 
\begin{array}{c}
a_1x+b_1y+c_1z=d_1 \\ 
a_2x+b_2y+c_2z=d_2 \\ 
a_3x+b_3y+c_3z=d_3
\end{array}
\right. 
OUTPUT:
Syntax:
 \left\{ 
\begin{array}{c}
a_1x+b_1y+c_1z=d_1 \\ 
a_2x+b_2y+c_2z=d_2 \\ 
a_3x+b_3y+c_3z=d_3
\end{array}
\right. 

Example –
 \left\{ 
\begin{array}{c}
a_1x+b_1y+c_1z=d_1 \\ 
a_2x+b_2y+c_2z=d_2 \\ 
a_3x+b_3y+c_3z=d_3
\end{array}
\right. 

OUTPUT:
Summation is the addition of a sequence of any kind of numbers, called addends or summands; the result is their sum or total.Syntax:\sum_{i=0}^n i^2
Example –\sum_{i=0}^n i^2
OUTPUT:
Syntax:
\sum_{i=0}^n i^2

Example –
\sum_{i=0}^n i^2

OUTPUT:
subscriptsis a character that is set slightly below the normal line of type.Syntax:\log_2 x
Example –\log_2 x
OUTPUT:
Syntax:
\log_2 x

Example –
\log_2 x

OUTPUT:
floor is the function that takes as input a real number and gives as output the greatest integer less than or equal to, denoted.Syntax:\lfloor n \rfloor
Example –\lfloor 2.2 \rfloor
OUTPUT:
Syntax:
\lfloor n \rfloor

Example –
\lfloor 2.2 \rfloor

OUTPUT:
ceil function maps to the least integer greater than or equal to, denoted.Syntax:\lceil n \rcei
Example –\lceil 2.5 \rceil
OUTPUT:
Syntax:
\lceil n \rcei

Example –
\lceil 2.5 \rceil

OUTPUT:
Some Combined examples :Example –Use\sum_{i=0}^n i^2 = \frac{(n^2+n)(2n+1)}{6}for Example –Use\left(\frac{\sqrt x}{y^3}\right)for Example –Use\Biggl(\biggl(\Bigl(\bigl((n)\bigr)\Bigr)\biggr)\Biggr)for Example –Use\sqrt[3]{\frac xy}for 
Use\sum_{i=0}^n i^2 = \frac{(n^2+n)(2n+1)}{6}for Example –
\sum_{i=0}^n i^2 = \frac{(n^2+n)(2n+1)}{6}
for 
Example –
Use\left(\frac{\sqrt x}{y^3}\right)for Example –
\left(\frac{\sqrt x}{y^3}\right)
for 
Example –
Use\Biggl(\biggl(\Bigl(\bigl((n)\bigr)\Bigr)\biggr)\Biggr)for Example –
\Biggl(\biggl(\Bigl(\bigl((n)\bigr)\Bigr)\biggr)\Biggr)
for 
Example –
Use\sqrt[3]{\frac xy}for 
\sqrt[3]{\frac xy}
for 
Engineering Mathematics
Writing code in comment?
Please use ide.geeksforgeeks.org,
generate link and share the link here.
Activation Functions
Mathematics | Walks, Trails, Paths, Cycles and Circuits in Graph
Newton's Divided Difference Interpolation Formula
Discrete Mathematics | Hasse Diagrams
Difference between Propositional Logic and Predicate Logic
Mathematics | Graph Isomorphisms and Connectivity
Mathematics | Euler and Hamiltonian Paths
Graph measurements: length, distance, diameter, eccentricity, radius, center
Mathematics | Graph Theory Basics - Set 1
Number of Possible Super Keys in DBMS