Graphing a Function

Here are some of the steps to take in order to graph a function. Note that the answers can be copied and pasted into a Word document, or you could insert appropriate text right into this Mathematica worksheet. These steps could serve as an example for graphing your own function.

Differentiating an expression (press SHIFT-ENTER to execute each command)

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

Simplifying the last output (denoted by %)

Simplify[%]

Defining a function so that we can work with it repeatedly. That will be better than differentiating the expression directly, as we did above. Once we define the function, we can reuse it without retyping it, which will be rather convenient.

f[x_]=x/(x^3-2)

Evaluating the function f at zero

f[0]

Computing the derivative of f(x) and simplifying the answer in one command

Simplify[D[f[x],x,x]]

Evaluating the function at x (as a reminder)

f[x]

Computing the limit at infinity, in this context it results in the equation of the horiz asymptote

Limit[f[x],x->Infinity]

Solving the derivative equal to zero (i.e. finds the critical points)

Solve[D[f[x],x,x]==0,x]

Computing the second derivative and defining it as ddf(x)

ddf[x_]=D[f[x],x,x]

Evaluating the second derivative ddf(x) at x=-10

ddf[-10]

Evaluating the function f(x) at x=-1

f[-1]

Plotting the graph of f(x) for x between -5 and 5

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

Evaluating the numerical approximation to 18/59

N[(18/59)]

`