I'm continuing[1,2] the study of an infinite square well in the context of quantum mechanics.
Ultimate goal is to calculate the product $\Delta x\Delta k$, for various eigenstates, that is for various values of number $n$. I have finished with $\Delta x$, but I'm stuck with $\Delta k$.
ClearAll["Global`*"];
(* The length of the well *)
L = 1;
(* The eigenfunctions, n=1,2,3,... *)
u[n_, x_] := If[x <= 0 || x >= L, 0, Sqrt[2/L] Sin[n π x / L]]
(* The Fourier transform of eigenfunctions u[n,x] from the position
domain onto the momentum domain *)
φ[n_, k_] :=
Simplify[
FourierTransform[u[n, x], x, k, FourierParameters -> {0, -1}],
n ∈ Integers]
(* The probability density function η(n,k) *)
η[n_, k_] :=
FullSimplify[φ[n, k] \[Conjugate] φ[n, k],
{n ∈ Integers, k ∈ Reals}]
(* Calculate (Δk)^2 = <k^2> - <k>^2 = <k^2> *)
Integrate[
k^2 η[n, k], {k, -∞, +∞},
(* Edited: Was: {n ∈ Integers, n > 0}, but this edit didn't
fix the problem. *)
Assumptions -> n ∈ Integers && n > 0]
The problem is that Mathematica can't calculate the last integral for any arbitrary $n$, although it can, correctly, calculate its value for hardcoded $n$s. Like $n=1,2,...$.
My question is: Do you have any idea on how I could calculate it, perhaps by rewriting it a bit, or by using some other trick? In case it helps, the result should be $n^2\pi^2$.
Note: Actually it can be calculated with Cauchy's residue theorem, but I'd like to avoid taking that route, if possible. Though, if it can't be done otherwise, I will post a solution with residual calculation so that this question has an answer.
Mathematica.SE related (to the physical problem) questions:
Is there a more mathematica-y way to label these plots?
Why does FourierTransform converge while same integral manually written does not?


