I have two vectors, $\bar{x},\bar{v}$ and I want to produce a third vector such that:$$ u_i = \int_{x_i}^{x_i+\delta} f(v_i,t)dt \ .$$ I tried (with a simple function for example):
Integrate[v*(Cos[w*n*t]), {t, x, x +D} ]
but this ends up returning a matrix$$ u_{ij} = \int_{x_i}^{x_i+\delta}f(v_j,t)dt \ .$$ How do I make it so the index of the two vectors is the same? Essentially I want the diagonal of this matrix, but calculating the entire matrix and then taking the diagonal is computationally very slow as the matrix is large. I also tried defining a function
F[i_] = Integrate[Index[v,i]*(Cos[w*n*t]), {t, Index[x,i], Index[x,i] +D} ]
(I could not access vector elements in the function definition using x[[i]]
) but this does not evaluate when I enter say F[1]
.