Basic complex number math -- what am I doing wrong?

In summary, the conversation discusses two different methods for finding the square magnitude of a function and how one method produces an extra cosine term. The error is found in incorrectly applying the identity |a+b|^2=|a|^2+|b|^2+2Re(ab).
  • #1
Isaac0427
Insights Author
718
163
For this, f and g are real functions, and k is a real constant.

I have ##\psi = fe^{ikx}+ge^{ikx}## and I want to find ##\left|\psi \right|^2##. I went about this two different ways, and got two different answers, meaning I must be doing something wrong.

Method 1:
##\psi =(f+g)e^{ikx}##
##\left|\psi \right|^2=(f+g)^2\left|e^{ikx}\right|^2=(f+g)^2=f^2+g^2+2fg##

Method 2:
Since ##|a+b|^2=|a|^2+|b|^2+2\Re (ab)##,
##|\psi |^2=f^2+g^2+2\Re \left( fge^{2ikx} \right)=f^2+g^2+2\cos(2kx)fg##

Method 2 gives me that extra cosine term. Where did I go wrong?
 
Mathematics news on Phys.org
  • #2
Isaac0427 said:
Since |a+b|2=|a|2+|b|2+2R(ab)|a+b|2=|a|2+|b|2+2ℜ(ab)|a+b|^2=|a|^2+|b|^2+2\Re (ab),
Edit: Why isn't formatting preserved in quotes?
Where does this come from? If we write a = a + ic and b = b + id
|a + b|2 = |a+b+i(c+d)|2 = (a+b)2 + (c+d)2 = a2 + c2 + b2 + d2 + 2(ab + cd)
ab = ab - cd + i(ad +bc)
Hence |a + b|2 is not equal to |a|2 + |b|2 + 2Re(ab)
 
  • Like
Likes Isaac0427
  • #3
Isaac0427 said:
Since ##|a+b|^2=|a|^2+|b|^2+2\Re (ab)##,
Where are you getting this from?
Edit: mjc beat me to it. BTW: You can format the TeX in the quotes directly.
 
  • Like
Likes Isaac0427
  • #4
TeethWhitener said:
Where are you getting this from?
Oh man... I messed up my identities... It should be 2Re(ab*) which would give me where I went wrong. Thank you for pointing this out!
 

FAQ: Basic complex number math -- what am I doing wrong?

Can you explain what a complex number is?

A complex number is a number that has two parts: a real part and an imaginary part. The imaginary part is a multiple of the imaginary unit, i, which is defined as the square root of -1. The real part is any real number. Complex numbers are written in the form a + bi, where a is the real part and bi is the imaginary part.

How do I add or subtract complex numbers?

To add or subtract complex numbers, you simply combine the real parts and combine the imaginary parts separately. For example, to add 3 + 2i and 5 + 4i, you would add 3 and 5 to get 8, and add 2i and 4i to get 6i. The sum of these two complex numbers would be 8 + 6i.

What is the difference between multiplying and dividing complex numbers?

Multiplying complex numbers is similar to multiplying polynomials. To multiply two complex numbers, you multiply the real parts and multiply the imaginary parts separately, then combine them. Dividing complex numbers requires a few extra steps, as you need to rationalize the denominator by multiplying both the numerator and denominator by the complex conjugate of the denominator. The complex conjugate of a complex number a + bi is a - bi.

How do I solve equations with complex numbers?

To solve equations with complex numbers, you can use the same algebraic rules as you would with real numbers. For example, to solve z^2 + 4 = 0, you can use the quadratic formula. Remember that the solutions to the quadratic formula will be complex numbers, so be sure to use all necessary steps to simplify your answer.

Why is it important to understand basic complex number math?

Complex numbers are used in a variety of fields, including engineering, physics, and mathematics. They can be used to solve problems that cannot be solved with only real numbers, and they have many practical applications, such as in electrical engineering and signal processing. Understanding basic complex number math is essential for further studies in these fields and for solving real-world problems.

Back
Top