Definite integral of function is zero I am attempting to solve an equation wherein $\int_{-\infty}^\infty f(x) \, dx = 0$. There obviously exist some some solutions, such as $f(x) = xe^{-x^2}$ and trivially $f(x) = 0$, but is there a general pattern apart from the function being odd? $\sin(x)$ obviously does not work, even though it's an odd function.
 A: Given any function on the positive real line $f(x)$ such that $I_1 = \int_0^{\infty} f(x) dx \in \mathbb{R}$, and any other function on the negative real line $g(x)$ such that $J_1 = \int_{-\infty}^0 g(x) dx \in \mathbb{R}$ and $J_1 \neq 0$, define
$$h(x) = \begin{cases}
f(x) & \text{ if }x > 0\\
-\dfrac{I_1}{J_1} g(x) & \text{ if }x<0\\
h_0 & \text{ if }x=0
\end{cases}$$
The function $h(x)$ has the desired property.
A: The only "pattern" is that the integral of $f$ where $f$ is positive must equal in absolute value the integral of $f$ where $f$ is negative. 
A: The condition $\int_{-\infty}^\infty f(x)\>dx=0$ is, apart from convergence issues, a very weak condition on $f$.
Fix a function $u_0$ with $u_0(x)\geq0$ for all $x\in{\mathbb R}$ and $\int_{-\infty}^\infty u_0(x)\>dx=1$, e.g., $u_0:=$ the standard normal distribution.
Let $g:\>{\mathbb R}\to{\mathbb R}$ be any function with $\int_{-\infty}^\infty \bigl|g(x)\bigr|\>dx<\infty$. Then the number $\alpha:=\int_{-\infty}^\infty g(x)\>dx$ is well defined, and the function
$$f(x):=g(x)-\alpha u_0(x)$$
satisfies the condition $\int_{-\infty}^\infty f(x)\>dx=0$.
