Is there a simple way to determine the order of the poles of a rational function?

I have a difficult function where I need Mathematica to find the poles. It would be interesting to also know what the order is. Does there exist a basic command?

  • $\begingroup$ Is your function a rational function? $\endgroup$
    – John McGee
    Commented Jul 27, 2015 at 11:50
  • 1
    $\begingroup$ It'd be nice if you posted exactly what your "difficult function" looks like. $\endgroup$ Commented Jul 27, 2015 at 12:44
  • 1
    $\begingroup$ Yes @JohnMcGee it is a rational function. $\endgroup$ Commented Jul 27, 2015 at 13:09
  • $\begingroup$ @J. M. I really don't think it would be illuminating if I explicitly gave you this function. Also I just wanted to know if this was possible in general. $\endgroup$ Commented Jul 27, 2015 at 13:10
  • 1
    $\begingroup$ Well, as noted, rational functions are easy. Transcendentals will require some work, since nothing's built-in. $\endgroup$ Commented Jul 27, 2015 at 13:11

2 Answers 2


One quick way for rational functions is to leverage built-in control system functions:

TransferFunctionPoles[TransferFunctionModel[1/(1 + s^2), s]][[1, 1]]
   {-I, I}
  • $\begingroup$ This only gives me the poles, not the order... $\endgroup$ Commented Jul 27, 2015 at 13:24
  • 1
    $\begingroup$ You can use Tally[] for that. ;) $\endgroup$ Commented Jul 27, 2015 at 13:29
  • 1
    $\begingroup$ Ah nice, I understand. TransferFunctionPoles will give the solution multiple times in contrast to Solve. Thanks! $\endgroup$ Commented Jul 27, 2015 at 13:34

Yo can go by solving the inverse of the function and then Count the solution.

f[x_] := x/(a - x)^3/(b - x);
div = x /. Solve[1/f[x] == 0, x];
poles = Union[div]
Count[div, #] & /@ poles



Depending on how complicated your function is, you may have to go for numerical treatment, like NSolve or NRoots.


As Guess who it is suggests, You can use Tally[div] instead of Count.

For some reason I always forget the right command at right time :] .

  • $\begingroup$ Thanks! This works. As alternatives you mean Reduce? $\endgroup$ Commented Jul 27, 2015 at 13:16
  • 1
    $\begingroup$ You could, of course, use Solve[]/Reduce[] on Denominator[f[x]]. $\endgroup$ Commented Jul 27, 2015 at 13:20
  • 1
    $\begingroup$ @cherzieandkressy, if your function is too heavy for Solve then you may have to go numeric, like NSolve or NRoots. $\endgroup$
    – Sumit
    Commented Jul 27, 2015 at 16:53

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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