# Order of a pole

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?

• Is your function a rational function? Commented Jul 27, 2015 at 11:50
• It'd be nice if you posted exactly what your "difficult function" looks like. Commented Jul 27, 2015 at 12:44
• Yes @JohnMcGee it is a rational function. Commented Jul 27, 2015 at 13:09
• @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. Commented Jul 27, 2015 at 13:10
• Well, as noted, rational functions are easy. Transcendentals will require some work, since nothing's built-in. Commented Jul 27, 2015 at 13:11

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}

• This only gives me the poles, not the order... Commented Jul 27, 2015 at 13:24
• You can use Tally[] for that. ;) Commented Jul 27, 2015 at 13:29
• Ah nice, I understand. TransferFunctionPoles will give the solution multiple times in contrast to Solve. Thanks! 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


{a,b}

{3,1}

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

Tally

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

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