Re: force variable to be real
- To: mathgroup at smc.vnet.net
- Subject: [mg91791] Re: [mg91736] force variable to be real
- From: Bob Hanlon <hanlonr at cox.net>
- Date: Sun, 7 Sep 2008 22:55:35 -0400 (EDT)
- Reply-to: hanlonr at cox.net
w = x + I 2 x z;
y = Simplify[Re[w], Element[{x, z}, Reals]]
x
or more simply
y = ComplexExpand[Re[w]]
x
D[y, x]
1
Bob Hanlon
---- phillman5 <PHILLMAN5 at gmail.com> wrote:
=============
How do you force variables to be real?
I have
w:=x + I 2 x z,
and
y:=Re[w]
and want the derivative of y wrt x, x and z are Real
D[y, x]
gives
Re'[x] - 2 z Im'[x z]
where I'd expect just 1. Or I need to evaluate Re[w] forcing x and z
to be real, then take the derivative.
Thank you for any help
Paul
--
Bob Hanlon