Session 1.7: Differentiating expressions and functions with diff

> restart;

> fe1:=x^2; <- Expression giving the square of x

[Maple Math]

> fe2:=x*sin(x)-x; <- More complicated Expression

[Maple Math]

> dfe1:=diff(fe1,x); <- Derivative of fe1 with respect to x

[Maple Math]

> dfe2:=diff(fe2,x); <- Derivative of fe2 with respect to x

[Maple Math]

> f1:=x->x^2; <- Function giving the square operation

[Maple Math]

> f2:=x->x*sin(x)-x; <- Second function

[Maple Math]

> df1:=diff(f1(x),x); <- Note : you must specify f1 as a function of x

[Maple Math]

> df2:=x->diff(f2(x),x); <- Here is another way to produce a function

[Maple Math]

Higher order derivatives may also be produced

> fe3:=(x^2+y^2)*sin(x)*cos(y);

<- Expression depending on both x and y

[Maple Math]

> diff(fe3,x); <- The derivative of fe3 with respect to x

[Maple Math]

> diff(fe3,x,y); <- The second partial derivative (wrt x and y)

[Maple Math]

> f3:=(x,y)->(x^2+y^2)*sin(x)*cos(y);

<- The arrow form for the same function

Note : order of variables is important

[Maple Math]

> diff(f3(u,v),u); <- Change variables from (x,y) to (u,v)

[Maple Math]

>