Here’s a pretty nasty function:

f[x_]:=x^x

We can get Mathematica to plot it pretty easily:

Plot[f[x],{x,-2,2}]

Notice that Mathematica didn’t plot anything on the left, even though the function is defined for some negative values and produces a real number output (don’t put too much confidence in your calculator or software!)

f[-2]

f[-3]

f[-1/3]

First derivative of f with respect to x:

D[f[x],x]

We’ll see how to get the derivative through the process called “logarithmic differentiation”:

Second derivative of f:

D[f[x],{x,2}]