Partial Differentiation

Define An Interesting Function :

f[x_,y_]:=Cos[x^2+y^2]*Sin[x*y]

Plot3D[f[x,y],{x,-3,3},{y,-3,1}, PlotPoints->40,AxesLabel->{"X","Y","Z"},PlotLabel->"Cos[(x^2)+(y^2)] Sin[xy]", PlotRange->All]

ContourPlot[f[x,y],{x,-3,3},{y,-3,1}, PlotPoints->20,FrameLabel->{"X","Y"},PlotLabel->"Cos[(x^2)+(y^2)] Sin[xy]", Contours->40, ColorFunction->"TemperatureMap"]

Compute the first partial derivatives in x and y :

dfx = D[f[x,y],x]

dfy = D[f[x,y],y]

Compute Mixed Second Partial Derivatives and check that they are equal.

dfxy = D[f[x,y],x,y]

dfyx = D[f[x,y],y,x]

dfxy - dfyx

Just for fun, compute the 4th partial derivative of f(x,y) with respect to x and the 9th partial derivative of f(x,y) with respect to y.  Use the “Simplify” command to make the answers a bit easier to handle :

dfy4 = D[f[x,y],{x,4}]

Simplify[dfy4]

dfy20= D[f[x,y],{y,20}]

Simplify[dfy20]

Compute Higher Order Mixed Second Partial Derivatives and check that they are equal.

dfxy = D[f[x,y],{x,3},{y,2}]

dfyx = D[f[x,y],{y,2},{x,3}]

dfyx-dfxy

Simplify[dfyx-dfxy]