# Functional differentiation

(Difference between revisions)
 Revision as of 22:34, 8 December 2010 (edit) (use correct type signature)← Previous diff Current revision (08:32, 19 December 2010) (edit) (undo)m (→Code) Line 34: Line 34: * [http://hackage.haskell.org/package/fad Forward accumulation mode Automatic Differentiation] Hackage package * [http://hackage.haskell.org/package/fad Forward accumulation mode Automatic Differentiation] Hackage package - * [http://hackage.haskell.org/package/vector-space Vector-space package], including derivatives as linear transformations satisfying product rule. + * [http://hackage.haskell.org/package/vector-space Vector-space package], including derivatives as linear transformations satisfying chain rule. [[Category:Mathematics]] [[Category:Mathematics]]

## 1 Introduction

Functional differentiation means computing or approximating the derivative of a function. There are several ways to do this:

• Approximate the derivative f'(x) by $\frac{f(x+h)-f(x)}{h}$ where h is close to zero. (or at best the square root of the machine precision $\varepsilon$.
• Compute the derivative of f symbolically. This approach is particularly interesting for Haskell.

## 2 Functional analysis

If you want to explain the terms Higher order function and Currying to mathematicians, this is certainly a good example. The mathematician writes

$D f (x) = \lim_{h\to 0} \frac{f(x+h)-f(x)}{h}$

derive :: (Fractional a) => a -> (a -> a) -> (a -> a)
derive h f x = (f (x+h) - f x) / h    .
derive h
approximates the mathematician's D.

In functional analysis D is called a (linear) function operator, because it maps functions to functions.