Previous Up Next

6.21.1 Gradient: derive deriver diff grad

The derive command finds partial derivatives of a multivariable expression.
diff and grad can be used synonymously for derive here.


Example.
Find the gradient of F(x,y,z)=2x2y−xz3.
Input:

derive(2*x^2*y-x*z^3,[x,y,z])

or:

diff(2*x^2*y-x*z^3,[x,y,z])

or:

grad(2*x^2*y-x*z^3,[x,y,z])

Output:

⎡
⎣
2· 2 x y−z3,2 x2,−3 x z2⎤
⎦

Output after simplification with normal(ans()):

⎡
⎣
4 x y−z3,2 x2,−3 x z2⎤
⎦

To find the critical points of F(x,y,z)=2x2y−xz3:
Input:

solve(derive(2*x^2*y-x*z^3,[x,y,z]),[x,y,z])

Output:

⎡
⎣
⎡
⎣
0,y,0⎤
⎦
⎤
⎦

Previous Up Next