Skip to content

Commit

Permalink
ComplexExpand doc corrections/completions
Browse files Browse the repository at this point in the history
  • Loading branch information
rocky committed Jul 8, 2023
1 parent e424b77 commit c4f1f2b
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions mathics/builtin/numbers/hyperbolic.py
Original file line number Diff line number Diff line change
Expand Up @@ -261,14 +261,17 @@ class ComplexExpand(SympyFunction):
<dl>
<dt>'ComplexExpand[$expr$]'
<dd>expands $expr$ assuming that all variables are real.
<dt>'ComplexExpand[$expr$,{$x1$,$x2$, ...}]
<dd>expands $expr$ assuming that variables matching any of the $xi$ are complex.
</dl>
Note: we get equivalent, but different results from WMA:
>> ComplexExpand[3^(I x)]
= 3 ^ (-Im[x]) Re[3 ^ (I Re[x])] + I Im[3 ^ (I Re[x])] 3 ^ (-Im[x])
Assume that both and are real:
Assume that both $x$ and $y$ and are real:
>> ComplexExpand[Sin[x + I y]]
= Cosh[y] Sin[x] + I Cos[x] Sinh[y]
Expand All @@ -289,7 +292,7 @@ class ComplexExpand(SympyFunction):
>> ComplexExpand[Abs[2^z Log[2 z]], z]
= Abs[I Arg[Re[z] + I Im[z]] + Log[4 Im[z] ^ 2 + 4 Re[z] ^ 2] / 2] 2 ^ Re[z]
Specify that a variable is take to be complex:
Specify that variable $z$ is taken to be complex:
>> ComplexExpand[Re[2 z^3 - z + 1], z]
= 1 - Re[z] + 2 Re[z] ^ 3 - 6 Im[z] ^ 2 Re[z]
"""
Expand Down

0 comments on commit c4f1f2b

Please sign in to comment.