# If two integrals are equal, then the functions are the same

Assume that we have two continuous functions $f(x)$ and $g(x)$. If the integrals $\int_{x_1}^{x_2}f dx$ and $\int_{x_1}^{x_2}g dx$ are the same for any choice of $x_1$ and $x_2$, then the functions are also the same?

My attempt: I fix $x_1$ and let $x_2$ vary. Then I take the derivative of both integrals. It sounds right. I am missing something? Any better solution?

• I think you are right. – spaceisdarkgreen Jun 30 '17 at 21:16
• Yes, that's basically the fundamental theorem of calculus. – fleablood Jun 30 '17 at 21:19
• Thanks guys for the help! – Majid Jun 30 '17 at 21:24

Fundamental theorem of calculus: Let $a<b$ and let $f$ be a continuous (real valued) function on $\lbrack a,b\rbrack\subset \mathbb{R}$. Then, $\forall x\in (a,b)$, we have $$f(x)=\dfrac{\mathrm{d}}{\mathrm{d}x}\int_a^x f(t)\;\mathrm{d}t.$$
As an application of this theorem for your problem, since $f$ and $g$ are continuous on $\mathbb{R}$, you can fix $a\in\mathbb{R}$ and choose any $a<x$. You then have $$\int_a^x f(t)\;\mathrm{d}t=\int_a^x g(t)\;\mathrm{d}t$$ by hypothesis (and this is for any $x\in\mathbb{R}$). Differentiating both sides gives $f(x)=g(x)$ for any $x\in\mathbb{R}$. Thus, $f=g$, as requested.