Let $$q=\text {e}^{2\pi i\tau }, \mathfrak {I}\tau >0$$ , $$x=\text {e}^{2\pi i{z}}$$ , $${z}\in \mathbb {C}$$ , and $$(x;q)_\infty =\prod _{n\ge 0}(1-xq^n)$$ . Let $$(q,x)\mapsto ({q_1},{x_1})$$ be the classical modular substitution given by the relations $${q_1}=\text {e}^{-2\pi i/\tau }$$ and $${x_1}=\text {e}^{2\pi i{z}/{\tau }}$$ . The main goal of this paper is to give a modular-type representation for the infinite product $$(x;q)_\infty $$ , this means, to compare the function defined by $$(x;q)_\infty $$ with that given by $$({x_1};{q_1})_\infty $$ . Inspired by the work (Stieltjes in Collected Papers, Springer, New York, 1993) of Stieltjes on semi-convergent series, we are led to a “closed” analytic formula for the ratio $$(x;q)_\infty /({x_1};{q_1})_\infty $$ by means of the dilogarithm combined with a Laplace type integral, which admits a divergent series as Taylor expansion at $$\log q=0$$ . Thus, the function $$(x;q)_\infty $$ is linked with its modular transform $$({x_1};{q_1})_\infty $$ in such an explicit manner that one can directly find the modular formulae known for Dedekind’s Eta function, Jacobi Theta function, and also for certain Lambert series. Moreover, one can remark that our results allow Ramanujan’s formula (Berndt in Ramanujan’s notebooks, Springer, New York, 1994, Entry 6’, p. 268) (see also Ramanujan in Notebook 2, Tata Institute of Fundamental Research, Bombay, 1957, p. 284) to be completed as a convergent expression for the infinite product $$(x;q)_\infty $$ .