To err is human, to blame it on someone else is even more human, Jacob’s Law
A function of two variables $f: \mathbb{R} \times \mathbb{R} \to \mathbb{R}$ assigns to each ordered pair in its domain a unique real number. Examples include geometric formulas like Area = $\frac{1}{2}bh$, or algebraic surfaces like $z = f(x, y) = 2x + 3y$, $f(x, y) = x^2 + y^2$, and $f(x,y) = e^{x+y}$.
Partial derivatives differentiate a multivariable function $f(x_1, x_2, \dots, x_n)$ with respect to one target variable while treating all other variables as constants. They measure how the function changes in a single specific direction.
If $f(x, y) = 2x^2y^3$, then $\frac{\partial f}{\partial x} = f_x = 4xy^3$ and $\frac{\partial f}{\partial y} = f_y = 6x^2y^2$.
If $f(x, y) = x^3y + y^2$, then $f_x = 3x^2y$ and $f_y = x^3+2y$.
A point $(x_1, x_2, \dots, x_n)$ is considered a critical point if the gradient of $f$ at that point is the zero vector, or if the gradient does not exist.
The gradient $\nabla f$ is a vector containing all first-order partial derivatives of $f$. It geometrically points in the direction of the function’s steepest ascent. $\nabla f = \left\langle \frac{\partial f}{\partial x_1}, \frac{\partial f}{\partial x_2}, \dots, \frac{\partial f}{\partial x_n} \right\rangle$.
In 2D space ($n = 2$), finding a critical point $(x_0, y_0)$ requires solving the system: $\frac{\partial f}{\partial x}(x_0, y_0) = 0$ and $\frac{\partial f}{\partial y}(x_0, y_0) = 0$.
Theorem: The gradient vector is perpendicular (orthogonal) to the level curves or level surfaces of the function at any given point. This means if you walk along a contour line where the function’s value is constant, the direction of steepest uphill is exactly 90 degrees to your path.
The directional derivative $\frac{dw}{ds}\bigg\vert{}_{\vec{u}}$ represents the rate of change of a function $w$ as you move in the direction of the unit vector $\vec{u}$. It can be expressed or compactly written via the dot product of the gradient and the direction vector: $\frac{dw}{ds}\bigg\vert{}_{\vec{u}} = \nabla w \cdot \vec{u} = \vert{}\nabla w\vert{}\vert{}\vec{u}\vert{}\cos(\theta) = \vert{}\nabla w\vert{}\cos(\theta)$ where $\theta$ is the angle between the gradient $\nabla w$ and the unit vector $\vec{u}$.
A double integral allows us to integrate a function of two variables, say $f(x, y)$, over a region R in a two-dimensional space (typically the xy-plane). Instead of just finding or calculating a 2D area, with a double integral, we’re looking for the volume under the surface (or below the graph) $z = f(x, y)$ and above the region $R$.

When evaluating a double integral over a region, the order of integration refers to the sequence in which we perform integration with respect to different variables, for example, $dxdy$ versus $dydx$.
For rectangular regions (where all limits are constants), exchanging the order is as simple as swapping the integration bounds: $\int_{0}^{1} (\int_{0}^{2} f(x, y)dx)dy = \int_{0}^{2} (\int_{0}^{1} f(x, y)dy)dx$ (Figure i), $\int_{0}^{2}(\int_{1}^{3} xy^2dy)dx = \int_{1}^{3} (\int_{0}^{2} xy^2dx)dy$.
However, for non-rectangular regions, swapping the order requires redefining the region entirely. You cannot simply swap the limits if they contain variables. This technique is incredibly powerful because it allows us to simplify calculations by choosing the most convenient order of integration based on the given problem—and in some cases, it is the only way to evaluate an integral that has no elementary antiderivative in its original order.
Compute the inner integral. $\int_{\tan^{-1}(x)}^{\frac{\pi}{4}} \cos(y)dy = \left[\sin(y)\right]_{\tan^{-1}(x)}^{\frac{\pi}{4}}$
$= \sin\left(\frac{\pi}{4}\right) - \sin(\tan^{-1}(x)) =[...] \frac{1}{\sqrt{2}} - \frac{x}{\sqrt{1+x^2}}$
[…] Evaluating $\sin(\tan^{-1}(x))$: Recall the right triangle definition of trigonometric functions. If we set $\theta = \tan^{-1}(x)$, it means $\tan(\theta) = \frac{x}{1} = \frac{\text{Opposite}}{\text{Adjacent}}$. Using the Pythagorean theorem, the hypotenuse is $\sqrt{1+x^2}$. Therefore, $\sin(\theta) = \frac{\text{Opposite}}{\text{Hypotenuse}} = \frac{x}{\sqrt{1+x^2}}$(Figure C).

Compute the outer integral. $\int_{0}^{1} (\frac{1}{\sqrt{2}}-{\frac{x}{\sqrt{1+x^2}}})dx$
This last integral can be solved using a substitution method. Let $u = 1+x^2$, which means $du = 2xdx$ (or $xdx = \frac{du}{2}$).
$\int \frac{x}{\sqrt{1+x^2}}dx = \frac{1}{2} \int u^{-1/2}du = \frac{1}{2} (2u^{1/2}) = \sqrt{1+x^2}$
$\int_{0}^{1} (\frac{1}{\sqrt{2}}-{\frac{x}{\sqrt{1+x^2}}})dx = (\frac{1}{\sqrt{2}}x-\sqrt{1+x^2})\bigg|_{0}^{1} = \frac{1}{\sqrt{2}}-\sqrt{2}-(0-1) = \frac{1}{\sqrt{2}}-\frac{2}{\sqrt{2}}+1 = 1 -\frac{1}{\sqrt{2}}$
Change the order of integration to simplify the computation. Sometimes, changing the order of integration can simplify the computation significantly, or even make an impossible integral solvable. The original integral requires us to integrate $\frac{1}{1+x^4}$ with respect to $x$ first, which is highly complex. Instead, let's reverse the order. (Figure D).

Looking at the original limits, the region is bounded by $x = y$ on the left and $x = 1$ on the right, for $y$ ranging from $0$ to $1$. To change the order to $dydx$, we analyze the region from the $x$-axis perspective: $x$ ranges from $0$ to $1$, and for each fixed $x$, $y$ goes from the bottom boundary ($y = 0$) up to the diagonal line ($y = x$).
Thus, the double integral can be rewritten as: $\int_{0}^{1} \int_{y}^{1}\frac{1}{1+x^4}dxdy = \int_{0}^{1} \int_{0}^{x}\frac{1}{1+x^4}dydx.$
Compute the inner integral (with respect to y): Because the integrand contains only $x$, it acts as a constant relative to $y$, $\int_{0}^{x}\frac{1}{1+x^4}dy = \frac{1}{1+x^4}y\bigg|_{0}^{x} = \frac{x}{1+x^4}$.
Compute the outer integral (with respect to x): $\int_{0}^{1} \frac{x}{1+x^4}dx$
Use substitution: let $u = x^2$, so $du = 2xdx$ (and $xdx = \frac{du}{2}$).
$\frac{1}{2} \int_{0}^{1} \frac{1}{1+u^2} du = \frac{1}{2}\left[\tan^{-1}(u)\right]_{0}^{1}$
The standard integral $\int \frac{1}{1+u^2}du = \tan^{-1}(u)$ is a fundamental result in calculus worth memorizing.
$= \frac{1}{2}(\tan^{-1}(1) - \tan^{-1}(0)) = \frac{1}{2}\left(\frac{\pi}{4} - 0\right) = \frac{\pi}{8}$Change the order of integration to simplify the computation. Sometimes, changing the order of integration can simplify the computation significantly. The function $\cos(y^3)$ has no elementary antiderivative, so we must change the order. The original region has $y$ ranging from the curve $y = \sqrt{x}$ up to $y = 1$, with $x$ ranging from $0$ to $1$. If we swap perspectives, $y$ ranges from $0$ to $1$ overall, and for a fixed $y$, $x$ ranges from $0$ to the curve $x = y^2$. (Figure 1).

Changed the order of integration to simplify the computation. Sometimes, changing the order of integration is the only way to proceed. The original integral requires us to integrate $\frac{1}{y^4+1}$ with respect to $y$ first, which has no elementary antiderivative. To bypass this, we sketch the region and swap the integration order to $dxdy$ (Figure 2).

Compute the outer integral (with respect to y) $\int_{0}^{2} \frac{y^3}{y^4+1} dy$.
This integral is a standard form, which can be solved using substitution. Let $u = y^4 + 1$, meaning $du = 4y^3dy$, or $y^3dy = \frac{du}{4}$.
Rewriting the integral in terms of u, we get: $\int_{0}^{2} \frac{y^3}{y^4+1} dy = \frac{1}{4}\int \frac{1}{u}du = \frac{1}{4}ln|u| = \frac{1}{4}ln|y^4+1|\bigg|_{0}^{2} = \frac{1}{4}(ln(17)-ln(1)) = \frac{ln(17)}{4}$.

Unlike a square boundary, this region (figure D) is a quarter disk. For a fixed $x_0$, $y$ varies from $0$ up to the boundary of the circle, $y = \sqrt{1-x_0^2}$.
Therefore, $V = \int_{0}^{1}\left(\int_{0}^{\sqrt{1-x^2}} (1-x^2-y^2)dy\right)dx$
Compute the Inner Integral: (Integrate with respect to y, then evaluate the inner integral) $\int_{0}^{\sqrt{1-x^2}} (1-x^2-y^2)dy = \left[y - x^2y - \frac{y^3}{3}\right]_{0}^{\sqrt{1-x^2}}$
Factor out $y$: $= \left[y(1 - x^2) - \frac{y^3}{3}\right]_{0}^{\sqrt{1-x^2}}$
Substitute the upper limit: $= \sqrt{1-x^2}(1-x^2) - \frac{1}{3}(\sqrt{1-x^2})^3 = (1-x^2)^{\frac{3}{2}} - \frac{1}{3}(1-x^2)^{\frac{3}{2}} = \frac{2}{3}(1-x^2)^{\frac{3}{2}}$
Compute the Outer Integral (with respect to x): $\int_{0}^{1} \frac{2}{3}(1-x^2)^{\frac{3}{2}}dx$
Use trigonometric substitution: Let $x = \sin(\theta)$. Then $dx = \cos(\theta)d\theta$. When $x=0, \theta=0$; when $x=1, \theta=\frac{\pi}{2}$.
Besides, $(1-x^2)^{\frac{1}{2}} = (1-\sin^2(\theta))^{\frac{1}{2}} = \cos(\theta)$.
$= \int_{0}^{\frac{\pi}{2}} \frac{2}{3}(\cos^2(\theta))^{\frac{3}{2}}\cos(\theta)d\theta = \frac{2}{3}\int_{0}^{\frac{\pi}{2}} \cos^4(\theta)d\theta$
Power-Reducing Identities: $\cos^2(\theta) = \frac{1+\cos(2\theta)}{2}$, $\cos^4(\theta) = \left(\frac{1+\cos(2\theta)}{2}\right)^2 = \frac{1}{4}(1 + 2\cos(2\theta) + \cos^2(2\theta))$. Finally, we apply the identity again for $\cos^2(2\theta) = \frac{1+\cos(4\theta)}{2}$.
Substituting the expanded identity: $\frac{2}{3} \cdot \frac{1}{4} \int_{0}^{\frac{\pi}{2}} \left(1 + 2\cos(2\theta) + \frac{1}{2} + \frac{\cos(4\theta)}{2}\right)d\theta = \frac{1}{6} \int_{0}^{\frac{\pi}{2}} \left(\frac{3}{2} + 2\cos(2\theta) + \frac{\cos(4\theta)}{2}\right)d\theta$
$= \frac{1}{6} \left[\frac{3}{2}\theta + \sin(2\theta) + \frac{1}{8}\sin(4\theta)\right]_{0}^{\frac{\pi}{2}} = \frac{1}{6}\left(\frac{3}{2}\cdot\frac{\pi}{2} + 0 + 0\right) = \frac{\pi}{8}$
To find the volume V of the solid, we use a double integral. The volume is given by: V = $\iint_R f(x, y) dA$ where f(x, y) represents the height of the solid above the region R in the xy-plane. The plane equation 2x +y +4z = 4 can be rearranged to express z in terms of x and y: z = $\frac{1}{4}(4-2x-y)$ (Figure iii).

The region R is the projection (or the “footprint”) of the solid onto the xy-plane (where $z = 0$). Setting $z=0$ gives the boundary line $2x + y = 4$, or $y = 4 - 2x$.
Therefore, the region R, shown in Figure iii, is $R = \{(x, y): 0 \le x \le 2, 0 \le y \le 4 -2x \}$
In its current form, this integral cannot be solved because $\frac{e^y}{y}$ lacks an elementary antiderivative. We must exchange the order of integration, which will structurally change the bounds of the integrals(Figure v).

Region of Integration.
To change the order of integration, we first need to understand the region of integration. The region is bounded by: x ranging from 0 to 1, y ranging from $\sqrt{x}$ to x (notice that the inner integral moves from a larger value to a smaller one because $\sqrt{x} \gt x$ on this interval).
When changing the order of integration, y will go from 0 to 1, and for a given y, x will range from $y$ to $y^2$. To maintain consistency with the original orientation, the limits integrate from the larger value $y$ to the smaller value $y^2$. Therefore, the new integral becomes: $\int_{0}^{1} (\int_{\sqrt{x}}^{x} \frac{e^y}{y}dy)dx = \int_{0}^{1} (\int_{y}^{y^2} \frac{e^y}{y}dx)dy$.
Compute the Inner Integral: $\int_{y}^{y^2} \frac{e^y}{y}dx = \frac{e^y}{y}x\bigg|_{y}^{y^2}=e^yy-e^y$
Compute the Outer Integral: $\int_{0}^{1} e^yy-e^ydy = \int_{0}^{1} e^yydy - \int_{0}^{1} e^ydy$
The second part requires Integration by Parts ($\int u dv = uv - \int v du$): Let $u = y$, $dv = e^y dy$. Then, $du = dy$, $v = e^y$.
$\int e^yydy = ye^y -\int e^ydy$
$ye^y\bigg|_{0}^{1} = e -0 = e$
$\int e^ydy = e^y\bigg|_{0}^{1} =e -1$
Putting it all together:
$\int_{0}^{1} e^yy-e^ydy = (e -(e-1))-(e -1)= e -e +1 -e +1 = 2 -e$