How do we get the imaginary part?

  • MHB
  • Thread starter evinda
  • Start date
  • Tags
    Imaginary
In summary, evinda found that WolframAlpha incorrectly calculates the imaginary part of a complex function when treated as a real function. However, if we do not treat functions as complex, my result is correct.
  • #1
evinda
Gold Member
MHB
3,836
0
Hello! (Wave)

We have this: $y''+y=\frac{1}{\cos x} , y'(0)=0, y(\pi)=0$.

Using the Green function I got that $y(x)= x \sin x+ \cos x( -\ln |\cos \pi|+ \ln |\cos x|)=x \sin x+ \cos x (\ln |\cos x|)$.

But according to Wolfram: y'''''''+'y'='1'/'cosx , y''''('0')''='0, y'('pi')''='0 - Wolfram|AlphaHow do we get the imaginary part?
 
Physics news on Phys.org
  • #2
evinda said:
Hello! (Wave)

We have this: $y''+y=\frac{1}{\cos x} , y'(0)=0, y(\pi)=0$.

Using the Green function I got that $y(x)= x \sin x+ \cos x( -\ln |\cos \pi|+ \ln |\cos x|)=x \sin x+ \cos x (\ln |\cos x|)$.

But according to Wolfram: y'''''''+'y'='1'/'cosx , y''''('0')''='0, y'('pi')''='0 - Wolfram|Alpha

How do we get the imaginary part?

Hey evinda! (Smile)

Wolfram always treats functions as complex functions.
That has in particular impact on the natural logarithm.

Consider that if we're talking about real functions that we actually have:
$$
\int \frac{dx}{x} = \begin{cases}\ln(x) + C_1&\text{if }x>0 \\ \ln(-x) + C_2&\text{if }x<0\end{cases}
$$
That's because the domain is split into 2 disconnected intervals for which we have independent integration constants.
This is usually written as:
$$\int \frac{dx}{x} = \ln|x| + C$$
with the understanding that the integration constant $C$ can be different on each part of the domain. (Nerd)

However, with complex functions there is no such distinction - all of the domain is connected with only an undefined point at $z=0$. That is:
$$
\int \frac{dz}{z} = \ln z + C
$$
Furthermore, $\ln z$ is a so called multivalued function that behaves a bit different than a normal function.
That is, we can't just take the natural logarithm of a complex number. (Sweating)So instead of:
$$
-\ln|\cos\pi| + \ln|\cos x|
$$
we really have something like:
$$
-\ln(\cos\pi) + \ln(\cos x) = \ln\frac{\cos x}{\cos\pi} = \ln(-\cos x)
$$

Now let's define $z = \ln(-\cos x)$, so that we have $e^z = -\cos x$.
Since we're talking about complex numbers, we can write this as:
$$e^{z+2\pi ik} = -\cos x
\quad\Rightarrow\quad e^{z+i\pi+2\pi ik} = \cos x
\quad\Rightarrow\quad z+i\pi+2\pi ik = \ln(\cos x)
\quad\Rightarrow\quad z = \ln(\cos x)-i\pi-2\pi ik
$$
(Whew)
 
  • #3
I like Serena said:
Hey evinda! (Smile)

Wolfram always treats functions as complex functions.
That has in particular impact on the natural logarithm.

Consider that if we're talking about real functions that we actually have:
$$
\int \frac{dx}{x} = \begin{cases}\ln(x) + C_1&\text{if }x>0 \\ \ln(-x) + C_2&\text{if }x<0\end{cases}
$$
That's because the domain is split into 2 disconnected intervals for which we have independent integration constants.
This is usually written as:
$$\int \frac{dx}{x} = \ln|x| + C$$
with the understanding that the integration constant $C$ can be different on each part of the domain. (Nerd)

However, with complex functions there is no such distinction - all of the domain is connected with only an undefined point at $z=0$. That is:
$$
\int \frac{dz}{z} = \ln z + C
$$
Furthermore, $\ln z$ is a so called multivalued function that behaves a bit different than a normal function.
That is, we can't just take the natural logarithm of a complex number. (Sweating)So instead of:
$$
-\ln|\cos\pi| + \ln|\cos x|
$$
we really have something like:
$$
-\ln(\cos\pi) + \ln(\cos x) = \ln\frac{\cos x}{\cos\pi} = \ln(-\cos x)
$$

Now let's define $z = \ln(-\cos x)$, so that we have $e^z = -\cos x$.
Since we're talking about complex numbers, we can write this as:
$$e^{z+2\pi ik} = -\cos x
\quad\Rightarrow\quad e^{z+i\pi+2\pi ik} = \cos x
\quad\Rightarrow\quad z+i\pi+2\pi ik = \ln(\cos x)
\quad\Rightarrow\quad z = \ln(\cos x)-i\pi-2\pi ik
$$
Note that Wolfram's answer is actually incomplete, since it leaves out the $2\pi i k$. (Whew)

I see... (Yes)

But if we do not treat functions as complex functions, my result is correct, right?
 
  • #4
evinda said:
I see... (Yes)

But if we do not treat functions as complex functions, my result is correct, right?

Yes.
We can verify (and we should) by filling it in in the original equation, and by also checking the boundary conditions. (Nerd)
 
  • #5
I like Serena said:
Yes.
We can verify (and we should) by filling it in in the original equation, and by also checking the boundary conditions. (Nerd)

Ok... Thank you! (Smile)
 

FAQ: How do we get the imaginary part?

How do we determine the imaginary part of a complex number?

The imaginary part of a complex number is the coefficient of the imaginary unit, i, in the number's representation in the form of a+bi, where a is the real part and b is the imaginary part.

Can the imaginary part of a complex number be negative?

Yes, the imaginary part of a complex number can be negative. This simply means that the coefficient of the imaginary unit, i, is a negative number in the number's representation in the form of a+bi.

How do we add or subtract complex numbers with imaginary parts?

To add or subtract complex numbers with imaginary parts, we simply combine the real parts and the imaginary parts separately. For example, (3+5i) + (2+4i) = (3+2) + (5+4)i = 5+9i.

How do we multiply complex numbers with imaginary parts?

To multiply complex numbers with imaginary parts, we use the distributive property and remember that i^2 = -1. For example, (3+5i)(2+4i) = 3(2+4i) + 5i(2+4i) = 6+12i+10i+20i^2 = 6+22i-20 = -14+22i.

Can the imaginary part of a complex number be a decimal or fraction?

Yes, the imaginary part of a complex number can be a decimal or fraction. This simply means that the coefficient of the imaginary unit, i, is a decimal or fraction in the number's representation in the form of a+bi.

Similar threads

Replies
11
Views
2K
Replies
2
Views
2K
Replies
36
Views
1K
Replies
5
Views
2K
Replies
1
Views
1K
Replies
3
Views
2K
Replies
52
Views
3K
Replies
7
Views
1K
Back
Top