# Need help with expectation value !

1. Feb 29, 2008

### begyu85

1. The problem statement, all variables and given/known data

I have a random, uniformly distributed vector with Cartesian components x,y,z. I should calculate the expectation value of the products of the components, e.g. $$<x\cdot x>, <x\cdot y>, ..., <z\cdot z>$$.

2. Relevant equations

In spherical coordinates the $$x,y,z$$ components are

$$x = \sin(\theta)\cdot\cos(\phi)$$
$$y= \sin(\theta)\cdot\sin(\phi)$$
$$z = \cos(\theta)$$

$$<x\cdot x> =\int f(x)\cdot x^2 dx = const.\times \int x^2 dx$$,
because the probability density function is constant of the uniform probability distribution.

3. The attempt at a solution

I think it is useful to convert the Cartesian coordinates to spherical coordinates. So for example

$$<x\cdot x> = \int_{0}^{\pi}d\theta\int_{0}^{2\pi}d\phi~~[\sin(\theta)\cdot\cos(\phi)]^{2}$$

I wrote a program for this, and the solution is:

$$<x\cdot x> = <y\cdot y> = <z\cdot z> = \frac{1}{3}$$
and the other terms are zero.

But the solution of the above integral is not 1/3.

2. Mar 1, 2008

### chaoseverlasting

You dont need to convert to spherical coordinates, the limit you're assuming is from 0 to 1 on all three axes. And the value of the integral IS 1/3, but you've forgotten to multiply by f(x).

I dont know if youre calculating the same expectation value, but in QM, $$<f>=\int_{a}^{b}f(r)*f'*f(r)'dr$$,

where f' is the operator, f(r) is the function (physical quantity), and f(r)' is its conjugate. If f is real only, then f(r)=f(r)' and the integral becomes,

$$f(r)^2\int_{a}^{b}f'dr$$

If that is what you were trying to calculate, then you missed out by a factor of $$f(x)^2$$. Also, $$\theta$$ is a constant, not a variable.