[Date Index] [Thread Index] [Author Index]
Re: A Problem with Simplify
On 4/15/08 at 6:51 AM, popkov at gmail.com (Alexey Popkov) wrote: >And code: >int1 = Integrate[Cos[a*x]/Sin[x], x]; int1 /. a -> 1 >MUST give us answer equal to >int2 = Integrate[Cos[x]/Sin[x], x] Mathematica simply doesn't work this way. If you do Integrate[Cos[a x]/Sin[x],x] you will see a fairly complex expression. I assume this expression is valid and can be simplified to Log[Sin[x]] when a is 1 with the right transformations. But it is far from obvious to me what transformations are required. And Mathematica does not attempt to simplify this expression. Once you get this result, the replacement rule simply substitutes 1 for a every where and evaluates. This simple process results in division by 0. There are two ways to avoid this problem. One would be to find the set of transformations that reduce the expression to Log[Sin[x]]. The other is to re-write the problem as: Integrate[Cos[a x]/Sin[x]/.a->1, x] Despite the fact, Mathematica does not get the result you desire, this is not a bug. Mathematica is working as intended. So, you have a choice. Either accept this and figure out how to use Mathematica as it is or find some other tool that works more like you want.