0

Given the following finite sum:

$S = \sum_{k=0}^{2n}\left(\sum_{i=\max(0,k-n)}^{\min(n,k)}a_{i}a_{k-i}\right)$

From this summation, I want to calculate explicitly each element $(i,j)$, i.e. the partial derivatives, in the Hessian (and with that find an analytical expression), $H_{i,j}$.

The Hessian is calculated in the following way: \begin{equation} \mathbf{H}=\left[\begin{array}{cccc} \frac{\partial^2 S}{\partial a_0^2} & \frac{\partial^2 S}{\partial a_0 \partial a_1} & \cdots & \frac{\partial^2 S}{\partial a_0 \partial a_n} \\ \frac{\partial^2 S}{\partial a_1 \partial a_0} & \frac{\partial^2 S}{\partial a_1^2} & \cdots & \frac{\partial^2 S}{\partial a_1 \partial a_n} \\ \vdots & \vdots & \ddots & \vdots \\ \frac{\partial^2 S}{\partial a_n \partial a_0} & \frac{\partial^2 S}{\partial a_n \partial a_1} & \cdots & \frac{\partial^2 S}{\partial a_n^2} \end{array}\right] . \end{equation}

Example for $n=2$, the result is (without using an analytical expression): \begin{bmatrix} 1 & \frac{1}{2} & \frac{1}{3} \\ \frac{1}{2} & \frac{1}{3} & \frac{1}{4} \\ \frac{1}{3} & \frac{1}{4} & \frac{1}{5} \\ \end{bmatrix}

I want a similar result (i.e. an analytical expression) like in this topic to give an idea: Differentiation of a double summation.

Math98
  • 85
  • 8
  • 1
    We should have $\frac{\partial^2 S}{\partial a_m \partial a_p}=2$. You can prove it by applying the Leibnitz rule to the first expression of the sum that you have given – Marco Jun 12 '23 at 13:10
  • Your question is phrased as an isolated problem, without any further information or context. This does not match many users' quality standards, so it may attract downvotes, or be closed. To prevent that, please [edit] the question. This will help you recognise and resolve the issues. Concretely: please provide context, and include your work and thoughts on the problem. These changes can help in formulating more appropriate answers. – Shaun Jun 12 '23 at 13:23
  • 1
    @shaun I improved the question and gave more context. – Math98 Jun 12 '23 at 14:34
  • @Math98 your question is a particular case of the link you posted. It is the case $a_{ii}=1$ and $a_{ij}=2$ for $i \ne j$ (try to expand the product in the case $n=2$ or $n=3$) – Marco Jun 12 '23 at 14:43
  • 1
    Do NOT change your OP, you changed the OP this in this post and you did again here https://math.stackexchange.com/questions/4712964/product-of-two-finite-sums-left-sum-k-0na-k-right-left-sum-k-0nb – MathFail Jun 14 '23 at 11:00
  • Ok, clear. However, do you know the answer to the question? @MathFail – Math98 Jun 15 '23 at 11:08
  • @Marco I should get a matrix instead of a scalar as an output. Can you show with an example that my situation is an particular case of the link I posted. I don't follow your reasoning. – Math98 Jun 15 '23 at 11:09
  • 1
    The matrix Is the One with all the coefficients 2. You Just changed your equation. Add context doesn't means changing what you are asking. – Marco Jun 15 '23 at 11:51
  • @Shaun Can you delete this question, so I can ask it in a new OP right away correctly? – Math98 Jun 16 '23 at 20:36

2 Answers2

1

Note that with respect to your previous post $S$ admits due to symmetry the significant simpler representation \begin{align*} \color{blue}{S}&=\sum_{k=0}^{2n}\sum_{i=\max(0,k-n)}^{\min(n,k)}a_{i}a_{k-i}\\ &=\left(\sum_{k=0}^na_k\right)^2\\ &\,\,\color{blue}{=\sum_{k=0}^na_k^2+2\sum_{0\leq k<l\leq n}a_ka_l}\tag{1} \end{align*}

From (1) it is easily seen that \begin{align*} \color{blue}{\mathbf{H}}&= \begin{bmatrix} \frac{\partial^2 }{\partial a_r \partial a_s}S \end{bmatrix}_{0\leq r,s\leq n}\\ &= \begin{bmatrix} \frac{\partial^2}{\partial a_r \partial a_s} \left(\sum_{k=0}^na_k^2+2\sum_{0\leq k<l\leq n}a_ka_l\right) \end{bmatrix}_{0\leq r,s\leq n}\tag{1}\\ &\,\,\color{blue}{= \begin{bmatrix} 2 \end{bmatrix}_{0\leq r,s\leq n}}\\ \end{align*}

Markus Scheuer
  • 108,315
0

Take the first derivative

$$\frac{\partial S}{\partial a_m}=2\left(\sum_{k=0}^na_k\right)\sum_{k=0}^n\frac{\partial a_k}{\partial a_m}=2\left(\sum_{k=0}^na_k\right)\sum_{k=0}^n\delta_{km}=2\sum_{k=0}^na_k$$

where $\delta_{km}$ is Kronecker delta.

$$\frac{\partial^2 S}{\partial a_m\partial a_p}=2\sum_{k=0}^n \frac{\partial a_k}{\partial a_p}=2\sum_{k=0}^n\delta_{kp}=2$$

MathFail
  • 21,128