Questions tagged [complex]

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

Filter by
Sorted by
Tagged with
50
votes
6answers
11k 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 ...
43
votes
5answers
46k views

Plotting Complex Quantity Functions

Trying to plot with complex quantities seems not to work properly in what I want to accomplish. I would like to know if there is a general rule/way of plotting when you have complex counterparts in ...
42
votes
2answers
21k 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?
89
votes
5answers
13k views

How can I generate this “domain coloring” plot?

I found this plot on Wikipedia: Domain coloring of $\sin(z)$ over $(-\pi,\pi)$ on $x$ and $y$ axes. Brightness indicates absolute magnitude, saturation represents imaginary and real magnitude. ...
20
votes
6answers
9k views

Plotting complex numbers as an Argand Diagram

I have the function: $F(\omega) = \frac{5\; - \;i\;\omega}{5^2\; +\; \omega^2}$ When $\omega$ has the values : $\{ -7, -2,\; 0,\; 2,\; 7\}$ How would I plot the Argand diagram in Mathematica? Or ...
16
votes
3answers
8k views

Complex number operations: telling Mathematica variables are real

I want to do Conjugate[a + b*I], but when I do that, the solution is Conjugate[a] - I*Conjugate[b]; when for me, a and b are ...
15
votes
2answers
16k views

How to specify assumptions before evaluation?

If I request mathematica evaluate an integral for me, I'll often get a more general ConditionalExpression than I want. Example : ...
14
votes
2answers
8k views

Paths integrals in the complex plane

I can't find how to calculate path integrals of complex functions in the complex plane. For example: $$\oint_{\mid z \mid =2}\frac{1-e^z+z}{z^3 (z-1)^2}dz$$
6
votes
2answers
2k views

Derivative of conjugate multivariate function

I have a problem with Mathematica, taking the derivative of the conjugate of some function. I know that a similar question has been posed before here, but the solution did not work for multivariate ...
27
votes
2answers
4k 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 ...
43
votes
3answers
69k views

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

I'm trying to expedite some quantum mechanical calculations (expectation values etc.) by running them through Mathematica. When I say, for example, ...
18
votes
4answers
16k 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 ...
15
votes
3answers
9k views

How can I convert a complex number into an exponent form

When I have an expression such as (1/4 + I/4) ((1 - 2 I) x + Sqrt[3] y) it is hard to get an intuition of the number. So I want to convert it to the complex ...
9
votes
3answers
912 views

Complex result for Real vectors in VectorAngle

I was expecting a real angle using VectorAngle when passing real valued vectors, but I obtained a complex angle: ...
27
votes
3answers
6k views

Visualizing a Complex Vector Field near Poles

I've been playing around with a visualization technique for complex functions where one views the function $f: \mathbb{C} \rightarrow \mathbb{C}$ as the vector field $f: \mathbb{R^2} \rightarrow \...
13
votes
2answers
678 views

What is the best way to define Wirtinger derivatives

Wirtinger derivatives ( also called Cauchy operators) in complex analysis are widely used tools. They are defined in the case of one dimensional complex plane as follows $$\frac{\partial}{\partial z}=...
6
votes
3answers
453 views

Integrating a real function I get a complex value, while after variable transformation the result is real. Bug?

I have the following integral: Integrate[1/Sqrt[0.7 + 0.3*(1 + z)^3], {z, 0, ∞}, Assumptions -> z ∈ Reals] >> -3.36354 - 3.85013 I The output is complex, ...
5
votes
2answers
526 views

When does the real part of Zeta vanish on the critical line?

This seems to be a quite a simple problem but I cannot make it work. I am trying to find all values within a given range for which the real part of the Zeta ...
17
votes
3answers
15k views

Plotting complex Sine

I've got another plotting problem. I want to plot Sin[z] where z is complex. So, I've tried the following: ...
20
votes
3answers
8k views

Derivative of real functions including Re and Im

When deriving functions using Re, Im or Arg (and probably some other functions as well), ...
13
votes
2answers
10k views

Remove annoying Conjugate

Here is an expression ...
7
votes
3answers
312 views

Wrapper for inexact numeric complex numbers that maintains polar form

Related question: How can I convert a complex number into an exponent form Mathematica insists on displaying complex number in form a+I b when ...
8
votes
2answers
1k views

How to eliminate the zero real part of a purely imaginary number?

In Mathematica 9, a purely imaginary number, e.g. 0.9 I, will display as 0. + 0.9i in the output form. How can I eliminate the ...
48
votes
1answer
11k views

How to visualize Riemann surfaces?

In WolframAlpha we can easily visualize Riemann surfaces of arbitrary functions, can we plot the Riemann surface of an arbitrary function using Mathematica and ...
23
votes
1answer
1k views

Numerical inverse Laplace-Hankel transform

When trying to reproduce the result of this paper about numerical solution of Lamb's problem, I encountered the following double integral (to be more precise, the 0-order inverse Hankel-Laplace ...
3
votes
1answer
4k views

Complex line integral

Can someone recommend an online article or introductory tutorial that will show me how to do real and complex line integrals using Mathematica?
4
votes
1answer
542 views

Orbit followed by a particle around Schwarzschild Black Hole

The following is a equation which describes various possible orbits of a particle around the Schwarzschild black hole spacetime in general relativity. I want to solve it from ...
5
votes
1answer
614 views

Factoring a two variable polynomial in a special way

Let $$f=x^9-x^6+4x^5y+2x^3y^2-y^4$$ I would like to factorize $f$ into form: $$(y-F_1(x))\cdots(y-F_k(x))$$ over complex numbers. How can I do it with Mathematica?
11
votes
3answers
7k views

Is there a simple way to plot complex numbers satisfying a given criteria

I think this should be straightforward, but I cannot seem to find a good source on how to do it after searching around, so I'm trying to sketch sets of complex numbers that meet a given for criteria. ...
2
votes
1answer
2k views

Finding residues of multi-dimensional complex functions

Say I have a function $f$ of $n$ complex variables, $\{ z_i \}_{i=1}^{i=Nc}$. And then I want to contour integrate the expression such that for each $z_i$ its an integration on an unit circle about ...
7
votes
2answers
3k views

Draw the image of a complex region

I'm working on a complex question that asks that I determine a function that maps the complement of the region $D=\{z:|z+1|\le 1\}\cup\{z: |z-1|\le 1\}$ onto the upper half plane. That is, $f$ must ...
10
votes
1answer
307 views

FiniteElement v.s. TensorProductGrid: which is reliable for Schrödinger equation with periodic b.c.?

This is a problem comes up in the discussion under this post and I think it's worth starting a new question for it. I suspect the underlying issue is the same as in this post, but not sure. Consider ...
9
votes
2answers
5k views

Laurent series expansion

Can someone share how to find the Laurent series expansion of $$f(z)=\frac{1}{(z^2-1)(z^2-4)}$$ centered at $0$ on the annulus $1<|z|<2$?
7
votes
3answers
2k views

Complex conjugate

How do I complex conjugate a vector? ...
3
votes
2answers
833 views

Eigensystem, Eigenvalue doesn't output nonreal eigenvalues

Basically I have a matrix and when I used either Eigenvalue or Eigensystem, it doesn't output nonreal eigenvalues, instead it ...
5
votes
1answer
2k views

Symbolic integration in the complex plane

Context While answering this question, I defined (symbolic and numerical) path integrations as follows ...
5
votes
6answers
3k 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. ...
17
votes
4answers
815 views

Why is (-1.)^2. a complex number

Why (-1.)^2. in Mathematica returns a complex number? It looks like in both C and Fortran it returns 1. Why does Mathematica behave differently than the other ...
22
votes
5answers
5k views

Why this real integral yields imaginary results?

This integral yields -1-4Iπ/3 in Mathematica: Integrate[(y - y^2 + x - x^2 + 2*x*y)/(1 - x - y), {x,0,1}, {y, 0, 1}] Since ...
21
votes
2answers
1k views

Why doesn't FullSimplify drop the Re function from an expression known to be real?

For some reason Mathematica does not properly simplify this expression: ...
14
votes
2answers
3k 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. ...
10
votes
1answer
1k views

How do I put an image on the complex plane?

I watched this video and became interested in transforming an image. But I have no good idea on how to embed an image in the complex plane using Mathematica. I have a method that seems to work, but ...
6
votes
4answers
1k views

Visualizing the complex map $f(z)=z^2$

I would like to visualize the complex map $f(z)=z^2$ as the following picture (see Visual Complex Analysis by Tristan Needham) shows: Naively applying the code in an answer I got something far from ...
15
votes
2answers
1k views

Visualizing a holomorphic bijection between the unit disc and a domain

One can construct a holomorphic bijection between the (open) unit disc $D=\{z\in{\bf C}: |z|<1\}$, and a domain $D\setminus\overline{B_{1/2}(-1/2)}$ where $B_r(z_0)$ denotes the ball of radius $r$ ...
6
votes
2answers
3k views

How to tell Mathematica that the argument of a function is real?

I want to define the following function in mathematica: $$R(\psi)=\begin{bmatrix}1&0&0\\0&\cos 2\psi & \sin 2\psi\\0&-\sin 2\psi & \cos 2\psi\end{bmatrix}\qquad,\psi\in\mathbb ...
2
votes
1answer
304 views

Re and Im relationships without Abs among Fourier, FourierTransform, InverseFourier, and InverseFourierTransform

Is there a way to make Fourier's Re and Im components separately track the results of ...
14
votes
2answers
1k views

Compiling the VoigtDistribution PDF

According to List of compilable functions, Erf and Erfc are compilable functions. However, I want to make a compiled version ...
9
votes
1answer
3k views

Is it possible to set a variable as a positive one in the whole notebook?

I'm having issues during integration due to the fact that Mathematica doesn't know if an undefined variable is positive or not (it gives me complexes which bothers me in the end). For example I do ...
5
votes
2answers
188 views

How can I improve my code for visualizing a complex map?

This code visualize a complex map, but it looks rather cumbersome: ...
1
vote
1answer
206 views

How do I visualize $\exp(z)$ as a complex mapping?

How do I visualize $\exp(z)$ as a complex mapping? How can I ensure that it does not miss any value on the complex plane as it's value (is in the best condition of Picard's theorem). Can anyone help ...