Characteristic function of $X+X^2$ if $X$ is a standard Gaussian random variable Can anyone please tell me how I can find the characteristic function of the random variable given by the sum $X+X^2$ where $X$ is a standard Gaussian random variable?
Many thanks!
 A: In a comment I indicated how the answer can be found from knowledge of the Non-central chi-squared distribution.  Here I will sketch how to find it from the definition.
Let $X$ be a random variable.  Recall that the characteristic function of any random variable $g(X)$ is, by definition, a function of a real variable $t$ given by
$$\phi_{g(X)}(t) = E\left[e^{ig(X)t}\right]$$
where $i^2=-1$ is a Complex imaginary unit.
For a standard Gaussian (Normal) random variable, this expectation is the integral against the Normal density $$f(x)\mathrm{d}x = \frac{1}{\sqrt{2\pi}} e^{-x^2/2}\mathrm{d}x,$$
so with $g(x) = x+x^2$ we find
$$\eqalign{\phi_{X+X^2}(t) &= \frac{1}{\sqrt{2\pi}}\int_{\mathbb{R}} e^{i(x+x^2)t}e^{-x^2/2}\mathrm{d}x = \frac{1}{\sqrt{2\pi}}\int_{\mathbb{R}} e^{-(x^2 -2i(x+x^2)t)/2}\mathrm{d}x.\tag{1}
}$$
Evaluate this integral by completing the square
$$x^2 - 2i(x+x^2)t = (1-2it)\left(x^2 -\frac{2ixt}{1-2it}\right) = (1-2it)\left(x -\frac{it}{1-2it} \right)^2 + \frac{t^2}{1-2it}.$$
This puts the exponent in integral $(1)$ into the form 
$$-\frac{1}{2\sigma^2}((x-\lambda)^2) + \gamma$$
where $\sigma^2 = 1/(1-2it),$ $\lambda = it/(1-2it),$ and $\gamma = -t^2/(2(1-2it)).$  Because
$$1 = \frac{1}{\sqrt{2\pi\sigma^2}}\int e^{-u^2/(2\sigma^2)} \mathrm{d}u,$$ upon the change of variable $u=x-\lambda,$ $(1)$ becomes
$$\eqalign{\phi_{X+X^2}(t) &= e^{\gamma}\frac{1}{\sqrt{2\pi}}\int_{-\infty-\lambda}^{\infty-\lambda} e^{-u^2/(2\sigma^2)}\mathrm{d}u \\&= e^\gamma \sqrt{\sigma^2}\frac{1}{\sqrt{2\pi\sigma^2}}\int_{-\infty-\lambda}^{\infty-\lambda} e^{-u^2/(2\sigma^2)}\mathrm{d}u \\ 
&= e^\gamma \sqrt{\sigma^2} \\&=\frac{e^{-t^2/(2(1-2it))}}{\sqrt{1-2it}}.
}$$

As a quick check, I simulated 10,000 realizations of $X$ and estimated $\phi_{X+X^2}(t)$ for a range of values of $t$ by averaging their realizations.  This figure graphs the real and imaginary parts of $\phi_{X+X^2}$ in red and overplots the simulated estimates: the agreement is excellent.

This is the R code to do these calculations:
x <- rnorm(4e4)
t <- seq(-1e2, 1e2, length.out=201)
z <- sapply(t, function(t) mean(exp((x + x^2) * (1i * t))))
phi <- function(t) exp(-t^2 / (2*(1-2i * t))) / sqrt(1 - 2i * t)
par(mfrow=c(1,2))
for (s in list("Re", "Im")) {
  f=eval(parse(text=s))
  curve(f(phi(t)), xname="t", xlim=range(t), col="Red", lwd=2, n=501, ylab="", 
        main=substitute(f(phi[X+X^2]), list(f=s)))
  points(t, f(z), pch=16, cex=1/2)
}
par(mfrow=c(1,1))

