\documentclass[a4paper,12pt]{article}
\begin{document}


{\bf Question}

This question introduces an example where the value of the
integral depends on the order of integration. Show that:
\begin{description}
\item[(a)]
$$\int_{x=0}^{x=1} \! \int_{y=0}^{y=1} \frac{x-y}{(x+y)^3}\,dy\,dx
= \frac{1}{2}$$
\item[(b)]
$$\int_{y=0}^{y=1} \! \int_{x=0}^{x=1} \frac{x-y}{(x+y)^3}\,dy\,dx
= \frac{1}{2}$$
\end{description}
What feature of this function may be causing the answers to be
different? \\ ({\bf HINT:} In part (a) evaluate the integral by
expressing the integrand using the method of partial fractions. In
part (b) consider the effect on the integral of formally
interchanging the variables x and y.)


{\bf Answer}

\begin{description}
\item[(a)]
$$\frac{x-y}{(x+y)^3}=\frac{2x-x-y}{(x+y)^3}=\frac{2x}{(x+y)^3}-\frac{x+y}{(x+y)^3}
=\frac{2x}{(x+y)^3}-\frac{1}{(x+y)^2}$$

The integral becomes:

$\displaystyle \int_{x=0}^{x=1} \left\{\int_{y=0}^{y=1}
\frac{2x}{(x+y)^3}-\frac{1}{(x+y)^2} \,dy \right\}\,dx$

\begin{eqnarray*} & = & \int_{x=0}^{x=1}
\left[\frac{-x}{(x+y)^2}+\frac{1}{x+y} \right]_{y=0}^{y=1} \,dx\\
& = & \int_{x=0}^{x=1}
\frac{-x}{(x+1)^2}+\frac{1}{x+1}+\frac{1}{x}-\frac{1}{x} \,dx\\ &
= & \int_{x=0}^{x=1} \frac{1}{x+1} - \frac{x}{(x+1)^2} \,dx\\ & =
& \int_{x=0}^{x=1} \frac{1}{(x+1)^2} \,dx = \left[\frac{-1}{x+1}
\right]_0^1 = -\frac{1}{2}+1 = \frac{1}{2}
\end{eqnarray*}

\item[(b)]
Formally interchanging $x$ and $y$ gives

$$\int_{y=0}^{y=1} \! \int_{x=0}^{x=1} \frac{y-x}{(y+x)^3} \,dx
\,dy = \frac{1}{2}$$

So that $$\displaystyle \int_{y=0}^{y=1} \! \int_{x=0}^{x=1}
\frac{x-y}{(x+y)^3} \,dx \,dy = -\int_{y=0}^{y=1} \!
\int_{x=0}^{x=1} \frac{y-x}{(y+x)^3} \,dx \,dy = -\frac{1}{2}$$

The difference arises because $\displaystyle \frac{x-y}{(x+y)^3}$
has a singularity at $(x,y)=(0,0)$ [hence the function is not
properly defined at the point $(0,0)$].
\end{description}


\end{document}
