I'm trying to expedite some quantum mechanical calculations (expectation values etc.) by running them through Mathematica. When I say, for example,
u[x_] := Sqrt[2/L] * Sin[Pi * n * x / L]
and then take the complex conjugate, I get
Sqrt[2] Conjugate[Sqrt[1/L]] Sin[(Ï€ Conjugate[n x])/Conjugate[L]]
But I want to tell Mathematica that some of the parameters are real (i.e. $L$) and some are integer valued and real (i.e. $n$). Is there a way to do that? I've tried adapting some syntax that I've seen in other context (but do not strictly know what it means or does) but it hasn't worked. For example,
Conjugate[u[x], Im[n] = 0]
Sin[n*Pi] /. n = Integer
Don't work the way I want them to. Chugging through this, however, when it comes time to compute values (like, in this example, $
$, I get the following:
Integrate[u[x]*(-h^2)*u''[x], {x, 0, L}]
(* => (h^2 n π (n π - 1/2 Sin[2 n π]))/L^2 *)
Where the second term there is clearly zero for all integer values of $n$ (but Mathematica doesn't know that).
Comments
Post a Comment