# A quick expectant value question

1. Feb 4, 2012

### StephenD420

Solve <cos(n*pi*x/L)> = integral from negative infinity to positive infinity of x*cos^2(n*pi*x/L)dx
if we use integration by parts with u=x du=dx and dv=cos(2*n*pi*x/L) and v=(L/2*pi*n)*sin(2*pi*n*x/L)
gives
L/((2*pi*n)^2)x*sin(2*pi*n*x/L) + (L/2*pi*n)^2*cos(2*pi*n*x/L) + 1/4*x^2

but now how do I solve this from negative infinity to positive infinity??

Thanks.
Stephen

2. Feb 4, 2012

### vela

Staff Emeritus
Is this for the infinite square well? If so, the limits on your integral are wrong because the wave function is 0 outside the well.

3. Feb 4, 2012

### StephenD420

nope no infinite square well
the question just asks us to find <cos(n*pi*x/L)>
thats it....
any help????

4. Feb 5, 2012

### vela

Staff Emeritus
It would help if you provided more context. In any case, the integral in your original post isn't correct. I'm not sure why you're throwing in a factor of x and squaring the cosine.

5. Feb 5, 2012

### StephenD420

According to my professor and the question <wave equation>=integral from negative to positive infinity of wave function * conjugate of wave function*x
so if wave function = cos(n*pi*x/L)
<cos(n*pi*x/L)>= the integral from negative to positive infinity of x*cos^2(n*pi*x/L) dx

I know this is right as it is in the problem statement so.....
any help???

6. Feb 5, 2012

### vela

Staff Emeritus
The notation $\langle Y \rangle$ means
$$\langle Y \rangle = \int_{-\infty}^\infty \psi^*(x)Y\psi(x)\,dx$$ where Y is some operator, so what you're writing is
$$\langle \cos(n\pi x/L) \rangle = \int_{-\infty}^\infty \psi^*(x) \cos(n\pi x/L) \psi(x)\,dx$$ What you seem to mean is you want to calculate
$$\langle x \rangle = \int_{-\infty}^\infty \psi^*(x) x \psi(x)\,dx$$ when the system is in the state given by $\psi(x) = \cos(n\pi x/L)$.

7. Feb 5, 2012

### StephenD420

Ok...my professor basically said that <x> and <wave function> was the same thing and when he wrote <wave function> then he means <wave function> = ∫∞−∞ψ∗(x)xψ(x)dx
when the system is in the state given by ψ(x)=cos(nπx/L).
So now that I solved the integral in my original post...How do I find the solution using
L/((2*pi*n)^2)x*sin(2*pi*n*x/L) + (L/2*pi*n)^2*cos(2*pi*n*x/L) + 1/4*x^2 + C
from a general solution to a specific solution from negative to positive infinity????
would it be lim n->infinity L/((2*pi*n)^2)x*sin(2*pi*n*x/L) + (L/2*pi*n)^2*cos(2*pi*n*x/L) + 1/4*x^2
so 0+ (L/2*pi*n)^2 +0 = (L/2*pi*n)^2 ??????

Thanks for the help.
Stephen

8. Feb 5, 2012

### vela

Staff Emeritus
Why would you take a limit as n goes to infinity?

9. Feb 5, 2012

### StephenD420

Because since I found the general solution I have to input the integral limits which from CALC II you take the limit as n goes to negative infinity + limit as n goes to positive infinity.......

10. Feb 5, 2012

### vela

Staff Emeritus
But you're integrating with respect to x, not n.

11. Feb 5, 2012

### StephenD420

I meant x not n

but the integral should be 0+(L/2*pi*n)^2 +0-0+(L/2*pi*n)^2 +0 = 0

and since the integral is an orthogonality integral it should equal zero right or is the answer
2(L/2*pi*n)^2 ???
Any help would be apprecaited

12. Feb 5, 2012

### vela

Staff Emeritus
Evaluate the integral as
$$\lim_{b \to \infty} \int_{-b}^b x\,\cos^2(n\pi x/L)\,dx$$ You should find it comes out to be 0. Because of the sines, cosines, and diverging terms, you can't simply plug in infinity like usual. The other way to see it is that the integrand is an odd function of x.

13. Feb 5, 2012

### StephenD420

Is there a way to plug that equation into a ti-89 since we have several variable constants or mathematica???

Thanks so much for the help.
Stephen

14. Feb 5, 2012

### vela

Staff Emeritus
I'm going to assume you integrated correctly. You get
$$\left[\frac{L}{(2\pi n)^2}x\sin\left(\frac{2\pi n}{L}x\right) + \frac{L}{(2\pi n)^2}\cos \left(\frac{2\pi n}{L}x\right) + \frac{1}{4}x^2 \right]_{-b}^b$$ You should be able to see that's equal to 0 pretty easily.

EDIT: The last term is obviously wrong. Perhaps it's missing factor of 1/L. If you look at the units of the original integral, you'll see it has units of length. So your answer should have units of length, which the first two terms do, but the last doesn't.