# Functional differentiation

(Difference between revisions)
Jump to: navigation, search
 Revision as of 15:54, 20 June 2007 (edit) (add link to Typeful_symbolic_differentiation)← Previous diff Revision as of 19:31, 10 October 2007 (edit) (undo) (functional analysis)Next diff → Line 1: Line 1: == Introduction == == Introduction == - Functional differentiation means computing or approximating the deriviative of a function. + Functional differentiation means computing or approximating the derivative of a function. There are several ways to do this: 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$. * 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$ [[Typeful_symbolic_differentiation|symbolically]]. This approach is particularly interesting for Haskell. * Compute the derivative of $f$ [[Typeful_symbolic_differentiation|symbolically]]. This approach is particularly interesting for Haskell. + + == 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}$ + and the Haskell programmer writes + + derive :: a -> (a -> a) -> (a -> a) + derive h f x = (f (x+h) - f x) / h . + + Haskell's derive h approximates the mathematician's $D$. + In functional analysis $D$ is called a (linear) function operator, because it maps functions to functions. + In Haskell derive h is called a higher order function for the same reason. + $D$ is in curried form. If it would be uncurried, you would write $D(f,x)$. + == Blog Posts == == Blog Posts ==

## 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}$

and the Haskell programmer writes

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

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

In Haskell
derive h
is called a higher order function for the same reason.

D is in curried form. If it would be uncurried, you would write D(f,x).

## 3 Blog Posts

There have been several blog posts on this recently. I think we should gather the information together and make a nice wiki article on it here. For now, here are links to articles on the topic.