The goal is to plot both the surface graph of the function and the tangent plane to the surface on one plot. There are two functions I believe I'm having issues with:(adsbygoogle = window.adsbygoogle || []).push({});

f(x,y) = cos(x+y)exp(x^2 - y^2) @ point (0.5,-0.5)

&

f(x,y) = sin(exp(xy)) @ point (1,1)

My code for the two are as follows respectively:

Clear[f,x,y,fx,fy,point1,point2]

point1=0.5;

point2=-0.5;

f[x_,y_]=cos(x+y)exp((x^2) - (y^2));

fx[x_,y_]=D[f[x,y],x];

fy[x_,y_]=D[f[x,y],y];

T[x_,y_]:=f[point1,point2]+fx[point1,point2](x-point1)+fy[point1,point2](y-point2)

T[x,y]

Clear[G1,G2];

G1=Plot3D[f[x,y],{x,-2,10},{y,-4,4}]

G2=Plot3D[T[x,y],{x,-2,10},{y,-4,4}]

Show[G1,G2,ViewPoint -> {0,-2,0.3},AspectRatio -> 1,AxesLabel -> {"x","y","f(x,y)"}]

for the second:

Clear[f,x,y,fx,fy,point1,point2]

point1=1;

point2=1;

f[x_,y_]= sin(exp(xy));

fx[x_,y_]=D[f[x,y],x];

fy[x_,y_]=D[f[x,y],y];

T[x_,y_]:=f[point1,point2]+fx[point1,point2](x-point1)+fy[point1,point2](y-point2)

T[x,y]

Clear[G1,G2];

G1=Plot3D[f[x,y],{x,-2,10},{y,-4,4}]

G2=Plot3D[T[x,y],{x,-2,10},{y,-4,4}]

Show[G1,G2,ViewPoint -> {0,-2,0.3},AspectRatio -> 1,AxesLabel -> {"x","y","f(x,y)"}]

I believe the outputs I'm getting are wrong. For the cos one it just plots a flat plane at 0. For the second one there isn't any plot. I've changed around the intervals and viewpoints, but still nothing shows up. Just looking for a little insight into the issue. thanks!

**Physics Forums - The Fusion of Science and Community**

Dismiss Notice

Join Physics Forums Today!

The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

# Help With Mathematica

Loading...

Similar Threads for Help Mathematica | Date |
---|---|

Mathematica Mathetica function (help fix my equation please) | Mar 15, 2016 |

Mathematica Undetermined gauges (Help in mathematica)() | Oct 27, 2014 |

Mathematica Help with "Which[] in a For loop using Mathematica | Sep 12, 2014 |

New to mathematica, some basic help needed | May 10, 2014 |

Mathematica NDSolve conditions help | Dec 22, 2013 |

**Physics Forums - The Fusion of Science and Community**