\( (*\(\(\ \)\(Laborotory\ Exercise\ #3 : \ 

\ 
                  Lines\ tangent\ lines\ to\ coordinate\ curves\ on\ the\ graph\ of\ z\  = \ 
                f[x, y] . 

Math\ 261
\ Ron\ Umble, \ 
              Instr . 

\ \(Name : 
\(Date : 

Given\ a\ point\ {a, b, f[a, 
                            b]}\ on\ the\ graph\ of\ a\ differentiable\ function\ z\)\)\  = \ 
                f[x, y], 
\ \ \ this\ routine\ draws\ lines\ tangent\ to\ the\ coordinate\ curves\ {t, b, f[t, b]}\ and\ a, t, 
              f[a, t]\)\(}\)\) . \ \ 
\ \ \ \ The\ slopes\ of\ these\ lines\ in\ the\ respective\ vertical\ planes\ y = \(b\ and\ x = 
          a\ are\ the\ partial\ 
\ \ \ \ derivatives\ of\ f\ wrt\ x\ and\ wrt\ y\ at\ {a, 
                b} . \ \ \ \ \ 

\ \ \ \(Assignment : 
\ \ 1. \ Change\ the\ value\ of\ parameters\ a\ and\ b\)\), \ 
      then\ display\ and\ print\ out\ the\ coordinate\ curves, 
\ \ \ \ \ \ \ \ \ \ tangent\ lines\ and\ graph\ of\ the\ function\ below\ the\ at\ points\ {0, 0, 
          f[0, 0]}, \ {1, 0, 
              f[1, 0]}
\ \ \ \ \ \ \ and\ {0, 1, 
                f[0, 1]} . \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ 

\ \ \ 2. \ Replace\ the\ function\ below\ with\ the\ following\ function\ whose\ graph\ is\ the\ "monkey saddle" : \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ 
\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ f[x, y]\  = \ 
        x\^3\  - \ 2  x\ y\^2\  - \ x\^2\  - \ 
          y\^2 . \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ 
\ \ \ \ \ \ Change\ the\ value\ of\ parameters\ a\ and\ b, \ 
      then\ display\ and\ print\ out\ the\ coordinate\ curves, 
\ \ \ \ \ \ \ \ \ \ tangent\ lines\ and\ graph\ of\ this\ function\ at\ points\ {0, 0, f[0, 0]}, \ {1, 0, 
        f[1, 0]}, \ 
\ \ \ \ \ \ \ \ \ \ {0, 1, 
          f[0, 1]}\ and\ \(\({1, 1, 
            f[1, 1]}\)\(.\)\)\ \ \ \ \ \ \ 

\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ *) \)

a = 1

b = 1

f[x_, y_] := 4  -  ((x^2) +  (y^2))

fx[x_, y_] := Evaluate[D[f[x, y], x]]

fy[x_, y_] := Evaluate[D[f[x, y], y]]

XCoordCurve[t_] := {t, b, f[t, b]}

YCoordCurve[t_] := {a, t, f[a, t]}

XTanLine[t_] := {a, b, f[a, b]} + t {1, 0, fx[a, b]}

YTanLine[t_] := {a, b, f[a, b]} + t {0, 1, fy[a, b]}

\(ParametricPlot3D[

      Evaluate[{
XCoordCurve[
            t]\ , 
YCoordCurve[
            t]\ , 
XTanLine[t], 
YTanLine[
            t]\ 
\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ }], {t, \(-2\), 2}, \ 
	
      ViewPoint -> {1, 3, 1}\ , AspectRatio -> 1]\)

Plot3D[f[x, y], {x, -2, 2}, {y, -2, 2},  
      ViewPoint -> {1, 3, 1}, AspectRatio -> 1, Mesh -> False, 
      DisplayFunction -> Identity]

Show[%, %%, DisplayFunction -> $DisplayFunction]