CollapseNested - Maple Help

IntegrationTools

 CollapseNested
 collapse a nested integral into a multiple integral

 Calling Sequence CollapseNested(v) CollapseNested(v, options)

Parameters

 v - nested integral expression options - (optional) specify one or more of the following: stripoptions, intersectoptions, matchtypes, norecurse

Description

 • The function CollapseNested collapses a nested integral into a multiple integral given as a single Int or int function call.
 • If v is an expression of nested definite and indefinite integrals, only the matching integrals will be collapsed.
 • You can control whether options present in the integral v will appear in the output. If the option stripoptions is given, none of the options in the integral v will appear in the output.  If the option intersectoptions is given, the options that appear in every integral will appear in the output. Otherwise, all options on any of the integrals will appear in the output.
 • If the option matchtypes is given, only integrals of the same type will be collapsed.  For example, two nested Int integrals will be collapsed, but nested int and Int integrals will not be collapsed.
 • If the option norecurse if given, only the outermost integrals will be collapsed.

Examples

 > $\mathrm{with}\left(\mathrm{IntegrationTools}\right):$
 > $\mathrm{i1}≔\mathrm{Int}\left(\mathrm{Int}\left(f\left(x,y\right),x\right),y\right)$
 ${\mathrm{i1}}{≔}{\mathrm{Typesetting}}{:-}{\mathrm{_Hold}}{}\left(\left[{\mathrm{Int}}{}\left({\mathrm{Int}}{}\left({f}{}\left({x}{,}{y}\right){,}{x}\right){,}{y}\right)\right]\right)$ (1)
 > $\mathrm{i2}≔\mathrm{CollapseNested}\left(\mathrm{i1}\right)$
 ${\mathrm{i2}}{≔}{\mathrm{Typesetting}}{:-}{\mathrm{_Hold}}{}\left(\left[{\mathrm{Int}}{}\left({f}{}\left({x}{,}{y}\right){,}\left[{x}{,}{y}\right]\right)\right]\right)$ (2)

The display of i1 and i2 look the same but in fact the integrals have different structure:

 > $\mathrm{lprint}\left(\mathrm{i2}=\mathrm{i1}\right)$
 Int(f(x,y),[x, y]) = Int(Int(f(x,y),x),y)
 > $\mathrm{CollapseNested}\left(\mathrm{Int}\left(\mathrm{Int}\left(f\left(x,y\right),x=a..b\right),y=c..d\right)\right)$
 ${\mathrm{Typesetting}}{:-}{\mathrm{_Hold}}{}\left(\left[{\mathrm{Int}}{}\left({f}{}\left({x}{,}{y}\right){,}\left[{x}{=}{a}{..}{b}{,}{y}{=}{c}{..}{d}\right]\right)\right]\right)$ (3)
 > $\mathrm{CollapseNested}\left(\mathrm{Int}\left(\mathrm{Int}\left(f\left(x,y\right),x=a..b,\mathrm{CauchyPrincipalValue}\right),y=c..d\right)\right)$
 ${\mathrm{Typesetting}}{:-}{\mathrm{_Hold}}{}\left(\left[{\mathrm{Int}}{}\left({f}{}\left({x}{,}{y}\right){,}\left[{x}{=}{a}{..}{b}{,}{y}{=}{c}{..}{d}\right]{,}{\mathrm{CauchyPrincipalValue}}\right)\right]\right)$ (4)
 > $\mathrm{CollapseNested}\left(\mathrm{Int}\left(\mathrm{Int}\left(f\left(x,y\right),x=a..b,\mathrm{CauchyPrincipalValue}\right),y=c..d\right),\mathrm{stripoptions}\right)$
 ${\mathrm{Typesetting}}{:-}{\mathrm{_Hold}}{}\left(\left[{\mathrm{Int}}{}\left({f}{}\left({x}{,}{y}\right){,}\left[{x}{=}{a}{..}{b}{,}{y}{=}{c}{..}{d}\right]\right)\right]\right)$ (5)
 > $\mathrm{CollapseNested}\left(\mathrm{Int}\left(\mathrm{Int}\left(f\left(x,y\right),x=a..b,\mathrm{AllSolutions},\mathrm{CauchyPrincipalValue}\right),y=c..d,\mathrm{CauchyPrincipalValue}\right),\mathrm{intersectoptions}\right)$
 ${\mathrm{Typesetting}}{:-}{\mathrm{_Hold}}{}\left(\left[{\mathrm{Int}}{}\left({f}{}\left({x}{,}{y}\right){,}\left[{x}{=}{a}{..}{b}{,}{y}{=}{c}{..}{d}\right]{,}{\mathrm{CauchyPrincipalValue}}\right)\right]\right)$ (6)

Collapsing integrals will match the outermost type of integral

 > $\mathrm{CollapseNested}\left(\mathrm{Int}\left('\mathrm{int}'\left(f\left(x,y\right),x\right),y\right)\right)$
 ${\mathrm{Typesetting}}{:-}{\mathrm{_Hold}}{}\left(\left[{\mathrm{Int}}{}\left({f}{}\left({x}{,}{y}\right){,}\left[{x}{,}{y}\right]\right)\right]\right)$ (7)
 > $\mathrm{lprint}\left(\right)$
 Int(f(x,y),[x, y])
 > $\mathrm{CollapseNested}\left(\mathrm{Int}\left('\mathrm{int}'\left(f\left(x,y\right),x\right),y\right),\mathrm{matchtypes}\right)$
 ${\mathrm{Typesetting}}{:-}{\mathrm{_Hold}}{}\left(\left[{\mathrm{Int}}{}\left({\mathrm{int}}{}\left({f}{}\left({x}{,}{y}\right){,}{x}\right){,}{y}\right)\right]\right)$ (8)
 > $\mathrm{lprint}\left(\right)$
 Int(int(f(x,y),x),y)
 > $\mathrm{CollapseNested}\left(\mathrm{Int}\left(\mathrm{Int}\left(\mathrm{Int}\left(\mathrm{Int}\left(f\left(x,y\right),x=a..b\right),y=c..d\right),x\right),y\right)\right)$
 ${\mathrm{Typesetting}}{:-}{\mathrm{_Hold}}{}\left(\left[{\mathrm{Int}}{}\left({\mathrm{Int}}{}\left({f}{}\left({x}{,}{y}\right){,}\left[{x}{=}{a}{..}{b}{,}{y}{=}{c}{..}{d}\right]\right){,}\left[{x}{,}{y}\right]\right)\right]\right)$ (9)
 > $\mathrm{lprint}\left(\right)$
 Int(Int(f(x,y),[x = a .. b, y = c .. d]),[x, y])
 > $\mathrm{CollapseNested}\left(\mathrm{Int}\left(\mathrm{Int}\left(\mathrm{Int}\left(\mathrm{Int}\left(f\left(x,y\right),x=a..b\right),y=c..d\right),x\right),y\right),\mathrm{norecurse}\right)$
 ${\mathrm{Typesetting}}{:-}{\mathrm{_Hold}}{}\left(\left[{\mathrm{Int}}{}\left({\mathrm{Int}}{}\left({\mathrm{Int}}{}\left({f}{}\left({x}{,}{y}\right){,}{x}{=}{a}{..}{b}\right){,}{y}{=}{c}{..}{d}\right){,}\left[{x}{,}{y}\right]\right)\right]\right)$ (10)
 > $\mathrm{lprint}\left(\right)$
 Int(Int(Int(f(x,y),x = a .. b),y = c .. d),[x, y])