Re: help in solving a double integration....
- To: mathgroup at smc.vnet.net
- Subject: [mg66087] Re: [mg66062] help in solving a double integration....
- From: Daniel Lichtblau <danl at wolfram.com>
- Date: Sat, 29 Apr 2006 03:40:27 -0400 (EDT)
- References: <200604281032.GAA03124@smc.vnet.net>
- Sender: owner-wri-mathgroup at wolfram.com
ashesh wrote:
> Hi all,
>
> Would like to solve the following double integration.
>
> int_x_0^t int_y_0^t F(x) exp(-a|x-y|) G(y) dy dx
>
> F(x) = (3x/t); 0 < x <(t/3)
> = (2t-3y)/t; (t/3) < x < (2t/3)
> = 0; otherwise
>
> G(y) = F(y)
>
> Where a, t are real numbers. And there is absolute value of x-y, i.e.,
> it is |x-y| in the exponent.
>
> I am not sure as to how these fucntions, F(x) and G(y) can be fed to
> mathematica, as they have different values in different ranges.
>
> Hope some one can help me solve this integration.
Define your function using Piecewise.
f[x_,t_] := Piecewise[{{3*x/t,0<x<t/3}, {2*t-3*y/t,t/3<x<2*t/3}}, 0]
I pass some assumptions to integrate regarding the parameters {a,t}. I
think assumptions on both are needed in the current version of
Mathematica though the development version does not seem to worry about a.
InputForm[ii = Integrate[f[x,t]*Exp[-a*Abs[x-y]]*f[y,t],
{x,0,t}, {y,0,t}, Assumptions->{t>0,a>0}]]
Out[8]//InputForm=
(-81 + 324*E^((a*t)/3) - 243*E^((2*a*t)/3) + 54*a*t - 108*a*E^((a*t)/3)*t +
108*a*E^((2*a*t)/3)*t - 108*a*t^2 + 216*a*E^((a*t)/3)*t^2 +
72*a^2*E^((a*t)/3)*t^2 - 108*a*E^((2*a*t)/3)*t^2 -
72*a^2*E^((2*a*t)/3)*t^2 - 144*a^2*E^((a*t)/3)*t^3 +
144*a^2*E^((2*a*t)/3)*t^3 + 16*a^3*E^((2*a*t)/3)*t^3 +
72*a^2*E^((a*t)/3)*t^4 - 72*a^2*E^((2*a*t)/3)*t^4 -
36*a^3*E^((2*a*t)/3)*t^4 + 24*a^3*E^((2*a*t)/3)*t^5)/
(9*a^4*E^((2*a*t)/3)*t^2)
Sanity check: evaluate numerically at some parameter values and compare
to direct quadrature result for same.
In[22]:= ii /. {t->4.,a->2.}
Out[22]= 39.0948
In[23]:= With[{t=4,a=2},NIntegrate[f[x,t]*Exp[-2*Abs[x-y]]*f[y,t],
{x,0,t}, {y,0,t}]]
Out[23]= 39.0948
Daniel Lichtblau
Wolfram Research
- References:
- help in solving a double integration....
- From: "ashesh" <ashesh.cb@gmail.com>
- help in solving a double integration....