Mistake in applying a rule
- To: mathgroup at smc.vnet.net
- Subject: [mg80658] Mistake in applying a rule
- From: Steven Siew <siewsk at bp.com>
- Date: Tue, 28 Aug 2007 02:12:34 -0400 (EDT)
Hi,
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.
In[1]:=
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[];