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

4
votes
2answers
306 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
75 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]$: ...
3
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
2k 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
77 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
156 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
64 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
63 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
65 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\}.$$
1
vote
1answer
126 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
69 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
85 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 ...
0
votes
1answer
82 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 ...
7
votes
2answers
224 views

Does FindFit support complex numbers or doesn't it?

Inspired by this previous question: Findfit doesn't give the good fit; Changing the starting values will not change the results. Consider the following complex-valued dataset. ...
3
votes
1answer
272 views

HarmonicNumber problem

I am looking for all the roots of HarmonicNumber, in the domain [-30, 1] and [0, 6000] for the real and imaginary parts, respectively, and where the parameter ...
0
votes
1answer
52 views

How to evaluate Floor[1/2 + Arg[z]/(2π)] with Re[z] > 0

I want to do a series expansion of an expression containing Gamma functions with specific arguments. An example is the following: ...
0
votes
0answers
46 views

Why does this integral have a complex result

I wanted to find the normalization of distribution F2 . ...
0
votes
2answers
79 views

Absolute value and argument of a complex expression

I would like to find the absolute value and the argument of the expression: $ x + \sqrt { x^2 + y^2 } $ under the assumption that the absolute values of $ x $ and $ y $ are equal. I have written: ...
1
vote
1answer
66 views

Real and imaginary parts of a complex number

I would like to find the real and imaginary parts of $x + y$ in terms of polar coordinates. Here is code: ...
0
votes
3answers
97 views
-2
votes
1answer
72 views

how draw root locus in mathematica 9 for a special case

my closed loop transfer function is: H(s)=2exp(-q)/(1+exp(-2q)) q=sqrt((a+k*sqrt(s)+s)*s) , s=sigma+jw how can i draw root locus of H(s) as 'a' changes for ...
3
votes
1answer
113 views

Riemann surface for cubic root

I'm trying to generate Riemann surfaces of higher order. I read How to visualize Riemann surfaces?, and the subsequent documents. I'm able to reproduce the surface using polar representation, but I'm ...
2
votes
1answer
133 views

Differential Equation in Complex Plane and Parametric Plot

I would like to solve $dx/dt=\sqrt{1 + (I x)^3}$, where x is complex, for some initial condition like $1 - 5 I$ and plot the imaginary part of the solution versus the real part. (A somewhat similar ...
1
vote
2answers
125 views

Complex differential equation

I want to solve $dx/dt=\sqrt{(1-x^2)}$, where $x$ is complex. When I solve it by hand and analytically for some initial value and draw the imaginary part versus the real part, I obtain an ellipse, as ...
0
votes
1answer
86 views

Plot a real part of complex equation depending on a parameter

I would ask you to kindly provide me a way to solve this problem in mathematica way. Let the equation $z^2 + 9 -1.5 e^{- t z}=0$ where $z\in \mathbb C$ and $t\in \mathbb R^+$. In order to plot graph ...
0
votes
0answers
49 views

Complex integrals and residues

I have a question. I try to integrate this function: Integrate[Exp[I k z]*Exp[-Sqrt[k^2 - A^2]x]*Exp[-k^2*L^2/4]/Sqrt[k^2 - A^2], {k, -Infinity, -A}] But ...
0
votes
0answers
77 views

A power series expansion

Consider the function, $f(z) = z tanh(\pi z) log (z^2 + a^2)$ for some $a>0$. Now I am considering 3 different situations, $z = i(n+0.5) - i\epsilon + \delta - it$ for $n \in \mathbb{Z}$ and ...
0
votes
0answers
53 views

Polar Plotting in Complex Plane [duplicate]

How would I plot the following functions in the polar complex plane? $$ \phi={-k\over 2\pi r}cos(\theta_0-\theta) $$ and $$ \psi={-k\over 2\pi r}sin(\theta_0-\theta) $$ Please ...
0
votes
1answer
69 views

Trouble fitting an explicitly complex model with the TransformedFit package

This is follow up from a previous question in which @Oleksandr R. suggested the use of a package he developed for splitting a model and data into real and imaginary parts to avoid a problem with ...
3
votes
2answers
288 views

ComplexExpand absolute squared

ComplexExpand[Abs[a + b I]] Gives $\sqrt{a^2 + b^2 }$ ComplexExpand[Abs[a + b I]^2] On the other hand gives Abs[a ...
0
votes
1answer
58 views

Can't Plot Fourier Series [closed]

I have been trying to plot fourier series but the plot is allways empty. I guess there is something wrong in my code but i dont know exactly what is it. Looking here for some previous ...
-2
votes
1answer
147 views

How to solve a non-linear equation?

I am trying to solve the following non-linear equation: $\frac{i e^{-x^2} \sqrt{\pi } x}{K^2}+\left(-0.131251-0.0379031 x^2-0.0151154 x^4-0.0100462 x^6+0.5 \left(0.00273859 +0.0400003 K^2\right) ...
0
votes
0answers
69 views

About how Mathematica understands the branchcuts of the complex logarithm [Part 3]

One understands that for the function $\log(z^2+a^2)$ Mathematica implicitly puts the branch cuts to be starting at $\pm ia$ and going up/down respectively on the imaginary axis. The phase of this ...
1
vote
0answers
43 views

Conjugate of InterpolatingFunction?

From NDSolve, I got this: {{a1 -> InterpolatingFunction[{{0., 40.}}, "<>"]}} What would be a sensible approach to ...
2
votes
3answers
175 views

Conjugating symbolic expression

I am trying to conjugate a symbolic expression, and I have explicitly stated the real terms. However, I simply can't get it to work: ...
0
votes
1answer
89 views

Series expansion of a complex function

How do I expand a function $f(z)$ in a particular region? For example, how would I expand $f(z)=(z^2-3z+2)^{-1}$ in the region $0<|z-1|<1.$? I believe this can be done by the binomial theorem. ...
32
votes
6answers
4k 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 ...
8
votes
4answers
599 views

Moving the location of the branch cut in Mathematica

According to the documentation, Mathematica chooses the branch cut for $\log(z)$ to lie along the negative real axis. It it possible to change this so that it lies along the positive axis or elsewhere ...
0
votes
0answers
50 views
9
votes
1answer
534 views

How does Mathematica understand branchcuts of the complex logarithm?

Say I have the function $f(x) = x \tanh(\pi x) \log (x^2 +a^2)$ where $a$ is some positive real number. Then it seems to be me that Mathematica when given such a ...
11
votes
2answers
2k views

How to calculate contour integrals with Mathematica?

How to calculate the integral of $\frac{1}{\sqrt{4 z^2 + 4 z + 3}}$ over the unit circle counterclockwise for each branch of the integrand?
0
votes
0answers
582 views

Fastest way to create a NxNxNxN dimensional matrix

I have a function that outputs a complex number Func[x_,y_]:= blah blah; I have constructed a table of all possible values of this function. ...
0
votes
0answers
72 views

How does Mathematica understand branchcuts of the complex logarithm? [Part 2]

I observe that the answer generated by the first integration is not in any simple way related to the next two answers. (some simple jump of i 2\pi across the branchcut of the logarithm is not helping ...
1
vote
1answer
76 views
0
votes
0answers
36 views

Chopping pure Imaginary numbers [duplicate]

I would like to be able to Chop complex numbers and display only the non-zeroed real or imaginary part when applicable. Chop alone works just fine if the non-negligible part is only the real part. ...
0
votes
1answer
134 views

I integrate a real function, I want a real result [closed]

I want to count some integral in Mathematica (actually, check that this integral is zero...) I arrive to an answer which has a zero real part but has some imaginary part! Why? This could be a mistake ...
0
votes
1answer
82 views

A question about using Reduce [closed]

Can someone help decipher what is the meaning of this computation that Mathematica has done? ...
3
votes
1answer
121 views

How to do this complex integration on the real line?

$m, r$ are parameters in the following integral: Integrate[z Exp[I z r]/Sqrt[z^2 + m^2], {z, -∞, ∞}] How to do this integration directly? The result should be ...
2
votes
1answer
72 views

Determine types of input, output and internal variables in compiled functions

I am trying to speedup the computation of a longer function using Compile. For illustration consider the following short example: ...
0
votes
1answer
52 views

Simplifying complex expressions

I'm trying to work with complexes and I want Mathematica to know that all variables are real unless I explicitly assigned the variable with an I so I wrote: ...