`Re[z]` Command [closed]












2












$begingroup$


Suppose we have complex number $z=a+i b$, where $a$ and $b$ are variables.



Now, if we want real part of $z$, then in mathematica we use Re[z] command. But this command is not working (because $a$ and $b$ are not fixed real numbers).



Re[expr] is left unevaluated if expr is not a numeric quantity. (https://reference.wolfram.com/language/ref/Re.html)



How do we get Re[z]$=a$ as solution?










share|improve this question









$endgroup$



closed as off-topic by Michael E2, Daniel Lichtblau, b3m2a1, m_goldberg, march Jan 28 at 18:17


This question appears to be off-topic. The users who voted to close gave this specific reason:


  • "This question arises due to a simple mistake such as a trivial syntax error, incorrect capitalization, spelling mistake, or other typographical error and is unlikely to help any future visitors, or else it is easily found in the documentation." – Michael E2, Daniel Lichtblau, b3m2a1, m_goldberg, march

If this question can be reworded to fit the rules in the help center, please edit the question.












  • 3




    $begingroup$
    See "Properties & Relations" in the documentation for Re. It shows various uses of ComplexExpand with respect to Re.
    $endgroup$
    – Michael E2
    Jan 25 at 16:56
















2












$begingroup$


Suppose we have complex number $z=a+i b$, where $a$ and $b$ are variables.



Now, if we want real part of $z$, then in mathematica we use Re[z] command. But this command is not working (because $a$ and $b$ are not fixed real numbers).



Re[expr] is left unevaluated if expr is not a numeric quantity. (https://reference.wolfram.com/language/ref/Re.html)



How do we get Re[z]$=a$ as solution?










share|improve this question









$endgroup$



closed as off-topic by Michael E2, Daniel Lichtblau, b3m2a1, m_goldberg, march Jan 28 at 18:17


This question appears to be off-topic. The users who voted to close gave this specific reason:


  • "This question arises due to a simple mistake such as a trivial syntax error, incorrect capitalization, spelling mistake, or other typographical error and is unlikely to help any future visitors, or else it is easily found in the documentation." – Michael E2, Daniel Lichtblau, b3m2a1, m_goldberg, march

If this question can be reworded to fit the rules in the help center, please edit the question.












  • 3




    $begingroup$
    See "Properties & Relations" in the documentation for Re. It shows various uses of ComplexExpand with respect to Re.
    $endgroup$
    – Michael E2
    Jan 25 at 16:56














2












2








2





$begingroup$


Suppose we have complex number $z=a+i b$, where $a$ and $b$ are variables.



Now, if we want real part of $z$, then in mathematica we use Re[z] command. But this command is not working (because $a$ and $b$ are not fixed real numbers).



Re[expr] is left unevaluated if expr is not a numeric quantity. (https://reference.wolfram.com/language/ref/Re.html)



How do we get Re[z]$=a$ as solution?










share|improve this question









$endgroup$




Suppose we have complex number $z=a+i b$, where $a$ and $b$ are variables.



Now, if we want real part of $z$, then in mathematica we use Re[z] command. But this command is not working (because $a$ and $b$ are not fixed real numbers).



Re[expr] is left unevaluated if expr is not a numeric quantity. (https://reference.wolfram.com/language/ref/Re.html)



How do we get Re[z]$=a$ as solution?







complex






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Jan 25 at 15:00









GoldyGoldy

1702




1702




closed as off-topic by Michael E2, Daniel Lichtblau, b3m2a1, m_goldberg, march Jan 28 at 18:17


This question appears to be off-topic. The users who voted to close gave this specific reason:


  • "This question arises due to a simple mistake such as a trivial syntax error, incorrect capitalization, spelling mistake, or other typographical error and is unlikely to help any future visitors, or else it is easily found in the documentation." – Michael E2, Daniel Lichtblau, b3m2a1, m_goldberg, march

If this question can be reworded to fit the rules in the help center, please edit the question.







closed as off-topic by Michael E2, Daniel Lichtblau, b3m2a1, m_goldberg, march Jan 28 at 18:17


This question appears to be off-topic. The users who voted to close gave this specific reason:


  • "This question arises due to a simple mistake such as a trivial syntax error, incorrect capitalization, spelling mistake, or other typographical error and is unlikely to help any future visitors, or else it is easily found in the documentation." – Michael E2, Daniel Lichtblau, b3m2a1, m_goldberg, march

If this question can be reworded to fit the rules in the help center, please edit the question.








  • 3




    $begingroup$
    See "Properties & Relations" in the documentation for Re. It shows various uses of ComplexExpand with respect to Re.
    $endgroup$
    – Michael E2
    Jan 25 at 16:56














  • 3




    $begingroup$
    See "Properties & Relations" in the documentation for Re. It shows various uses of ComplexExpand with respect to Re.
    $endgroup$
    – Michael E2
    Jan 25 at 16:56








3




3




$begingroup$
See "Properties & Relations" in the documentation for Re. It shows various uses of ComplexExpand with respect to Re.
$endgroup$
– Michael E2
Jan 25 at 16:56




$begingroup$
See "Properties & Relations" in the documentation for Re. It shows various uses of ComplexExpand with respect to Re.
$endgroup$
– Michael E2
Jan 25 at 16:56










2 Answers
2






active

oldest

votes


















2












$begingroup$

z = a + I b;
ComplexExpand[Re[z]]



a




Hope that helps.






share|improve this answer









$endgroup$













  • $begingroup$
    But what is the difference between ComplexExpand[Re[z]] and Re[ComplexExpand[z]]??
    $endgroup$
    – Goldy
    Jan 25 at 15:17










  • $begingroup$
    Command ComplexExpand[Re[z]] gives me correct result, but Re[ComplexExpand[z]] is not working
    $endgroup$
    – Goldy
    Jan 25 at 15:18






  • 1




    $begingroup$
    ComplexExpand[z] has not got any work to do. If you try ComplexExpand[z^2] then it does do some work. Have a good look at the documentation. What would you expect it to do?
    $endgroup$
    – Hugh
    Jan 25 at 15:23



















3












$begingroup$

The rewrite rules behind ComplexExpand assume all undefined symbols in the expression are real.



ComplexExpand[z]


is just



z


Thus,



Re[ComplexExpand[z]]


first gets rewritten as



Re[z]


and no further rewrite is possible because Re has no rule for this case. But ComplexExpand inspects the structure of the expression it's given. It recognizes that it can rewrite Re[z] as z.



Mathematica is a language for rewriting mathematical expressions based on recognizing their structure. Sometimes those rewrites seem to act like "commands", but it is misleading to think of them that way.






share|improve this answer









$endgroup$




















    2 Answers
    2






    active

    oldest

    votes








    2 Answers
    2






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    2












    $begingroup$

    z = a + I b;
    ComplexExpand[Re[z]]



    a




    Hope that helps.






    share|improve this answer









    $endgroup$













    • $begingroup$
      But what is the difference between ComplexExpand[Re[z]] and Re[ComplexExpand[z]]??
      $endgroup$
      – Goldy
      Jan 25 at 15:17










    • $begingroup$
      Command ComplexExpand[Re[z]] gives me correct result, but Re[ComplexExpand[z]] is not working
      $endgroup$
      – Goldy
      Jan 25 at 15:18






    • 1




      $begingroup$
      ComplexExpand[z] has not got any work to do. If you try ComplexExpand[z^2] then it does do some work. Have a good look at the documentation. What would you expect it to do?
      $endgroup$
      – Hugh
      Jan 25 at 15:23
















    2












    $begingroup$

    z = a + I b;
    ComplexExpand[Re[z]]



    a




    Hope that helps.






    share|improve this answer









    $endgroup$













    • $begingroup$
      But what is the difference between ComplexExpand[Re[z]] and Re[ComplexExpand[z]]??
      $endgroup$
      – Goldy
      Jan 25 at 15:17










    • $begingroup$
      Command ComplexExpand[Re[z]] gives me correct result, but Re[ComplexExpand[z]] is not working
      $endgroup$
      – Goldy
      Jan 25 at 15:18






    • 1




      $begingroup$
      ComplexExpand[z] has not got any work to do. If you try ComplexExpand[z^2] then it does do some work. Have a good look at the documentation. What would you expect it to do?
      $endgroup$
      – Hugh
      Jan 25 at 15:23














    2












    2








    2





    $begingroup$

    z = a + I b;
    ComplexExpand[Re[z]]



    a




    Hope that helps.






    share|improve this answer









    $endgroup$



    z = a + I b;
    ComplexExpand[Re[z]]



    a




    Hope that helps.







    share|improve this answer












    share|improve this answer



    share|improve this answer










    answered Jan 25 at 15:08









    HughHugh

    6,40021945




    6,40021945












    • $begingroup$
      But what is the difference between ComplexExpand[Re[z]] and Re[ComplexExpand[z]]??
      $endgroup$
      – Goldy
      Jan 25 at 15:17










    • $begingroup$
      Command ComplexExpand[Re[z]] gives me correct result, but Re[ComplexExpand[z]] is not working
      $endgroup$
      – Goldy
      Jan 25 at 15:18






    • 1




      $begingroup$
      ComplexExpand[z] has not got any work to do. If you try ComplexExpand[z^2] then it does do some work. Have a good look at the documentation. What would you expect it to do?
      $endgroup$
      – Hugh
      Jan 25 at 15:23


















    • $begingroup$
      But what is the difference between ComplexExpand[Re[z]] and Re[ComplexExpand[z]]??
      $endgroup$
      – Goldy
      Jan 25 at 15:17










    • $begingroup$
      Command ComplexExpand[Re[z]] gives me correct result, but Re[ComplexExpand[z]] is not working
      $endgroup$
      – Goldy
      Jan 25 at 15:18






    • 1




      $begingroup$
      ComplexExpand[z] has not got any work to do. If you try ComplexExpand[z^2] then it does do some work. Have a good look at the documentation. What would you expect it to do?
      $endgroup$
      – Hugh
      Jan 25 at 15:23
















    $begingroup$
    But what is the difference between ComplexExpand[Re[z]] and Re[ComplexExpand[z]]??
    $endgroup$
    – Goldy
    Jan 25 at 15:17




    $begingroup$
    But what is the difference between ComplexExpand[Re[z]] and Re[ComplexExpand[z]]??
    $endgroup$
    – Goldy
    Jan 25 at 15:17












    $begingroup$
    Command ComplexExpand[Re[z]] gives me correct result, but Re[ComplexExpand[z]] is not working
    $endgroup$
    – Goldy
    Jan 25 at 15:18




    $begingroup$
    Command ComplexExpand[Re[z]] gives me correct result, but Re[ComplexExpand[z]] is not working
    $endgroup$
    – Goldy
    Jan 25 at 15:18




    1




    1




    $begingroup$
    ComplexExpand[z] has not got any work to do. If you try ComplexExpand[z^2] then it does do some work. Have a good look at the documentation. What would you expect it to do?
    $endgroup$
    – Hugh
    Jan 25 at 15:23




    $begingroup$
    ComplexExpand[z] has not got any work to do. If you try ComplexExpand[z^2] then it does do some work. Have a good look at the documentation. What would you expect it to do?
    $endgroup$
    – Hugh
    Jan 25 at 15:23











    3












    $begingroup$

    The rewrite rules behind ComplexExpand assume all undefined symbols in the expression are real.



    ComplexExpand[z]


    is just



    z


    Thus,



    Re[ComplexExpand[z]]


    first gets rewritten as



    Re[z]


    and no further rewrite is possible because Re has no rule for this case. But ComplexExpand inspects the structure of the expression it's given. It recognizes that it can rewrite Re[z] as z.



    Mathematica is a language for rewriting mathematical expressions based on recognizing their structure. Sometimes those rewrites seem to act like "commands", but it is misleading to think of them that way.






    share|improve this answer









    $endgroup$


















      3












      $begingroup$

      The rewrite rules behind ComplexExpand assume all undefined symbols in the expression are real.



      ComplexExpand[z]


      is just



      z


      Thus,



      Re[ComplexExpand[z]]


      first gets rewritten as



      Re[z]


      and no further rewrite is possible because Re has no rule for this case. But ComplexExpand inspects the structure of the expression it's given. It recognizes that it can rewrite Re[z] as z.



      Mathematica is a language for rewriting mathematical expressions based on recognizing their structure. Sometimes those rewrites seem to act like "commands", but it is misleading to think of them that way.






      share|improve this answer









      $endgroup$
















        3












        3








        3





        $begingroup$

        The rewrite rules behind ComplexExpand assume all undefined symbols in the expression are real.



        ComplexExpand[z]


        is just



        z


        Thus,



        Re[ComplexExpand[z]]


        first gets rewritten as



        Re[z]


        and no further rewrite is possible because Re has no rule for this case. But ComplexExpand inspects the structure of the expression it's given. It recognizes that it can rewrite Re[z] as z.



        Mathematica is a language for rewriting mathematical expressions based on recognizing their structure. Sometimes those rewrites seem to act like "commands", but it is misleading to think of them that way.






        share|improve this answer









        $endgroup$



        The rewrite rules behind ComplexExpand assume all undefined symbols in the expression are real.



        ComplexExpand[z]


        is just



        z


        Thus,



        Re[ComplexExpand[z]]


        first gets rewritten as



        Re[z]


        and no further rewrite is possible because Re has no rule for this case. But ComplexExpand inspects the structure of the expression it's given. It recognizes that it can rewrite Re[z] as z.



        Mathematica is a language for rewriting mathematical expressions based on recognizing their structure. Sometimes those rewrites seem to act like "commands", but it is misleading to think of them that way.







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Jan 25 at 15:30









        John DotyJohn Doty

        7,17311024




        7,17311024















            Popular posts from this blog

            Human spaceflight

            Can not write log (Is /dev/pts mounted?) - openpty in Ubuntu-on-Windows?

            張江高科駅