# Integration of part of a radius gives a complex number...

1. Aug 8, 2015

• Missing homework template due to originally being posted in other forum.
I am interested to find the length shown in red in the attached figure. I want this length as a function of d (shown in blue) and the angle θ. Then I will integrate this length to dθ from 0 to π/2.

Firstly, I used the law of the triangle to determine the length s which when subtracted from the radius r yields the desired length p.
s2+2sd cosθ+ d2-r2=0

Then I used a substitute a2=d2/ r2-d2
which gives, -sqrt(r2-d2 ∫ sqrt {(a2 cos2(θ)-1} dθ

Lastly, I used wolframe alfa to calculate the part under integration, here is what I got.( I used r=1 and d=1/2 r).

The result is a complex number ( attached). I dont understand how the integration of a length which is a real number results into a complex number.

#### Attached Files:

File size:
65.4 KB
Views:
47
• ###### Snap 2015-08-08 at 13.35.09.png
File size:
12.5 KB
Views:
52
Last edited: Aug 8, 2015
2. Aug 8, 2015

### BvU

Could you explain this ? To me it looks as if $(s+d\cos\theta)^2 < r^2$ !!

3. Aug 8, 2015

Consider the triangle with sides r, d and s,

r2= d2 + s2 + 2 ds cosθ

This is a quadratic equation of s, given d and r.

4. Aug 8, 2015

### BvU

Funny, I would say that $(s+d\cos\theta)^2 + z^2 = r^2$

5. Aug 8, 2015

True, I am using this too later in the calculation of p.

Please see the word file I just attached.

File size:
139.3 KB
Views:
39
6. Aug 8, 2015

### BvU

Using it later is pointless if your first step is simply wrong
 Oops -- looks like I'm off track. Let me review ...

Last edited: Aug 8, 2015
7. Aug 8, 2015

### BvU

About the question: you want to vary $\theta$ from $0$ to $\pi/2$. Is s a constant ? then doesn't d stay constant too ?

8. Aug 8, 2015

Yes $\theta$ varies from $0$ to $\pi/2$. d is a constant.

9. Aug 8, 2015

### BvU

d was shown in blue. What happens when $\theta$ reaches ${\pi\over 2} + \arcsin ({2r\over d})$ ?

 Sorry, ${\pi\over 2} + \arcsin ({d\over 2r})$ of course. This is when s = r and p goes through zero.

(to me that means d is approximately where z is in your drawing. meaning p = 0.

Last edited: Aug 8, 2015
10. Aug 8, 2015

I drew another circle with more clear lines. z is always perpendicular to r.

I didnt get you at the second sentence. d is always ≤r

#### Attached Files:

• ###### d, p and r.png
File size:
34.3 KB
Views:
33
Last edited: Aug 8, 2015
11. Aug 8, 2015

### BvU

OK, so I see: $z = d\sin\theta, \quad s = \sqrt{r^2-z^2} - d\cos\theta, \quad p = r - s$ ( or $p = | r - s |$ since you want the length of p). The p = 0 occurs when $\theta$ reaches ${\pi\over 2} + \arcsin ({d\over 2r})$; that's when the bottom end of the blue line is on the circle as well.

Note only the + sign in your solution of the quadratic equation for s applies because s > 0. So $s = \sqrt{r^2-d^2\sin^2\theta} - d\cos\theta$

In your word document you want to integrate $$\int_0^{\pi/2} r + d\cos\theta - \sqrt{d^2\cos^2\theta + r^2 - d^2 } \ d\theta$$ but you evaluate $$\int_0^{\pi/2} - \sqrt{d^2\cos^2\theta - r^2 + d^2 } \ d\theta$$could that be the problem ?

By the way, $d^2\cos^2\theta + r^2 - d^2 = r^2 - d^2\sin^2\theta$ ; as long as $d \le r$ taking the square root should be OK.

12. Aug 8, 2015

This is nice step that: $d^2\cos^2\theta + r^2 - d^2 = r^2 - d^2\sin^2\theta$ , I overlooked it at all.
Nothing wrong with $$\int_0^{\pi/2} r + d\cos\theta - \sqrt{d^2\cos^2\theta + r^2 - d^2 } \ d\theta$$ because I know how to evaluate the the first two terms but I stuck at the third one.

Now how to evaluate

$$\int_0^{\pi/2} \sqrt{r^2 - d^2\sin^2\theta } \ d\theta$$

Last edited: Aug 8, 2015
13. Aug 8, 2015

### LCKurtz

I don't think that is an elementary integral. Maple gives an answer in terms of Elliptic functions.

14. Aug 9, 2015

### BvU

So are we doing OK now Adel ?

15. Aug 9, 2015

But still I dont know how to evaluate
$$\int_0^{\pi/2} \sqrt{r^2 - d^2\sin^2\theta } \ d\theta$$
WolframAlfa didnt give me a solution.

Last edited: Aug 9, 2015
16. Aug 9, 2015

### LCKurtz

Maple gives this:

where

17. Aug 9, 2015

I am not familiar with elliptic integrals so I don not know what z and k in this solution are related to my problem.

For example, $$\int_0^{\pi/2} r + d\cos\theta - \sqrt{d^2\cos^2\theta + r^2 - d^2 } \ d\theta = {\pi/2} r + d - f(d, r)$$. So how to represent f(d,r)? If it is not elementary function so how to approximate it to an elementary one or at least represent it as a series?

18. Aug 9, 2015

### BvU

Approximate with elementary functions, represent as series: Is that really going to help you ? When I plot $p(\theta)$ for r = 3 and d = 2, I get something like

so you still want to pay attention to the point where the bottom end of d crosses the circle ( I assume you want |p| ). I have no hope of doing anything analytical with this one, so I would turn to numerics without much hesitation.

--

19. Aug 10, 2015

So if we taking the area under the curve, p(theta), it should represent the desired integration, right!.

Remember Buffon needle problem, a needle with a length 2d and the distance between the vertical lines is L crosses those lines with a probability = $$2d/ \pi L$$, One of smart solution to this problem is shown in wikipedia where it evaluates the integral $$\int_0^{(\pi/2} 2d cos\theta d\theta$$ as a nominator divided on $$\int_0^{\pi/2} L d\theta$$ as a denominator.

So what if I want to calculate the probability of the needle of length 2d crossing the circle circumference with a radius r.

I proposed to consider the length p, as it is done in this post, instead of $$d cos\theta$$ in the classical problem. Intuitively, the probability of crossing the circle is larger than the probability of crossing vertical lines which is consistent with $$p> dcos\theta$$.

Lastly, I am not sure if considering the bottom point of d when it crosses the circle will have a logic ground in calculating the probability. The reason is that when $$\theta > \pi/2$$, the lower half of the needle under the diameter of the circle will be considered instead of the upper half because of the symmetry. So, we always considering the half of the needle that makes $$\theta<\pi/2$$ with the diameter of the circle.

Last edited: Aug 10, 2015
20. Aug 10, 2015

### BvU

Not $p(\theta)$ but the absolute value of $p(\theta)$. After all, in your original post, you wanted to integrate "the length shown in red" .

You are losing me completely. My perception was that your d is fixed and you wanted p as a function of theta. So your blue line has the top end point on the circle and the bottom end point on the horizontal axis. Nowhere is there a probability coming in.

"So what if I want to calculate the probability of the needle of length 2d crossing the circle circumference with a radius r." Is not a well defined problem. Is the circle in a football field or on a chess board ?

--