Some weird results in complex number computing












3












$begingroup$


The question I met is to show that if $z=cos (theta)+isin(theta)$ with $i=sqrt{-1}$,then $ Re(frac{z-1}{z+1})=0$



In the normal way, we found that: $$frac{z-1}{z+1}=frac{cos(theta)-1+isin(theta)}{cos(theta)+1+isin(theta)}\
=frac{bigl(cos(theta)-1+isin(theta)bigl)bigl(cos(theta)+1-isin(theta)bigl)}{bigl(cos(theta)+1bigl)^2+sin^2(theta)}\
=frac{cos^2(theta)+cos(theta)-cos(theta)-1+sin^2(theta)+2isin(theta)}{bigl(cos(theta)+1bigl)^2+sin^2(theta)}\
=frac{2isin(theta)}{bigl(cos(theta)+1bigl)^2+sin^2(theta)}$$



So $Re(frac{z-1}{z+1})=0$



If we do it in another way:
$$
frac{cos(theta)-1+isin(theta)}{cos(theta)+1+isin(theta)}=frac{-2sin^2(frac{theta}{2})+2icos(frac{theta}{2})sin(frac{theta}{2})}{2cos^2(frac{theta}{2})+2isin(frac{theta}{2})cos(frac{theta}{2})}\
=-tan(frac{theta}{2})frac{sin(frac{theta}{2})-icos(frac{theta}{2})}{cos(frac{theta}{2})+isin(frac{theta}{2})}\
=-tan(frac{theta}{2})frac{cosbigl(-(frac{theta}{2}+frac{pi}{2})big)+isinbigl(-(frac{theta}{2}+frac{pi}{2})big)}{cos(frac{theta}{2})+isin(frac{theta}{2})}\
=-tan(frac{theta}{2})bigl(cos(-theta-frac{pi}{2})+isin(-theta-frac{pi}{2})bigl)
$$



So the real part of it will be $-tan(frac{theta}{2})cos(-theta-frac{pi}{2})$ which is not $0$.



Which step I made mistake or they are equivalent?










share|cite|improve this question











$endgroup$












  • $begingroup$
    There must be a sign error, the $theta$ should simplify instead, and the fraction turn to $e^{ipi/2}$.
    $endgroup$
    – Yves Daoust
    Jan 8 at 9:44












  • $begingroup$
    Demoivre's theory, the arguments of two complex number are added.
    $endgroup$
    – yuanming luo
    Jan 8 at 9:47










  • $begingroup$
    How did you get from $$-tan(frac{theta}{2})frac{cosbigl(-(frac{theta}{2}+frac{pi}{2})big)+isinbigl(-(frac{theta}{2}+frac{pi}{2})big)}{cos(frac{theta}{2})+isin(frac{theta}{2})}$$ to $$-tan(frac{theta}{2})bigl(cos(-theta-frac{pi}{2})+isin(-theta-frac{pi}{2})bigl)?$$
    $endgroup$
    – 5xum
    Jan 8 at 9:55










  • $begingroup$
    @5xum That's what I asked earlier, and the OP's comment above is about. It's simply subtraction of angles, from dividing unit length complex numbers by one another.
    $endgroup$
    – Arthur
    Jan 8 at 9:56












  • $begingroup$
    @Arthur " That's what I asked earlier"... I don't see your question anywhere...
    $endgroup$
    – 5xum
    Jan 8 at 9:58
















3












$begingroup$


The question I met is to show that if $z=cos (theta)+isin(theta)$ with $i=sqrt{-1}$,then $ Re(frac{z-1}{z+1})=0$



In the normal way, we found that: $$frac{z-1}{z+1}=frac{cos(theta)-1+isin(theta)}{cos(theta)+1+isin(theta)}\
=frac{bigl(cos(theta)-1+isin(theta)bigl)bigl(cos(theta)+1-isin(theta)bigl)}{bigl(cos(theta)+1bigl)^2+sin^2(theta)}\
=frac{cos^2(theta)+cos(theta)-cos(theta)-1+sin^2(theta)+2isin(theta)}{bigl(cos(theta)+1bigl)^2+sin^2(theta)}\
=frac{2isin(theta)}{bigl(cos(theta)+1bigl)^2+sin^2(theta)}$$



So $Re(frac{z-1}{z+1})=0$



If we do it in another way:
$$
frac{cos(theta)-1+isin(theta)}{cos(theta)+1+isin(theta)}=frac{-2sin^2(frac{theta}{2})+2icos(frac{theta}{2})sin(frac{theta}{2})}{2cos^2(frac{theta}{2})+2isin(frac{theta}{2})cos(frac{theta}{2})}\
=-tan(frac{theta}{2})frac{sin(frac{theta}{2})-icos(frac{theta}{2})}{cos(frac{theta}{2})+isin(frac{theta}{2})}\
=-tan(frac{theta}{2})frac{cosbigl(-(frac{theta}{2}+frac{pi}{2})big)+isinbigl(-(frac{theta}{2}+frac{pi}{2})big)}{cos(frac{theta}{2})+isin(frac{theta}{2})}\
=-tan(frac{theta}{2})bigl(cos(-theta-frac{pi}{2})+isin(-theta-frac{pi}{2})bigl)
$$



So the real part of it will be $-tan(frac{theta}{2})cos(-theta-frac{pi}{2})$ which is not $0$.



Which step I made mistake or they are equivalent?










share|cite|improve this question











$endgroup$












  • $begingroup$
    There must be a sign error, the $theta$ should simplify instead, and the fraction turn to $e^{ipi/2}$.
    $endgroup$
    – Yves Daoust
    Jan 8 at 9:44












  • $begingroup$
    Demoivre's theory, the arguments of two complex number are added.
    $endgroup$
    – yuanming luo
    Jan 8 at 9:47










  • $begingroup$
    How did you get from $$-tan(frac{theta}{2})frac{cosbigl(-(frac{theta}{2}+frac{pi}{2})big)+isinbigl(-(frac{theta}{2}+frac{pi}{2})big)}{cos(frac{theta}{2})+isin(frac{theta}{2})}$$ to $$-tan(frac{theta}{2})bigl(cos(-theta-frac{pi}{2})+isin(-theta-frac{pi}{2})bigl)?$$
    $endgroup$
    – 5xum
    Jan 8 at 9:55










  • $begingroup$
    @5xum That's what I asked earlier, and the OP's comment above is about. It's simply subtraction of angles, from dividing unit length complex numbers by one another.
    $endgroup$
    – Arthur
    Jan 8 at 9:56












  • $begingroup$
    @Arthur " That's what I asked earlier"... I don't see your question anywhere...
    $endgroup$
    – 5xum
    Jan 8 at 9:58














3












3








3





$begingroup$


The question I met is to show that if $z=cos (theta)+isin(theta)$ with $i=sqrt{-1}$,then $ Re(frac{z-1}{z+1})=0$



In the normal way, we found that: $$frac{z-1}{z+1}=frac{cos(theta)-1+isin(theta)}{cos(theta)+1+isin(theta)}\
=frac{bigl(cos(theta)-1+isin(theta)bigl)bigl(cos(theta)+1-isin(theta)bigl)}{bigl(cos(theta)+1bigl)^2+sin^2(theta)}\
=frac{cos^2(theta)+cos(theta)-cos(theta)-1+sin^2(theta)+2isin(theta)}{bigl(cos(theta)+1bigl)^2+sin^2(theta)}\
=frac{2isin(theta)}{bigl(cos(theta)+1bigl)^2+sin^2(theta)}$$



So $Re(frac{z-1}{z+1})=0$



If we do it in another way:
$$
frac{cos(theta)-1+isin(theta)}{cos(theta)+1+isin(theta)}=frac{-2sin^2(frac{theta}{2})+2icos(frac{theta}{2})sin(frac{theta}{2})}{2cos^2(frac{theta}{2})+2isin(frac{theta}{2})cos(frac{theta}{2})}\
=-tan(frac{theta}{2})frac{sin(frac{theta}{2})-icos(frac{theta}{2})}{cos(frac{theta}{2})+isin(frac{theta}{2})}\
=-tan(frac{theta}{2})frac{cosbigl(-(frac{theta}{2}+frac{pi}{2})big)+isinbigl(-(frac{theta}{2}+frac{pi}{2})big)}{cos(frac{theta}{2})+isin(frac{theta}{2})}\
=-tan(frac{theta}{2})bigl(cos(-theta-frac{pi}{2})+isin(-theta-frac{pi}{2})bigl)
$$



So the real part of it will be $-tan(frac{theta}{2})cos(-theta-frac{pi}{2})$ which is not $0$.



Which step I made mistake or they are equivalent?










share|cite|improve this question











$endgroup$




The question I met is to show that if $z=cos (theta)+isin(theta)$ with $i=sqrt{-1}$,then $ Re(frac{z-1}{z+1})=0$



In the normal way, we found that: $$frac{z-1}{z+1}=frac{cos(theta)-1+isin(theta)}{cos(theta)+1+isin(theta)}\
=frac{bigl(cos(theta)-1+isin(theta)bigl)bigl(cos(theta)+1-isin(theta)bigl)}{bigl(cos(theta)+1bigl)^2+sin^2(theta)}\
=frac{cos^2(theta)+cos(theta)-cos(theta)-1+sin^2(theta)+2isin(theta)}{bigl(cos(theta)+1bigl)^2+sin^2(theta)}\
=frac{2isin(theta)}{bigl(cos(theta)+1bigl)^2+sin^2(theta)}$$



So $Re(frac{z-1}{z+1})=0$



If we do it in another way:
$$
frac{cos(theta)-1+isin(theta)}{cos(theta)+1+isin(theta)}=frac{-2sin^2(frac{theta}{2})+2icos(frac{theta}{2})sin(frac{theta}{2})}{2cos^2(frac{theta}{2})+2isin(frac{theta}{2})cos(frac{theta}{2})}\
=-tan(frac{theta}{2})frac{sin(frac{theta}{2})-icos(frac{theta}{2})}{cos(frac{theta}{2})+isin(frac{theta}{2})}\
=-tan(frac{theta}{2})frac{cosbigl(-(frac{theta}{2}+frac{pi}{2})big)+isinbigl(-(frac{theta}{2}+frac{pi}{2})big)}{cos(frac{theta}{2})+isin(frac{theta}{2})}\
=-tan(frac{theta}{2})bigl(cos(-theta-frac{pi}{2})+isin(-theta-frac{pi}{2})bigl)
$$



So the real part of it will be $-tan(frac{theta}{2})cos(-theta-frac{pi}{2})$ which is not $0$.



Which step I made mistake or they are equivalent?







complex-numbers






share|cite|improve this question















share|cite|improve this question













share|cite|improve this question




share|cite|improve this question








edited Jan 8 at 9:47







yuanming luo

















asked Jan 8 at 9:38









yuanming luoyuanming luo

10211




10211












  • $begingroup$
    There must be a sign error, the $theta$ should simplify instead, and the fraction turn to $e^{ipi/2}$.
    $endgroup$
    – Yves Daoust
    Jan 8 at 9:44












  • $begingroup$
    Demoivre's theory, the arguments of two complex number are added.
    $endgroup$
    – yuanming luo
    Jan 8 at 9:47










  • $begingroup$
    How did you get from $$-tan(frac{theta}{2})frac{cosbigl(-(frac{theta}{2}+frac{pi}{2})big)+isinbigl(-(frac{theta}{2}+frac{pi}{2})big)}{cos(frac{theta}{2})+isin(frac{theta}{2})}$$ to $$-tan(frac{theta}{2})bigl(cos(-theta-frac{pi}{2})+isin(-theta-frac{pi}{2})bigl)?$$
    $endgroup$
    – 5xum
    Jan 8 at 9:55










  • $begingroup$
    @5xum That's what I asked earlier, and the OP's comment above is about. It's simply subtraction of angles, from dividing unit length complex numbers by one another.
    $endgroup$
    – Arthur
    Jan 8 at 9:56












  • $begingroup$
    @Arthur " That's what I asked earlier"... I don't see your question anywhere...
    $endgroup$
    – 5xum
    Jan 8 at 9:58


















  • $begingroup$
    There must be a sign error, the $theta$ should simplify instead, and the fraction turn to $e^{ipi/2}$.
    $endgroup$
    – Yves Daoust
    Jan 8 at 9:44












  • $begingroup$
    Demoivre's theory, the arguments of two complex number are added.
    $endgroup$
    – yuanming luo
    Jan 8 at 9:47










  • $begingroup$
    How did you get from $$-tan(frac{theta}{2})frac{cosbigl(-(frac{theta}{2}+frac{pi}{2})big)+isinbigl(-(frac{theta}{2}+frac{pi}{2})big)}{cos(frac{theta}{2})+isin(frac{theta}{2})}$$ to $$-tan(frac{theta}{2})bigl(cos(-theta-frac{pi}{2})+isin(-theta-frac{pi}{2})bigl)?$$
    $endgroup$
    – 5xum
    Jan 8 at 9:55










  • $begingroup$
    @5xum That's what I asked earlier, and the OP's comment above is about. It's simply subtraction of angles, from dividing unit length complex numbers by one another.
    $endgroup$
    – Arthur
    Jan 8 at 9:56












  • $begingroup$
    @Arthur " That's what I asked earlier"... I don't see your question anywhere...
    $endgroup$
    – 5xum
    Jan 8 at 9:58
















$begingroup$
There must be a sign error, the $theta$ should simplify instead, and the fraction turn to $e^{ipi/2}$.
$endgroup$
– Yves Daoust
Jan 8 at 9:44






$begingroup$
There must be a sign error, the $theta$ should simplify instead, and the fraction turn to $e^{ipi/2}$.
$endgroup$
– Yves Daoust
Jan 8 at 9:44














$begingroup$
Demoivre's theory, the arguments of two complex number are added.
$endgroup$
– yuanming luo
Jan 8 at 9:47




$begingroup$
Demoivre's theory, the arguments of two complex number are added.
$endgroup$
– yuanming luo
Jan 8 at 9:47












$begingroup$
How did you get from $$-tan(frac{theta}{2})frac{cosbigl(-(frac{theta}{2}+frac{pi}{2})big)+isinbigl(-(frac{theta}{2}+frac{pi}{2})big)}{cos(frac{theta}{2})+isin(frac{theta}{2})}$$ to $$-tan(frac{theta}{2})bigl(cos(-theta-frac{pi}{2})+isin(-theta-frac{pi}{2})bigl)?$$
$endgroup$
– 5xum
Jan 8 at 9:55




$begingroup$
How did you get from $$-tan(frac{theta}{2})frac{cosbigl(-(frac{theta}{2}+frac{pi}{2})big)+isinbigl(-(frac{theta}{2}+frac{pi}{2})big)}{cos(frac{theta}{2})+isin(frac{theta}{2})}$$ to $$-tan(frac{theta}{2})bigl(cos(-theta-frac{pi}{2})+isin(-theta-frac{pi}{2})bigl)?$$
$endgroup$
– 5xum
Jan 8 at 9:55












$begingroup$
@5xum That's what I asked earlier, and the OP's comment above is about. It's simply subtraction of angles, from dividing unit length complex numbers by one another.
$endgroup$
– Arthur
Jan 8 at 9:56






$begingroup$
@5xum That's what I asked earlier, and the OP's comment above is about. It's simply subtraction of angles, from dividing unit length complex numbers by one another.
$endgroup$
– Arthur
Jan 8 at 9:56














$begingroup$
@Arthur " That's what I asked earlier"... I don't see your question anywhere...
$endgroup$
– 5xum
Jan 8 at 9:58




$begingroup$
@Arthur " That's what I asked earlier"... I don't see your question anywhere...
$endgroup$
– 5xum
Jan 8 at 9:58










2 Answers
2






active

oldest

votes


















2












$begingroup$

You should be more careful when applying transformations of sines into cosines.



It's much easier than that:
$$
sinfrac{theta}{2}-icosfrac{theta}{2}=
ileft(cosfrac{theta}{2}+isinfrac{theta}{2}right)
$$

You could write this in trigonometric form
$$
=left(cosfrac{pi}{2}+isinfrac{pi}{2}right)
left(cosfrac{theta}{2}+isinfrac{theta}{2}right)
=cosleft(frac{theta}{2}+frac{pi}{2}right)+
isinleft(frac{theta}{2}+frac{pi}{2}right)
$$

and now you can go and chase for your mistake.



Another way to do the same: the conjugate of your number $w=frac{z-1}{z+1}$ is
$$
bar{w}=frac{bar{z}-1}{bar{z}+1}
$$

but, since $|z|=1$, we have $bar{z}=z^{-1}$; therefore
$$
bar{w}=frac{z^{-1}-1}{z^{-1}+1}=frac{1-z}{1+z}=-w
$$

From $bar{w}=-w$ it follows that $operatorname{Re}(w)=0$.



If you want to find the imaginary part in term of $theta$, you can consider $z=u^2$, where $u=cos(theta/2)+isin(theta/2)$; then
$$
w=frac{z-1}{z+1}=frac{u^2-1}{u^2+1}=frac{u-u^{-1}}{u+u^{-1}}
=frac{u-bar{u}}{u+bar{u}}=
frac{2isin(theta/2)}{2cos(theta/2)}=itanfrac{theta}{2}
$$






share|cite|improve this answer









$endgroup$





















    1












    $begingroup$

    We have
    $$
    sinleft(fractheta2right) - icosleft(fractheta2right) = -sinleft(-fractheta2right) - icosleft(fractheta2right)\
    = -cosleft(-fractheta2-fracpi2right) - isinleft(fractheta2 + fracpi2right)\
    = -left(cosleft(fractheta2 + fracpi2right) + isinleft(fractheta2 + fracpi2right)right)
    $$

    so you have a sign error in the numerator between line 2 and line 3 of your alternate approach.






    share|cite|improve this answer









    $endgroup$














      Your Answer








      StackExchange.ready(function() {
      var channelOptions = {
      tags: "".split(" "),
      id: "69"
      };
      initTagRenderer("".split(" "), "".split(" "), channelOptions);

      StackExchange.using("externalEditor", function() {
      // Have to fire editor after snippets, if snippets enabled
      if (StackExchange.settings.snippets.snippetsEnabled) {
      StackExchange.using("snippets", function() {
      createEditor();
      });
      }
      else {
      createEditor();
      }
      });

      function createEditor() {
      StackExchange.prepareEditor({
      heartbeatType: 'answer',
      autoActivateHeartbeat: false,
      convertImagesToLinks: true,
      noModals: true,
      showLowRepImageUploadWarning: true,
      reputationToPostImages: 10,
      bindNavPrevention: true,
      postfix: "",
      imageUploader: {
      brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
      contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
      allowUrls: true
      },
      noCode: true, onDemand: true,
      discardSelector: ".discard-answer"
      ,immediatelyShowMarkdownHelp:true
      });


      }
      });














      draft saved

      draft discarded


















      StackExchange.ready(
      function () {
      StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmath.stackexchange.com%2fquestions%2f3065975%2fsome-weird-results-in-complex-number-computing%23new-answer', 'question_page');
      }
      );

      Post as a guest















      Required, but never shown

























      2 Answers
      2






      active

      oldest

      votes








      2 Answers
      2






      active

      oldest

      votes









      active

      oldest

      votes






      active

      oldest

      votes









      2












      $begingroup$

      You should be more careful when applying transformations of sines into cosines.



      It's much easier than that:
      $$
      sinfrac{theta}{2}-icosfrac{theta}{2}=
      ileft(cosfrac{theta}{2}+isinfrac{theta}{2}right)
      $$

      You could write this in trigonometric form
      $$
      =left(cosfrac{pi}{2}+isinfrac{pi}{2}right)
      left(cosfrac{theta}{2}+isinfrac{theta}{2}right)
      =cosleft(frac{theta}{2}+frac{pi}{2}right)+
      isinleft(frac{theta}{2}+frac{pi}{2}right)
      $$

      and now you can go and chase for your mistake.



      Another way to do the same: the conjugate of your number $w=frac{z-1}{z+1}$ is
      $$
      bar{w}=frac{bar{z}-1}{bar{z}+1}
      $$

      but, since $|z|=1$, we have $bar{z}=z^{-1}$; therefore
      $$
      bar{w}=frac{z^{-1}-1}{z^{-1}+1}=frac{1-z}{1+z}=-w
      $$

      From $bar{w}=-w$ it follows that $operatorname{Re}(w)=0$.



      If you want to find the imaginary part in term of $theta$, you can consider $z=u^2$, where $u=cos(theta/2)+isin(theta/2)$; then
      $$
      w=frac{z-1}{z+1}=frac{u^2-1}{u^2+1}=frac{u-u^{-1}}{u+u^{-1}}
      =frac{u-bar{u}}{u+bar{u}}=
      frac{2isin(theta/2)}{2cos(theta/2)}=itanfrac{theta}{2}
      $$






      share|cite|improve this answer









      $endgroup$


















        2












        $begingroup$

        You should be more careful when applying transformations of sines into cosines.



        It's much easier than that:
        $$
        sinfrac{theta}{2}-icosfrac{theta}{2}=
        ileft(cosfrac{theta}{2}+isinfrac{theta}{2}right)
        $$

        You could write this in trigonometric form
        $$
        =left(cosfrac{pi}{2}+isinfrac{pi}{2}right)
        left(cosfrac{theta}{2}+isinfrac{theta}{2}right)
        =cosleft(frac{theta}{2}+frac{pi}{2}right)+
        isinleft(frac{theta}{2}+frac{pi}{2}right)
        $$

        and now you can go and chase for your mistake.



        Another way to do the same: the conjugate of your number $w=frac{z-1}{z+1}$ is
        $$
        bar{w}=frac{bar{z}-1}{bar{z}+1}
        $$

        but, since $|z|=1$, we have $bar{z}=z^{-1}$; therefore
        $$
        bar{w}=frac{z^{-1}-1}{z^{-1}+1}=frac{1-z}{1+z}=-w
        $$

        From $bar{w}=-w$ it follows that $operatorname{Re}(w)=0$.



        If you want to find the imaginary part in term of $theta$, you can consider $z=u^2$, where $u=cos(theta/2)+isin(theta/2)$; then
        $$
        w=frac{z-1}{z+1}=frac{u^2-1}{u^2+1}=frac{u-u^{-1}}{u+u^{-1}}
        =frac{u-bar{u}}{u+bar{u}}=
        frac{2isin(theta/2)}{2cos(theta/2)}=itanfrac{theta}{2}
        $$






        share|cite|improve this answer









        $endgroup$
















          2












          2








          2





          $begingroup$

          You should be more careful when applying transformations of sines into cosines.



          It's much easier than that:
          $$
          sinfrac{theta}{2}-icosfrac{theta}{2}=
          ileft(cosfrac{theta}{2}+isinfrac{theta}{2}right)
          $$

          You could write this in trigonometric form
          $$
          =left(cosfrac{pi}{2}+isinfrac{pi}{2}right)
          left(cosfrac{theta}{2}+isinfrac{theta}{2}right)
          =cosleft(frac{theta}{2}+frac{pi}{2}right)+
          isinleft(frac{theta}{2}+frac{pi}{2}right)
          $$

          and now you can go and chase for your mistake.



          Another way to do the same: the conjugate of your number $w=frac{z-1}{z+1}$ is
          $$
          bar{w}=frac{bar{z}-1}{bar{z}+1}
          $$

          but, since $|z|=1$, we have $bar{z}=z^{-1}$; therefore
          $$
          bar{w}=frac{z^{-1}-1}{z^{-1}+1}=frac{1-z}{1+z}=-w
          $$

          From $bar{w}=-w$ it follows that $operatorname{Re}(w)=0$.



          If you want to find the imaginary part in term of $theta$, you can consider $z=u^2$, where $u=cos(theta/2)+isin(theta/2)$; then
          $$
          w=frac{z-1}{z+1}=frac{u^2-1}{u^2+1}=frac{u-u^{-1}}{u+u^{-1}}
          =frac{u-bar{u}}{u+bar{u}}=
          frac{2isin(theta/2)}{2cos(theta/2)}=itanfrac{theta}{2}
          $$






          share|cite|improve this answer









          $endgroup$



          You should be more careful when applying transformations of sines into cosines.



          It's much easier than that:
          $$
          sinfrac{theta}{2}-icosfrac{theta}{2}=
          ileft(cosfrac{theta}{2}+isinfrac{theta}{2}right)
          $$

          You could write this in trigonometric form
          $$
          =left(cosfrac{pi}{2}+isinfrac{pi}{2}right)
          left(cosfrac{theta}{2}+isinfrac{theta}{2}right)
          =cosleft(frac{theta}{2}+frac{pi}{2}right)+
          isinleft(frac{theta}{2}+frac{pi}{2}right)
          $$

          and now you can go and chase for your mistake.



          Another way to do the same: the conjugate of your number $w=frac{z-1}{z+1}$ is
          $$
          bar{w}=frac{bar{z}-1}{bar{z}+1}
          $$

          but, since $|z|=1$, we have $bar{z}=z^{-1}$; therefore
          $$
          bar{w}=frac{z^{-1}-1}{z^{-1}+1}=frac{1-z}{1+z}=-w
          $$

          From $bar{w}=-w$ it follows that $operatorname{Re}(w)=0$.



          If you want to find the imaginary part in term of $theta$, you can consider $z=u^2$, where $u=cos(theta/2)+isin(theta/2)$; then
          $$
          w=frac{z-1}{z+1}=frac{u^2-1}{u^2+1}=frac{u-u^{-1}}{u+u^{-1}}
          =frac{u-bar{u}}{u+bar{u}}=
          frac{2isin(theta/2)}{2cos(theta/2)}=itanfrac{theta}{2}
          $$







          share|cite|improve this answer












          share|cite|improve this answer



          share|cite|improve this answer










          answered Jan 8 at 10:05









          egregegreg

          186k1486208




          186k1486208























              1












              $begingroup$

              We have
              $$
              sinleft(fractheta2right) - icosleft(fractheta2right) = -sinleft(-fractheta2right) - icosleft(fractheta2right)\
              = -cosleft(-fractheta2-fracpi2right) - isinleft(fractheta2 + fracpi2right)\
              = -left(cosleft(fractheta2 + fracpi2right) + isinleft(fractheta2 + fracpi2right)right)
              $$

              so you have a sign error in the numerator between line 2 and line 3 of your alternate approach.






              share|cite|improve this answer









              $endgroup$


















                1












                $begingroup$

                We have
                $$
                sinleft(fractheta2right) - icosleft(fractheta2right) = -sinleft(-fractheta2right) - icosleft(fractheta2right)\
                = -cosleft(-fractheta2-fracpi2right) - isinleft(fractheta2 + fracpi2right)\
                = -left(cosleft(fractheta2 + fracpi2right) + isinleft(fractheta2 + fracpi2right)right)
                $$

                so you have a sign error in the numerator between line 2 and line 3 of your alternate approach.






                share|cite|improve this answer









                $endgroup$
















                  1












                  1








                  1





                  $begingroup$

                  We have
                  $$
                  sinleft(fractheta2right) - icosleft(fractheta2right) = -sinleft(-fractheta2right) - icosleft(fractheta2right)\
                  = -cosleft(-fractheta2-fracpi2right) - isinleft(fractheta2 + fracpi2right)\
                  = -left(cosleft(fractheta2 + fracpi2right) + isinleft(fractheta2 + fracpi2right)right)
                  $$

                  so you have a sign error in the numerator between line 2 and line 3 of your alternate approach.






                  share|cite|improve this answer









                  $endgroup$



                  We have
                  $$
                  sinleft(fractheta2right) - icosleft(fractheta2right) = -sinleft(-fractheta2right) - icosleft(fractheta2right)\
                  = -cosleft(-fractheta2-fracpi2right) - isinleft(fractheta2 + fracpi2right)\
                  = -left(cosleft(fractheta2 + fracpi2right) + isinleft(fractheta2 + fracpi2right)right)
                  $$

                  so you have a sign error in the numerator between line 2 and line 3 of your alternate approach.







                  share|cite|improve this answer












                  share|cite|improve this answer



                  share|cite|improve this answer










                  answered Jan 8 at 9:56









                  ArthurArthur

                  123k7122211




                  123k7122211






























                      draft saved

                      draft discarded




















































                      Thanks for contributing an answer to Mathematics Stack Exchange!


                      • Please be sure to answer the question. Provide details and share your research!

                      But avoid



                      • Asking for help, clarification, or responding to other answers.

                      • Making statements based on opinion; back them up with references or personal experience.


                      Use MathJax to format equations. MathJax reference.


                      To learn more, see our tips on writing great answers.




                      draft saved


                      draft discarded














                      StackExchange.ready(
                      function () {
                      StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmath.stackexchange.com%2fquestions%2f3065975%2fsome-weird-results-in-complex-number-computing%23new-answer', 'question_page');
                      }
                      );

                      Post as a guest















                      Required, but never shown





















































                      Required, but never shown














                      Required, but never shown












                      Required, but never shown







                      Required, but never shown

































                      Required, but never shown














                      Required, but never shown












                      Required, but never shown







                      Required, but never shown







                      Popular posts from this blog

                      Wiesbaden

                      To store a contact into the json file from server.js file using a class in NodeJS

                      Marschland