Why is the graph of function behaving in a seemingly erratic fashion?

54 Views Asked by At

I was recently trying to plot the graph of the function $f(x)$. This function is defined as follows:

$ f(x) = \frac{\sin{3x} - 3\sin{x}}{(\pi - x)^3} $

I first plotted the numerator ($A(x) = \sin{3x} - 3\sin{x}$) and the reciprocal of the denominator (B(x) = $\frac{1}{(\pi - x)^3}$) separately. Their graphs were as expected, with an asymptote in the latter: image of the graph.

However, when I later plotted the whole function, it showed highly erratic behavior at $x \to \pi$.

The graph is available here.

It can be seen that the function itself is indeterminate at $x = \pi$, but the other two functions ($A$ and $B$) I plotted seem to be quite well behaved at $x = \pi$. This made me wonder why does their product, $f$ behave in an oscillatory fashion. Is it because of the asymptote caused in $B$? Or is there any other reason?

I'd appreciate any insight into the matter.

1

There are 1 best solutions below

1
On

Here is a graph of the function.
graph 1
The limit at $\pi$ is $-4$.

Here is a magnified graph.
graph 2
It looks like it is doing wild stuff near $\pi$. But look at the scale on the $y$-axis... All that wild stuff is within $0.0002$ of the true limit $-4$.