Are the definite and indefinite integrals actually two different things? Where is the flaw in my understanding?

The point is, there are three slightly different concepts here:

1) If $f$ and $F$ are functions with the same domain, and $F'(x)=f(x)$ on that domain, then we say that $F$ is an antiderivative of $f$.

2) If $f$ is a function on the interval $a \le x \le b$, then the definite integral of $f$, $\int_a^b f(x) \, dx$, is (loosely speaking) the area under the graph of $y=f(x)$ for $a \le x \le b$, or (more precisely speaking) a limit of Riemann sums. This definition does not involve any derivatives.

3) If $f$ is a function on the interval $a < x < b$ and $c$ is a point in that interval, then the function $G(x)=\int_c^x f(t) \, dt$ could be called an indefinite integral of $f$. This definition of the function $G$ comes directly from the definition in 2) of the definite integral, so it also does not involve any derivatives.

You are saying that you don't see any difference between 2) and 3). You are correct! If your mental definition of "indefinite integral" is 3), then an indefinite integral is just a definite integral with some unknown limits.

The question you're linking is saying that many calculus books use 1) as the definition of an "indefinite integral": that is, they say that if $F$ is an antiderivative of $f$, then $\int f(x) \, dx = F(x)+C$ is the indefinite integral of $f$. They can get away with this because of the fundamental theorem of calculus, which says (in part) that

$$ \frac{d}{dx}\int_c^x f(t) \, dt=f(x) \, . $$

That is, the function $G(x)$ defined in 3) is an antiderivative of the function $f$, so these two notions of "indefinite integral" are closely related.

But closely related does not mean identical! K B Dave's answer is giving you some examples of situations where the two definitions 1) and 3) diverge slightly. Specifically:

  • We gave the definition 3) on an interval $a < x < b$, but it doesn't work very well on a more complicated domain. This means that definition 1) is more robust when $f$ has singularities.
  • The fundamental theorem of calculus says that every "indefinite integral" in the sense of 3) is an antiderivative. It does not say that every antiderivative is an indefinite integral, which in fact is false; you can have functions $f$ and $F$ where $F'(x)=f(x)$, but there is no way to write $F(x)=\int_c^x f(t) \, dt$.

$\DeclareMathOperator{\dom}{dom}$

"Reasonable" functions $f$ can have antiderivatives $D^{-1}f$ that are not of the form $x\mapsto \int_{a}^xf(t)\mathrm{d}t$ for any $a$ in the domain of $f$.

  1. Let $U=(-\infty,0)\cup(0,\infty)$, and consider $$\begin{align} f&: U\to\mathbb{R} & x&\mapsto \frac{1}{x}\text{.} \end{align}$$ Then $$D^{-1}f(x)=\begin{cases} \ln(-x)+C_- & x < 0\\ \ln(x) + C_+ & x > 0 \end{cases}$$ where $C_-$ and $C_+$ can differ—because the domain is not path-connected, there is no way to integrate from positive $x$ to negative $x$.
  2. Consider $$\begin{align} f&:\mathbb{R}\to \mathbb{R} & x&\mapsto \frac{1}{1+x^2}\text{.} \end{align}$$ Then $$\int_a^xf(t)\mathrm{d}t=\arctan x - \arctan a$$ but $$D^{-1}f(x)=\arctan x + C\text{;}$$ since the magnitude of $\arctan a$ is bounded by $\pi/2$, if $\lvert C \rvert \geq \pi/2$ then $D^{-1}f(x)$ is not of the form $\int_a^xf(t)\mathrm{d}t$.