What is the indefinite integral of ∫ [sin (π/x)]/ x^2] dx ?

This is what I did:
Let u = π/x
(to get the derivative and du:)
π*1/x
π(-1/x^2)dx = du
π(1/x^2)dx = (-1)du
so, 1/x^2 = -1/πdu

then ∫ [sin (π/x)]/ x^2] dx = ∫ sin(u) (-1/π)du

= -1/π ∫ sin u du

= -1/π (-cos u) + C

= 1/π (cos u) + C

sub back in:

1/π cos (π/x) + C

I'm unsure of this because I don't know if I got du the right way.

Should it have been

Let u = π/x
-π/x^2 dx = du
1/x^2 dx = -πdu

That would make the answer a lot different...

Help!

Your first derivation is correct.

The last equation you wrote does not follow from (-π/x^2) dx = du

You did it right the first time

To solve the integral ∫ [sin (π/x)]/ x^2 dx, you correctly started by letting u = π/x. Now, let's confirm your calculation of du.

You correctly used the chain rule to find the derivative of u with respect to x:
du/dx = d(π/x)/dx = -π/x^2

To get du, you can multiply both sides of the equation by dx:
-π/x^2 dx = du

So, your calculation of du as -π/x^2 dx is correct. Now, let's continue with the integration.

Using the substitution u = π/x, the integral becomes:
∫ [sin (π/x)]/ x^2 dx = ∫ sin(u) (-1/π) du

To simplify, we can bring the constant (-1/π) outside the integral:
= (-1/π) ∫ sin(u) du

Now, ∫ sin(u) du is a standard integral that you can solve easily. The integral of sin(u) is -cos(u), so:
= (-1/π) (-cos(u)) + C

Finally, substitute back u = π/x:
= 1/π cos (π/x) + C

So, your final answer is 1/π cos (π/x) + C.

Overall, your approach and calculations were correct. Just make sure to carefully keep track of your differentials (du) during the substitution process.