# Ashley Deloch, Math Artist f(x,y)=(x^2+y^2)*e^(1-x^2-y^2)

given by going from P(-1,0) to Q1(-3,-1) and to Q2(-2,-2):

gives vector PQ1 = v1 =(-3+1)i + (-1-0)j= -2i-1j
and vector PQ2 = v2 =(-2+1)i + (-2-0)j= -1i-2j.

The magnitude would be the same for both vectors, 2^2+1^2=5,
then you take the square root of that and you get 5^(1/2).

So u1=<-2/5^(.5),-1/5^(.5)> and u2= <-1/5^(.5), -2/5^(.5)
are the unit vectors corresponding to v1 and v2.

Find the partial derivatives:

fx = 2x*e^(1-x^2-y^2)+(-2x*e^(1-x^2-y^2))*(x^2+y^2)
fx = 2x*e^(1-x^2-y^2) - (2x*e^(1-x^2-y^2))*(x^2+y^2)
factor and simplify
fx = 2x*e^(1-x^2-y^2)*(1-(x^2+y^2))
fx = 2x*(1-x^2-y^2)*e^(1-x^2-y^2)

and

fy = 2y*e^(1-x^2-y^2)+(-2y*e^(1-x^2-y^2))*(x^2+y^2)
fy = 2y*e^(1-x^2-y^2) - (2y*e^(1-x^2-y^2))*(x^2+y^2)
factor and simplify
fy = 2y*e^(1-x^2-y^2)*(1-(x^2+y^2))
fy = 2y*(1-x^2-y^2)*e^(1-x^2-y^2)

Find the directional derivative Du f(x,y)= grad f.u1
=(-4xe^(1-x^2-y^2)(1-x^2-y^2)-2ye^(1-x^2-y^2)(1-x^2-y^2))/ (5^(.5))
=((2e^(1-x^2-y^2)(1-x^2-y^2))/(5^.5))(-2x-y)

plug in P(-1,0) into grad f.u1 and get

Find the directional derivative Du f(x,y)= grad f.u2
=(-2xe^(1-x^2-y^2)(1-(x^2+y^2))-4ye^(1-x^2-y^2)(1-(x^2+y^2))/(5^(.5))
=((2xe^(1-x^2-y^2)(1-(x^2+y^2))/(5^.5))(-x-2y)

Now plug in P(-1,0) into grad f.u1 and get    