# fnder

Differentiate function

## Description

returns the `fprime`

= fnder(`f`

,`dorder`

)`dorder`

-th derivative of the function in
`f`

. The default value of `dorder`

is 1.
For negative `dorder`

, the particular
|`dorder`

|-th indefinite integral is returned that vanishes
|`dorder`

|-fold at the left endpoint of the basic
interval.

The output is of the same form as the input, they are either both ppforms, or both B-forms, or both stforms.

If the function in `f`

is *m*-variate, then
`dorder`

must be given, and must be of length
*m*.

Also:

If

`f`

is in ppform, or in B-form with its last knot of sufficiently high multiplicity, then, up to rounding errors,`f`

and`fnder(fnint(f))`

are the same.If

`f`

is in ppform and`fa`

is the value of the function in`f`

at the left end of its basic interval, then, up to rounding errors,`f`

and`fnint(fnder(f),fa)`

are the same, unless the function described by`f`

has jump discontinuities.If

`f`

contains the B-form of*f*, and*t*_{1}is its leftmost knot, then, up to rounding errors,`fnint(fnder(f))`

contains the B-form of*f*–*f*(*t*_{1}). However, its leftmost knot will have lost one multiplicity (if it had multiplicity > 1 to begin with). Also, its rightmost knot will have full multiplicity even if the rightmost knot for the B-form of*f*in`f`

doesn't. To verify this, create a spline,`sp = spmak([0 0 1], 1)`

. This spline is, on its basic interval [`0`

..`1`

], the straight line that is 1 at 0 and 0 at 1. Now integrate its derivative:`spdi = fnint(fnder(sp))`

. The spline in`spdi`

has the same basic interval, but, on that interval, it agrees with the straight line that is 0 at 0 and –1 at 1.

`fnder(f)`

is the same as
`fnder(f,1)`

.

## Examples

## Input Arguments

## Output Arguments

## Limitations

The

`fnder`

function does not work with rational splines. To work with rational splines, use the`fntlr`

function instead.The

`fnder`

function works for stforms only in a limited way: if the type is`tp00`

, then`dorder`

can be`[1,0]`

or`[0,1]`

.

## Algorithms

For differentiation of either polynomial form, the `fnder`

function finds the derivatives in the piecewise-polynomial sense. The function
differentiates each polynomial piece separately, and ignores jump discontinuities
between polynomial pieces during differentiation.

For the B-form, the function uses the [*PGS*; (X.10)] formulas
for differentiation.

For the stform, differentiation relies on knowing a formula for the relevant derivative of the basis function of the particular type.

## Version History

**Introduced before R2006a**