For some particular reason, Mathematica makes wrong calculations when using Simplify[]. I need Simplify[] for a fractional decomposition of some fractions of low-order polynomicals.
Here is a (somewhat) minimal example illustrating the problem:
denom = 25 + 2 g + x^2;
x0 = I /2 Sqrt[100 + 8 g];
Simplify[Simplify[(x - x0)/denom] /. {x -> x0}]
(* --> 0 (WRONG) *)
test1 = {g -> 1000};
Simplify[Simplify[(x - x0)/denom /. test1] /. {x -> (x0 /. test1)}]
(* --> -i / 90 (RIGHT) *)
test2 = {g -> 1};
Simplify[Simplify[(x - x0)/denom /. test2] /. {x -> (x0 /. test2)}]
(* --> Indeterminate with warnings 1/0 and 0*ComplexInfinity *)
Note that x0 is a (non-degenerate) root of denom for any value of g. As such, 1/denom = a/(x-x0) + b/(x-x1) for some constants a and b (dependent on the value of g).
In the application, with this construct I try to calculate a and b (in the test1 case of g=1000 it is a=-i/90 and b=+i/90). But if the result returns 0 without warning something is clearly wrong.
What is happening here, also in the second test case ?
In the end, how do I compute fractional decomposition the best way (if I know all roots of the denominator)? Apart[] does only handle numerical input...
/.{x->x0+eps}//Simplifythen/.{eps->0}. – Stephen Luttrell Nov 20 '14 at 18:32/.is a quick and easy way to perform substitutions, but it may not always give correct answers in cases where singularities are involved, and to rigorously evaluate a function limit at a particular point, you should instead useLimit[..., x -> x0]. – DumpsterDoofus Nov 20 '14 at 19:14