# [Maxima] Arguments of operatorp

Robert Dodier robert.dodier at gmail.com
Fri Jun 22 00:08:00 CDT 2012

```On 2012-06-21, Jérome Laurens <jerome.laurens at u-bourgogne.fr> wrote:

> - Fubini
> - integration by parts on unbounded domains
> - change of variables in 2D
> for the soft side, and for the hard side
> Given an expression of the form
> integrate(f*g,...)
> change g according to f and the integral bounds.
>
> Of course, this must apply to subexpressions of bigger ones.

As mentioned elsewhere, you can use defrule, apply1, etc. for problems
like these. You could define one rule per transformation and then for
some expression containing integrals: apply1(expr, r1, r2, r3, ...)
where r1, r2, r3, ... are the rules you defined.

Here is an attempt at applying Fubini's theorem. I've used integrate2
as the operator in expressions to represent 2-dimensional integrals
since Maxima only recognizes integrals over intervals and complains
about anything else. Probably you want some other representation for
multidimensional integrals; I didn't think about it too much.

(%i1) matchdeclare (integrand, all);
(%o1)                                done
(%i2) matchdeclare (xxyy, listp);
(%o2)                                done
(%i3)  matchdeclare (xxyy, lambda ([e], listp (e) and length (e) = 2));
(%o3)                                done
(%i4) matchdeclare (rr, lambda ([e], not atom (e) and op (e) =
'rectangle));
(%o4)                                done
(%i5) defrule (rfubini2, integrate2 (integrand, xxyy, rr), fubini2
(integrand, xxyy, rr));
(%o5) rfubini2 : integrate2(integrand, xxyy, rr) ->
fubini2(integrand,
xxyy, rr)
(%i6) fubini2 (I, xy, r) := integrate (integrate (I, second (xy), third
(r), fourth (r)), first (xy), first (r), second (r));
(%o6) fubini2(I, xy, r) := integrate(integrate(I, second(xy), third(r),
fourth(r)), first(xy), first(r),
second(r))
(%i7) I : integrate2 (foo (u, v), [u, v], rectangle (au, bu, av, bv));
(%o7)      integrate2(foo(u, v), [u, v], rectangle(au, bu, av, bv))
(%i8) 1 + 1/(1 + I);
1
(%o8)  ------------------------------------------------------------ + 1
integrate2(foo(u, v), [u, v], rectangle(au, bu, av, bv)) + 1
(%i9) apply1 (%, rfubini2);
1
(%o9)                   --------------------------- + 1
bu  bv
/   /
[   [
I   I   foo(u, v) dv du + 1
]   ]
/   /
au  av

> With subst variants we can make a substitution only occur in one specific argument,
> for example only in the lower bound of an integrate command.
> But is there a tool to find the number arguments of substpart based on general criteria,
> for example "the lower bounds of the integrals subexpression in variable 't'"

I don't understand what you mean by this. Can you give an example?

best

Robert Dodier

```