Back to top
diff(function,x) differentiates function with respect to the symbolic variable x. The main variable of function is used if x is not provided. Functions defined by user programs can often be handled as well.
You can easily plot the result of differentiation as:
as explained in the section plotting
Let us consider few more example skipping the print statement: