1
$\begingroup$

With sufficiently complicated integrands, Rubi often leaves integrals in the form

Subst[Int[expr1, x], x, expr2]

where x is the integration variable. I have been unable to find documentation for what Subst actually does: I assume it stands for a substitution of the form x->expr2, but I would like to 'undo' it, and to do that I would need to understand it better. Does it eg. mean that the substitution has already been made in expr1 (if not, my problem would basically be solved, since I could just get expr1 out of this form)?

What I'm after for is a function undoSubst such that, for expr3 for which Int[expr3,x] is of the form of Subst[...], I can call undoSubst[Subst[...]] and have it return expr3.

$\endgroup$
4
  • 2
    $\begingroup$ Could you give an actual example of an integral that gives rise to this output? $\endgroup$
    – MarcoB
    Commented Apr 27, 2023 at 15:28
  • $\begingroup$ It is not clear what you are trying to do as you did not give an example. It looks like parsing of Rubi ouput? this recreational-challenge-best-looking-output-for-rubi-integration-steps question has good info on Subst. If you are looking for an internal function to modify Rubi's output may be you can ask at Rubi forum as the Author Albert Rich reads that. He might be able to help better on this. $\endgroup$
    – Nasser
    Commented Apr 27, 2023 at 15:29
  • $\begingroup$ If you run ??Subst you will get at least a basic idea: "Subst[u,x,v] returns u with all nondummy occurrences of x replaced by v and resulting constant terms replaced by 0." You will also see the code for Subst, which might help. $\endgroup$
    – MarcoB
    Commented Apr 27, 2023 at 15:31
  • 1
    $\begingroup$ @MarcoB here is an example showing Subst Steps[Int[Sin[x]/Sqrt[1 + x], x]] after loading Rubi. The steps with Subst on them are now displayed on the console window. $\endgroup$
    – Nasser
    Commented Apr 27, 2023 at 15:31

1 Answer 1

1
$\begingroup$

Apologies for being too vague --- I managed to reverse-engineer the behaviour of Subst enough by finding a sufficiently simple integrand for which the result involves a Subst and as such have an answer to my own question.

If intres is of the form Subs[Int[a,x],x,b], then

(#[[1]][[1]] /. {#[[2]] -> #[[3]]})*(intres /. Thread[Variables@intres -> 1])* D[#[[3]], #[[2]]] &[((intres)/(intres /. Thread[Variables@intres -> 1]))]

appears to return the original integrand that can then be integrated numerically, which is what was my motivation for doing this. I confirmed this numerically with the integrand ArcSin[Sqrt[x] - Sqrt[1 + x]].

Notably, this behaviour, eg the inclusion of the Jacobian factor, is not how I would have interpreted the result of Subst's ??-query posted in the comments.

$\endgroup$

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.