To have a third term equal to 6/x², the value of n must be 3.
The general expanssion of (a + b)ⁿ is:
(a + b)ⁿ = aⁿ + n*aⁿ⁻¹*b + n*(n -1)*aⁿ⁻¹*bⁿ
Here we will have:
(1+1/x)ⁿ
The third term is:
n*(n - 1)*1ⁿ⁻²*(1/x)² = n*(n - 1)(1/x)²
And this is equal to 6/x², then:
n*(n - 1)(1/x)² = 6/x²
n*(n - 1) = 6
We could solve this, but we also can see that if n = 3, we get:
3*(3 - 1) = 6
3*2 = 6
6 = 6
this is true, thus, n = 3.