Given the following integral: $$\int_{y_1=0}^{y_2=x}\,dy\int_{x_1=1}^{x_2=2}\arctan\left(\frac{y}{x}\right)\,dx$$
I thought of using $u$-substitution:
$$\begin{align} u &= \frac{y}{x} \\ w &= \arctan(u) \\ \frac{\partial w}{\partial y} &= -\frac{x}{y^2 \cdot (1 + u^2)} \\ \frac{\partial w}{\partial x} &= \frac{1}{y \cdot (1 + u^2)} \end{align}$$
But then... how do I use the partial derivatives for integration?
$$ \int \arctan(\frac{y}{x})\;dx, \;\text{ Let } u=\arctan\frac{y}{x}\; \Rightarrow \; du = \frac{1}{(\frac{y}{x})^2+1}\cdot \frac{-y}{x^2}dx \; \Rightarrow \; du = \frac{-y}{x^2+y^2}dx \\ \text{and let } dv=dx \; \Rightarrow \; v=x \\ \text{Therefore} \\ \int u \;dv = uv \; - \; \int v\;du \;\; \Rightarrow \; \; \int \arctan\frac{y}{x}dx = \; x\cdot \arctan\frac{y}{x} \; + \; \int \frac{xy}{x^2+y^2}dx $$
To solve $$ \int \frac{xy}{x^2+y^2}dx $$ we can let $w = x^2+y^2$, where $\frac{1}{2}dw = x\;dx$
Which gives us $$ \int \frac{xy}{x^2+y^2}dx \; = \; \frac{1}{2}y\int\frac{1}{w}dw \; = \frac{1}{2}y\cdot \ln|w| \; = \frac{1}{2}\cdot y \cdot \ln|x^2+y^2| $$
giving us the final result of $$ \int \arctan\frac{y}{x}dx = x\cdot \arctan\frac{y}{x} \; + \; \frac{1}{2} \cdot y \cdot \ln|x^2+y^2|+C $$