Non-trivial examples of taking the exponential of an integral This question is inspired by a recent course I did on random matrix theory and also from common mistakes high-schoolers make in algebra :).
In random matrix theory, one often encounters somewhat intractable integrals involving a logarithmic term that are often made more amenable to analysis using the replica trick, that is, say, in the case of trying to find the expectation of logarithm of a partition function, $Z(x)$, one can use the identity:
$$\mathbb{E}\big[\log Z(x)\big] = \lim_{n\to 0} \frac{1}{n}\log \mathbb{E}\big[Z(x)\big]^n.$$
This helps to evaluate integral more easily because the partition function usually takes the form of an exponential multiplied by another function. 
My question is much simpler than this. Under what conditions would it just justifiable, or through the use of what technique would it be possible that either of the following relations
$$ \int \exp(f(x)) dx = \exp\left(\int f(x) dx\right) $$
or
$$ \int \log(f(x)) dx = \log\left(\int f(x) dx\right) $$
holds. Here $f\in \mathbb{C}^{\infty}$ and the integral denotes the Riemann integral.
 A: Given $f(x)>0$ for $x>0$, we could extend the function to negative $x$ by demanding that:
$$f(-x)=f(x)-\log(e^{f(x)}-1)$$
then
$$e^{f(x)}+e^{f(-x)}=\exp[f(x)+f(-x)],$$
hence $\int e^f\,dx = \exp\left(\int f\,dx\right)$. A discontinuity at $x=0$ can avoided if $f(0)=\log 2$.
As pointed out by Pietro Majer, this construction needs a finite domain $-a<x<a$ for a convergent integral. [Alternatively, the domain could be displaced to $(a,b)$ by relating $f(x)$ to $f(a+b-x)$.]
A: Here's one way to get lots of examples.
Start with a finite interval $[a,b]$ and a function $g$ on this interval
such that $\int_a^b g(x)\; dx > 0$, and
for $c > 0$ and $d > 0$ consider $f$ defined on $[ca, cb]$ by $f(x) = d g(x/c)$.  Then
$$ A(c,d)  := \exp\int_{ca}^{cb} f(x)\; dx = \exp\left(c d \int_a^b g(t)\; dt\right) $$
$$ B(c,d) := \int_{ca}^{cb} \exp(f(x))\; dx =  c \int_a^b \exp(d g(t))\; dt $$
We have $A(0,d) = 1$ and $B(0,d) = 0$, while for any fixed $d > 0$, 
$A(c,d) > B(c,d)$  if $c$ is sufficiently large.  Thus by the Intermediate Value Theorem, there will be some $c$ that makes $A(c,d) = B(c,d)$.
