# 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).

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.