1
$\begingroup$

I am relatively new to Mathematica and I am still trying to figure out all the commands. I have these three complex numbers: enter image description here

And I wish to calculate the following quotient and write it in the a+bi form: enter image description here

What I have done on Mathematica is the following: enter image description here

I have been trying to figure out how to transform the last answer to the desired form but I can't figure it out. Maybe I have constructed the questions in a faulty manner but I simply don't know a better way. I would appreciate all the help I could get.

$\endgroup$
7
  • 2
    $\begingroup$ Please provide Mathematica code! Look for ComplexExpand. $\endgroup$ Commented Jul 21, 2023 at 8:17
  • $\begingroup$ When I put my quotient in the ComplexExpand command it yielded a cumbersome answer in the trigonometric form that I don't want. $\endgroup$ Commented Jul 21, 2023 at 8:27
  • 1
    $\begingroup$ Use E instead of e. I get {136/241, -(428/509)} as the real and imaginary parts. $\endgroup$
    – Syed
    Commented Jul 21, 2023 at 8:34
  • $\begingroup$ How do I find the Mathematica code? $\endgroup$ Commented Jul 21, 2023 at 8:35
  • 1
    $\begingroup$ @Syed I think z // ComplexExpand // ReIm // N should be sufficient $\endgroup$ Commented Jul 21, 2023 at 10:58

2 Answers 2

6
$\begingroup$

I think ComplexExpand gives the answer

z1 = Sqrt[5 - Sqrt[3 I]];
z2 = Pi/I - I/Pi;
z3 = Exp[I] - I^E;
z = Conjugate[z1 - z2 + z3]/Abs[z1 + z2 - z3];

ComplexExpand[z, TargetFunctions -> {Abs, Arg}] // Simplify   
(* huge symbolic expression ...*)
%//N
(*0.523774 - 0.872962 I*)
$\endgroup$
0
$\begingroup$

Better forget Mathematicas Complex simplifying algorithms. For purely numerical evaluations the shortest way is direct manipulation by the operations definitions. At least one knows what one is doing:
(Just indent your code to get it pretty printed and copyable text, never use subscripts in communications)

z1 = Sqrt[5 - Sqrt[3 I]]; z2 = Pi/I - I/Pi; z3 = Exp[I] - I^E;

  res0 = ComplexExpand[((z1 - z2 + z3) /. 
  Complex[a_, b_] :> 
   a - I b)/((Sqrt[#*(# /. Complex[a_, b_] :> a - I b)] &)[
  z1 + z2 - z3])];



LeafCount[res0] 
    8973 
     N[res0]
     0.566439 - 1.03623 I

Now we calculate using a replacement rule for complex numbers

res=((z1 - z2 + z3) /.Complex[a_, b_] :> a-I b)/
((Sqrt[#*(# /. Complex[a_, b_] :> a - I b)] &)[z1+z2-z3])

(-(-I)^E+Sqrt[5-(-1)^(1/4) Sqrt[3]]+
E^-I-I/\[Pi]-I \[Pi])/
(\[Sqrt]((I^E+Sqrt[5-(-1)^(1/4) Sqrt[3]]-E^I-I/\[Pi]-
I \[Pi]) ((-I)^E+Sqrt[5-(-1)^(1/4) Sqrt[3]]-E^-
I+I/\[Pi]+I \[Pi])))

N[res]

0.566439 - 1.03623 I

Finally one tries to get a normal algebraic expressions in many steps

ToRadicals@ FullSimplify[
 Together@ ExpandAll[res] /. 
 {Power[a_Complex | a_?Negative, b_] :> Exp[b Log[a]]}]

$$\frac{e^{-\frac{1}{2} i (2+e \pi )} \left(\frac{1}{2} e^{\frac{i e \pi }{2}} \left(2 \pi +e^i \left(\left(\sqrt{20-(2+2 i) \sqrt{6}}-2 i \pi \right) \pi -2 i\right)\right)-e^i \pi \right)}{\sqrt{1+\pi \left(2 \left(\sin (1)-\sin \left(\frac{e \pi }{2}\right)\right)+\pi \left(-\sqrt[4]{-1} \sqrt{3}+9+\pi \left(\pi +2 \sin (1)-2 \sin \left(\frac{e \pi }{2}\right)\right)-2 \cos \left(1-\frac{e \pi }{2}\right)+\sqrt{20-(2+2 i) \sqrt{6}} \left(\cos \left(\frac{e \pi }{2}\right)-\cos (1)\right)\right)\right)}}$$

  LeafCount[res2]
  169
      

N[res2]
0.566439 - 1.03623 I

,

$\endgroup$
3
  • 2
    $\begingroup$ Your defintion of z is different to the one QP asked for! $\endgroup$ Commented Jul 21, 2023 at 11:11
  • $\begingroup$ Not the definition of z1,z2,z3, I meant z in your second code-block $\endgroup$ Commented Jul 21, 2023 at 14:50
  • $\begingroup$ Not the timing is my issue, the formula is probably wrong! $\endgroup$ Commented Jul 21, 2023 at 15:29

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.