Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Find the tangent plane to the surface in Mathematica

  1. Oct 18, 2005 #1
    Hey guys I have just started learning mathematica and I was wandering if someone could confirm if I did the following correct:


    Find the tangent plane to the surface z = 2x^2 -y^2 at the point (2,1). Plot the tangent plane and the surface on the same graph. Change th eviewpoint to show the tangent plane clearly.


    Clear[f, x, y, fx, fy, point1, point2]
    point1 = 2;
    point2 = 1;
    f[x_, y_] = 2x^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)"}]

    Thanks in advance
  2. jcsd
  3. Oct 19, 2005 #2
    anyone able to confirm if it's correct?
  4. Oct 19, 2005 #3


    User Avatar
    Staff Emeritus
    Science Advisor
    Gold Member

    I tried it and it looks ok ; the code also looks ok...
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook

Have something to add?

Similar Discussions: Find the tangent plane to the surface in Mathematica