MathGroup Archive 2003

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

Search the Archive

Transformation Problem

  • To: mathgroup at
  • Subject: [mg43454] Transformation Problem
  • From: "Geir Ove" <geirAoves at>
  • Date: Wed, 17 Sep 2003 07:59:21 -0400 (EDT)
  • Sender: owner-wri-mathgroup at


I am trying to transform an expression that involves Sin[x] and Cos[x] into
an expression that only contains Cos[x] terms. However, I do not succeed.
The very problem seems to be that the built in rules that Mathematica knows,
will always rewrite e.g. terms like -Cos[x + Pi/2] to Sin[x].

E.g. assume:

f = Sin[x] + Cos[x]

Now, for the sake of the example, I want mathematica to start represening f
as Cos[x] - Cos[x + Pi/2]. So I try:

In :     f /. Sin[x] -> -Cos[x + Pi/2]
Out:   Sin[x] + Cos[x]

It seems that mathematica does nothing, but it does: It does the
replacement, then uses its internal definitions to simplify back -Cos[x +
Pi/2] to Sin[x]. You can convince yourself about this by doing:

In :     f /. Sin[x] -> Cos[x + Pi/2]
Out:   Sin[x] - Cos[x]

Mathematica changed the sign since you gave the wring rule.


How can I achieve what I want, namely the form: Cos[x] - Cos[x + Pi/2]. ???

The expression I wan to simplify is of course more complex, but the same
principle applies.

In advance, thanks for any help.

Geir Ove

  • Prev by Date: RE: Plot Rendering Problem with V5 FrontEnd on Linux
  • Next by Date: Re: Plot Rendering Problem with V5 FrontEnd on Linux
  • Previous by thread: Re: Plot3D
  • Next by thread: RE: Transformation Problem