Reducing or simplifying the **symbolic** product of two integrals

3 views (last 30 days)
I wish using the Symbolic toolbox to guide me in rather simple but tedious work. Part of the formulae I deal with includes the square of a generic integral (or the product of two integrals):
syms t xi h(t) a = int(h(xi), xi, 0, t) pretty(a*a)
QUESTION: Is there any command that I can use to have MATLAB deriving the following expansion (where eta is a symbolic variable of course)
int(int(h(xi), xi, 0, t) * h(eta), eta, 0, t)
i.e., automatically recognising that the product of the above integrals is the double/iterated integral of the product??
That would simplify greatly my life! Without it I am frustrated and resorted to paper and pen: I must in fact anyway evaluate the expected value of the generic quantities h(xi) as random variables and having MATLAB just simplifying the expression a tiny bit would have helped.
Tnx!

Answers (1)

Christopher Creutzig
Christopher Creutzig on 4 Sep 2014
What simplify currently cannot do is to rename your bound variable eta to xi at the right time. You may need to explicitly tell it to do so; assuming you only have eta as a bound variable (such that it can be renamed at will wherever it appears), the following may help:
>> syms h(xi) eta t
>> a = int(h(xi), xi, 0, t)^2 - int(int(h(xi), xi, 0, t) * h(eta), eta, 0, t);
>> subs(expand(a), eta, xi)
ans =
0

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!