       Re: Add the Logarithms (error in integral)

• To: mathgroup at smc.vnet.net
• Subject: [mg25143] Re: [mg25060] Add the Logarithms (error in integral)
• From: BobHanlon at aol.com
• Date: Sun, 10 Sep 2000 03:15:01 -0400 (EDT)
• Sender: owner-wri-mathgroup at wolfram.com

```In a message dated 9/7/2000 10:59:20 PM, Jos.Bergervoet at philips.com writes:

>I'm trying to integrate a function f over a triangle with vertices:
>(0,0), (a,0), (0,b). My input is:
>
>  f = 1/ Sqrt[1+x^2+y^2]^3
>  g = Integrate[f, {y,0, b-b x/a} ]
>  h = Integrate[g, {x,0,a}]
>  N[ h /. {a->10, b->10} ]
>
>With a=b=10, the output for this positive(!) function is negative:
>
>  Out= -4.91074 + 0. I
>
>which is obviously wrong.
>
>Looking at the answer with FullSimplify[h] I see it contains 4
>logarithms (see answer at the end of this message). Is there any
>way to add these logarithms? (into one logarithm with the product
>of the original arguments?)
>
>FullSimplify refuses to do this. Is there another way?
>

Let a > 0 and b > 0

subst = {(Log[x_] + Log[y_]) -> Log[x*y], (Log[x_] - Log[y_]) -> Log[x/y],
Sqrt[a^2 + a^4] -> a*Sqrt[1 + a^2]};

cond = (a > 0 && b > 0);

f[x_, y_] := 1/Sqrt[1 + x^2 + y^2]^3;

g[x_, a_, b_] :=
Evaluate[Simplify[Integrate[f[x, y], {y, 0, b(1 - x/a)}], cond]]

h[a_, b_] :=
Evaluate[Simplify[
Simplify[PowerExpand[Integrate[g[x, a, b], {x, 0, a}]], cond] /.
subst] //. subst]

h[a, b]
1/2*I*Log[((a - I*Sqrt[1 + a^2]*b)*
(I*b*(b + Sqrt[1 + b^2]) +
a*(1 + b^2 + b*Sqrt[1 + b^2])))/
((a + I*Sqrt[1 + a^2]*b)*(-I*b*(b + Sqrt[1 + b^2]) +
a*(1 + b^2 + b*Sqrt[1 + b^2])))]

h1010 = (h[10, 10] // N // Chop)

1.3724418046360918

Plot3D[h[a, b], {a, 0.01, 10}, {b, 0.01, 10}];

haa[a_] := Evaluate[FullSimplify[h[a, a], a > 0]]

(haa // N // Chop) == h1010

True

Plot[{haa[a], Pi/2}, {a, 0.001, 40},
PlotStyle -> {RGBColor[0, 0, 1], {RGBColor[1, 0, 0],
AbsoluteDashing[{5, 5}]}}, PlotRange -> All];

Needs["Graphics`Graphics`"];

LogLinearPlot[{haa[a], Pi/2}, {a, 10, 1000},
PlotStyle -> {RGBColor[0, 0, 1], {RGBColor[1, 0, 0],
AbsoluteDashing[{5, 5}]}}, PlotRange -> All];

Bob Hanlon

```

• Prev by Date: RE: Rounding Numbers in for output in GridBox
• Next by Date: Re: Rounding Numbers in for output in GridBox