## Equivalence relation

An Equivalence relation is a generalization of the concept of "is equal to". It has the following properites:

• a = a (reflexive property),
• if a = b then b = a (symmetric property), and
• if a = b and b = c then a = c (transitive property).

As a consequence of the reflexive, symmetric, and transitive properties, any equivalence relation provides a partition of the underlying set into disjoint equivalence classes. Two elements of the given set are equivalent to each other if and only if they belong to the same equivalence class.

### Modular arithmetic

Modular arithmetic can be handled mathematically by introducing a *congruence relation. Two numbers a and b are said to be congruent modulo n if a and b have the same remainder when divided by positive integer n.  The number n is called the modulus of the congruence.

The congruence relation satisfies all the conditions of an equivalence relation.

The equivalence class consisting of the integers congruent to a modulo n, is called the congruence class or residue class.

Consider the polynomial and its values for The prime factorizations of these values are given as follows:

n n n 1 −4 −22 16 251 251 31 956 22⋅239
2 −1 −1 17 284 22⋅71 32 1019 1019
3 4 22 18 319 11⋅29 33 1084 22⋅271
4 11 11 19 356 22⋅89 34 1151 1151
5 20 22⋅5 20 395 5⋅79 35 1220 22⋅5⋅61
6 31 31 21 436 22⋅109 36 1291 1291
7 44 22⋅11 22 479 479 37 1364 22⋅11⋅31
8 59 59 23 524 22⋅131 38 1439 1439
9 76 22⋅19 24 571 571 39 1516 22⋅379
10 95 5⋅19 25 620 22⋅5⋅31 40 1595 5⋅11⋅29
11 116 22⋅29 26 671 11⋅61 41 1676 22⋅419
12 139 139 27 724 22⋅181 42 1759 1759
13 164 22⋅41 28 779 19⋅41 43 1844 22⋅461
14 191 191 29 836 22⋅11⋅19 44 1931 1931
15 220 22⋅5⋅11 30 895 5⋅179 45 2020 22⋅5⋅101

The prime factors dividing are , and every prime whose final digit is or ; no primes ending in or ever appear.

Now, is a prime factor of whenever In other words, whenever .

In this case this happens whenever The law of *Quadratic reciprocity gives a similar characterization of prime divisors of for any prime q, which leads to a characterization for any integer .

Law of quadratic reciprocity — Let p and q be distinct odd prime numbers, and define the *Legendre symbol as: Where: Then: This law allows the easy calculation of whether there exists any integer solution n for a quadratic equation of the form for p an odd prime. However it gives no help at all for finding a specific solution; for this, one uses *quadratic residues.

## Polynomial ring

The polynomial ring, K[X], in X over a field K is defined as the set of expressions, called polynomials in X, of the form The polynomial ring in X over K is equipped with an addition, a multiplication and a scalar multiplication that make it a *commutative algebra. These operations are defined according to the ordinary rules for manipulating algebraic expressions. Specifically, if  then where  and where  The scalar multiplication is It is easy to verify that these three operations satisfy the axioms of a commutative algebra. Therefore, polynomial rings are also called polynomial algebras.

Gauss remarked that the procedure of division with the remainder can also be defined for polynomials: given two polynomials p and q with q ≠ 0, one can write where the quotient u and the remainder r are polynomials, and the degree of r is strictly less than the degree of q. Moreover, a decomposition of this form is unique. The quotient and the remainder are found using *polynomial long division.

$\displaystyle \begin{array}{r} x^2 + \phantom{1}x + 3\\ x-3 \, \overline{) \, x^3 - 2x^2 + 0x - 4}\\ \underline{x^3 - 3x^2 {\color{White} {} + 0x - 4}}\\ x^2 + 0x {\color{White} {} - 4}\\ \underline{x^2 - 3x {\color{White} {} - 4}}\\ 3x - 4\\ \underline{3x - 9}\\ 5 \end{array}$
therefore
$\displaystyle x^3 - 2x^2 + 0x - 4 = (x^2 + \phantom{1}x + 3)(x-3) + 5$

Using the existence of greatest common divisors, Gauss was able to simultaneously rigorously prove the fundamental theorem of arithmetic for integers and its generalization to polynomials.

For polynomials over the integers, over the rational numbers, or over a finite field, there are efficient algorithms for computing the factorization that are implemented in computer algebra systems (see *Factorization of polynomials).

## Einstein notation

According to this convention, when an index variable appears twice in a single term and is not otherwise defined (see *free and bound variables), it implies summation of that term over all the values of the index. So where the indices can range over the set {1, 2, 3}, is simplified by the convention to: .

Any tensor T in VV can be written as: .

The matrix product of two matrices Aij and Bjk is: equivalent to ## Metric contraction

Vectors are *column vectors. Upper indices represent components of vectors (contravariant) Covectors are *row vectors. Lower indices represent components of covectors (covariant). We ordinarily think of the product of a vector and a covector as a scalar. In *Einstein notation: This is an example of tensor contraction. The important thing to note is that by the Einstein summation convention when both vectors use the same index i then tensor contraction occurs.

But the product of a vector and a covector can also be a (1,1) tensor. In *Einstein notation: The important thing to note is that by the Einstein summation convention when the vectors use different indices i and j then there is no tensor contraction.

Contraction on a pair of indices that are either both contravariant or both covariant is not possible in general. However, in the presence of an inner product (also known as a metric) g, such contractions are possible. One uses the metric to *raise or lower one of the indices, as needed, and then one uses the usual operation of contraction. The combined operation is known as metric contraction. Metric contraction can be used to find the dot product of 2 vectors Not only can the dot product be written using an (0,2) tensor but the dot product is sometimes said to BE an (0,2) tensor which is said to be a map from two vectors to a scalar or a map from a vector to a covector.

## Geometric calculus

Geometric calculus extends the geometric algebra to include differentiation and integration. The formalism is powerful and can be shown to encompass other mathematical theories including differential geometry and differential forms.

With a geometric algebra given, let a and b be *vectors and let F(a) be a multivector-valued function. The directional derivative of F(a) along b is defined as provided that the limit exists, where the limit is taken for scalar ε. This is similar to the usual definition of a directional derivative but extends it to functions that are not necessarily scalar-valued.

Next, choose a set of basis vectors and consider the operators, noted , that perform directional derivatives in the directions of : Then, using the *Einstein summation notation, consider the operator : which means: or, more verbosely: It can be shown that this operator is independent of the choice of frame, and can thus be used to define the geometric derivative: This is similar to the usual definition of the gradient, but it, too, extends to functions that are not necessarily scalar-valued.

It can be shown that the directional derivative is linear regarding its direction, that is: From this follows that the directional derivative is the inner product of its direction by the geometric derivative. All needs to be observed is that the direction can be written , so that: For this reason, is often noted .

The standard order of operations for the geometric derivative is that it acts only on the function closest to its immediate right. Given two functions F and G, then for example we have Although the partial derivative exhibits a product rule, the geometric derivative only partially inherits this property. Consider two functions F and G: Since the geometric product is not commutative with in general, we cannot proceed further without new notation. A solution is to adopt the *overdot notation, in which the scope of a geometric derivative with an overdot is the multivector-valued function sharing the same overdot. In this case, if we define then the product rule for the geometric derivative is Let F be an r-grade multivector. Then we can define an additional pair of operators, the interior and exterior derivatives,  In particular, if F is grade 1 (vector-valued function), then we can write and identify the divergence and curl as  Note, however, that these two operators are considerably weaker than the geometric derivative counterpart for several reasons. Neither the interior derivative operator nor the exterior derivative operator is *invertible.

The reason for defining the geometric derivative and integral as above is that they allow a strong generalization of Stokes' theorem. Let be a multivector-valued function of r-grade input A and general position x, linear in its first argument. Then the fundamental theorem of geometric calculus relates the integral of a derivative over the volume V to the integral over its boundary: As an example, let for a vector-valued function F(x) and a (n-1)-grade multivector A. We find that and likewise Thus we recover the divergence theorem, ## Calculus of variations

*Calculus of variations, *Functional, *Functional analysis, *Higher-order function

Whereas calculus is concerned with infinitesimal changes of variables, calculus of variations is concerned with infinitesimal changes of the underlying function itself.

Calculus of variations is a field of mathematical analysis that uses variations, which are small changes in functions and functionals, to find maxima and minima of functionals.

A simple example of such a problem is to find the curve of shortest length connecting two points. If there are no constraints, the solution is obviously a straight line between the points. However, if the curve is constrained to lie on a surface in space, then the solution is less obvious, and possibly many solutions may exist. Such solutions are known as geodesics. A related problem is posed by Fermat's principle: light follows the path of shortest optical length connecting two points, where the optical length depends upon the material of the medium. One corresponding concept in mechanics is the principle of least action.

Given an equation that you want to minimize You then solve the corresponding *Euler–Lagrange equation for y(x). 