Sie sind auf Seite 1von 6

LATEX Mathematics Examples

Prof Tony Roberts


September 10, 2018

Contents
1 Delimiters 1

2 Spacing 2

3 Arrays 2

4 Equation arrays 3

5 Functions 4

6 Accents 4

7 Command definition 5

8 Theorems et al. 5

1 Delimiters
See how the delimiters are of reasonable size in these examples
 
b
(a + b) 1 − = a,
a+b
p x + y
|xy| ≤ ,

2
even when there is no matching delimiter
Z b 2 b Z b
dv dv du dv
u 2 dx = u − dx.
a dx dx a a dx dx

2 Spacing
Differentials often need a bit of help with their spacing as in
ZZ
1
xy 2 dx dy = x2y 3,
6
whereas vector problems often lead to statements such as
−y x
u= 2 , v= 2 , and w = 0 .
x + y2 x + y2
Occasionally one gets horrible line breaks when using a list in mathe-
matics such as listing the first twelve primes 2, 3, 5, 7, 11, 13, 17, 19, 23, 2
In such cases, perhaps include \mathcode‘\,="213B inside the in-
line maths environment so that the list breaks: 2 , 3 , 5 , 7 , 11 , 13 ,
17 , 19 , 23 , 29 , 31 , 37 . Be discerning about when to do this as the
spacing is different.

3 Arrays
Arrays of mathematics are typeset using one of the matrix environ-
ments as in  
  1  
1 x 0   1 + xy
y = .
0 1 −1 y−1
1
Case statements use cases:
(
x, if x ≥ 0 ,
|x| =
−x, if x < 0 .

Many arrays have lots of dots all over the place as in


−2 1 0 0 ··· 0
1 −2 1 0 ··· 0
0 1 −2 1 ··· 0
0 0 1 −2 . . . ..
.. .. .. ... ... 1
0 0 0 ··· 1 −2

4 Equation arrays
In the flow of a fluid film we may report
 
1
uα = 2κxxx y − y 2 , (1)
2
v = 3κxxxy , (2)
p = κxx . (3)

Alternatively, the curl of a vector field (u, v, w) may be written with


only one equation number:
∂w ∂v
ω1 = − ,
∂y ∂z
∂u ∂w
ω2 = − , (4)
∂z ∂x
∂v ∂u
ω3 = − .
∂x ∂y
Whereas a derivation may look like
(p ∧ q) ∨ (p ∧ ¬q) = p ∧ (q ∨ ¬q) by distributive law
= p ∧ T by excluded middle
= p by identity

5 Functions
Observe that trigonometric and other elementary functions are type-
set properly, even to the extent of providing a thin space if followed
by a single letter argument:
 
1 1
exp(iθ) = cos θ + i sin θ , sinh(log x) = x− .
2 x
With sub- and super-scripts placed properly on more complicated
functions,
lim kf (x)kq = max |f (x)|,
q→∞ x
and large operators, such as integrals and
∞ n n
X x Y
ex = where n! = i,
n=0
n! i=1
\
Uα = Uα .
α
In inline mathematics the scripts are correctly placed
P∞to the side in
order to conserve vertical space, as in 1/(1 − x) = n=0 xn.

6 Accents
Mathematical accents are performed by a short command with one
argument, such as
Z ∞
1
f˜(ω) = f (x)e−iωx dx ,
2π −∞
or
~˙ = ~r × I~ .
ω

7 Command definition
The Airy function, Ai(x), may be incorrectly defined as this integral
Z
Ai(x) = exp(s3 + isx) ds .

This vector identity serves nicely to illustrate two of the new


commands:
     
∂w ∂v ∂u ∂w ∂v ∂u
∇×q =i − +j − +k − .
∂y ∂z ∂z ∂x ∂x ∂y
Recall that typesetting multi-line mathematics is an art normally
too hard for computer recipes. Nonetheless, if you need to be au-
tomatically flexible about multi-line mathematics, and you do not
mind some rough typesetting, then perhaps invoke \parbox to help
as follows:
3 3 1
u1 = −2γ s2 + µ 8 s2 + 8 s1i + 3 − 81
2
 2
32 s4 s2 −
27 9 27 9 3
2 2 2

s s s i + 32 s4s1 + 32 s3s2i − 16 s3s2s1 − 32 s3s1i +
R16b 4 2 1 2 3
a 1 − 2x + 3x − 4x dx

Also, sometimes use \parbox to typeset multiline entries in tables.

8 Theorems et al.
Definition 1 (right-angled triangles) A right-angled triangle
is a triangle whose sides of length a, b and c, in some permuta-
tion of order, satisfies a2 + b2 = c2.
Lemma 2 The triangle with sides of length 3, 4 and 5 is right-
angled.

This lemma follows from the Definition 1 as 32 + 42 = 9 + 16 =


25 = 52.

Theorem 3 (Pythagorean triplets) Triangles with sides of


length a = p2 − q 2, b = 2pq and c = p2 + q 2 are right-angled
triangles.

Prove this Theorem 3 by the algebra a2 +b2 = (p2 −q 2)2 +(2pq)2 =


p4 − 2p2q 2 + q 4 + 4p2q 2 = p4 + 2p2q 2 + q 4 = (p2 + q 2)2 = c2.

Das könnte Ihnen auch gefallen