Avoid error in the following symbolic integration?

I have attached a code in short0.nb that produces an erroneous result - see colour comments in the file. The error is in the integration of the function curr[t] between t and t+T, see the line with the defined variable avcurr. When this calculation is split into two parts in the same document, it is done correctly. When it is done independently and - importantly - on another notebook, see attached test.nb, then the results is correct again. Any ideas?

short0.nb (23.5 KB)
test.nb (3.44 KB)

Your avcurr contains a term proportional to t . See attached notebook, Out[26]

short0.1.nb (30.4 KB)

of course, this is that very error I was talking about, it should not contain that term. If you look at the test.nb where the same calculation is done starting immediately from curt[t], the correct result is obtained without the t. I have no idea why this happens. That is precisely my question.

  • sorry, may be I misunderstood your answer, then , please, explain.

also, if you look down the same notebook where you added your command, I split the function curr[t] into two parts and performed the same calculation for each of them. There is not term with t in there at all! The result is correct this way. Weird!

Interesting. I don’t know what happens. But if I change the names of variables in the integration both terms are equal. See notebook at the very end.

short0.1.nb (40.1 KB)

Thanks, Hans. I have asked somebody in Mathematica to have a look. When they come back to me, I’ll let everybody know.