0
$\begingroup$
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,

d

Then only further calculations can be performed.

s

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:

ss s

$\endgroup$
2
  • 1
    $\begingroup$ You have not provided all of the definitions, e.g., what is \[Psi]s1? $\endgroup$
    – Bob Hanlon
    Oct 19, 2020 at 0:00
  • $\begingroup$ Edited the question by including the definition. $\endgroup$
    – Jasmine
    Oct 19, 2020 at 0:04

1 Answer 1

1
$\begingroup$
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 *)
$\endgroup$
3
  • $\begingroup$ When I solve for the A, I am getting both positive and negative values. That means Abs is not working properly. This is because absolute value of a quantity shouldn't be negative! ie, A1 = Assuming[0 < a < b, Solve[ 1/3 b Abs[A]^2 == 1, Abs[A]]] $\endgroup$
    – Jasmine
    Oct 19, 2020 at 0:34
  • 1
    $\begingroup$ You are trying to use Abs[A] as if it were a variable. The Abs in that context doesn't get evaluated. You probably intend A1 = Assuming[0 < a < b, Solve[{1/3 b Abs[A]^2 == 1}, A]] $\endgroup$
    – Bob Hanlon
    Oct 19, 2020 at 0:52
  • $\begingroup$ Both are giving same results! But I understood your point $\endgroup$
    – Jasmine
    Oct 19, 2020 at 0:55

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.