Mathematica 9 is now available
Services & Resources / Wolfram Forums
-----
 /
MathGroup Archive
2007
*January
*February
*March
*April
*May
*June
*July
*August
*September
*October
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 2007

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

Search the Archive

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[];



  • 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