3
$\begingroup$

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?

$\endgroup$
  • $\begingroup$ Can you explain what answer you expect to see? $\endgroup$ – bill s Aug 22 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 Aug 22 at 12:20
1
$\begingroup$

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

myHeavy[s^2]

To evaluate with Sin[s]

myHeavy[Sin[s]]

These seem to return plausible answers.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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