So I understand what to do if I have $\frac{d}{dx} \int_a^b f(x)dx$ for some function $f$.
But if I have $\frac{d}{dx} \int f(x)dx$ - an indefinite integral -the derivative and the integral cancel each other out, and I just have the function: is that right?
And if I have the $\int \frac{d}{dx} f(x)dx$ - it is just the function as well, correct?
Thanks
Not quite. The arbitrary constant from integration changes it up. Explicitly,
$$\frac{d}{dx} \int f(x)dx = f(x)$$
$$\int \left( \frac{d}{dx} f(x) \right) dx = f(x) + C$$
An example will be illustrative in finding the anomaly if it's not obvious. Let $f(x) = x^2$. We know $\int f(x)dx = x^3/3 + C$, $f'(x) = 2x$, and, obviously, the derivative of a constant $C$ is $0$.
Then
$$\frac{d}{dx} \int f(x)dx = \frac{d}{dx} \int x^2dx = \frac{d}{dx} \left( \frac{x^3}{3} + C \right) = \frac{3x^2}{3} + 0 = x^2 = f(x)$$
but
$$\int \left( \frac{d}{dx} f(x) \right) dx = \int \left( \frac{d}{dx} x^2 \right) dx = \int 2xdx = \frac{2x^2}{2} + C = x^2 + C = f(x) + C$$