# Defining functions with integrals

Is it okay to have a function $f(x)$ defined by $$f(x)=\int_0^x{x^2-x\,dx}\,?$$ If so, what would $f'(x)$ be?

I've seen many questions like these on my math competitions (they give functions defined by integrals and both the limits of the integral and the integrand contain the same variable, as in the example above) and it seems like they do have a/n (numerical) answer, and they accept the answer as correct, although people are able to dispute why it shouldn't be okay to have such function.

• just another nitpicky remark, $\int f(x) - g(x)\,dx$ should be denoted as $\int (f(x)-g(x))\,dx$ simply for the sake of clarity. Most people will understand your intent, however it's best to be as clear as possible. – Dando18 Jul 15 '17 at 6:04
• @Dando18: I never understood that particular nitpicking point on clarity. What could it possibly mean other than that that writing parentheses would "clarify" it? – Mehrdad Jul 15 '17 at 8:29
• @Mehrdad: Playing devil's advocate... we spend a lot of time training our spatial recognition to automatically parse arithmetic expressions, and we spend a lot of time training ourselves to read parentheses as delimiters. We spend comparatively little time training ourselves to read $\int \ldots \mathrm{d}x$ as delimiters. $\int f(x) - g(x) \, dx$ is simply harder to read than $\int(f(x) - g(x)) \, dx$, since it conflicts with our training. That the intent is unambiguous doesn't change that fact. – Hurkyl Jul 15 '17 at 9:08
• @Mehrdad I know this context is single variable, but just as an aside I've often seen $\int_C \vec{f}\,d\vec{r}$ written as $\int_C u(x,y)dx + v(x,y)dy$, which in some cases can be confusing without proper parenthesis. – Dando18 Jul 15 '17 at 13:16
• I think I'm the only one that has more problem with the use of $x$ as a dummy variable than no parentheses. – Shashi Jul 15 '17 at 15:46

Writing $\int_0^x f(x)\,dx$ is the same as $\int_0^x f(t)\,dt$. However, the former is much more ambiguous and should be avoided for sake of clarity.

This means the derivative would be,

$$\frac{d}{dx}\left[ \int_0^x (x^2-x)\,dx \right] = \frac{d}{dx}\left[ \int_0^x (t^2-t)\,dt \right] = x^2 - x$$

• $\int_0^xf(x)~\mathrm dx=\int_0^xf(t)~\mathrm dt$ is quite a bad habit, and it will become especially ambiguous when your integrals contain multiple variables. – Simply Beautiful Art Jul 15 '17 at 23:12

Let $\phi$ be a continuous, real-valued function defined in some neighborhood of $0$. Writing $$f(x) = \int_{0}^{x} \phi(x)\, dx$$ is bad syntax: it uses the single letter $x$ for both

• The input value of the function $f$;

• The dummy variable of integration.

Setting $x = 2$, for example, invites the reader to ponder the meaning of $$f(2) = \int_{0}^{2} \phi(2)\, d2,$$ which is almost surely not intended. (The problem is "$d2$".)

Strictly speaking, "no", it is not okay to have a function $f$ defined by $$f(x) = \int_{0}^{x} (x^{2} - x)\, dx.$$

By contrast, equations such as $$g(x) = \int_{0}^{x} \phi(t)\, dt,\qquad h(x) = \int_{0}^{x} (x - t)\phi(t)\, dt,$$ do properly define functions. Note carefully that in the defintion of $h$, the input value $x$ appears in the integrand but is not the variable of integration.

The fundamental theorem of calculus gives $$g'(x) = \phi(x),\qquad h'(x) = \int_{0}^{x} \phi(t)\, dt = g(x).$$ The second is an edifying exercise; to give a proof, it may help to write $$h(x) = \int_{0}^{x} (x\phi(t) - t\phi(t))\, dt = x\int_{0}^{x} \phi(t)\, dt - \int_{0}^{x} t\phi(t))\, dt = xg(x) - \int_{0}^{x} t\phi(t)\, dt.$$

It is just a basic property,

$$I=\int_{0}^{t}f(x)dx$$

Differentiating

$$I'=f(t)$$

$$f(x)=\int_{0}^{x}x^2-xdx$$

Note that t is a variable

Differentiating w.r.t x

$$f'(x)=x^2-x$$

Reasoning is

$$f(x)=[\frac{x^3}{3}-\frac{x^2}{2}]_{0}^{x}$$

$$f(x)=\frac{x^3}{3}-\frac{x^2}{2}$$

$$f'(x)=x^2-x$$

A function like this is OK, but can be simplified due to the fundamental theorem of calculus. If $G(x)$ is the antiderivative of $g(x)$: $$f(x)=\int_0^xg(x)\,dx=[G(x)]_0^x=G(x)-G(0)$$ $$f'(x)=(G(x))'-(G(0))'=g(x)$$ Similar derivations can be made for domains of integration other than $[0,x]$.

• Especially if the upper bound is, say, $\sqrt{x}$, then $f'(x) = (G(\sqrt{x}))' - (G(0))' = g(\sqrt{x})\cdot\frac{1}{2\sqrt{x}}$. – ComFreek Jul 15 '17 at 9:11

The variable of integral $x$ and the upper bound of integral are different. They arent the same. Since we have by integration property that $\int _a^b f (x)dx=\int _a^bf (t)dt$ we can write it that way though some people find it wrong. Also a case is possible where both the limit of integral and the variable are same like for example. $\int_0 ^x x^2f (t)dt$ then both the x are the same as the variable of integral is t and not x and we can pull it out from the integral operator. As for the part of $f'(x)$ we have a well known theorem ie Newton Leibnitz theorem or Fundamental theorem of calculus which says that if $f (x)= \int _{h(x)}^{g (x)}k (t)dt$ then $f'(x)=k (g (x)).g'(x)-k (h (x).h'(x)$

I'm going to say "no, it is not okay". As you will eventually find out, you can have integrals such as

$$\int_0^x3x^2+y~\mathrm dy$$

Which should evaluate to $3x^3+\frac12x^2$ (feel free to work it out yourself)

Such integrals appear very often in multivariable calculus, and the above integral was probably part of a larger problem:

$$\int_0^1\int_0^x3x^2+y~\mathrm dy~\mathrm dx$$

Particularly, surface integrals tend to be integrals involving multiple variables, often related to one another. The above example comes from the following integral:

$$\iint_{0<y<x<1}(3x^2+y)~\mathrm dA$$

So when you've come to problems like these, it will become extremely unclear which variables refer to what and what things mean if you don't name your variables properly. Note that unlike most of the other answers, in the first integral of my answer, the $x$ in the upper bound and the $x$ inside the integral are one and the same!

So overcome your bad habits soon and use your variables correctly, as any assumptions you make about how you can name your variables will one day bite you back!