Questions about using complex numbers in Mathematica. This includes basic arithmetic, functions of complex numbers, plotting complex functions, and dealing with branch cuts.

learn more… | top users | synonyms

1
vote
0answers
31 views

Fourier transform of a real white noise on a 3D cubic lattice [migrated]

I'm facing the following problem: I have a cubic domain of side $L=2\pi$; this domain is divided in a cubic grid, each side is divided in $N$ points, where $N$ is an even integer number. the ...
8
votes
2answers
83 views

Pattern matching with Complex. Feature or a bug?

I have run into some strange behavior while doing some pattern matching. First, this works as expected: Exp[2 I u x] /. Exp[Complex[0, a_] u x] :> a (* 2 *) ...
0
votes
0answers
48 views

Nothing showing up on complex contour plot [closed]

I am trying to graph the following function, where z:=x+y*I z(Conjugate[z]+2)=3. But with my code nothing is showing up. I've tried many different scales so something must be wrong with the actual ...
0
votes
1answer
73 views

Plotting Complex Numbers - Functions of Complex Numbers [duplicate]

So I have to generate a few different plots with z, where z is a complete number... z[x_, y_] := x + y*I F[z_] := (25*Pi*z*I)/(1 + 10*Pi*z*I) First, I need to ...
4
votes
2answers
116 views

Trying to get Arg[1 + I a] -> ArcTan[a]

Can Mathematica evaluate Arg[1+ I a] when a is a positive real in order to get ArcTan[a]? ...
0
votes
1answer
36 views

Complex number plot with inequalities [duplicate]

I need to plot the function where z is a complex number: $$S = {z:|z + 0.15|<0.6} \wedge {z:Pi/4<=arg(z)<=Pi}$$ I can do this: ...
1
vote
2answers
49 views

Differentiation of an unknown function

I have to take the partial differentiation of an unknown function. For example, take the unknown function to be $g(x)$. Then it's derivative w.r.t $x$ is $g'(x)$. By default, Mathematica ...
1
vote
1answer
131 views
2
votes
1answer
69 views

NIntegrate and Integrate giving different results for ill-behaved function

I'm trying to integrate the following function with Mathematica 8: $$ I(a,b)= \int_0^1 \mathrm{d}x\int_0^1\mathrm{d}y \,\theta(1-x-y) \frac{1}{x a^2-y(1-y)b^2},$$ where $\theta$ is the Heaviside ...
1
vote
1answer
86 views

How to prevent tiny complex errors in Integrate?

Integrate is adding a tiny imaginary error to an easy result. Why? And how can I stop it? ...
0
votes
0answers
41 views

Why is PolyLog[] giving weird answers for ordinary values?

Possibly related to this question, but it seems slightly different: Strange behaviour of PolyLog Function Wikipedia says that for real s, z<1 should be real. So I was confused when MMa returned: ...
0
votes
1answer
43 views

Plot of the set complex numbers [duplicate]

I want to show this set (eigenvalues of my matrix): ...
1
vote
0answers
44 views

Complex input for Compile makes it slow

I asked a question here and then tried to use Compile for the solution to gain even more speed. Inside Compile there is a loop ...
0
votes
1answer
83 views

Matrix form of complex numbers [closed]

Complex numbers have matrix form. But some 2x2 matrices while differ, represent the same complex number. To compare complex numbers one has to transform the matrices to the form \begin{pmatrix} a ...
-1
votes
1answer
84 views

Is it possible to have Logarithm with base 1 or 0? [closed]

I am wondering is there any definition that allows logarithm to have base 0 or 1 in real or complex fields (considering Euclidean space)?? Out-coming question is if you can define a logarithm with ...
1
vote
3answers
1k views

How to take conjugate of a function?

Naïvely this is what happens and it obviously is not helpful! ...
1
vote
1answer
57 views

Evaluating the real part of an expression

I want to get the Real part of this expression - shouldn't be too hard to evaluate. Why is Mathematica not evaluating but returning the same code? ...
3
votes
1answer
106 views

Decomposing a complex numbers equation into its real and imaginary part

I have an equation such as: a*z^2 + b*(z - c)^2 == d where z is a complex variable and ...
1
vote
2answers
359 views

How to tell Mathematica that certain variables are real/imaginary, integer-valued, etc

I'm trying to expedite some quantum mechanical calculations by running them through Mathematica. Expectation values and stuff like that. When I say, for example, ...
8
votes
4answers
6k views

Factoring polynomials to factors involving complex coefficients

I've run into some problems using Factor on polynomials with complex coefficient factors. Reading the documentation it looks like it only factors over the ...
0
votes
1answer
84 views

How do I declare that a variable represents a real number?

How do I tell Mathematica that a variable is a real number. I searched for this question here and in Google and nothing that was suggested seems to work for me. I must be missing something. My code is ...
4
votes
1answer
209 views

Problem on limit involving complex numbers

I have $${\frac{(6 k+1)^{k}}{(2 k+5)^{k}}}*(z-2 i)^k$$ and I need to find it's limit for $k$ approaching infinity. ...
-2
votes
1answer
85 views

Why is it so complicated to simplify a complex conjugate? [closed]

My question is very simple. I would like to multiply a complex number by its conjugate. Unfortunately, this seems to be extremely complicated in Mathematica. Consider the very basic example: ...
0
votes
0answers
37 views

Simplification of a complex-valued expression with purely real components

(I'm including all the information here, as I'm not sure how much of it is necessary to solve the problem. For a tl;dr skip to the bottom) I've been working on a problem involving calculating ...
0
votes
1answer
117 views

How find solve the equation complex conjugate? [closed]

Tried solving it with every function I know but couldn't z*=z^2
0
votes
1answer
93 views

How to find all roots of a complex number [duplicate]

Finding all roots, and I know there are four f them, of this (1 - i)^(1/4) Not only real, but imaginary as well
1
vote
1answer
80 views

Rationalize complex numbers

What is the best way to rationalize complex numbers, if not both the real and imaginary part are actually rational? According to the documentation, Rationalize ...
0
votes
3answers
100 views

Plot Complex Function [duplicate]

I want to have a 3D plot for the following function: (1.6 - 0.005 I) E^(-0.5 p^2 + ( 2. I) p q + (6.5 - 11 q) q) p and q from -10 to 10 Is there any way?
2
votes
1answer
44 views

A question about expanding complex functions of real arguments

I have the following problem. There is such an expression as: P[x_,y_] := z[y] E^(I beta x) + Conjugate[z[y] E^(I beta x)]; The variables ...
0
votes
0answers
77 views

ComplexExpand does not treat everything as real number

ComplexExpand does not treat everything as real number?? Please read the following simple example ...
36
votes
6answers
5k views

Finding real roots of negative numbers (for example, $\sqrt[3]{-8}$)

Say I want to quickly calculate $\sqrt[3]{-8}$, to which the most obvious solution is $-2$. When I input $\sqrt[3]{-8}$ or Power[-8, 3^-1], Mathematica gives the ...
4
votes
1answer
134 views

Optimizing a function containing a complex exponential

I've noticed the following significant different in performance for different formulations of the same function: ...
7
votes
3answers
453 views

How do I plot the images of oriented curves under complex transformation?

I'm working on a complex transformation sketch that I'd like to create via mathematica. I'm working with the function $$w=z^2\tag{0},$$ where its real and imaginary parts are $u=x^2-y^2$ and $v=2xy$, ...
18
votes
1answer
837 views

Mobius transformations revealed

Mobius Transformations Revealed is a short video that vividly illustrates the simplicity of Mobius transformations when viewed as rigid motions of the Riemann sphere. It was one of the winners in the ...
2
votes
1answer
130 views

Real and Imaginary parts of solutions to a complex linear ODE system

Consider a complex linear ODE system $x'=Ax$, where $$A=\left( \begin{matrix} 0&1\\ -2&-i \end{matrix}\right). $$ One can first find the eigenvalues and eigenvectors using ...
2
votes
2answers
212 views

Listplot imaginary part of complex numbers

I have the following list w={{0.01,99 +0.00001414 I},{0.15,6.6370108 +0.003144129 I},{0.25,3.9515722 +0.00854493297 I},{6,0.10041 +0.28132187 I}} and I want to ...
0
votes
0answers
112 views

Differential equations with a complex variable

Is Mathematica able to handle ordinary differential equations where the variable itself is complex? I am looking for solutions of ODE systems of the form $$\left\{ \begin{align} i\frac{da_1}{dt} ...
3
votes
2answers
195 views

Contourplot of complex Roots

Suppose I have this equation: $$ z^2 + 3z + (x^2 + y^2) = 0 $$ I want the real and complex contour plot of $z(x,y)$. Analytically, the real/imaginary boundary is separated by condition $x^2 + y^2 ...
4
votes
2answers
615 views

Why does this integral have a complex component?

I wanted to find the probability of my normally-distributed random variable being at least 15, so I set up this integral: ...
4
votes
2answers
111 views

Can't solve equation having complex coefficients

Why can't Mathematica solve $\quad\quad\frac{1-i}{\sqrt{2}}=e^{i \alpha } \tan \left(\frac{\beta }{2}\right)$ with the restrictions $\alpha \in [0, 2 \, \pi)$ and $\beta \in [0,\pi]$: ...
4
votes
6answers
1k views

Why is this Mandelbrot set's implementation infeasible: takes a massive amount of time to do?

The Mandelbrot set is defined by complex numbers such as $z=z^2+c$ where $z_0=0$ for the initial point and $c\in\mathbb C$. The numbers grow very fast in the iteration. ...
4
votes
3answers
3k views

How can I plot the complex graph of $x^x$ in Mathematica?

For example, this Wolfram Alpha query shows this graph: But it does not show the code for plotting it in Mathematica. Plot[x^x, {x, -1, 1}] only plots the real ...
1
vote
1answer
193 views

Simplifying complex expression with Mathematica

I want do get the imaginary part of Exp[I*t]/(1-Exp[I*t]) I've tried to do this Im[ComplexExpand[Exp[I*t]/(1-Exp[I*t])]] ...
1
vote
4answers
192 views

How to extract only real solutions from the result of Solve

For Example, I have the following polynomial equations: $$ \left\{ \begin{array}{ll} \dfrac{2025 (208 x+5 (y-3446))}{52 (y+90)^2}+\dfrac{300 (8 x-21 y+1920) (y-80)}{7 (x+30)^3}+\frac{300 (80 x-21 ...
1
vote
3answers
117 views

Selecting a specific complex number from a list

I have a formula which is producing a large (hundreds of elements) list of complex numbers of the simple form $x+iy$. However I'm only interested in the one value which satisfies the conditions: ...
1
vote
1answer
80 views

How to solve the warning problem and obtain real roots without imaginary part?

I am trying to solve a equation with Newton's method via FindRoot, and the codes are: Define the functions: ...
1
vote
1answer
102 views

Plot sets in the complex plane [duplicate]

I just want to know if there's a way to plot sets in the complex plane. For example $$A=\{z\in \mathbb{C},z+e^{z}=0\},\\A=\{z\in \mathbb{C},\Re(z)+e^{z}\geq0\}.$$
2
votes
1answer
150 views

Check for holomorphy of a function

Given a (rather complicated) function H(z), what is the best approach to check symbolically whether it is holomorphic? What I tried is checking explicitly the ...
3
votes
1answer
168 views

Express a complex function $f(z)$ as $u(x,y)+iv(x,y)$

How can I write a complex function $f(z)$ in the form $u(x,y)+iv(x,y)$ using Mathematica? Re and Im do not work, because they do it for complex numbers, not functions. For example, if I try ...
1
vote
1answer
102 views

How do I solve for the real and complex parts of an equation simultaneously?

If I were to have an equation, say something similar to... (1-Sqrt[x - I y])/(1+Sqrt[x - I y]) = A + I B Where I = Sqrt[-1], is there a way for Mathematica to ...