I know that two functions which describe the state of a particle in an infinite square (on interval $-d/2<x<d/2$) well are like:
\begin{align} \psi_{even}&= \sqrt{\frac{2}{d}}\sin\left(\frac{N\pi x}{d}\right)\quad N=2,4,6\dots\\ \psi_{odd} &= \sqrt{\frac{2}{d}}\cos\left(\frac{N\pi x}{d}\right)\quad N=1,3,5\dots \end{align}
Q1: I am a bit unsure, but correct me if I am wrong. I assume that if I want to calculate the ground state $N=1$ I have to take the odd solution and set $N=1$ like this:
$$ \psi = \sqrt{\frac{2}{d}}\cos\left(\frac{1\pi x}{d}\right) $$
but if I want to calculate for the state $N=2$ i must take the even function and set $N=2$ like this:
$$ \psi = \sqrt{\frac{2}{d}}\sin\left(\frac{2\pi x}{d}\right) $$
Is this correct? Is there any need to superpose the odd and even functions or anything like that?
Q2: Now lets say I have to calculate $\langle x^2\rangle$ for the ground state. Do I do it like this?
$$\int\limits_{-d/2}^{d/2}\sqrt{\frac{2}{d}}\cos\left(\frac{1\pi x}{d}\right) x^2\sqrt{\frac{2}{d}}\cos\left(\frac{1\pi x}{d}\right) dx$$
Or for the 1st excited state:
$$\int\limits_{-d/2}^{d/2}\sqrt{\frac{2}{d}}\sin\left(\frac{2\pi x}{d}\right) x^2\sqrt{\frac{2}{d}}\sin\left(\frac{2\pi x}{d}\right) dx$$
Q3: Are $\langle x^2\rangle$ in general the same for the intervals $-d/2<x<d/2$ and $0<x<d$?
Thank you!