This is related to the question (Integrate many simple terms fast) I had before, where Nasser gave me an answer which worked 'most of the time' but not always. Context: Map[Integrate[#,x]&,Expand@func[x]] works much faster for func[x] a huge sum of easy to integrate terms than just using Integrate.
There is one problem though: This cannot handle single terms, that is terms like: x^2 or E^x x^20. It needs to have at least one sum/difference in it, like x^2+1.
Is there a way to either Check if my expression is of the form 'a single term' (NOT atomic, since x^2 is not atomic)
or a work-around of this problem? (adding and subtracting e.g. 1 does not work, as Mathematica will cancel them.)
NOTE: adding {} around Expand@func[x] is NOT a viable solution, since this eliminates the whole reason for Map in the first place: Speeding up calculations. Adding {} will make it treat as one whole expression rather than each one separately, as intended.
Distribute does not speed up the calculation (as tested).

*otherwise, will not. For all other input, normal Integrate is called. There is nothing special about wrapper function. It just makes it easier to call Integrate from everywhere so caller does not have to check themselves and it is all done inside one function, the wrapper. – Nasser Jan 18 '24 at 22:15Distributedoes not really work. It does the integration first, then it Distribute. Which is not what you want. You want to distribute integrate BEFORE it does the integration. So Map is what you want to use. – Nasser Jan 18 '24 at 22:36