MathGroup Archive 2007

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

Search the Archive

Mistake in applying a rule

  • To: mathgroup at
  • Subject: [mg80658] Mistake in applying a rule
  • From: Steven Siew <siewsk at>
  • Date: Tue, 28 Aug 2007 02:12:34 -0400 (EDT)


  I'm trying to show that Integrate[Cos[x-a]] is Sin[x-a] + C

  I manage to get Simplify @ Integrate[Cos[x-a]] to give -Sin[a-x]

  This is fine because Sin[-x] is equal to -Sin[x]

  But when I apply the rule Times[-1,Sin[Plus[g_,Times[-1,h_]]]] ->
Sin[h-g]  it fails.

  Here is the complete transcript.

Mathematica 5.2 for Students: Microsoft Windows Version
Copyright 1988-2005 Wolfram Research, Inc.

Out[1]= {stdout}

In[2]:= (* Write your mathematica code below *)

In[3]:= Simplify @ Integrate[Cos[x-a],x]

Out[3]= -Sin[a - x]

In[4]:= FullForm[%]

Out[4]//FullForm= Times[-1, Sin[Plus[a, Times[-1, x]]]]

In[5]:= % /. Times[-1,Sin[Plus[g_,Times[-1,h_]]]]  -> Sin[h-g]

Out[5]= -Sin[a - x]

In[6]:= (* End of mathematica code *)

In[7]:= Quit[];

  • Prev by Date: Re: Plot "not working"
  • Next by Date: Re: Another question on lists
  • Previous by thread: Re: Problems minimizing an overconstrained system
  • Next by thread: Re: Mistake in applying a rule