Mathematica Does Derivatives: Syntax

Prime

The prime syntax is an easy way to get the derivative of an explicit function.

Clear[y,f,g]

y[x_]=f[x]g[x]

y'[x]

Clear[y]

Note that the following does not work, since y has not been defined in Mathematica as a function of x!

y=f[x]g[x]

y'

The prime notation is useful when the function f(x) is easy to define:

f[x_]=x^2

f'[x]

Here is how you can evaluate a derivative at a point using the prime syntax:

f'[z+u]

f'[2]

Clear[f,y,g]

D

An alternate form is D. I like this form since it reminds us that we always take a derivative with respect to some variable, and with the D form this variable is explicitly named. This will be very useful to us when we look at multivariable calculus later in teh semester.

D[f[x],x]

D[f[x]g[x],x]

D[f[x]/g[x],x]

D[(x^2+3x+Exp[x])/(1-Exp[x]),x]

D[x^2,x]

Here is how you can evaluate a derivative at a point using the D syntax:

D[x^2,x]/.x->z+u

D[x^2,x]/.x->3

Derivative

There is also a long form command Derivative, which is useful in certain instances since it easily allows you to evaluate a derivative at a specific point. I have used this form in upper level classes, but you won't need it in Calculus I or Calculus II.

f[x_]=x^2

Derivative[1][f][z+u]

Derivative[1][f][3]