comparing vs to compare

Before we move on to the second part of large signal analysis, it is worth spending a few moments comparing the graphical method and the analytical method.
Can I replace “comparing” by “to compare” in the sentence above?

It would be better to write: ‘in order to compare’ if you want to use the infinitive as that shows the purpose of the comparison.

Hello,

I want to ask you more questions about this.
Do you mean that I can use “to compare” in the sentence above?
Yes, I like your suggestion about “in order to” but I think that “to” also can be used to show purpose. Is that right?