# A Wolfram Notebook on nth Derivatives

n

th

## Introduction

Introduction

Derivatives of functions play a fundamental role in calculus and its applications. The function D computes derivatives of various types in the Wolfram Language and is one of the most-used functions in the system.

Starting from the derivative of a function, one can compute derivatives of higher orders to gain further insight into the physical phenomenon described by the function. For example, suppose that the position of a particle moving along a straight line at time is defined as follows.

s(t)

t

In[1]:=

s[t_]:=t^5-10t+(1/12)Sin[3t]

Then, the velocity and the acceleration of the particle are given by its first and second derivatives, respectively. The higher derivatives too can be computed easily using D; they also have special names, which can be seen in the following computation.

In[2]:=

{velocity,acceleration,jerk,snap,crackle,pop}=Table[D[s[t],{t,i}],

{i,6}];

In[3]:=

Plot[Evaluate[{x[t],velocity,acceleration,jerk,snap,crackle,

pop}],{t,0,Pi},Exclusions->None,

PlotLegends->{"position","velocity","acceleration","jerk",

"snap","crackle","pop"},PlotRange->All]

Out[3]=

Recent versions of the Wolfram Language allow you to compute not just the derivative of any specific order for a function, but also closed-form expressions for derivatives of symbolic order n using D. Such a closed form encodes all the information required to compute higher derivatives of the function.

Here we will give some examples for computing these derivatives, starting with an elementary example to illustrate how one might guess a formula for the derivative. Next, we create a table of derivatives to show that sophisticated special functions are needed to express the closed forms in general. Finally, we show that the calculus of derivatives is a generalization of the ordinary calculus of derivatives by exhibiting the sum, product and chain rules for these derivatives.

n

th

n

th

n

th

n

th

## An Elementary Example

An Elementary Example

Let us begin by considering the cosine function. Its first four derivatives are given by:

In[4]:=

Table[D[Cos[x],{x,n}],{n,4}]

Out[4]=

{-Sin[x],-Cos[x],Sin[x],Cos[x]}

There is a clear pattern in the table, namely that each derivative may be obtained by adding a multiple of to , as shown here.

π/2

x

In[5]:=

Table[Cos[x+(nπ)/2],{n,4}]

Out[5]=

{-Sin[x],-Cos[x],Sin[x],Cos[x]}

In[6]:=

D[Cos[x],{x,n}]

Out[6]=

Cos+x

nπ

2

An immediate application of the above closed form would be to compute higher-order derivatives of Cos with blinding speed. D itself uses this method to compute the billionth derivative of Cos in a flash, as shown here.

In[7]:=

D[Cos[x],{x,10^9}]//Timing