Given the normalised ground-state wave-function: $$\Psi(x, t)=\begin{cases} \sqrt\frac{2}{d}\cos(\frac{\pi x}{d})e^\frac{-i\hbar\pi^2t}{2md^2} & \ \lvert x\rvert<\frac{d}{2}, \\ 0 & \text{otherwise.} \end{cases}$$ for a particle of mass $m$ confined to potential well of form: $$V(x)=\begin{cases} 0 & \ \lvert x\rvert<\frac{d}{2}, \\ \infty & \text{otherwise.} \end{cases}$$ show that $\langle x\rangle =0$
I'm told that the correct answer is $$\langle x\rangle=\int_{-\frac{d}{2}}^\frac{d}{2} x\frac{2}{d}\cos^2\biggl(\frac{\pi x}{d}\biggr)\mathrm{d}x=0$$ as the integrand is an odd function. But I don't understand why the integrand takes this form. Could some please explain it to me? I would like to know where the $x$ comes from? Thanks.
Expectation of $x$ is the position of the particle and by my logic this is $\langle x\rangle = \int\psi^*(x)\psi(x)dx=\int_{-\frac{d}{2}}^\frac{d}{2} \frac{2}{d}\cos^2\biggl(\frac{\pi x}{d}\biggr)\mathrm{d}x$ basically without the factor $x$ as shown above which was my reason for asking about it.