Discretising a line integral

79 Views Asked by At

UPDATE 2: This question is a work in progress. Either the paper I was referring to is wrong, or I made a mistake translating what's in section 3.2 of the paper into this question (e.g. multidimensional $\mathbf{f}:\mathbb{R}^m \rightarrow \mathbb{R}^n$, the line integral $\oint$ seems to be over a closed curve)

UPDATE: Rewrote the full question for clarity. The original question was based on a research paper and made it difficult to understand the question

With a function $f: \mathbb{R} \rightarrow \mathbb{R}$, take a line integral of $|\frac{df'(x)}{dx}|$ over the trajectory $T$ to get the LHS. When discretised to get the RHS, we get a $\frac{1}{2}$ coefficient in the front, why?

$$\int_{x \in T} |\frac{df'(x)}{dx}|dx \approx \frac{1}{2} \sum_{i=0}^{k-1} |f'(x_i) - f'(x_{i+1})|$$

As an example of how this is calculated, let function $f(x) = 10x^2$, with $T$ ranging from $x=0$ to $x=1$

$$\mathrm{LHS} = \int_{0}^1 |\frac{df'(x)}{dx}|dx = \int_0^1 20\ dx = 20 $$

We have

$$f'(x) = 20x$$

Therefore, taking $x_0 = 0, x_1 = 0.5, x_2 = 1$, we have

$$\mathrm{RHS} = \frac{1}{2} \sum_{i=0}^{1} |f'(x_i) - f'(x_{i+1})| = \frac{1}{2} (|f'(0) - f'(0.5)| + |f'(0.5) - f'(1)|) = \frac{1}{2} (10 + 10) = 10$$

My question is, why do we get a $\frac{1}{2}$ coefficient at the front of the RHS? Is there double-counting somewhere?

1

There are 1 best solutions below

3
On

Something or another is fishy, because this $\frac{1}{2}$ shouldn't be needed at all. What went wrong earlier is that you differentiated $10x^2$ wrong, the second derivative of it should be just $20$ and so the integral should be just $20$ such that you don't need a factor of $\frac{1}{2}$ in the sum anymore.