How to find correlation between two functions? Let's say I have two functions, $f$ and $g$.  Both take the same normally distributed random variable ($X$) as an input.
\begin{align}
f(X) &= X \\
g(X) &= X^2
\end{align}
How does one find the correlation between these two functions, or any two functions in general?
I'd like to do so closed form.  No simulation, no interpolation.
Edit:  Specified normal distribution.
 A: If you apply a function to a random variable you get a new random variable (the function should be measurable for this to hold). Then you can proceed to calculate correlation in the usual manner. So if you take any $f$ and $g$ and normal variable $X$, the desired correlation is 
$$cor(f(X),g(X))=\frac{cov(f(X),g(X))}{\sqrt{Var(f(X))}\sqrt{Var(g(X))}}$$
Now 
\begin{align}
cov(f(X),g(X))&=E[f(X)g(X)]-E[f(X)]E[g(X)]\\
Var(f(X))&= E[f^2(X)]-E[f(X)]^2\\
Var(g(X))& = E[g^2(X)]-E[g(X)]^2 
\end{align}
so you need to calculate 5 integrals: $E[(f\cdot g)(X)]$, $E[f(X)]$, $E[f^2(X)]$, $E[g(X)]$, $E[g^2(X)]$ to get the correlation. Even if the $X$ distribution is known and normal, there is no closed form solution for general $f$ and $g$. The particular case of $f(x)=x$ and $g(x)=x^2$ is covered by the answer of Dilip Sarwate. Since you can find closed formulas for moments of normal variables, it would be possible to derive the closed formula in the case of polynomial $f$ and $g$.
A: For the given functions $X$ and $X^2$ with $X \sim(\mu,\sigma^2)$ being a normal
random variable, finding 
$\operatorname{cov}(X,X^2)$ is relatively
easy, and then the (Pearson) correlation coefficient can be found as
$$\rho = \frac{\operatorname{cov}(X,X^2)}{\sqrt{\operatorname{var}(X)
\operatorname{var}(X^2)}}.$$
Note that 
$\operatorname{cov}(X,X^2) = E[X\cdot X^2]-E[X]E[X^2]
= E[X^3]-E[X]E[X^2]$ where the values of all three expectations
can be found in numerous texts and tables as well as on
Wikipedia.
For example, $E[X^3] = \mu^3 + 3\mu\sigma^2$.
Similarly, $\operatorname{var}(X^2) = E[X^4]-\left(E[X^2]\right)^2$
also can be calculated using the known formulas for the
moments of a normal random variable.
