MathGroup Archive 2007

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

Search the Archive

Re: Mistake in applying a rule


Steven Siew wrote:
> 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.

Hi,

Your replacement rule is working correctly, however, for some reason 
Mathematica likes to sort the variables inside the Sin[], and take the 
minus sign out.  For example, try the following:

In[1]:= Sin[b-a]
Out[1]= -Sin[a-b]

In[2]:= Cos[b-a]
Out[2]= Cos[a-b]

In[3]:= f[b-a]
Out[3]= f[-a+b]

Szabolcs


  • Prev by Date: Question on PrincipalValue in Integrate
  • Next by Date: Re: version 6 Plot3D exporting results in HUGE files
  • Previous by thread: Mistake in applying a rule
  • Next by thread: Re: Mistake in applying a rule