This comes from Calculus by Michael Spivak, 3rd ed., chapter 14, Problem 11.

> 
> 11. Find $F'(x)$ if $F(x) = \int\_0^x xf(t)dt$. The answer is *not* $xf(x)$; you should perform an obvious manipulation on the integral before trying to find $F'$.)
> 
> 
> 

Here, Spivak fails to include the assumption that $f$ is continuous.

With this assumption, the answer is $\int\_0^xf(t)dt + xf(x)$, and is solved [here](https://math.stackexchange.com/a/1787756/754927), [here](https://math.stackexchange.com/a/1787756/754927), and [here](https://math.stackexchange.com/a/650033/754927).

I understand the solution. I was able to do it myself. It makes sense to me. I also solved it using the $\lim\_{h\to 0}$ approach, and that worked too.

Yet, naively, it *seems* like the answer should be $xf(x)$. It *seems* like since $x$ "behaves like a constant" in that integration, and because $f$ is continuous, then $xf$ must also be continuous, and so $F'(c) = cf(c)$.

I'm hoping to build better intuition about why this is wrong.

I was thinking perhaps one way of looking at it is that $xf$ cannot be assumed to be continuous because we are free to change the value of $x$ somewhat arbitrarily. In fact, at any fixed point $c$, $xf(c)$ varies with $x$, so certainly we cannot guarantee anything about the value of $xf(t)$ simply by restricting $t$ to certain values.

Does this make any sense? I'm sorry to use such sloppy reasoning/language/arguments.

There's a good chance I just don't yet have the tools to fully "get it" yet, but I appreciate any insight you might be able to share.

**Edit**

Ian's answer helps explain something that confused me in Spivak's solution to a later problem.

The next two problems are:

> 
> 12. Prove that if $f$ is continuous, then
> $$\int\_0^xf(u)(x-u)du = \int\_0^x\left(\int\_0^uf(t)dt\right)du.$$
> Hint: Differentiate both sides, making use of Problem 11.
> 
> 
> 

> 
> 13. Use Problem 12 to prove that  
> 
> $$\int\_0^xf(u)(x-u)^2du = 2\int\_0^x\left(\int\_0^{u\_2}\left(\int\_0^{u\_1}f(t)dt\right)du\_1\right)du\_2.$$
> 
> 
> 

These each require fairly straightforward calculations, the details of which we can skip here. However, in the published Answer Book solution for the latter, problem 13, Spivak does something that initially I found baffling. He begins:

> 
> Applying Problem 12 to $g(u) = f(u)(x-u)$, we obtain
> $$\int\_0^xf(u)(x-u)^2du =\int\_0^x[f(u)(x-u)](x-u)du$$
> $$=\int\_0^x\left(\int\_0^uf(t)(x-t)dt\right)du$$
> 
> 
> 

This substitution is misleading. The result he's using from problem 12. applies only to functions that do *not* depend on $x$, while Spivak's $g$ here clearly *does* depend on $x$.

I think he gets away with it here only because $\frac{\partial}{\partial x}[f(u)(x-u)] = f(u).$