# Strange Integrate behavior (a bug!)

The following two calculations should give the same result. After all, integration is a linear operation.

I have pasted the code below in case you want to play with it.

Integrate[Integrate[v[x], x] -
Integrate[Integrate[v[x], x] * u'[x], x]/u[x], x]

Integrate[Integrate[v[x], x], x] -
Integrate[Integrate[Integrate[v[x], x] * u'[x], x]/u[x], x]

-
if i plug in example functions for v,u I get the same result (not zero) – george2079 Nov 15 '13 at 20:52
Should I tag this question as "bug"? – Hector Nov 16 '13 at 14:36
@Hector No, every integration is defined up to an additive constant. Therefore answer is defined up to a nontrivial function. – ybeltukov Nov 16 '13 at 14:48
@Hector Indeed. Most likely Mathematica think that Integrate[v[x], x] is a constant (i.e. bug). – ybeltukov Nov 16 '13 at 15:45
Simpler example illustrating @ybeltukov's comment: Integrate[Integrate[Integrate[v[x], x] * Derivative[1][u][x], x] - Integrate[v[x], x] * Integrate[Derivative[1][u][x], x], x] evaluates to zero. Note that it does not evaluate to zero if the outside Integrate is removed. – Michael E2 Nov 17 '13 at 15:44