Imagine having some undefined functions $X(x),\ Y(x), \dots$, and all we know about them is that they integrate to specific constants, i.e. $$\bar X := \int_{-\infty}^\infty \text d x \ |X(x)|^2, \quad \bar Y := \int_{-\infty}^\infty \text d x \ |Y(x)|^2, \quad \dots $$
What I want Mathematica to do is calculating the integral $\int_{-\infty}^\infty \text d x \ f(x)$ of a function that looks approximately like $$f(x) = a X(x)X(x)^* + bY(x)Y(x)^* + \dots$$ and then return something like $$a \bar X + b \bar Y + \dots\ .$$ Do you have any idea, how i can do this in Mathematica? In fact my $f(x)$ is a bit more complicated, but this example should illustrate my problem.