kill(all)$

How to construct : z=f(x,y), tangent plane,tangent line,version 1.0a,part3
peter.vlasschaert@gmail.com, 27/03/2020.

ref :http://people.kzoo.edu/barth/math214/SurfacePlaneLine.html

2d version  : y =f(x)  , part   1
3d version  : z=f(x,y), part   2 
3d version  : z=f(x,y),  part  3, ' concept : gradient'

rem :introduction to vector analysis in space = 3d
=> gradient .......

load packages
===========

load(lrats)$
load(vect)$

How to find tangent plane : 'gradient  concept' 
--------------------------------------------------------

1e)  definition plane ' see part 2',trough the point (x0,y0,z0)
------------------------------------------------------------------------
use :p2b3, part 2

p1:C*(z0-z)+B*(y0-y)+A*(x0-x)=0;

2e) How to find gradient 
------------------------------

gradient : definition : z = f(x,y)
======================

p2:z=f(x,y);

p2a:g(x,y,z) = rhs(p2)-lhs(p2);

only use :cartesian coordinates
x -direction  → derivative : diff(g,x)
y -direction  → derivative : diff(g,y)
z -direction  → derivative : diff(g,z)

p2b1:diff(p2a,x);
p2b2:diff(p2a,y);
p2b3:diff(p2a,z);

definition:  gradient    'g(x,y,z)'
==============

p2c1:[lhs(p2b1),lhs(p2b2),lhs(p2b3)];

definition:  gradient    'z=f(x,y)'
==============

p2c2:[rhs(p2b1),rhs(p2b2),rhs(p2b3)];

3e) relation between gradient & 1e)
-------------------------------------------
A → x-direction  ( @ x=x0),y=y0
B → y-direction ( @ y=y0),x=x0
C → z-direction ( @ z=z0)
for z =f(x,y)  → z0  =f(x0,y0)
rem :point (x0,y0) same plane.

p2c3a:[at(p2c2[1],x=x0),at(p2c2[2],y=y0),p2c2[3]];

p2c3b:[subst(y=y0,p2c3a[1]),subst(x=x0,p2c3a[2]),p2c3a[3]];

4e) tangent plane
----------------------
combination :relation between 1e) @ 3e)

p4a:[A,B,C];
p4b:p2c3b;

p4c:map("=",p4a,p4b);

use : 'p1'

p4d:subst(p4c,p1);

same result :'part 2', p7c2
--------------------------------

2e) form :C*(z0-z)+B*(y0-y)+A*(x0-x)=0
==============================

→ example : z=x^2+y^2, @ x=x0,y=y0, 'see part 2'

use of function
===========

def : gradient , ' function  = gradf,gradfv'
=============================

→ symbolic = general
---------------------------

p5a:gradf(f,x,y,z):=[diff(f,x),diff(f,y),diff(f,z)]$

gradf(rhs(p2a),x,y,z);

→ symbolic = values ,@ (x0,y0,z0)
-------------------------------------------

p5b:gradfv(f,x,x0,y,y0,z,z0):=[at(diff(f,x),x=x0),at(diff(f,y),y=y0),at(diff(f,z),z=z0)]$

same :p2c3a,below

p5b1::gradfv(rhs(p2a),x,x0,y,y0,z,z0);