# Integration limits when changing multiple variables

I'm working on a problem slightly more complicated than the one described below, but hopefully the following question captures the essence of what I'm confused about.

Let's say I have an integral of something like

$$\int_0^1 dx \int_0^x dy \ f(x,y)$$

However, $$f(x,y)$$ becomes much simpler when written in the variables $$u = \frac{1}{2}(x+y)$$, $$v=\frac{1}{2}(x-y)$$. For cases like this, I'm having trouble coming up with a systematic way of properly modifying the limits of integration when changing from $$(x,y)$$ to $$(u,v)$$ that doesn't result in nonsense (i.e., situations where the range of $$u$$ depends on $$v$$ and the range of $$v$$ depends on $$u$$). Is this always possible for general changes of variables?

As a first pass attempt for the above example, I could try writing the limits of integration as

$$0 < u+ v < 1 \Rightarrow -v < u < 1-v$$

$$0 < u - v < u + v$$

but moving around variables doesn't seem to give me an clear way of writing the limits in a way such that the limits don't mutually depend on each other. This specific example can be visualized pretty easily, and I imagine I could inuit the answer by drawing a few diagrams, but the actual problem I'm dealing with has more variables and more complicated limits, so I would like to understand a systematic way of obtaining the limits of integration (a Mathematica command would also suffice).

## 2 Answers

I have found the answer, at least numerically. The Reduce function in Mathematica automatically reduces the inequalities to be in the desired format (i.e. a hierarchy of variables, where the limits of each variable only depend on the variables above it). I don't believe there's any sort of straightforward analytic approach to solving these sorts of problems generally, although I would be interested to see them if so.

The usual technique to change the limits of integration is by a geometric interpretation of the region you are integrating over. Consider the specific example that you have given in the question $$\displaystyle \int_0^1 \int_0^x f(x,y)\ dy \ dx$$. Let us try and sketch that area in the $$x- y$$ plane. For every value of $$x$$, the value of $$y \in [0,x]$$. Thus, this corresponds to a right angled triangle in the $$x-y$$ plane with its three coordinates at $$(0,0), (1,0)$$ and $$(1,1)$$. This is the area you are integrating over. So when you change the variable, you need to keep a track of how this $$2$$-D figure changes under the transformation. It is not difficult to see that transformation yields another triangle in the $$u-v$$ plane with vertices at $$(0,0), (0.5, 0.5)$$ and $$(1,0)$$. This is the area you are now integrating over in the $$u-v$$ plane. So let us try finding the limits in this plane. If we fix a value of $$u$$, then we see that $$v \in [0, 0.5 - |u - 0.5|]$$. This is easy to see once you draw a figure of the aforementioned triangle. Similarly, if you fix a value of $$v$$, you can note that $$u \in [0.5 - |v - 0.5|, 0.5 + |v - 0.5|]$$. This gives you the required limits for both the orders of integration.

To answer your question, that whether it is always possible, the answer is yes. And the standard trick is to use the geometric interpretation as explained above (of course assuming simple algebraic rearrangement is not helpful). However, it might not be so easy in higher dimensions as you might not be able to visualise the same. I am not aware if there exists a standardised algorithm for the same that might help in writing routines for softwares but I am guessing there should be. But as far as solving it analytically is concerned, this geometric method works well in my experience.