11 hours later…
16:05
@Allure
Assuming
just creates a local environment where $Assumptions
is set. So it basically works as if you would set $Assumptions
globally for this call and I guess it's not only used for the integration itself but also for intermediate simplification steps. So one explanation "could" be that the Assumption
option of Integrate
is only used for certain integration steps.
2 hours later…
17:52
Assuming[k \[Element] Integers, Integrate[Sin[k x], {x, 0, 2 Pi}]] // AbsoluteTiming {0.155795, 0} Assuming[k \[Element] Integers, Simplify@#] &@Integrate[Sin[k x], {x, 0, 2 Pi}] // AbsoluteTiming {0.00918, 0}
18:24
@b3m2a1 Yes, I'd expect that. In your first example, the assumption needs to be taken into account on each step in the integration while it's only used to simplify the result in your second case. What I wanted to suggest is that probably
Integrate
does intermediate simplification steps along the way of integration and it appears that for these steps the settings of the Assumption option is not used. « first day (3214 days earlier) ← previous day next day → last day (1568 days later) »