question on integration of $f(x)\delta(g(x))$

I am learning integration with dirac delta. I do not understand this result by Maple

Mathematica graphics

When I work it by hand, using known relation (here is an image of the page)

Mathematica graphics


$ $ \int_{0}^{\pi}f\left( x\right) \delta\left( g\left( x\right) \right) dx=\sum_{x_{0}}\frac{f\left( x_{0}\right) }{\left\vert g^{\prime}\left( x_{0}\right) \right\vert } $ $

Where the sum is over all zeros of $ g\left( x\right) $ in the integration interval, which is $ \left\{ 0,\pi\right\} $ since $ \sin\left( x\right) $ is zero at these points, and since $ g^{\prime}\left( x\right) =\cos\left( x\right) $ , and $ f\left( x\right) =\frac{1}{x}$ , then I get

\begin{align*} \int_{0}^{\pi}f\left( x\right) \delta\left( g\left( x\right) \right) dx & =\lim_{x\rightarrow0}\frac{\frac{1}{x}}{\left\vert \cos\left( x\right) \right\vert }+\lim_{x\rightarrow\pi}\frac{\frac{1}{x}}{\left\vert \cos\left( x\right) \right\vert }\ & =\infty \end{align*}

So I am doing something wrong or not using the above result correctly. Is it ok to use the zeros of $ g(x)$ if they located at the edge of the interval as in this case? There are no other zeros inside the interval.

Does this mean if there are no zeros of $ g(x)$ in the interval of integration, the integral is therefore zero, since nothing to sum?

How did Maple obtain zero for the above?