In engineering mechanics, a classic approach for the calculation of displacements (virtual work method) requires the evaluation of the definite integral of the product of two continuous functions in $[x_1,x_2]$. For beam elements the first function is arbitrary and the second one is linear. In the literature it is common to use a visual trick to evaluate those integrals for beams. The trick is summarized in the following equation:
$\int_{x_1}^{x_2}y_1(x) y_2(x)dx = a_{y_1}\bar{y_2}$
where $y_1(x)$ is the arbitrary function, $y_2(x)$ is a linear function, $a_{y_1}$ is the area of the graph of $y_1(x)$ between $x_1$ and $x_2$, and $\bar{y_2}$ is the ordinate of $y_2$ opposite to the centorid of $a_{y_1}$.
Unfotunately I can't find any references with the proof for that equation. Do you have any ideas how I can justify the usage of the afformentioned equation?
Just write the linear function as $y_2(x) = cx + d$.
\begin{align} \int_{x_1}^{x_2}y_1(x) y_2(x) dx &= \int_{x_1}^{x_2}y_1(x) (cx + d) dx = c \int_{x_1}^{x_2} x y_1(x) dx + d \int_{x_1}^{x_2}y_1(x) dx \\ &= \left(\int_{x_1}^{x_2}y_1(x) dx\right) \left( c \frac{\int_{x_1}^{x_2} x y_1(x) dx}{\int_{x_1}^{x_2} y_1(x) dx} + d \right). \end{align} Notice that the first term is the area of $y_1$ and the second term is applying $y_2$ to the centroid of $y_1$.