# Integration by parts, geometry, signed areas

IBP works both for increasing and decreasing functions.
trying to understand why it gives the correct area in both cases...

As shown, when the point B moves from top to down, IBP exactly removes the unwanted areas and gives the correct area. It seems every formula/expression just works out no matter how the curve is. It doesn't seem that intuitive. Why is it so?

horizontal axis is $$u=u(t)$$
vertical axis is $$v=v(t)$$

Consider 2 scenarios.

1) Increasing function
By IBP, area of green region is given by:
$$\int_{t=A}^{t=B} vdu = uv|_{t=A}^{t=B} - \int_{t=A}^{t=B} udv$$ 2) Decerasing function
By IBP, area of green region is given by:
$$\int_{t=A}^{t=B} vdu = uv|_{t=A}^{t=B} + \int_{t=B}^{t=A} udv$$  $$\int_{t=A}^{t=B} vdu=S_{ABCD}=I, uv|_{t=A}^{t=B}=S_{BCDAFG}=I+III,\int_{t=A}^{t=B} udv=S_{BAFG}=III \\ \to I=（I+III）-III$$
$$\int_{t=A}^{t=B} vdu = uv|_{t=A}^{t=B} - \int_{t=A}^{t=B} udv$$
$$\int_{t=A}^{t=B} vdu=S_{ABCD}=I+IV, uv|_{t=A}^{t=B}=S_{BCEF}-S_{ADEG}=S_{BCDH}-S_{AHFG}=I-III,\\ \int_{t=B}^{t=A} udv=S_{ABFG}=III+IV \\ \to I+IV=(I-III)+(III+IV)$$
$$\int_{t=A}^{t=B} vdu = uv|_{t=A}^{t=B} + \int_{t=B}^{t=A} udv$$