# Homework Help: Integral containing 1/(a+b*x+c*sqrt(d-x^2))^2

1. Jan 11, 2013

### Wu Xiaobin

Thank you so much if anyone can solve this integral to obtain its individual marginal PDF.

The joint probability density function shows as follows:
$f(\xi_1,\xi_2)=\frac{1-\eta_1^2-\eta_2^2-\eta_3^2}{4\pi}[\frac{1}{(1-\eta_1\xi_1-\eta_2\xi_2-\eta_3\sqrt{1-\xi_1^2-\xi_2^2})^2}+\frac{1}{(1-\eta_1\xi_1-\eta_2\xi_2+\eta_3\sqrt{1-\xi_1^2-\xi_2^2})^2}]$
with the domain of integration $0\leq(\xi_1^2+\xi_2^2\leq1)$

And I want to integrate the above joint probability density function to obtain $f(\xi_1)$

2. Jan 11, 2013

### haruspex

Writing the denominators as (A-Bx±C√(D2-x2))2, I believe the integrand reduces to $\frac{f+g}{\left(f-g\right)^2}$ where f = (A-Bx)2 and g = C2(D2-x2). Maybe you can usefully expand that with partial fractions.

3. Jan 11, 2013

### Wu Xiaobin

4. Jan 11, 2013

### Wu Xiaobin

Could you please give some more hint. I am confused about using partial fractions.

5. Jan 11, 2013

### haruspex

In what I posted before, f and g are quadratics in x. So f-g is a quadratic; suppose it has roots α, β. Then we have $\frac{f+g}{(x-\alpha)^2(x-\beta)^2}$. It should be possible to write this as a sum of fractions in which the numerators are all constants and the denominators are (x-α), (x-α)2, (x-β), (x-β)2. To find the numerators, just fill them in as four unknowns, equate the sum to the original integrand, multiply out, then collect up terms according to the powers of x. That should produce four equations, one for each power of x.

6. Jan 12, 2013

### Ray Vickson

You have
$$f = c\left[ \frac{1}{A - \sqrt{B}}+ \frac{1}{A + \sqrt{B}} \right],$$
where A = linear and B = quadratic in $(\xi_1,\xi_2)$ . Adding the fractions gives
$$f = c \frac{2A}{A^2 - B} = \frac{\text{linear}}{\text{quadratic}},$$
whose indefinite $\xi_2$ integration is do-able in terms of log and arctan functions.

7. Jan 12, 2013

### Wu Xiaobin

However when I work it out in Mathematica, the root appears rather complicated. Two of the roots are
$\alpha,\beta=\frac{\eta_2-\xi_1\eta_1\eta_2\pm\sqrt{-\eta_3^2(1-2\xi_1\eta_1-\eta_2^2-\eta_3^2+\xi_1^2(\eta_1^2+\eta_2^2+\eta_3^2))}}{\eta_{2}^{2}+\eta_3^2}$

It appears to be it would be rather complex to derive the four fractions.

8. Jan 12, 2013

### Wu Xiaobin

Excuse me. I wonder you may neglect the square in the integral?

9. Jan 12, 2013

### Wu Xiaobin

I got the result as follows, but I still can't work it out.
I hope if anyone could help.
$f(\xi_1)=\frac{(1-\eta_1\xi_1)(1-\eta_1^2-\eta_2^2-\eta_3^2)}{2[(1-\eta_1\xi_1)^2-(\eta_2^2+\eta_3^2)(1-\xi_1^2)]^{3/2}}$
where the domain of integration is $-1\leq \xi_1\leq 1$

10. Jan 12, 2013

### haruspex

By suitable change of variable, you should be able to get that into the form $\frac{\left(x+A\right)dx}{\left(x^2+B^2\right)^{3/2}}$. The x term in the numerator is easy: 2x.dx =d(x2), allowing direct integration. That leaves $\frac{dx}{\left(x^2+B^2\right)^{3/2}}$. Put x = Btan(θ).

11. Jan 12, 2013

### Wu Xiaobin

I put the result $f(\xi_1)$ here but I am not able to obtain $f(\xi_1)$.
The question is I can't obtain $f(\xi_1)$ from integrating $f(\xi_1,\xi_2)$ with respect to $\xi_2$

I found it too difficult to obtain the partial fractions and it's hard to integrate to obtain $f(\xi)$ in the form I put.

12. Jan 12, 2013

### haruspex

Oh, ok, I misunderstood your previous post.
Can you just keep the roots as α, β and finish the integration, then substitute in at the end? You might find there's a lot of cancellation, e.g. you can easily substitute for α+β.

13. Jan 12, 2013

### Wu Xiaobin

But how can I use $\alpha,\beta$ without taking its real form into consideration. Just as I put in the previous message, it has quite complicate form.

I am not very good at it, could you show me just how to use $\alpha,\beta$ to obtain the partial fraction. Of course I will solve the integration my self. Please tell me how to carry on.

14. Jan 12, 2013

### Ray Vickson

Sorry: I did not see the "square".

15. Jan 12, 2013

### Ray Vickson

You can write
$$\frac{1}{(x - \alpha)(x-\beta)} = \frac{c_1}{x-\alpha} + \frac{c_2}{x-\beta},$$ where $c_1, \, c_2$ are easily expressible in terms of $\alpha, \, \beta$. Thus,
$$\left[ \frac{1}{(x - \alpha)(x-\beta)} \right]^2 = \left[ \frac{c_1}{x-\alpha} + \frac{c_2}{x-\beta} \right]^2,$$
which involves $1/(x - \alpha)^2, \; 1/(x - \beta)^2$ and $1/[(x-\alpha)(x-\beta)]$. Re-write the latter again in terms of just $1/(x-\alpha)$ and $1/(x-\beta)$. In the end you will have a function of the form
$$f = \frac{a_1}{x-\alpha} + \frac{b_1}{(x - \alpha)^2} + \frac{a_2}{x - \beta} + \frac{b_2}{(x - \beta)^2} + c + px + qx^2,$$
where $x = \xi_2$ and the coefficients $a_i, b_i , c, p, q$ and $\alpha, \, \beta$ are all functions of $\xi_1$. You can then do the integral.

Using this method to compute
$$f(\xi_1) = \int_{-\sqrt{1-\xi_1^2}}^{\sqrt{1-\xi_1^2}} f(\xi_1,\xi_2) \, d \xi_2,$$
Maple gives an answer that takes between 25 and 26 pages to display when everything is written out in terms of the $\eta_i.$ So, the final result is long and messy.

Last edited: Jan 12, 2013
16. Jan 12, 2013

### haruspex

Yet, if I understand Wu Xiaobin's post, the answer is supposed to be as in post #9.

17. Jan 12, 2013

### Ray Vickson

I do not believe the answer in post #9. I input input some numerical values of the eta_i and tackled the integration for f(xi_1) directly, numerically; that is, for each numerical value of xi_1, I can do the xi_2 integral numerically. I plotted f(xi_1) and compared it with the formula in #9. The shapes are different. (All computations done in Maple.)

18. Jan 12, 2013

### Wu Xiaobin

That is fine.

19. Jan 12, 2013

### Wu Xiaobin

Yeah, I see. If I strive to work it out in partial fraction, I believe the result would be messy.
However I have tried another method and it works out.

I would post here later.

20. Jan 12, 2013

### Wu Xiaobin

You are right. The result is displayed in post #9.

Last night I worked it out with your kind help. I would posted here later.

It would take me a little time to check.

21. Jan 13, 2013

### Ray Vickson

No, the correct result is NOT displayed in post #9. Just look at the formula. The actual f(xi_1) is given by
$$f(\xi_1) = \int_{-\sqrt{1-\xi_1^2}}^{\sqrt{1-\xi_1^2}} f(\xi_1, \xi_2)\, d\xi_2, \; -1 \leq \xi_1 \leq 1.$$
As $\xi_1 \to \pm 1$ this → 0 because we have an integral from 0 to 0. However, the formula in post #9 gives nonzero results at $\xi_1 = \pm 1$.

Last edited: Jan 13, 2013
22. Jan 13, 2013

### Wu Xiaobin

Thank you so much for all friends who replied.

I think I have worked it out, but maybe using another way to solve it.
However partial fractions really help when I solve this problem.

I needs great effort to type the integration process here, so I decide to attach the pdf
document here.

The attachment shows the whole process of solving the integral.

In the end, I want to give me special gratitude to haruspex and Ray Vickson.

--
Best regards
Jacky Wu

#### Attached Files:

• ###### Integral.pdf
File size:
27.6 KB
Views:
55
23. Jan 13, 2013

### Ray Vickson

However, it is possible to give a corrected answer, and it is not very difficult to get. Below, I use $x_1, x_2, x_3$ instead of $\xi_1, \xi_2, \xi_3$ and I use $c_1, c_2, c_3$ instead of $\eta_1, \eta_2, \eta_3$. I will get the marginal density of $x_3$ instead of $x_1$, but by a simple re-labelling you can get the other two marginals as well. The density function is
$$P(x_1,x_2,x_3) = k \frac{\delta(1 - \sqrt{x_1^2 + x_2^2 + x_3^2})}{( 1 - c_1 x_1 - c_2 x_2 - c_3 x_3)^2},$$
where k is a constant which you give in the pdf file. Let's change to polar coordinates:
$$x_1 = r \sin(\theta) \cos(\phi)\\ x_2 = r \sin(\theta) \sin(\phi)\\ x_3 = r \cos(\theta).$$
When we fix x_3 the area element is $dA = dx_1 dx_2 = R\, dR\, d\phi$, where $R = r \sin(\theta)$, so $dR = dr \sin(\theta)$ (since, ultimately, we are fixing θ). Thus, $dA = r \sin^2(\theta) dr \, d\phi$, so the marginal density $f(x_3)$ is given as
$$f = k \sin^2(\theta) \int_0^{2 \pi} \frac{1}{(1 - c_1 \sin(\theta) \cos(\phi) - c_2 \sin(\theta) \sin(\phi) - c_3 \cos(\theta))^2} \, d \phi,$$
because the r-integration is simply $\int \delta(r-1) q(r,\phi)\, dr$. Note that since r = 1 we have $\cos(\theta) = x_3$ and $\sin(\theta) = \sqrt{1-x_3^2}.$ We may write
$$c_1 \sin(\theta) \cos(\phi) + c_2 \sin(\theta) \sin(\phi) = C \cos(\omega - \phi),$$ where $C = \sin(\theta) \sqrt{c_1^2 + c_2^2}$ and $\cos(\omega) = c_1 \sin(\theta)/C, \: \sin(\omega) = \sin(\theta) c_2/C.$ Since we are integrating $\phi$ over an entire cycle, we can omit $\omega$ and write
$$f = k (1-x_3^2) \int_0^{2 \pi} \frac{1}{(1 - C \cos(\phi) -c_3 x_3)^2}\, d\phi = k (1-x_3^2) \text{sign}(x_3 - 1 -C)\frac{2(c_3 x_3 - 1)}{( 1 - 2 c_3 x_3 + c_3^2 x_3^2 - c_1^2 - c_2^2 - C^2)^{3/2}}.$$
Since $x_3 \in (-1,1)$ we have sign = -1, so finally we have
$$f(x_3) = \text{const.} \frac{(1 - c_3 x_3)(1 - x_3^2)}{( (1 - c_3 x_3)^2 - (c_1^2 + c_2^2)(1 - x_3^2))^{3/2}}, \: -1 \leq x_3 \leq 1.$$
Here, we assume that $c_1^2 + c_2^2 + c_3^2 < 1$ and also that the denominator function $(1 - c_3 x_3)^2 - (c_1^2 + c_2^2)(1 - x_3^2)$ does not vanish for $x_3 \in [-1,1].$ A sufficient condition for this is that
$$1 - c_1^2 - c_2^2 - c_3^2 > 2 c_3.$$ When the denominator function vanishes at some point in (-1,1) the integral is singular at some values of $x_3$, and the computation breaks down.

Note that this formula gives $f(x_3) \to 0$ as $x_3 \to \pm 1$, as it must be (since having x_3 = ± 1 gives an integration over a region of area = 0). The formula you gave in post #9 does not have this necessary property.

Last edited: Jan 13, 2013
24. Jan 13, 2013

### Wu Xiaobin

Actually I don't know where the problem is?

But the result of $f(\xi)$ appears in several academic papers.

I will check it later to find out which one suits better and try to find out the exact problem.

25. Jan 13, 2013

### Ray Vickson

No fair! You posted incorrect, misleading information. You say you wanted to find the marginal density of $x_1$ from the bivariate density
$$f(x_1,x_2) = c \left[ \frac{1}{(1-c_1 x_1 - c_2 x_2 - c_3 \sqrt{1-x_1^2 - x_2^2})^2} + \frac{1}{(1-c_1 x_1 - c_2 x_2 + c_3 \sqrt{1-x_1^2 - x_2^2})^2} \right], \; x_1^2 + x_2^2 \leq 1,$$
but in fact, your bivariate density should be
$$f(x_1,x_2) = \frac{c}{\sqrt{1-x_1^2-x_2^2}} \left[ \frac{1}{(1-c_1 x_1 - c_2 x_2 - c_3 \sqrt{1-x_1^2 - x_2^2})^2} + \frac{1}{(1-c_1 x_1 - c_2 x_2 + c_3 \sqrt{1-x_1^2 - x_2^2})^2} \right], \; x_1^2 + x_2^2 \leq 1$$ (from your pdf file). This makes all the difference in the world! The first form leads to $f(x_1) \to 0$ as $x_1 \to \pm 1$, while this does not happen for the second form!