MathGroup Archive 2010

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Absolute value

  • To: mathgroup at
  • Subject: [mg110627] Re: Absolute value
  • From: Marco Masi <marco.masi at>
  • Date: Tue, 29 Jun 2010 06:59:17 -0400 (EDT)

Thanks, this gave some insight. And yet I'm struggling to get it in another form. I have to work with an expression like:

   Abs[A1 E^(I \[Phi]1) ((1 + Cos[Sqrt[2] c z])/2) +
      AD E^(I \[Phi]D) I/Sqrt[2] Sin[Sqrt[2] c z] +
      A2 E^(I \[Phi]2) ((Cos[Sqrt[2] c z] - 1)/2)]^2,
   TargetFunctions -> {Re, Im}], A1 | A2 | AD], TrigFactor]

Which does not separate A1, A2 and AD. I would like to have an output in a form like:

A1^2*f1[Cos[Sqrt[2] c z],Sin[Sqrt[2] c z]] + A2^2*f2[Cos[Sqrt[2] c z],Sin[Sqrt[2] c z]] + AD^2*f3[Cos[Sqrt[2] c z],Sin[Sqrt[2] c z]],

where f1, f2, and f3 are some functions of Cos[Sqrt[2] c z] and Sin[Sqrt[2] c z]. Is this possible?

Regards, Mark.

--- Lun 28/6/10, Peter Pein <petsie at> ha scritto:

Da: Peter Pein <petsie at>
Oggetto: Re: Absolute value
Data: Luned=EC 28 giugno 2010, 09:05

Am Mon, 28 Jun 2010 06:30:57 +0000 (UTC)
schrieb Marco Masi <marco.masi at>:

> Yes, thank you, that brough me a step forward (and yes, I forgot to
> square the Abs value in the previous example... sorry for that).
> However, there is still a step which I can't accomplish. Please try
> the following: FullSimplify[ ComplexExpand[ Abs[1/2 (A1 E^(I \[Phi]1)
> - A2 E^(I \[Phi]2) + A1 E^(I \[Phi]1) Cos[Sqrt[2] c z] + A2 E^(I
> \[Phi]2) Cos[Sqrt[2] c z])]]^2]
> I would like to have Mathematica avoiding one of the resulting Cos[2
> Sqrt[2] c z] expression, and maintain both as Cos[Sqrt[2] c z], and
> then simplify. How should I proceed?
> Regards, Mark.

Hi Mark,

try squaring the absolute value before using ComplexExpand:
   Abs[(1/2)*(A1*E^(I*\[Phi]1) - A2*E^(I*\[Phi]2) +
A1*E^(I*\[Phi]1)*Cos[Sqrt[2]*c*z] +

--> (1/4)*Abs[A2*E^(I*\[Phi]2)*(-1 + Cos[Sqrt[2]*c*z]) +
A1*E^(I*\[Phi]1)*(1 + Cos[Sqrt[2]*c*z])]^2

but I would prefer:

    Abs[(1/2)*(A1*E^(I*\[Phi]1) -
      A2*E^(I*\[Phi]2) + A1*E^(I*\[Phi]1)*Cos[Sqrt[2]*c*z] +
   TargetFunctions -> {Re,Im}],
A1 | A2, TrigFactor]

which returns
A1^2*Cos[(c*z)/Sqrt[2]]^4 + A2^2*Sin[(c*z)/Sqrt[2]]^4 -
(1/2)*A1*A2*Cos[\[Phi]1 - \[Phi]2]*Sin[Sqrt[2]*c*z]^2


  • Prev by Date: Re: precedence for ReplaceAll?
  • Next by Date: Customizing Manipulate's Autorun
  • Previous by thread: Re: Absolute value
  • Next by thread: Re: Absolute value