Equivalence between two definitions of an antiderivative. I have been taught two definitions of indefinite integral.

Definition 1: For a function $f : [a,b] \to \mathbb{R}$, we call a differentiable function $F : [a,b] \to \mathbb{R}$ an
anti-derivative of $f$ if and only if $F'(x) = f(x)$ for all $x \in [a,b]$
Definition 2: For a Riemann integrable function $f$ on $[a,b]$, a function $F: [a,b] \to \mathbb{R}$ defined as $F(x) = \displaystyle
 \int_a^x f(t) \, \mathrm{d}t$ is called an antiderivative of $f$. And
the set $\{F(x)+ C : C \in \mathbb{R} \}$ is called the indefinite
integral of $f$

Sadly, I have always taken these two definitions for granted and assumed they were somehow equivalent without actually delving into them too much. But now that I'm going through my books all over again, I notice that these definitions aren't quite equivalent. For instance, the antiderivative in definition $1$ is assumed to be a differentiable function while in definition $2$, it may not be differentiable (unless my integrand $f$ is continuous).
My question is — What conditions are missing from one definition that when added to it would make it equivalent to the other and vice versa. For an example, if my integrand $f$ was a continuous function, I could see the definitions being equivalent though I'm not sure, frankly. But sticking to just continuous functions would kill all the fun. I'm looking for something more general, if at all there is something more general. Any help is appreciated, thank you.
 A: If you switch from Riemann to Henstock-Kurzweil integration, they are practically equivalent: If $f$ has an antiderivative, that antiderivative is always an indefinite integral.
Going the other way, $F(x) = \int_a^x f(t)\,dt$ is always differentiable, and $F' = f$ almost everywhere. I.e., for any $\epsilon > 0$, the set $\{x \mid F'(x) \ne f(x)\}$ can be covered by a collection of intervals whose total length is $< \epsilon$. The thing is, two functions $f_1$ and $f_2$ can differ in ways that have no effect on integration - for example, when $f_1(x) = f_2(x)$ for $x \ne 0$, but $f_1(0) = 0$ and $f_2(0) = 1$. This does not affect the definition of integration, but the derivative of that indefinite integral is well-defined. It cannot be both values at $0$. So at most one of $f_1$ and $f_2$ can be the derivative (or maybe the derivative has some other value, or the functions suddenly change directions at $0$, so the derivative does not exist).
In other words, if you limit yourself to only integrands $f$ that are the derivative of some function, and if you loosen up the definition of integration just a little to allow all such $f$ to be integrable, then indeed $$\int F'(x)\,dx = F(x) + C$$ is always true.

Added:
Perhaps the simplest example to show what goes wrong with the Riemann integral is $$f(x) = \dfrac 1{\sqrt{|x|}}, x \ne 0; f(0) = 0$$
If we define the function $$F(x) = \begin{cases}-2\sqrt{-x},&x < 0\\2\sqrt x, &x \ge 0\end{cases}$$
Then $F'(x) = f(x)$ everywhere except at $x = 0$, where $F'$ doesn't exist. But integration is not affected by the values at single points, so it should be reasonable to say for general $a,b\in \Bbb R$ that $$\int_a^bf(x)\,dx = F(b) - F(a)$$
But if we look at the definition of the Riemann integral when $a < 0 < b$ we run into a problem. For the integral to exist there has to be an $L$ such that for every $\epsilon > 0$, there is a $\delta > 0$ for which all tagged partitions $P = (\{x_i\}_{i=0}^n, \{t_i\}_{i=1}^n)$ of $[a,b]$ with $|P| = \max_i (x_i - x_{i-1}) < \delta$ satisfy $$\left|\sum_{i=1}^n f(t_i)(x_i-x_{i-1}) - L\right| < \epsilon$$
But for any given delta, we can create a partition P all of whose $x_i$ are equally spaced at widths of $\frac \delta 2$, with possibly one undersized exception that we'll place well-away from $0$. Choose an arbitrary $t_i$ from each sub-interval, and we have a tagged partition with $|P| < \delta$. However, one of those sub-intervals has to contain $0$: $0 \in [x_{k-1}, x_k]$. Because $f(x)$ is unbounded around $0$, the tag $t_k$ can be chosen to make $f(t_k)$ as large as you like. The summation term $f(t_k)(x_k - x_{k-1}) = f(t_k)\frac \delta 2$ can be so large it dwarfs the sum of all the other terms and $L$ as well. $\left|\sum_{i=1}^n f(t_i)(x_i-x_{i-1}) - L\right|$ will not be less than $\epsilon$. The Riemann integral of $f(x)$ over $[a, b]$ does not exist when $0 \in [a,b]$.
Of course this particular example has a well-known work-around: improper Riemann integration. You define the integration away from $0$, then take limits to extend it to $0$. That is fine when you have one isolated problem point such as here. It is even fine when you have any finite number of problem points, as you can deal with each separately. But when the problem points become infinite within a bounded region, it is not fine anymore. It is no longer possible to handle them separately.
Henstock-Kurzweil takes a different approach. The problem in the Riemann integral occurs because it wants a one-size-fits-all solution $\delta$, without paying attention to regional situations (yes, bad governance occurs in mathematics, not just real life). Instead Henstock-Kurzweil pick a function $\delta(x) > 0$, not a constant value. Their condition on allowable partitions is $$t_i - \delta(t_i) \le x_{i-1} \le t_i \le x_i \le t_i + \delta(t_i)\text{ for all }i$$
By choosing $\delta(x)$ to approach $0$ fast enough as $x \to 0$, whatever tags near $0$ are chosen, you can force them to be in small enough subintervals that $f(t_k)(x_k - x_{k-1})$ can no longer be chosen as large as desired, but in fact will contribute only a reasonable amount to the Riemann sum. ($\delta(x)$ is not required to be continuous, so $\lim_{x\to 0}\delta(x)$ can be $0$ while $\delta(0) > 0$. And since $f(0) = 0$, if $0$ is chosen as a tag, we get no contribution to the Riemann sum regardless of the size of $\delta(0)$.)
Thus $f(x)$ is Henstock-Kurzweil integrable around $0$, though it is not Riemann integrable. An unbounded function does not require an improper Henstock-Kurzweil integral. Improper integrals are only needed for infinite limits of integration.
