Expressing a indefinite integral using a definite integral with the same function I was wondering how we can express a indefinite integral $\int f(x) \, dx$ with the function $F(x) = \int_a^x f(t)\,dt$.
I was experimenting with some functions, for example, if $f(x) = 3x^2$, then
\begin{equation}
\int f(x) \, dx = \int 3x^2 \, dx = x^3 + C.
\end{equation}
On the other hand,
\begin{equation}
F(x) = \int_a^x f(t) \, dt = \int_a^x 3t^2 \, dt = [t^3]^x_a = x^3 - a^3.
\end{equation}
That means what $F(x)$ and $\int f(x) \,dx$ differs is only by a constant.
I was wondering if there is a proof for $F(x) + C = \int f(t)\,dt$ and the proof works for integrals that do not cannot be expressed as an elementary function (e.g. the error function (maybe))
P.S. I was thinking if this has to do with the derivatives of $F$ and integral of $f$, but if there is no upper and lower limit in the indefinite integral, we cannot use FTC. That's why I do not know how to proceed.
Thanks you!
Edit: Yes. I have forgotten to mention that $f$ should be a continuous function, in order to make things more neat and to apply FTC. However, I very much thank you all for the responses, especially those who talked about discontinuous functions as well. Cheers.
 A: Here is the full Monty, i.e., the overly pedantic answer to the question extracted from the discussion with @ParamanandSingh whose comments point us in the right direction.
The trouble with calculus courses and textbooks (as opposed to real analyis courses and textbooks) is that the goal is to get the students able to work computationally with derivatives and integrals without necessarily a thorough understanding of what they are doing or what the rigorous foundations really are.
Here are some details that should be known relative to this question.

*

*If  $f:(a,b)\to \mathbb R$ is a function defined on an open interval  $(a,b)$  then the statement
$$\int  f(x)\,dx = F(x) + C $$
means that   $F'(x)=f(x) $  for all  $x $  in the open interval  $(a,b)$  and that $C$ represents an arbitrary constant.

If this is true then  $f$ is said to be a derivative on $ (a,b) $  and  $F$ is said to be its primitive (or its antiderivative or an indefinite integral).
It is essential that the interval in question is mentioned.  Calculus textbooks seldom do however.  Calculus questions and answers seldom do.


*The Fundamental Theorem of the Calculus (FTC)  as it is usually taught
asserts that if   $f:(a,b)\to \mathbb R$ is continuous at every point of the open interval $ (a,b) $ then
(i)    $f$  is indeed a derivative on  $(a,b)$.
(ii)   $f$ is Riemann integrable on any interval  $[s,t]\subset (a,b)$.
(ii)    Pick any  $a<c<b$  and then the function
$$      F(x) = \int_c^x f(t)\,dt   \tag{1}$$
is a primitive for   $f$  on the interval $ (a,b)$.  Here the integral is interpreted in the Riemann sense.


*This formula (1)  always gives a primitive for a continuous  $f$ but in special cases, as every calculus student discovers, there are techniques (integration by parts, by substitution, etc.)  that allow you to write an explicit formula for   $F(x)$.   Those techniques can fail even for very simple functions $f$.   That doesn't mean there is no primitive or indefinite integral, it just means that (1) or some series or limit etc. will be your only choice for a formula.


*This formula (1)  offers a constructive method (the method of Riemann integration) for determing a primitive from a continuous function.   In theory then we always can work with primitives of continuous functions, even if no series or formula etc. is availble.


*Now let's drop continuity.   A function  $f:(a,b)\to \mathbb R$ is given.  How will we know it is a derivative, i.e., how will we know if it has an indefinite integral on this interval?
Maybe, with luck you can construct a function   $F(x) $  and check at each point that   $F'(x)=f(x)$.
If not then maybe look for some other properties that   $f$ has that will imply it is a derivative.    The problem in this generality has no current satisfactory solution.   There are special cases, but even these are not elementary.
So leaving the world of continuous functions the general problem of determining conditions under which a function is or is not a derivative is not elementary and not particularly accessible.


*Let us suppose, however, that we do discover that   $f$ is a derivative on  $(a,b)$,  but we do not have a procedure yet to find its primitive.  We know a primitive exists here but how to   express it?

Can we still write
$$     \int f(x)\,dx  = \int_c^x f(t)\,dt  + C ?   \tag{2}$$
(i)  If   $f $  is known to be a derivative on $(a,b)$ and if  $f $ is Riemann integrable
on each interval   $[s,t]\subset (a,b)$  then  (2)  is valid.  (Easy calculus proof.)
(ii)  If   $f$   is known to be a derivative on $(a,b)$ and if  $f $ is  Lebesgue integrable
on each interval  $ [s,t]\subset (a,b) $ then  (2)  is valid.  (Real analysis level proof.)
(iii)   If   $f$   is known to be a derivative on $(a,b)$  then $ f$  must be   Denjoy-Perron-Henstock-Kurzweil integrable
on each interval   $[s,t]\subset (a,b)$  and (2)  is valid.  (Real analysis level proof.)
In case (i) there is a simple constructive process (due to Cauchy and Riemann)  for finding  a primitive   from $f$.
In case (ii) there is the constructive method of Lebesgue for   finding a primitive from $f$.
In case (iii)  the methods of Perron and Henstock-Kurzweil are not constructive.   The method of Denjoy is constructive but it is way too sophisticated to even sketch here.
Short answer:  For continuous functions FTC does all the work and the story is very nice and straightforward.  For discontinuous functions---a real can of worms.
