The Chain Rule.mw

The Chain Rule: Examples

1. Find dw/dt when dw is as follows:  w=x^2*y-y^2         x=sin(t)           y=exp(t)

Anwser:

To find this, we must use the chain rule, then just use the diff function:

> diff(x^2*y-y^2,x)*diff(sin(t),t)+diff(x^2*y-y^2,y)*diff(exp(t),t);

2. Find dw/dt and dw/ds when the functions are as follows:  w=2*x*y     x=s^2+t^2    y=s/t

Anwser

To find dw/dt we can find all of partial derivatives we need using the diff command:

> diff(2*x*y,x)*diff(s^2+t^2,t)+diff(2*x*y,y)*diff(s/t,t);

Then we substiute in the x and y values and simplify:

> eval(%,[x=s^2+t^2,y=s/t]);

> simplify(%);

To find dw/ds we hold t constant and use the diff command to do the chain rule:

> diff(2*x*y,x)*diff(s^2+t^2,s)+diff(2*x*y,y)*diff(s/t,s);

Then we substiute in the x and y values and simplify:

> eval(%,[x=s^2+t^2,y=s/t]);

> simplify(%);