3 The paper found!

I do not have the reference, but it

It is easy to explain "how the Fourier analysis meshed in". Namely, using the standard notation for the Mobius Möbius function, the Euler's totient function, and the integer / fractional part functions, your sum can be written as $$\sum_{n\le x} \sum_{d\mid(n,l)} \mu(d) = \sum_{d\mid l} \mu(d) \lfloor x/d \rfloor = x \sum_{d\mid l} \frac{\mu(d)}d + R = \frac{\phi(l)}lx + R,$$ where the remainder term is $$R = \sum_{d\mid l} \mu(d) \{x/d\}.$$ The real work starts As Fedor Petrov observed, this already suffices to improve the remainder term from $\phi(l)$ to $\tau(l)$ and indeed, to the number of coursesquare-free divisors of $l$, which is $2^{\omega(l)}$. To get better estimates, when you use one can try to plug in the Fourier expansion for $\{x/d\}$ and estimate the resulting sums.

As to the paper you mention, I think I was able to spot it out: is it "Extremal values of $\Delta(x,N)=\sum_{n<xN,(n,N)=1} 1-x\phi(N)$" by P. Codeca and M. Nair, published in Canad. Math. Bull. 41 (3) (1998), pp. 335–347? Another paper by the same authors on the same subject: "Links between $\Delta(x,N)=\sum_{n<xN,(n,N)=1} 1-x\phi(N)$ and character sums", Boll. Unione Mat. Ital. Sez. B Artic. Ric. Mat. 6 (2) (2003), pp. 509–516. I could find one more paper on this problem published in a Canadian journal: "The distribution of totatives" by D.H. Lehmer, Canad. J. Math. 7 (1955), pp. 347–357.

2 deleted 2 characters in body

I do not have the reference, but it is easy to explain "how the Fourier analysis meshed in". Namely, using the standard notation for the Mobius function, the Euler's totient function, and the integer /fractional part functions, your sum can be written as $$\sum_{n\le x} \sum_{d\mid(n,l)} \mu(d) = \sum_{d\mid l} \mu(d) \lfloor x/d \rfloor = x \sum_{d\mid l} \frac{\mu(d)}d + R = \frac{\phi(d)}d\,x frac{\phi(l)}lx + R,$$ where the remainder term is $$R = \sum_{d\mid l} \mu(d) \{x/d\}.$$ The real work starts, of course, when you use the Fourier expansion for $\{x/d\}$.

1

I do not have the reference, but it is easy to explain "how the Fourier analysis meshed in". Namely, using the standard notation for the Mobius function, the Euler's totient function, and the integer /fractional part functions, your sum can be written as $$\sum_{n\le x} \sum_{d\mid(n,l)} \mu(d) = \sum_{d\mid l} \mu(d) \lfloor x/d \rfloor = x \sum_{d\mid l} \frac{\mu(d)}d + R = \frac{\phi(d)}d\,x + R,$$ where the remainder term is $$R = \sum_{d\mid l} \mu(d) \{x/d\}.$$ The real work starts, of course, when you use the Fourier expansion for $\{x/d\}$.