Mathematica Asked on February 27, 2021
P1 = Integrate[(Abs[[Psi]s1])^2, {x, 0,b}]
When I integrate the above function, I am getting an answer as below. I am not sure what’s going on.
1/3 a A Conjugate[A]
Psi]s1 is same as the following piecewise function. ie, [Psi]s1= [Psi][x, 0]
I am expecting,
Then only further calculations can be performed.
Also while integrating the modulus square of the above piece wise functions , it is showing an error.
[Psi][x_, 0] :=
Piecewise[{{(A*x)/a, 0 <= x <= a}, {A*(b - x)/(b - a), a <= x <= b}}]
Integrate[(Abs[[Psi][x, 0]])^2, {x, a, b}]
The original answer is:
Clear["Global`*"]
Include the assumption 0 < a < b
ψ[x_, 0] :=
Piecewise[{{(A*x)/a, 0 <= x <= a}, {A*(b - x)/(b - a), a <= x <= b}}]
Assuming[0 < a < b,
Integrate[(Abs[ψ[x, 0]])^2, {x, 0, b}] // Simplify]
(* 1/3 b Abs[A]^2 *)
Assuming[0 < a < b,
Integrate[(Abs[(A*x)/a])^2, {x, 0, a}] +
Integrate[(Abs[A*(b - x)/(b - a)])^2, {x, a, b}] // Simplify]
(* 1/3 b Abs[A]^2 *)
Assuming[0 < a < b,
Integrate[(Abs[ψ[x, 0]])^2, {x, 0, a}] +
Integrate[(Abs[ψ[x, 0]])^2, {x, a, b}] // Simplify]
(* 1/3 b Abs[A]^2 *)
Correct answer by Bob Hanlon on February 27, 2021
Get help from others!
Recent Questions
Recent Answers
© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP