How to perform the following line integral \begin{align} \int_0^1 ((I-A)+A \operatorname{diag}(r(t)))^{-1}v \cdot r'(t) \, dt \end{align} where $r(t)= a t$ with $a \in \mathbb{R}^n$, and where `$\cdot$' denotes dot product.
Also, lets assume that there are no issues with inversion.
What I did The first thing I did is to simplify the expression
$$ \int_0^1 ((I-A)+A \operatorname{diag}(a)t)^{-1}v \cdot a \, dt $$
My intuition from one dimension case tells me that we should get an expression with a logarithm. However, I am not sure how to go about this in the matrix case.
Define the matrices $$\eqalign{ &B = (I-A),\quad &C = B^{-1}A\;{\rm Diag}(a) \\ &(I-A)+A{\,\rm Diag}(a)&t = B\,(I+Ct) \\ }$$ Assume that $\lim_{n\to\infty}C^n=0\,$ and perform the integration term-by-term over a series. $$\eqalign{ J &= \int_0^1 a^T\Big((I-A)+A{\,\rm Diag}(a)\,t\Big)^{-1}v\,dt \\ &= a^T\Bigg(\int_0^1 (I+Ct)^{-1}dt\Bigg)B^{-1}v \\ &= a^T\Bigg(\int_0^1 \big(I-Ct+C^2t^2-C^3t^3+\ldots\big)\,dt\Bigg)B^{-1}v \\ &= a^T\Big(I-\tfrac{1}{2}C+\tfrac{1}{3}C^2-\tfrac{1}{4}C^3+\ldots\Big)\,B^{-1}v \\ &= a^T\Big(C^{-1}\log(\,I+C\,)\Big)\,B^{-1}v \\ }$$ If $\,\Big(C^{-1}\log(\,I+C\,)\Big)\,$ exists and is real-valued, then this result remains valid, even if the assumed limit isn't zero. If none of these conditions are satisfied, you still might be able to perform the integration via numerical quadrature.