I am having some trouble with a particular integral that I would like to solve using Rubi https://rulebasedintegration.org/

Mathematica can return an analytic form of the integral but Rubi cannot. This seems odd as Rubi is supposedly an extension to Mathematica's symbolic rules for integrals.

Mathematica can return an analytic expression for the integral but Rubi just returns the Int function with the integrand unevaluated.

I list the integrand below and the integration is from t from -inf to inf, all other parameters are real numbers.

1/(γ σ) (Exp[-(Abs[2 t + δ]/σ) - Abs[-2 t + δ - 2 τ]/γ]
     UnitStep[t + δ/2]^2 UnitStep[t - δ/2 + τ]^2 - 
     2 Exp[-((σ Abs[-2 t + δ] + γ Abs[2 t + δ] + σ Abs[-2 t + δ - 2 τ] +
     γ Abs[2 t + δ + 2 τ])/(2 γ σ))] Cos[τ (-ω1 + ω2)] UnitStep[t - δ/2]
     UnitStep[t + δ/2] UnitStep[t - δ/2 + τ] UnitStep[t + δ/2 + τ] + 
     Exp[-(Abs[-2 t + δ]/γ) - Abs[2 t + δ + 2 τ]/σ]
     UnitStep[t - δ/2]^2 UnitStep[t + δ/2 + τ]^2)

2 Answers 2


According to the developer, Albert Rich, "To keep this already massive project at least theoretically finite in scope, I have limited it to rules for integrating certain general forms involving algebraic, elementary and a fixed set of special functions. That does not include non-analytic functions like the absolute value and Dirac-delta functions." [Source: personal communication.]

Hence I expect the step function was not included because it is non-analytic.

If you want to integrate using Rubi, you might try experimenting with this formulation for unit step, which was suggested in the comments by Ruslan:

 (x + Sqrt[x^2])/(2 x)

Since you are computing definite integrals, I would caution you that Rubi computes them by first determining the indefinite integral, substituting the upper and lower limits of integration, and subtracting. This is only guaranteed to be valid for integrands that are continuous on the closed interval between and including those limits.

  • $\begingroup$ To amplify the caution in the last paragraph about continuous integrands, the Question's integrand is discontinuous. For instance, at $(\delta, \gamma, \sigma, \tau, \omega_1, \omega_2) = (2,3,5,7,11,13)$, the integrand is discontinuous at $t = -1$ and at $t = 1$. $\endgroup$ Apr 13, 2020 at 14:47
  • 2
    $\begingroup$ I think (x + Sqrt[x^2])/(2 x) is a simpler form for the unit step function, and it has the advantage that its discontinuity line is straight in the complex plane (this function is equal to UnitStep[Re[x]]), unlike your expression with ArcTans, where discontinuity is curved. $\endgroup$
    – Ruslan
    Apr 13, 2020 at 19:38
  • $\begingroup$ Completely agree with @Ruslan . It is not even possible to compute Integrate[UnitStep[x] UnitStep[1 - x], {x, -\[Infinity], \[Infinity]}] with your parametrization. $\endgroup$
    – yarchik
    Apr 13, 2020 at 19:51
  • $\begingroup$ While the first part of the answer is useful in providing additional information on Rubi, the second part is misleading. $\endgroup$
    – yarchik
    Apr 13, 2020 at 19:52
  • $\begingroup$ @yarchik How and why would you recommend rewording it? $\endgroup$
    – theorist
    Apr 15, 2020 at 9:22

Rubi does not have rules for UnitStep. I just searched the whole source code of Rubi for UnitStep and it did not show up in any rule.

Int[UnitStep[t], t]

Mathematica graphics

Integrate[UnitStep[t], t]

Mathematica graphics

Rubi does not support Piecewise functions

f[t_] := Piecewise[{{0, t < 0}, {1, t >= 0}}]
Int[f[t], t]

Mathematica graphics

Integrate[f[t], t]

Mathematica graphics

You could ask Albert Rich, the Author of Rubi on this, he would know best why that is. He reads the Rubi-Gitter forum.

If you can reformulate the integral itself yourself to avoid UnitStep in the integrand then that is one possibility.


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.