Interpolazione lineare
f ( t ) = t q + ( 1 − t ) p f(t) = t\ \mathbf{q} + (1 - t)\ \mathbf{p} f ( t ) = t q + ( 1 − t ) p , con f : [ 0 , 1 ] → R n f: [0, 1] \to \R^n f : [ 0 , 1 ] → R n , è detta
interpolazione lineare tra i punti p \mathbf{p} p e q \mathbf{q} q . Nei linguaggi di
programmazione, spesso la funzione è chiamata lerp.
L’immagine di f f f è rappresentata dal segmento con estremi p \mathbf{p} p e
q \mathbf{q} q .
Consideriamo una funzione f : A ⊆ R n → R f: A \subseteq \R^n \to \R f : A ⊆ R n → R definita su un insieme
A A A tale che:
Esistono p , q ∈ A \mathbf{p}, \mathbf{q} \in A p , q ∈ A per cui il segmento
[ p , q ] = { t q + ( 1 − t ) p , t ∈ [ 0 , 1 ] } [\mathbf{p}, \mathbf{q}] = \Set{t\ \mathbf{q} + (1 - t)\ \mathbf{p}, t \in [0,1]} [ p , q ] = { t q + ( 1 − t ) p , t ∈ [ 0 , 1 ] }
è contenuto in A A A .
f f f è continua sul segmento [ p , q ] [\mathbf{p}, \mathbf{q}] [ p , q ] e differenziabile al
suo interno ( p , q ) (\mathbf{p}, \mathbf{q}) ( p , q ) .
In queste condizioni, esiste un punto c ∈ ( p , q ) \mathbf{c} \in (\mathbf{p}, \mathbf{q}) c ∈ ( p , q )
tale che:
f ( q ) − f ( p ) = ∇ f ( c ) ⋅ ( q − p ) f(\mathbf{q}) - f(\mathbf{p}) = \nabla f(\mathbf{c}) \cdot (\mathbf{q} - \mathbf{p}) f ( q ) − f ( p ) = ∇ f ( c ) ⋅ ( q − p )
Corollario : Se ∀ p ∈ B ( p 0 , r ) \forall\ \mathbf{p} \in B(\mathbf{p}_0, r) ∀ p ∈ B ( p 0 , r ) , il gradiente è
nullo (∇ f ( p ) = 0 \nabla f(\mathbf{p}) = \mathbf{0} ∇ f ( p ) = 0 ), allora la funzione f f f è costante
su quell’intorno, ovvero
∀ p ∈ B ( p 0 , r ) , f ( p ) = f ( p 0 ) \forall\ \mathbf{p} \in B(\mathbf{p}_0, r),\ f(\mathbf{p}) = f(\mathbf{p}_0) ∀ p ∈ B ( p 0 , r ) , f ( p ) = f ( p 0 ) .
Sia f : A ⊆ R n → R m f: A \subseteq \R^n \to \R^m f : A ⊆ R n → R m ,
f ( x ) = ( f 1 ( x ) , … , f m ( x ) ) f(\mathbf{x}) = (f_1(\mathbf{x}), \ldots, f_m(\mathbf{x})) f ( x ) = ( f 1 ( x ) , … , f m ( x )) , con
f i : A → R f_i: A \to \R f i : A → R .
Assumendo che per ogni i = 1 , … , m i = 1,\ldots,m i = 1 , … , m , il gradiente parziale
∇ f i ( x ) \nabla f_i(\mathbf{x}) ∇ f i ( x ) esista in x \mathbf{x} x , la matrice Jacobiana
D f ( x ) D_f(\mathbf{x}) D f ( x ) è una matrice di dimensione m × n m \times n m × n la cui i i i -esima riga
è data da ∇ f i ( x ) \nabla f_i(\mathbf{x}) ∇ f i ( x ) :
D f ( x ) = [ ∂ f 1 ∂ x 1 ( x ) … ∂ f 1 ∂ x n ( x ) ⋮ ⋮ ∂ f m ∂ x 1 ( x ) … ∂ f m ∂ x n ( x ) ] D_f(\mathbf{x}) = \begin{bmatrix}
\frac{\partial f_1}{\partial x_1}(\mathbf{x}) & \ldots & \frac{\partial f_1}{\partial x_n}(\mathbf{x}) \\
\vdots & & \vdots \\
\frac{\partial f_m}{\partial x_1}(\mathbf{x}) & \ldots & \frac{\partial f_m}{\partial x_n}(\mathbf{x})
\end{bmatrix} D f ( x ) = ∂ x 1 ∂ f 1 ( x ) ⋮ ∂ x 1 ∂ f m ( x ) … … ∂ x n ∂ f 1 ( x ) ⋮ ∂ x n ∂ f m ( x )
La regola della catena permette di calcolare le derivate parziali di una
funzione composta, richiedendo solo il calcolo delle derivate parziali delle
funzioni componenti.
Siano g : A ⊆ R n → R m g: A \subseteq \R^n \to \R^m g : A ⊆ R n → R m , f : B ⊆ R m → R k f: B \subseteq \R^m \to \R^k f : B ⊆ R m → R k e
supponiamo che g ( A ) ⊆ B g(A) \subseteq B g ( A ) ⊆ B .
Inoltre supponiamo che, dato un punto x ∈ A \mathbf{x} \in A x ∈ A :
g ( x ) = ( g 1 ( x ) , … , g m ( x ) ) g(\mathbf{x}) = (g_1(\mathbf{x}), \ldots, g_m(\mathbf{x})) g ( x ) = ( g 1 ( x ) , … , g m ( x )) , con
g i : A → R g_i: A \to \R g i : A → R differenziabili in x \mathbf{x} x .
f ( y ) = ( f 1 ( y ) , … , f k ( y ) ) f(\mathbf{y}) = (f_1(\mathbf{y}), \ldots, f_k(\mathbf{y})) f ( y ) = ( f 1 ( y ) , … , f k ( y )) , con
f j : B → R f_j: B \to \R f j : B → R differenziabili in y = g ( x ) \mathbf{y} = g(\mathbf{x}) y = g ( x ) .
Consideriamo ora la funzione composta h : R n → R k h: \R^n \to \R^k h : R n → R k ,
h ( x ) = ( f ∘ g ) ( x ) h(\mathbf{x}) = (f \circ g)(\mathbf{x}) h ( x ) = ( f ∘ g ) ( x ) ; allora le funzioni h 1 , … , h k h_1, \ldots, h_k h 1 , … , h k
sono differenziabili in x \mathbf{x} x e la matrice Jacobiana di h h h è data dal
prodotto delle matrici Jacobiane delle funzioni di partenza.
D h ( x ) = D f ( g ( x ) ) D g ( x ) D_h(\mathbf{x}) = D_f(g(\mathbf{x}))\ D_g(\mathbf{x}) D h ( x ) = D f ( g ( x )) D g ( x )