I am looking for a function $\phi(x)$ such that


$\mathbb{E}\_{x\sim\mathcal{N}(0,1)}[\phi(x)^2] = \mathbb{E}\_{x\sim\mathcal{N}(0,1)}[\phi'(x)^2]$.


Obvious solutions are $\phi(x) = x$ and $\phi(x) = \exp(x)$. But do you know any other non-trivial solution?



When do $\phi^2$ and $\phi’^2$ have the same expectation under a Gaussian random variable?
In fact, every reasonable function can be made into an example by adding an appropriate constant.


I'll write $Z$ for a standard Gaussian random variable. Recall the Gaussian Poincaré inequality:



> 
> **Theorem.** For every $f \in C^1(\mathbb{R})$ we have $\operatorname{Var}[f(Z)] \le E[f'(Z)^2]$.
> 
> 
> 


Equivalently, this is the fact that the Ornstein-Uhlenbeck "number" operator has spectral gap equal to 1. Perhaps the simplest way to prove the Poincaré inequality is via Hermite polynomials; see Bogachev, *Gaussian Measures*, Theorem 1.6.4. The statement generalizes directly to absolutely continuous functions (in the appropriate Sobolev space over Gaussian measure)



> 
> **Corollary.** Let $f \in C^1(\mathbb{R})$ with $E[f(Z)^2], E[f'(Z)^2] < \infty$. There exist either one or two real numbers $c$ such that $\phi(x) := f(x) + c$ satisfies $E[\phi(Z)^2] = E[\phi'(Z)^2]$.
> 
> 
> 


*Proof.* Set 
$$\begin{align\*}\psi(c) &:= E[\phi(Z)^2] - E[\phi'(Z)^2] \\ &= \operatorname{Var}[\phi(Z)] + (E[f(Z)] + c)^2 - E[\phi'(Z)^2] \\
&= \operatorname{Var}[f(Z)] + (E[f(Z)] + c)^2 - E[f'(Z)^2]\end{align\*}.$$
Now $\psi(c)$ is a quadratic in $c$ with $\psi(c) \to +\infty$ as $c \to \pm \infty$, and by the Poincaré inequality we have $\psi(-E[f(Z)]) \le 0$. So $\psi$ has either one or two real roots. 


Indeed, the only way for the constant $c$ to be unique is if $f$ is a linear function, because that is the only case in which the Poincaré inequality saturates. Again, this can be seen via Hermite polynomials.


