Drexel dragonThe Math ForumDonate to the Math Forum



Search All of the Math Forum:

Views expressed in these public forums are not endorsed by Drexel University or The Math Forum.


Math Forum » Discussions » Software » comp.soft-sys.math.mathematica

Topic: Repeated Integrals
Replies: 1   Last Post: May 21, 2013 12:02 AM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ]
Peter Pein

Posts: 1,147
Registered: 5/4/05
Re: Repeated Integrals
Posted: May 21, 2013 12:02 AM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

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]




Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© Drexel University 1994-2014. All Rights Reserved.
The Math Forum is a research and educational enterprise of the Drexel University School of Education.