Well, for algebraic expressions like your example, you can use Barton's
favorite function substitution trick:
derect(ex):=ratsimp(subst([
nounify(realpart)=lambda([q],(q+conjugate(q))/2),
nounify(imagpart)=lambda([q],%i*(conjugate(q)-q)/2)],
ex));
but for, say, expr: rectform(sin(z)), there is still some work to do to
simplify back to the original.
trigreduce(trigsimp(trigexpand(expand(derect(expr))))) gets you back to
sin(z), and seems to work for other trig expressions, but it doesn't work
for other expressions like exp(z).
-s
On Sat, Feb 23, 2013 at 8:15 AM, Henry Baker <hbaker1 at pipeline.com> wrote:
> I'd love to reverse the effect of "rectform", as below.
>
> However, I don't want to have to type in "realpart(z)=(z+conjugate(z))/2",
> etc., for every single complex variable.
>
> Any thoughts?
>
> Maxima 5.28.0-2 http://maxima.sourceforge.net
> using Lisp GNU Common Lisp (GCL) GCL 2.6.8 (a.k.a. GCL)
> Distributed under the GNU Public License. See the file COPYING.
> Dedicated to the memory of William Schelter.
> The function bug_report() provides bug reporting information.
> (%i1) declare(z,complex);
> (%o1) done
> (%i2) z,rectform;
> (%o2) realpart(z) + %i imagpart(z)
> (%i3) %,realpart(z)=(z+conjugate(z))/2,imagpart(z)=(z-conjugate(z))/2/%i;
> conjugate(z) + z z - conjugate(z)
> (%o3) ---------------- + ----------------
> 2 2
> (%i4) %,expand;
> (%o4) z
> (%i5)
>
> _______________________________________________
> Maxima mailing list
> Maxima at math.utexas.edu
> http://www.math.utexas.edu/mailman/listinfo/maxima
>