In mathematics, a derivation is a function on an algebra which generalizes certain features of the derivative operator. Specifically, given an algebra A over a ring or a field K, a Kderivation is a Klinear map D : A → A that satisfies Leibniz's law:
D
(
a
b
)
=
D
(
a
)
b
+
a
D
(
b
)
.
More generally, if M is an Abimodule, a Klinear map D : A → M that satisfies the Leibniz law is also called a derivation. The collection of all Kderivations of A to itself is denoted by Der_{K}(A). The collection of Kderivations of A into an Amodule M is denoted by Der_{K}(A, M).
Derivations occur in many different contexts in diverse areas of mathematics. The partial derivative with respect to a variable is an Rderivation on the algebra of realvalued differentiable functions on R^{n}. The Lie derivative with respect to a vector field is an Rderivation on the algebra of differentiable functions on a differentiable manifold; more generally it is a derivation on the tensor algebra of a manifold. It follows that the adjoint representation of a Lie algebra is a derivation on that algebra. The Pincherle derivative is an example of a derivation in abstract algebra. If the algebra A is noncommutative, then the commutator with respect to an element of the algebra A defines a linear endomorphism of A to itself, which is a derivation over K. An algebra A equipped with a distinguished derivation d forms a differential algebra, and is itself a significant object of study in areas such as differential Galois theory.
The Leibniz law itself has a number of immediate consequences. Firstly, if x_{1}, x_{2}, ..., x_{n} ∈ A, then it follows by mathematical induction that
D
(
x
1
x
2
⋯
x
n
)
=
∑
i
x
1
⋯
x
i
−
1
D
(
x
i
)
x
i
+
1
⋯
x
n
=
∑
i
D
(
x
i
)
∏
j
≠
i
x
j
(the last equality holds if, for all
i
,
D
(
x
i
)
commutes with
x
1
,
x
2
,
⋯
,
x
i
−
1
).
In particular, if A is commutative and x_{1} = x_{2} = ... = x_{n}, then this formula simplifies to the familiar power rule D(x^{n}) = nx^{n−1}D(x). Secondly, if A has a unit element 1, then D(1) = 0 since D(1) = D(1·1) = D(1) + D(1). Moreover, because D is Klinear, it follows that "the derivative of any constant function is zero"; more precisely, for any x ∈ K, D(x) = D(x·1) = x·D(1) = 0.
If k ⊂ K is a subring, and A is a kalgebra, then there is an inclusion
Der
K
(
A
,
M
)
⊂
Der
k
(
A
,
M
)
,
since any Kderivation is a fortiori a kderivation.
The set of kderivations from A to M, Der_{k}(A, M) is a module over k. Furthermore, the kmodule Der_{k}(A) forms a Lie algebra with Lie bracket defined by the commutator:
[
D
1
,
D
2
]
=
D
1
∘
D
2
−
D
2
∘
D
1
.
It is readily verified that the Lie bracket of two derivations is again a derivation.
Given a graded algebra A and a homogeneous linear map D of grade  D  on A, D is a homogeneous derivation if
D
(
a
b
)
=
D
(
a
)
b
+
ε

a


D

a
D
(
b
)
for every homogeneous element a and every element b of A for a commutator factor ε = ±1. A graded derivation is sum of homogeneous derivations with the same ε.
If ε = 1, this definition reduces to the usual case. If ε = −1, however, then
D
(
a
b
)
=
D
(
a
)
b
+
(
−
1
)

a

a
D
(
b
)
for odd  D , and D is called an antiderivation.
Examples of antiderivations include the exterior derivative and the interior product acting on differential forms.
Graded derivations of superalgebras (i.e. Z_{2}graded algebras) are often called superderivations.