Example problem:
Calculate the total area bounded by $f(x)=\ln(x)$, $g(x)=2\ln(x)$, $x=1, x=e.$
Solution:
This can be done without sketching the case. $g(x) \ge f(x) \ge 0$ in $[1,e]$, and the area $A$ is $$ \int_{1}^{e} 2\ln(x)-\ln(x) dx = \int_{1}^{e} \ln(x) dx = 1$$
Question: Is there a general techique for this kind of problem, such that does not require sketching? (Because what if the function is complicated to be drawn)
Consider we want to write the somputation formally, we will come up with: $$A = \int_{\{x\in[1,e]: f(x) > g(x)\}}f(x)-g(x)\mathrm{d}x + \int_{\{x\in[1,e]: g(x) > f(x)\}}g(x)-f(x)\mathrm{d}x = \\ = \int_1^e|f(x)-g(x)|\mathrm{d}x = \\ = \int_1^e \max\{f(x),g(x)\}-\min\{f(x),g(x)\}\mathrm{d}x $$
In some cases it might be simple to calculate the cases (e.g. for continous functions we can find the zeros of $f-g$ and see how the function behaves between them), but sometimes it might get somplicated.