0
$\begingroup$

This question already has an answer here:

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...

$\endgroup$

marked as duplicate by DumpsterDoofus, gpap, Bob Hanlon, bobthechemist, ubpdqn Nov 21 '14 at 5:03

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • 1
    $\begingroup$ You could try /.{x->x0+eps}//Simplify then /.{eps->0}. $\endgroup$ – Stephen Luttrell Nov 20 '14 at 18:32
  • $\begingroup$ This is a duplicate of a question asked last week, give me a minute and I'll post a link. $\endgroup$ – DumpsterDoofus Nov 20 '14 at 18:57
  • $\begingroup$ As Bob Hanlon points out, using /. 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 use Limit[..., x -> x0]. $\endgroup$ – DumpsterDoofus Nov 20 '14 at 19:14
2
$\begingroup$
denom = 25 + 2 g + x^2;
x0 = I/2 Sqrt[100 + 8 g];

Rather than substituting with x -> x0, take the limit

result[g_] = Limit[(x - x0)/denom, x -> x0]

-(I/(2*Sqrt[25 + 2*g]))

result[1000]

-(I/90)

result[1]

-(I/(6*Sqrt[3]))

Apart works with symbolic expressions:

(x - x0)/denom

((-(1/2))ISqrt[100 + 8*g] + x)/ (25 + 2*g + x^2)

% // Apart

-((I*Sqrt[25 + 2*g])/(25 + 2*g + x^2)) + x/(25 + 2*g + x^2)

$\endgroup$
  • $\begingroup$ Thank you very much, taking Limit[] works better. Although: Apart[] does nothing. Apart[1/denom,x] just returns 1/denom - no fractional decomposition. ApartSquareFree[] doesn't help either. $\endgroup$ – Seb Bi Nov 20 '14 at 22:05

Not the answer you're looking for? Browse other questions tagged or ask your own question.