When inputing

Integrate[HeavisideTheta[s - t], {s, 0, 1}, Assumptions -> {t > 0}]

Mathematica correctly simplifies if to

-(-1 + t) HeavisideTheta[1 - t]

even though I did not explicitly ask it to Simplify. However, if I include an undefined function of the variable integrated over, x[s], Mathematica returns a wrong (or, rather, incomplete) result:

Integrate[HeavisideTheta[s - t] x[s], {s, 0, 1},  Assumptions -> {t > 0}]

ConditionalExpression[0, t > 1]

Is there any way to fix this, e.g. leaving the expression unsimplified in the cases where indeed no simplifications can be made a priori?

  • $\begingroup$ Can you explain what answer you expect to see? $\endgroup$
    – bill s
    Commented Aug 22, 2019 at 3:26
  • $\begingroup$ It would be enough to leave it unevaluated, in such a way that if I then assign the function x[s] and Simplify I get the correct result. $\endgroup$
    – sdnnds
    Commented Aug 22, 2019 at 12:20

1 Answer 1


One approach is to define your integral as a function, which you can then call with your desired x[s]:

myHeavy[x_] := Integrate[HeavisideTheta[s - t] x, {s, 0, 1}, Assumptions -> {t > 0}];

Now, when you want to call this with a function x[s] = s^2, you evaluate


To evaluate with Sin[s]


These seem to return plausible answers.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.