How do you calculate the area of the intersection between a rectangle and a doughnut? I'm dealing with an engineering problem, involving concentric pipes, with air flowing through the outer pipe (doughnut).
I need a cross-beam to support the inner pipe, so I need to calculate how much of the outer doughnut's area will be consumed by the cross beam, in order to determine aerodynamic impact on the airflow through the outer circle of the doughnut.
The picture below illustrates what I'm trying to do.
I need to calculate the area of the gold section.
The actual height of the blue rectangle is irrelevant - it crosses both circles exactly twice, it is perpendicular to the axes, and it is centered over the vertical axis.
The intersection is fully rounded on both ends, exactly meeting the edges of both circles.

 A: The equations for the upper semicircles of the small pipe and large pipe are $f(x) = \sqrt{r^2 - x^2}$ and $g(x) = \sqrt{R^2 - x^2}$ respectively. The area of the cross-beam is then found by integrating $g(x) - f(x)$ over the interval $[-\frac{w}{2}, \frac{w}{2}]$:
\begin{align*}
\int_{-w/2}^{w/2} (g(x) - f(x))\,dx &= \int_{-w/2}^{w/2} g(x)\,dx - \int_{-w/2}^{w/2} f(x)\,dx \\
&= \int_{-w/2}^{w/2} \sqrt{R^2 - x^2}\,dx - \int_{-w/2}^{w/2} \sqrt{r^2 - x^2}\,dx \\
&= \left[\frac{1}{2} x \sqrt{R^2-x^2} 
+\frac{1}{2}R^2\arctan\frac{x}{\sqrt{R^2-x^2}}\right]^{w/2}_{-w/2} - \left[\frac{1}{2} x \sqrt{r^2-x^2} 
+\frac{1}{2}r^2\arctan\frac{x}{\sqrt{r^2-x^2}}\right]^{w/2}_{-w/2} \tag 1
\end{align*}
I should note that this is somewhat incomplete; I don't know if it's possible to simplify this expression before calculating it. That said, it should be possible to calculate it from this point.
David Quinn pointed out that $\arctan\frac{x}{\sqrt{R^2-x^2}}=\arcsin\frac xR$ (which follows from the definitions of $\sin$ and $\tan$). Using this, we can simplify equation $(1)$ as
\begin{align*}
\left[\frac{1}{2} x \sqrt{R^2-x^2} 
+\frac{1}{2}R^2\arctan\frac{x}{\sqrt{R^2-x^2}}\right]^{w/2}_{-w/2} - \left[\frac{1}{2} x \sqrt{r^2-x^2} 
+\frac{1}{2}r^2\arctan\frac{x}{\sqrt{r^2-x^2}}\right]^{w/2}_{-w/2} &= \left[\frac{1}{2} x \sqrt{R^2-x^2} 
+\frac{1}{2}R^2\arcsin\frac{x}{r}\right]^{w/2}_{-w/2} - \left[\frac{1}{2} x \sqrt{r^2-x^2} 
+\frac{1}{2}r^2\arcsin\frac{x}{r}\right]^{w/2}_{-w/2} \tag 2
\end{align*}
Evaluating each part of $(2)$ for $x = -\frac{w}{2}$ to $x = \frac{w}{2}$, we have [INCOMPLETE]
\begin{align*}
\left[\frac{1}{2} x \sqrt{R^2-x^2} 
+\frac{1}{2}R^2\arcsin\frac{x}{r}\right]^{w/2}_{-w/2} - \left[\frac{1}{2} x \sqrt{r^2-x^2} 
+\frac{1}{2}r^2\arcsin\frac{x}{r}\right]^{w/2}_{-w/2} &= 
\frac{w}{2}\sqrt{R^2 - x^2} - \frac{w}{2}\sqrt{r^2 - x^2} (+ \ldots)
\end{align*}
A: OK, let's think together. 


*

*First, I will calculate the area of the intersection between the rectangle and the upper half of the big circle with radius $R$, assuming the rectangle goes from the center of the circle and up. As shown:





*

*The resulting area would be the sum of: 


*

*a sector with angle $\theta = 2 \tan^{-1} (\frac{w}{2R})$ and, hence, area of $\frac{\theta}{2 \pi} \pi R^2$

*one small triangle on the left with area $\frac{1}{2}(\frac{w}{2}) (R \cos(\frac{\theta}{2}))$ 

*one small triangle on the right with area $\frac{1}{2}(\frac{w}{2}) (R \cos(\frac{\theta}{2}))$ 


*Finally, your area can be calculated by subtraction as follows:
$$
A = \frac{\theta_1 R^2}{2} + \frac{w R}{2} \cos(\frac{\theta_1}{2}) - \frac{\theta_2 r^2}{2} - \frac{w r}{2} \cos(\frac{\theta_2}{2}).
$$ 
where $\theta_1 = 2 \tan^{-1} (\frac{w}{2R})$ and $ \theta_2=2 \tan^{-1} (\frac{w}{2r})$.
