3
$\begingroup$

Suppose I have an expression, such as

A = 5 t^2 + 3 t + 4;

I want to define the variable t to be real, therefore I can write

A = Refine[A, {Element[t, Reals], t > 0}];

now if I take the complex conjugate of this expression:

Conjugate[A]

I get the result:

4 + 3 Conjugate[t] + 5 Conjugate[t]^2

What am I doing wrong? I want Mathematica to recognize that the variable t is real, so that Conjugate[A] will return

4 + 3t + 5t^2
$\endgroup$
1
  • 1
    $\begingroup$ When you evaluated Conjugate[A], the assumptions you explicitly specified in Refine[A, {Element[t, Reals], t > 0}] are not remembered, so t is again treated as complex. So you need to somehow explicitly specify your assumptions again before evaluating Conjugate[A], as thorimur demonstrates in the answer given. $\endgroup$ Feb 6 '21 at 21:29
8
$\begingroup$

Welcome to MMA SE! The assumption Element[t, Reals] is only used inside Refine, and so in a sense is not "known to" any evaluations outside of that expression. Refine doesn't change the nature of A; it merely spits out an expression produced from its argument evaluated under the provided assumptions. The assumptions don't "remain attached" to the symbol A.

You have a couple different ways to proceed:

  1. Simply Refine[Conjugate[A], {Element[t, Reals], t > 0}]!

In the following I'll mention other general strategies for applying assumptions, using Simplify as a way of applying them, but everything applies equally well to using Refine and other similar expressions in place of Simplify. (Note, though, that to use Simplify with assumptions, though, you need to provide them as an option, e.g. Simplify[Conjugate[A], Assumptions -> {Element[t, Reals]}])

  1. Set global assumptions via $Assumptions, e.g.
$Assumptions = {Element[t, Reals]}

Then e.g. Simplify[Conjugate[t]] will return t and Simplify[Conjugate[A]] will return A. Likewise for Refine[Conjugate[A]]. (Note that Conjugate[t] will still return Conjugate[t].)

  1. Wrap your expressions in Assuming and use Simplify/Refine, e.g.
Assuming[{Element[t, Reals]}, Simplify[Conjugate[A]]]

This is essentially a local version of the above; it's equivalent to temporarily appending to $Assumptions

  1. Bypass assumptions and set an upvalue for t:
t /: Conjugate[t] := t

This won't make t be assumed to be real in simplifying procedures, in general; it will only replace the actual expression Conjugate[t] with t when encountered. So, it relies on Conjugate[t] being present as-is, and while it does mean you don't have to use Simplify/Refine, it is rather fragile due to how specific it is.

Let me know if anything here doesn't make sense or could use expanding upon!

$\endgroup$
4
$\begingroup$

Using ComplexExpand command:

A = 5 t^2 + 3 t + 4;
ComplexExpand[Conjugate[A]]

For expressions within radicals, we must use the Refine command for the ComplexExpand command to work properly. Here is an example:

Without Refine command:

 Simplify[ComplexExpand[Conjugate[Sqrt[a - b c]]]]
 (*((a - b c)^2)^(1/4) (Cos[1/2 Arg[a - b c]] - I Sin[1/2 Arg[a - b c]])*)

With Refine command for $a-bc>0$ or $a-bc<0$

 Refine[ComplexExpand[Conjugate[Sqrt[a - b c]]], Assumptions -> a - b c > 0]
 (*Sqrt[a - b c]*)

 Refine[ComplexExpand[Conjugate[Sqrt[a - b c]]], Assumptions -> a - b c < 0]
 (*- I*Sqrt[b c - a]*)

  
$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.