Notes on automatic differentiation#
Preliminaries#
Definition of normalised derivative:
General Leibniz rule: given
Basic arithmetic#
Addition and subtraction#
Given
Multiplication#
Given
Division#
Given
We can now apply the normalised derivative of order
Squaring#
Given
Square root#
Given
We can apply the normalised derivative of order
We can then isolate
Exponentiation#
Given
By multiplying both sides by
We can now apply the normalised derivative of order
Exponentials#
Natural exponential#
Given
We can now apply the normalised derivative of order
Standard logistic function#
Given
we have
which, after the introduction of the auxiliary function
becomes
After applying the normalised derivative of order
Logarithms#
Natural logarithm#
Given
or, equivalently,
We can now apply the normalised derivative of order
Trigonometric functions#
Tangent#
Given
which, after the introduction of the auxiliary function
becomes
After applying the normalised derivative of order
Inverse trigonometric functions#
Inverse sine#
Given
or, equivalently,
We introduce the auxiliary function
so that (28) can be rewritten as
Applying the normalised derivative of order
We can now apply the general Leibniz rule (2) to the left-hand side and re-arrange
the terms to obtain, for
Inverse cosine#
The derivation is identical to the inverse sine, apart from a sign change.
Given
with
Inverse tangent#
Given
or, equivalently,
We introduce the auxiliary function
so that (36) can be rewritten as
Applying the normalised derivative of order
With the help of the general Leibniz rule (2), after re-arranging we obtain, for
Two-argument inverse tangent#
Given
After the introduction of the auxiliary function
(41) can be rewritten as
We can now apply the normalised derivative of order
Hyperbolic functions#
Hyperbolic sine#
Given
We introduce the auxiliary function
so that (45) can be rewritten as
We can now apply the normalised derivative of order
Hyperbolic cosine#
Given
the final result, for
Hyperbolic tangent#
Given
the final result, for
Inverse hyperbolic functions#
Inverse hyperbolic sine#
Given
the final result, for
Inverse hyperbolic cosine#
Given
the final result, for
Inverse hyperbolic tangent#
Given
the final result, for
Special functions#
Error function#
Given
which, after the introduction of the auxiliary function
becomes
After applying the normalised derivative of order
Celestial mechanics#
Kepler’s eccentric anomaly#
The eccentric anomaly is the bivariate function
with
where the partial derivatives are
Expanding the partial derivatives yields
or, equivalently,
We can now introduce the auxiliary functions
so that (67) can be rewritten as
After applying the normalised derivative of order
Eccentric longitude#
The eccentric longitude
is the trivariate function
with
After the introduction of the auxiliary functions
we can then proceed in the same way as explained for the eccentric anomaly.
The final result, for
Time functions#
Time polynomials#
Given the time polynomial of order
its derivative of order
where
which, with the help of elementary relations involving factorials and after re-arranging the indices, can be rewritten as