
Re: Repeated Integrals
Posted:
May 21, 2013 12:02 AM


Am 19.05.2013 11:46, schrieb briankolo@gmail.com: > I'm fairly new to Mathematica and I'm trying to create an expression for a set of nested integrals. The innermost integral is > > int[0,x,L(y,a)g(y),dy] > > Where g(y) is an arbitrary function and a is a parameter. The next integral is > > int[0,w,L(x,b)h(x,a),dx] > > Where b is a parameter and h(x,a) is the result of the previous integral. > > The process then repeats N times. Is there a simple way to express this in Mathematica? > >
Nest/NestList are your friends:
intlist = With[ (* toy example *) {L = HeavisideTheta[#1, 1  #1/#2]&, g = Cos[Pi #]&, a = 3, b = 2}, Assuming[Element[x, Reals], (* needed in this case *) NestList[ Block[{t}, Integrate[L[t, b] (# /. x>t), {t, 0, x}]]&, Integrate[L[y, a] g[y], {y, 0, x}], 5] ] ];
Peter
P.S.: in this example, try the plot:
Plot[MapIndexed[#1*Gamma[#2 + 1] x^#2 &, intlist] // Evaluate, {x, .1, 3.5}, PlotRange > {.22, 1}, Exclusions > None, PlotLegends > Automatic, WorkingPrecision > 1.5 $MachinePrecision]

