How do we get the imaginary part?

  • Context: MHB 
  • Thread starter Thread starter evinda
  • Start date Start date
  • Tags Tags
    Imaginary
Click For Summary
SUMMARY

The discussion focuses on solving the differential equation $y'' + y = \frac{1}{\cos x}$ with boundary conditions $y'(0) = 0$ and $y(\pi) = 0$. The solution derived using the Green function is $y(x) = x \sin x + \cos x (\ln |\cos x|)$. The conversation highlights the distinction between real and complex functions, particularly regarding the natural logarithm, and emphasizes that Wolfram Alpha treats functions as complex, leading to additional terms in the solution. The final conclusion is that the original solution is valid if complex functions are not considered.

PREREQUISITES
  • Understanding of differential equations, specifically second-order linear equations
  • Familiarity with Green's functions and their application in solving boundary value problems
  • Knowledge of complex analysis, particularly the properties of logarithmic functions
  • Ability to verify solutions against boundary conditions and original equations
NEXT STEPS
  • Study the application of Green's functions in solving differential equations
  • Learn about the properties of complex logarithmic functions and their implications in analysis
  • Explore boundary value problems in differential equations and their solutions
  • Investigate the differences between real and complex function treatments in mathematical software
USEFUL FOR

Mathematicians, physicists, and engineering students who are working with differential equations and boundary value problems, as well as anyone interested in the implications of complex analysis in real-world applications.

evinda
Gold Member
MHB
Messages
3,741
Reaction score
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
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)
 
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?
 
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)
 
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)
 

Similar threads

  • · Replies 11 ·
Replies
11
Views
4K
  • · Replies 2 ·
Replies
2
Views
4K
  • · Replies 36 ·
2
Replies
36
Views
5K
  • · Replies 4 ·
Replies
4
Views
2K
  • · Replies 5 ·
Replies
5
Views
4K
  • · Replies 1 ·
Replies
1
Views
1K
  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 52 ·
2
Replies
52
Views
8K
  • · Replies 2 ·
Replies
2
Views
3K
  • · Replies 7 ·
Replies
7
Views
3K