Differentiable • Theorems ○ f differentiable ⇒ f continuous ○ f differentiable ⇒f has partial derivative ○ T_a (v)=∂f/(∂x_1 ) (a) v_1+…+∂f/(∂x_n ) (a) v_n ○ f has continuous partial derivative ⇒f is differentiable • Example ○ There is a function f which has partial derivative everywhere ○ but is not continuous at (0,0) Chain Rule • Formula ○ d/dt f(x_1 (t),…,x_n (t))=∂f/(∂x_1 ) (dx_1)/dt+…+∂f/(∂x_n ) (dx_n)/dt • Proof ○ Let g(t)=f(x_1 (t),…,x_n (t)) § g(t+Δt)−g(t)=f(x_1 (t+Δt),…,x_n (t+Δt))−f(x_1 (t),…,x_n (t)) ○ Define Δx_k=x_k (t+Δt)−x_k (t), (k=1,…,n) § g(t+Δt)−g(t)=∂f/(∂x_1 ) (x)Δx_1+…+∂f/(∂x_n ) (x)Δx_n+Error ○ Derivative of g(t) § g^′ (t)=lim_(Δt→0)〖(g(t+Δt)−g(t))/Δt〗 § =lim_(Δt→0)(∂f/(∂x_1 ) (x) (Δx_1)/Δt+…+∂f/(∂x_n ) (x) (Δx_n)/Δt+Error/Δt) § =∂f/(∂x_1 ) (x) lim_(Δt→0)((Δx_1)/Δt)+…+∂f/(∂x_1 ) (x) lim_(Δt→0)((Δx_n)/Δt)+lim_(Δt→0)(Error/Δt) ○ Note that § lim_(Δt→0)((Δx_k)/Δt)=lim_(Δt→0)((x_k (t+Δt)−x_k (t))/Δt)=(dx_k)/dt § lim_(Δt→0)(Error/Δt)=0 ○ Therefore § g^′ (t)=∂f/(∂x_1 ) (dx_1)/dt+…+∂f/(∂x_n ) (dx_n)/dt • Gradient ○ g^′ (t)=f_(x_1 ) (x(t)) x_1^′ (t)+…+f_(x_n ) (x(t)) x_n^′ (t) ○ g^′ (t)=(█(f_(x_1 )@⋮@f_(x_n ) ))(█(x_1^′ (t)@⋮@x_n^′ (t) ))=∇ ⃗f(x ⃗ )⋅x ⃗^′ (t)=‖∇ ⃗f(x ⃗ )‖⋅‖x ⃗^′ (t)‖ cosθ ○ ∇ ⃗f is called gradient ○ x ⃗^′ (t) is called velocity vector • Interpretation ○ (x_1 (t),…,x_n (t)) cordinates of a point moving in Rn (t=time) ○ Velocity vector: v(t)=x ⃗^′ (t)=lim_(Δt→0)〖(x ⃗(t+Δt)−x ⃗(t))/Δt〗=(x_1^′ (t),…,x_n^′ (t)) ○ Example: Linear motion with constant velocity § x ⃗(t)=(x_1 (t),…,x_n (t))=p ⃗+t ⃗=(p_1+tv_1,…,p_n+tv_n ) § v(t)=x ⃗′(t)=(v_1,..,v_n ) ○ Example: Circular motion § x ⃗(t)=(█(cost@sint )) § v(t)=x ⃗′(t)=(█(−sint@cost )) ○ Example § f(x,y)=x2+y2 § ∇ ⃗f(x,y)=(█(f_x@f_y ))=(█(2x@2y)) • Theorem ○ f(x ⃗(t)) does not depend on t, if and only if ○ ∇ ⃗f(x ⃗(t))⊥x ⃗′(t) for all t • Proof ○ f(x ⃗(t)) constant for atb ○ ⟺d/dt (f(x ⃗(t)))=0 for atb ○ ⟺∇ ⃗f(x ⃗(t))⋅x ⃗(t)=0 for atb ○ ⟺∇ ⃗f(x ⃗(t))⊥x ⃗′(t) ○ Note: By convention 0 ⃗⊥any vector • Application: Gradient Decent ○ To decrease/increase f(x ⃗(t)), how should we choose x^′ (t) ○ Maximize/Minimize Condition § Maximal if cosθ=+1, i.e. θ=0 § Minimal if cosθ=−1, i.e. θ=π ○ Steepest Ascent/Descent ○ Pseudocode Level Sets • Definition ○ D⊆Rn open ○ If f:D→R, then ○ The level set of f at level c is ○ {x ⃗∈Rn│f(x ⃗ )=c}=f^(−1) (c) • Example ○ f(x,y,z)=x2+y2+z^2 ○ f^(−1) (1)={(x,y,z)∈R3 |x2+y2+z^2=1}=unit sphere ○ f^(−1) (0)={(x,y,z)∈R3 |x2+y2+z^2=0}=origin • Tangent ○ Let S⊆Rn, p∈S ○ Then v ⃗∈Rn is tangent to S ○ If there is a path x ⃗(t) with x ⃗(t_0 )=p and x^′ (t)=v ⃗, and x ⃗(t)∈S for all t • Theorem ○ If S=f^(−1) (c)={x ⃗∈Rn│f(x ⃗ )=c} ○ And v ⃗ is tangent to S at p∈S ○ Then ∇ ⃗f(p)⊥v ⃗ • Proof ○ Given v ⃗ is tangent to S ○ So there is a path x(t)∈S for all t with {█(x ⃗(t_0 )=p@x ⃗^′ (t)=v ⃗ )┤ ○ Since f(x ⃗(t))=c for all t ○ We have 0=d/dt f(x ⃗(t))=∇ ⃗f(x ⃗(t))⋅x ⃗^′ (t) ○ So at t=t_0, 0=∇ ⃗f(p)⋅v ⃗