Algebraic way to change limits of integration of a double integral
I know how to graphically change the limits of integration of a double integral. That is, by graphing the region and eyeballing (a.ka.a "looking at") it to determine the new limits. But an answer to a question hints that there is an algebraic method - I hope I'm using that term correctly - to finding the limits, and I want to know what that is.
The problem is to change the order of integration of $$\int_0^1 \int_0^{3x} f(x,y)\ dy\ dx.$$ The answer is $$\int_0^3 \int_{\frac y3}^1 f(x,y)\ dx\ dy.$$
The book's solution reads:
The region of integration is $0 \le x \le 1,\ 0 \le y \le 3x$. Writing $y=3x$ as $x=\frac y3$, we see that the inequalities translate into $0 \le y \le 3,\ \frac y3 \le x \le 1$.
That suggests that there is an algebraic way to find the new limits.
So, I can get one of the intervals by just following the solution's directions (i.e. substitute $x=\frac y3$ into the first inequality) $$ 0 \le x \le 1 \\ 0 \le \frac y3 \le 1 \\ 0 \le y \le 3.$$ So far so good.
But the same process does not work for the second inequality. I just get $0 \le x \le x$.
What's the procedure to change the limits of integration for this (or any) problem algebraically?
Being a lazy sort, I typically use Iverson brackets for the purpose. Recall that $[p]$ is $1$ if condition $p$ is true, and $0$ if condition $p$ is false.
With this, we can write your integral as
$$\iint [0\leq x\leq 1][0\leq y\leq 3x]f(x,y)\,\mathrm dy\mathrm dx=\iint [0\leq x\leq 1]\left[0\leq \frac{y}{3}\leq x\right]f(x,y)\,\mathrm dy\mathrm dx$$
This can be treated as an integral with doubly infinite limits; the Iverson brackets zero things out outside the domain of validity.
Now, Iverson brackets have the property that $[p\text{ and }q]=[p][q]$; we can use this property to give the alternate representation
$$\iint \left[0\leq \frac{y}{3}\leq x\leq 1\right]f(x,y)\,\mathrm dx\mathrm dy$$
where I have already taken the liberty to swap out the differentials.
Now, we can factor the Iverson bracket as
$$\iint \left[0\leq \frac{y}{3}\leq 1\right]\left[\frac{y}{3}\leq x\leq 1\right]f(x,y)\,\mathrm dx\mathrm dy$$
or
$$\iint \left[0\leq y\leq 3\right]\left[\frac{y}{3}\leq x\leq 1\right]f(x,y)\,\mathrm dx\mathrm dy$$
You can then translate this back into the usual notation:
$$\int_0^3\int_{y/3}^1 f(x,y)\,\mathrm dx\mathrm dy$$
The best way I figure these things out, despite your desire for a "pure" algebraic way, is to sketch the region of integration. In this case, you are integrating first from $y \in [0,3x]$, over $x \in [0,1]$; that is, the region below the line.
In switching the order of integration, you are still below the line $x=y/3$ (which is the same line as $y=3 x$. But now, to go horizontal first, you must begin at the line and end at $x=1$. This translates to
$$\int_0^1 dx \: \int_0^{3 x} dy \: f(x,y) = \int_0^3 dy \: \int_{y/3}^{1} dx \: f(x,y)$$
This procedure works very generally for bijections between $x$ and $y$. When in one direction you go from the axis to the curve, in the other direction you go from the curve outward.
In the first integral the bounds are as follows
$$0 \le x \le 1 \ \text{and} \ 0 \le y \le 3x$$
In the second one
$$0 \le y \le 3 \ \text{and} \ \frac{y}{3} \le x \le 1$$
Try to make a picture of your situation and see how the bounds change. Since $0 \le x \le 1$ and $0 \le y \le 3x$ we know the maximum value for $x$ is $1$. Hence the maximum value for $y$ is 3. Now we know, by changing order of the integral; $0 \le y \le 3$. Additionally, $y \le 3x \leftrightarrow \frac{y}{3} \le x$ and the maximum value for $y$ was $3$, because the maximum of $x$ was $1$. Thus $\frac{y}{3} \le x \le \frac{3}{3}=1$