Practical 7: Symbolic Toolbox

Practical 7

Differentiation and Integration

The Symbolic Toolbox features special commands for differentiation and integration. This practical will focus only on the basic diff and int commands. The default variable for integration or differentiation is x (first), or t (if there is no x) but you can specify another symbol.

> Exercise: Finding Derivatives & Integrals

> Open your script M-file symPoly.m with the equation p \left(x\right)=x^{2} \left(x+4\right)^{2}-8x \left(x+1\right)^{2}+13x-6.

> Create two new cells using the following commands to find the 1st and 2nd derivatives of p(x) as well as the indefinite and the definite integral from -1 to 1.

 

dp=diff(p,x)                 % note that you do not need to specify x because it is the default variable

d2p = diff(p,x,2)            % How would you find the third derivative of x?

intp = int(p,x)

intpDef=int(p,x,-1,1)