In mathematics, **quaternionic analysis** is the study of functions with quaternions as the domain and/or range. Such functions can be called **functions of a quaternion variable** just as functions of a real variable or a complex variable are called.

As with complex and real analysis, it is possible to study the concepts of analyticity, holomorphy, harmonicity and conformality in the context of quaternions. Unlike the complex numbers and like the reals, the four notions do not coincide.

The projections of a quaternion onto its scalar part or onto its vector part, as well as the modulus and versor functions, are examples that are basic to understanding quaternion structure.

An important example of a function of a quaternion variable is

which rotates the vector part of *q* by twice the angle represented by *u*.

The quaternion multiplicative inverse is another fundamental function, but as with other number systems, and related problems are generally excluded due to the nature of dividing by zero.

Affine transformations of quaternions have the form

Linear fractional transformations of quaternions can be represented by elements of the matrix ring operating on the projective line over . For instance, the mappings where and are fixed versors serve to produce the motions of elliptic space.

Quaternion variable theory differs in some respects from complex variable theory. For example: The complex conjugate mapping of the complex plane is a central tool but requires the introduction of a non-arithmetic, non-analytic operation. Indeed, conjugation changes the orientation of plane figures, something that arithmetic functions do not change.

In contrast to the complex conjugate, the quaternion conjugation can be expressed arithmetically, as

This equation can be proven, starting with the basis {1, i, j, k}:

- .

Consequently, since is linear,

The success of complex analysis in providing a rich family of holomorphic functions for scientific work has engaged some workers in efforts to extend the planar theory, based on complex numbers, to a 4-space study with functions of a quaternion variable.^{[1]} These efforts were summarized in Deavours (1973).^{[a]}

Though appears as a union of complex planes, the following proposition shows that extending complex functions requires special care:

Let be a function of a complex variable, . Suppose also that is an even function of and that is an odd function of . Then is an extension of to a quaternion variable where and . Then, let represent the conjugate of , so that . The extension to will be complete when it is shown that . Indeed, by hypothesis

- one obtains

In the following, colons and square brackets are used to denote homogeneous vectors.

The rotation about axis *r* is a classical application of quaternions to space mapping.^{[2]}
In terms of a homography, the rotation is expressed

where is a versor. If *p* * = −*p*, then the translation is expressed by

Rotation and translation *xr* along the axis of rotation is given by

Such a mapping is called a screw displacement. In classical kinematics, Chasles' theorem states that any rigid body motion can be displayed as a screw displacement. Just as the representation of a Euclidean plane isometry as a rotation is a matter of complex number arithmetic, so Chasles' theorem, and the screw axis required, is a matter of quaternion arithmetic with homographies: Let *s* be a right versor, or square root of minus one, perpendicular to *r*, with *t* = *rs*.

Consider the axis passing through *s* and parallel to *r*. Rotation about it is expressed^{[3]} by the homography composition

where

Now in the (*s,t*)-plane the parameter θ traces out a circle in the half-plane

Any *p* in this half-plane lies on a ray from the origin through the circle and can be written

Then *up* = *az*, with as the homography expressing conjugation of a rotation by a translation p.

Since the time of Hamilton, it has been realized that requiring the independence of the derivative from the path that a differential follows toward zero is too restrictive: it excludes even from differentiation. Therefore, a direction-dependent derivative is necessary for functions of a quaternion variable.^{[4]}^{[5]}
Considering the increment of polynomial function of quaternionic argument shows that the increment is a linear map of increment of the argument.^{[dubious – discuss]} From this, a definition can be made:

A continuous map is called differentiable on the set , if, at every point , the increment of the map can be represented as

where

is linear map of quaternion algebra and is a continuous map such that

The linear map is called the derivative of the map .

On the quaternions, the derivative may be expressed as

Therefore, the differential of the map may be expressed as follows with brackets on either side.

The number of terms in the sum will depend on the function *f*. The expressions
are called
components of derivative.

The derivative of a quaternionic function holds the following equalities

For the function *f*(*x*) = *axb*, the derivative is

and so the components are:

Similarly, for the function *f*(*x*) = *x ^{2}*, the derivative is

and the components are:

Finally, for the function *f*(*x*) = *x*^{−1}, the derivative is

and the components are: