Questions about using complex numbers in Mathematica. This includes basic arithmetic, functions of complex numbers, plotting complex functions, and dealing with branch cuts.
Questions tagged [complex]
1337 questions
16
votes
1 answer
Why are Exp[3] and 2 treated differently within Complex?
Why doesn't the last command below split the complex number into its real and imaginary parts?
Complex[2,2]
(* 2 + 2 I *)
Complex[N[Exp[3]], N[Exp[3]]]
(* 20.0855 + 20.0855 I *)
Complex[Exp[3],Exp[3])
(* Complex[E^3,E^3] *)
Soldalma
- 1,289
- 1
- 9
- 17
9
votes
2 answers
What is the value Re[Sqrt[1+I*2*x]]?
When I try to evaluate Re[Sqrt[z]], for some values of Mathematica fails to evaluate it.
For example,
Re[Sqrt[2 + I*x]]`
Re[Sqrt[2 + I x]]
How can I get the real number in Sqrt[complex number]?
user132682
- 317
- 3
- 8
8
votes
3 answers
Modify real part and leaves imaginary part unchanged
How can I flip the sign of the real part but not affect the imaginary part of a complex number:
a+bi => -a + bi
Example list:
list = {{-0.282095 + 0.282095 I, -0.27254 + 0.291336 I,
-0.262018 + 0.300835 I, -0.250437 + 0.310542…
leon365
- 649
- 4
- 8
7
votes
3 answers
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 + I b]^2
How can I let it evaluate to $a^2 + b^2$ instead?
sjdh
- 7,757
- 5
- 37
- 47
6
votes
2 answers
Visualizing branch cut and Riemann surface for a square root
I have the following complex function:
$$g (z) = (1 - a^2/z) (1 - 1 /z),$$
where $0 < a < 1$.
Calculations show that $\sqrt{g(z)}$ has a branch cut along $a^2 \to 1$. Is there a way to visualize the Riemann surface of this function and the…
user95917
6
votes
1 answer
How to make the imaginary part of a +0. I zero globally?
Values like a +0. I are really annoying. Answers from
How to reduce expressions with complex coefficients in the form of a+0.*I?
Is there a way to globally set when to treat a very small number as zero?
give me some clue, but I find $Post = Chop[#,…
novice
- 2,325
- 1
- 24
- 30
5
votes
2 answers
presenting a real number as real instead of imaginary
I have an equation which results in an answer of the form
$\frac{i a}{\sqrt{c-d}}$
is there any way to get Mathematica to present it in it's real form? like
$\frac{a}{\sqrt{d-c}}$
I know that I can simply take Re[f[x]] to get the real part, but I…
drjrm3
- 211
- 1
- 4
5
votes
3 answers
Complex Solutions not in a+bi form
Solve[x^2 + x + 1 == 0, x]
gives the solution:
{{x -> -(-1)^(1/3)}, {x -> (-1)^(2/3)}}
I know these are complex solutions but I'd like to have them in a+bi form. If I do N@Solve...I get the right form but as you can imagine I get numeric…
user2686410
- 347
- 1
- 7
3
votes
1 answer
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
Re[2 I (z) + 6 Conjugate[(z)] + Sin[(z)]]
Mathematica…
Thiago
- 311
- 1
- 9
3
votes
1 answer
Absolute value of a complex number
I want to calculate |xx|^2.
Why can't Mathematica just calculate it?
What am I supposed to do here?
I just want it to actually calculate it, so that there are no imaginary numbers left.
Is that so hard?
xx = (2 I E^(-I a k) k k1)/(2 I k k1 Cosh[a…
Σ balls
- 33
- 3
3
votes
2 answers
How to get rid of the absolute value in ComplexPlot3D[]?
I'm starting to study complex analysis,so I'm trying out Mathematica as tool for visualizing complex functions. I'm trying to graph $f(z)=z^2 + 1$ with the code:
ComplexPlot3D[z^2 + 1 , {z, 2}]
and what I get is this:
Something is wrong, because I…
3
votes
2 answers
Find the solution to an equation and show graphically that these lie on a circle in the complex number plane
I need to find the solution to the equation in the picture, and show graphically that these lie on a circle in the complex number plane. How would one go about this?
bittscoterie
- 41
- 2
3
votes
2 answers
Plotting transformations of loci in a complex plane
I found the solution to plot loci of complex numbers here, e.g. a locus of points of $z$ given $|z|=1$ is a circle centered at the origin with a radius 1.
But I am struggling to plot transformations, e.g. $T: w=2z$ would be an enlargement of the…
Mihail
- 131
- 1
3
votes
1 answer
Incorrect answer of FunctionAnalytic
A new command FunctionAnalytic of version 12.2 sometimes produces incorrect results, e.g.
FunctionAnalytic[Cos[Sqrt[z]], z]
False
FunctionAnalytic[Cos[Sqrt[z]], z, Complexes]
FunctionAnalytic[Cos[Sqrt[z]],z,\[DoubleStruckCapitalC]]
Up to Wiki…
user64494
- 26,149
- 4
- 27
- 56
3
votes
1 answer
Split complex equation
Sometimes it is useful to split a complex equation into its real and imaginary parts. Consider the following ode
ode = y'''[x] - k^3*y[x] == I*k*a*((2*x - c)*(y''[x] - k^2*y[x]) + 2*y[x])
bc1 = y'[0] == 0;
bc2 = y''[1] + k^2*y[1]/(1 - c) == 0;
in…
Nobody
- 823
- 4
- 10