# Special Functions

## Hypergeometric functions

The hypergeometric function 2F1 is used in Battin's method solving the Lambert problem, the two-point boundary value problem for orbital motion. The derivative with respect to the final argument (see Wolfram) is helpful when solving using Newton's method.

```
(set-reader-in-file)
(defun hypergeometric-and-derivative (z)
"The hypergeometric function F(3,1;5/2;z), (7.47), and its derivative dF/dz (7.49)."
(declare (optimize (speed 3) (debug 0) (safety 0)))
(declare (double-float z))
(values
(gsl:hypergeometric-2F1 3.0 1.0 2.5 z)
(* 6/5 (gsl:hypergeometric-2F1 4.0 2.0 3.5 z))))
```