# Functional differentiation

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

## Introduction

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

• Approximate the derivative ${\displaystyle f'(x)}$ by ${\displaystyle {\frac {f(x+h)-f(x)}{h}}}$ where ${\displaystyle h}$ is close to zero. (or at best the square root of the machine precision ${\displaystyle \varepsilon }$.
• Compute the derivative of ${\displaystyle f}$ 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

${\displaystyle Df(x)=\lim _{h\to 0}{\frac {f(x+h)-f(x)}{h}}}$

derive :: (Fractional a) => a -> (a -> a) -> (a -> a)

Haskell's derive h approximates the mathematician's ${\displaystyle D}$. In functional analysis ${\displaystyle 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. ${\displaystyle D}$ is in curried form. If it would be uncurried, you would write ${\displaystyle D(f,x)}$.