I have the following integration problem:
$$ \int_0^1{ -m f(x) \left(\int_0^x{f(u)} du \right)}^{m-1} dx $$
I attempted to approximate $ \int_0^x{f(u)} du $ using Chebyshev interpolation, I took $n+1$ Chebyshev nodes and calculated $ \int_0^{x_i}{f(u)} du $, where $x_i$ is the $i$th node. In the end, I had a polynomial $p(x) \approx \int_0^x{f(u)} du$. I used this polynomial to re-write the integral as
$$ \int_0^1{ -m f(x) \left(p(x) \right)}^{m-1} dx $$
This integral approximation was incorrect, and far from what it should have been for different values of $m$. My error for $p(x)$ appeared to be very small.
I should note, that $f(x)$ represents a probability density function, and that the gradient of $f(x)$ as $x \to 0 $ is $\infty$. My approximation $p(x)$ is therefore an approximation of the corresponding cumulative density function.
Can someone explain why this approximation didn't work - if my approximation $p(x)$ has negligible error, would it have worked?