How To

How to declare that a variable is real

How to declare that a variable is real

Postby GyrosGeier » Tue Apr 03, 2012 8:42 am

I'm trying to get the derivative of abs(exp(i*phi)+exp(2*i*phi)) under the assumption that phi is real.

For "abs(exp(i*phi))" alone, an extra box is shown for this special case -- is there any way I could rewrite my query to get the result for this case only?

Posts: 1
Joined: Tue Apr 03, 2012 8:26 am

Re: How to declare that a variable is real

Postby jyellott » Mon Apr 09, 2012 10:13 pm
Below the result you are interested in you see the option "Copiable plaintext", designated with an 'A'. In these fields are often included the input form for the result. The Mathematica form for this query is provided. It's based on the results above so if you need one query to reach this result I'll cover that procedure later here. The query is:
ComplexExpand[(I E^(I ϕ) + (2 I) E^((2 I) ϕ)) Abs'[E^(I ϕ) + E^((2 I) ϕ)]]
And the result is somewhat extensive.

Asking the query directly allows W|A to provide more detailed results, including graphs.

To ask the full desired query in one pass you refer to the initial query results 'A' form Mathimatica form and replace the contents of the above query, as:
ComplexExpand[D[Abs[Exp[I ϕ] + Exp[2 I ϕ]], ϕ]]
Which produces much the same results.

Checking what ComplexExpand is doing is an importent step, I found (through Google) that Wolfram Mathematica 8 online documentation, at, states that:
expands expr assuming that all variables are real.
Posts: 135
Joined: Mon Aug 17, 2009 2:35 pm

Who is online

Users browsing this forum: No registered users and 1 guest