0

Let $a\in \Bbb{R}^n$ be a vector consisting of constant values, $b ∈ \Bbb{R}^n$ and $C\in \Bbb{R}^{n\times n}$ .

How can the gradient be calculated for
$∇_ba \boldsymbol{\cdot} b$ ( dot-product of a and b) and/or $∇_bb \boldsymbol{\cdot} b$

I understand that this would be taking the derivate of the respective functions. However what process would I go through to solve such a problem and what should I expect to arrive at?

I know it can be started like... $∇_ba·b =(d/db_1 a·b, d/db_2 a·b, d/db_3 a·b...) $

$d/db_1 a·b = d/db_1 (a_1b_1+a_2b_2...)$

How do i get to the scalar and how can i understand the process going forward?

K.defaoite
  • 13,890
  • 2
    Does this answer your question? Gradient of a dot product – DMcMor Jan 19 '21 at 17:45
  • Write out everything in terms of the components of the vectors and matrix. It’s hard at first to calculate the gradient of a function defined so abstractly. It’s easier to convert everything into algebraic formulas that are easy to differentiate. – Deane Jan 19 '21 at 17:55

1 Answers1

1

Let's use @Deane's strategy. Summing over repeated indices,$$\frac{\partial(a_ib_i)}{\partial b_j}=\frac{\partial a_i}{\partial b_j}b_i+a_j$$.A matrix $M_{ij}:=\frac{\partial a_i}{\partial b_j}$ satisfies $\nabla_b(a\cdot b)=M^Tb+a$. Meanwhile,$$\frac{\partial(a_ia_i)}{\partial b_j}=2M_{ij}a_i=2(M^Ta)_j.$$

J.G.
  • 118,053