Deformed N=2 theories, generalized recursion relations and S-duality

We study the non-perturbative properties of N=2 super conformal field theories in four dimensions using localization techniques. In particular we consider SU(2) gauge theories, deformed by a generic epsilon-background, with four fundamental flavors or with one adjoint hypermultiplet. In both cases we explicitly compute the first few instanton corrections to the partition function and the prepotential using Nekrasov's approach. These results allow to reconstruct exact expressions involving quasi-modular functions of the bare gauge coupling constant and to show that the prepotential terms satisfy a modular anomaly equation that takes the form of a recursion relation with an explicitly epsilon-dependent term. We then investigate the implications of this recursion relation on the modular properties of the effective theory and find that with a suitable redefinition of the prepotential and of the effective coupling it is possible, at least up to the third order in the deformation parameters, to cast the S-duality relations in the same form as they appear in the Seiberg-Witten solution of the undeformed theory.


Introduction
Four-dimensional field theories with rigid N = 2 supersymmetry provide a remarkable arena where many exact results can be obtained; indeed N = 2 supersymmetry, not being maximal, allows for a great deal of flexibility but, at the same time, is large enough to guarantee full control. This fact was exploited in the seminal papers [1,2] where it was shown that the effective dynamics of N = 2 super Yang-Mills (SYM) theories in the limit of low energy and momenta can be exactly encoded in the so-called Seiberg-Witten (SW) curve describing the geometry of the moduli space of the SYM vacua. When the gauge group is SU(2), the SW curve defines a torus whose complex structure parameter is identified with the (complexified) gauge coupling constant τ of the SYM theory at low energy. This coupling receives perturbative corrections at 1-loop and non-perturbative corrections due to instantons, and the corresponding effective action follows from a prepotential F that is a holomorphic function of the vacuum expectation value a of the adjoint vector multiplet, of the flavor masses, if any, and of the dynamically generated scale in asymptotically free theories or of the bare gauge coupling constant τ 0 in conformal models (see for instance [3] for a review and extensions of this approach).
Recently, N = 2 superconformal field theories (SCFT) have attracted a lot of attention. Two canonical examples of SCFT's are the N = 2 SU(2) SYM theory with N f = 4 fundamental hypermultiplets and the N = 2 * theory, namely a N = 2 SYM theory with an adjoint hypermultiplet. In both cases, the β-function vanishes but, when the hypermultiplets are massive, the bare coupling τ 0 gets renormalized at 1-loop by terms proportional to the mass parameters. Besides these, there are also non-perturbative corrections due to instantons. As shown in [4] for the N = 2 * theory and more recently in [5] for the N f = 4 theory, by organizing the effective prepotential F as a series in inverse powers of a and by exploiting a recursion relation hidden in the SW curve, it is possible to write the various terms of F as exact functions of the bare coupling. These functions are polynomials in Eisenstein series and Jacobi θ-functions of τ 0 and their modular properties allow to show that the effective theory at low energy inherits the Sl(2, Z) symmetry of the microscopic theory at high energy. In particular one can show [4,5] that the S-duality map on the bare coupling, i.e. τ 0 → −1/τ 0 , implies the corresponding map on the effective coupling, i.e. τ → −1/τ , and that the prepotential F and its S-dual are related to each other by a Legendre transformation.
The non-perturbative corrections predicted by the SW solution can also be obtained directly via multi-instanton calculus and the use of localization techniques [6,7] 1 . This approach is based on the calculation of the instanton partition function after introducing two deformation parameters, ǫ 1 and ǫ 2 , of mass dimension 1 which break the four-dimensional Lorentz invariance, regularize the space-time volume and fully localize the integrals over the instanton moduli space on sets of isolated points, thus allowing their explicit evaluation. This method, which has been extensively applied to many models (see for instance [10] - [17]) can be interpreted as the effect of putting the gauge theory in a curved background, known as Ω-background [6,7,18], or in a supergravity background with a non-trivial graviphoton field strength, which are equivalent on the instanton moduli space [19,20]. The resulting instanton partition function Z inst (ǫ 1 , ǫ 2 ), also known as Nekrasov partition function, allows to obtain the non-perturbative part of the SYM prepotential according to (1.1) Actually, the Nekrasov partition function is useful not only when the ǫ parameters are sent to zero, but also when they are kept at finite values. In this case, in fact, the nonperturbative ǫ-deformed prepotential F inst (ǫ 1 , ǫ 2 ) = −ǫ 1 ǫ 2 log Z inst (ǫ 1 , ǫ 2 ) (1.2) 1 See also [8,9] for earlier applications of these techniques.
represents a very interesting generalization of the SYM one. By adding to it the corresponding (ǫ-deformed) perturbative part F pert , one gets a generalized prepotential that can be conveniently expanded as follows F (n,g) (ǫ 1 + ǫ 2 ) 2n (ǫ 1 ǫ 2 ) g . (1. 3) The amplitude F (0,0) , which is the only one that remains when the ǫ-deformations are switched off, coincides with the SYM prepotential F of the SW theory, up to the classical tree-level term. The amplitudes F (0,g) with g ≥ 1 account instead for gravitational couplings and correspond to F-terms in the effective action of the form F (0,g) W 2g , where W is the chiral Weyl superfield containing the graviphoton field strength as its lowest component. These terms were obtained long ago from the genus g partition function of the N = 2 topological string on an appropriate Calabi-Yau background [21] and were shown to satisfy a holomorphic anomaly equation [22,23] which allows to recursively reconstruct the higher genus contributions from the lower genus ones (see for instance [24,25]). More recently, also the amplitudes F (n,g) with n = 0 have been related to the N = 2 topological string and have been shown to correspond to higher dimensional F-terms of the type F (n,g) Υ 2n W 2g where Υ is a chiral projection of real functions of N = 2 vector superfields [26], which also satisfy an extended holomorphic anomaly equation [27,28]. By taking the limit ǫ 2 → 0 with ǫ 1 finite, one selects in (1.3) the amplitudes F (n,0) . This limit, also known as Nekrasov-Shatashvili limit [29], is particularly interesting since it is believed that the N = 2 effective theory can be described in this case by certain quantum integrable systems. Furthermore, in this Nekrasov-Shatashvili limit, using saddle point methods it is possible to derive a generalized SW curve [30,31] and extend the above-mentioned results for the SYM theories to the ǫ-deformed ones. By considering the Nekrasov partition function and the corresponding generalized prepotential for rank one SCFT's, in [32] a very remarkable relation has been uncovered with the correlation functions of a two-dimensional Liouville theory with an ǫ-dependent central charge. In particular, for the SU(2) theory with N f = 4 the generalized prepotential turns out to be related to the logarithm of the conformal blocks of four Liouville operators on a sphere and the bare gauge coupling constant to the cross-ratio of the punctures where the four operators are located; for the N = 2 * SU(2) theory, instead, the correspondence works with the one-point conformal blocks on a torus whose complex structure parameter plays the role of the complexified bare gauge coupling. Since the conformal blocks of the Liouville theory have well-defined properties under modular transformations, it is natural to explore modularity also on the four-dimensional gauge theory and try to connect it to the strong/weak-coupling S-duality, generalizing in this way the SW results when ǫ 1 and ǫ 2 are non-zero. On the other hand, one expects that the deformed gauge theory should somehow inherit the duality properties of the Type IIB string theory in which it can be embedded. Some important steps towards this goal have been made in [33] and also in [34] where it has been shown that the SW contour integral techniques remain valid also when both ǫ 1 and ǫ 2 are non-vanishing. To make further progress and gain a more quantitative understanding, it would be useful to know the various amplitudes F (n,g) in (1.3) as exact functions of the gauge coupling constant and analyze their behavior under modular transformations, similarly to what has been done for the SW prepotential F (0,0) in [4,5]. Recently, by exploiting the generalized holomorphic anomaly equation, an exact expression in terms of Eisenstein series has been given for the first few amplitudes F (n,g) of the SU (2) theory with N f = 4 and the N = 2 * SU(2) theory in the limit of vanishing hypermultiplet masses [35]. This analysis has then been extended in [36] to the massive N = 2 * model in the Nekrasov-Shatashvili limit, using again the extended holomorphic anomaly equation, and in [37] using the properties of the Liouville toroidal conformal blocks in the semi-classical limit of infinite central charge. However, finding the modular properties of the deformed prepotential in full generality still remains an open issue.
In this paper we address this problem and extend the previous results by adopting a different strategy. In Section 2, using localization techniques we explicitly compute the first few instanton corrections to the prepotential for the N = 2 * massive theory with gauge group SU(2) in a generic ǫ-background. From these explicit results we then infer the exact expressions of the various prepotential coefficients and write them in terms of Eisenstein series of the bare coupling. Our results reduce to those of [4,5] when the deformation parameters are switched off, and to those of [35] - [37] in the massless or in the Nekrasov-Shatashvili limits. The properties of the Eisenstein series allow to analyze the behavior of the various prepotential terms under modular transformations and also to write a recursion relation that is equivalent to the holomorphic anomaly equation if one trades modularity for holomorphicity. The recursion relation we find contains a term proportional to ǫ 1 ǫ 2 , which is invisible in the SYM limit or in the Nekrasov-Shatashvili limit. In Section 3 we repeat the same steps for the N = 2 SU(2) theory with N f = 4 and arbitrary mass parameters and also in this case derive the modular anomaly equation in the form of a recursion relation. In Section 4 we study in detail the properties of the generalized prepotential under S-duality, and show that when both ǫ 1 and ǫ 2 are different from zero, due to the new term in the recursion relation, the prepotential and its S-dual are not any more related by a Legendre transformation, an observation which has been recently put forward in [38] from a different perspective. We also propose how the relation between the prepotential and its S-dual has to be modified, by computing the first corrections in ǫ 1 ǫ 2 . Finally, in Section 5 we conclude by showing that there exist suitable redefinitions of the prepotential and of the effective coupling that allow to recover the simple Legendre relation and write the S-duality relations in the same form as in the undeformed SW theory. The appendices contain some technical details and present several explicit formulas which are useful for the computations described in the main text.

The N = 2 * SU(2) theory
The N = 2 * SYM theory describes the interactions of a N = 2 gauge vector multiplet with a massive N = 2 hypermultiplet in the adjoint representation of the gauge group. It can be regarded as a massive deformation of the N = 4 SYM theory in which the β-function remains vanishing but the gauge coupling constant receives both perturbative and non-perturbative corrections proportional to the hypermultiplet mass. Using the lo-calization techniques [6,7] one can obtain a generalization of this theory by considering the ǫ-dependent terms in the Nekrasov partition function. In the following we only discuss the case in which the gauge group is SU(2) (broken down to U(1) by the vacuum expectation value a of the adjoint scalar of the gauge vector multiplet). We begin by considering the non-perturbative corrections.

Instanton partition functions
The partition function Z k at instanton number k is defined by the following integral over the instanton moduli space M k : where S inst is the instanton moduli action of the N = 2 * theory. After introducing two deformation parameters ǫ 1 and ǫ 2 , the partition function Z k can be explicitly computed using the localization techniques. In the case at hand, each Z k can be expressed as a sum of terms in one-to-one correspondence with an ordered pair of Young tableaux of U(k) such that the total number of boxes in the two tableaux is k. For example, at k = 1 we have the two possibilities: ( , •) and (•, ); at k = 2 we have instead the five cases: ( , •), (•, ), ( , •), (•, ), ( , ); and so on and so forth. Referring for example to the Appendix A of [39] for details, at k = 1 one finds where a uv = a u − a v with a 1 = −a 2 = a, and is the equivariant mass parameter for the adjoint hypermultiplet in the ǫ-background [40,35]. The 1-instanton partition function is therefore At k = 2 the relevant partition functions are The contributions corresponding to the other Young tableaux at k = 2 can be obtained from the previous expressions with suitable redefinitions. In particular, Z (•, ) is obtained from Z ( ,•) in (2.5) by exchanging a 12 ↔ a 21 , Z ( ,•) is obtained by exchanging ǫ 1 ↔ ǫ 2 , and finally Z (•, ) is obtained by simultaneously exchanging a 12 ↔ a 21 and ǫ 1 ↔ ǫ 2 . The complete 2-instanton partition function is but we refrain from writing its expression since it is not particularly inspiring. This procedure can be systematically extended to higher instanton numbers leading to explicit formulas for the instanton partition functions. Following [7] we can cast these results in a nice and compact form. Indeed, defining where τ 0 = θ 2π + i 4π g 2 is the complexified gauge coupling constant of the N = 2 * SYM theory, the grand-canonical instanton partition function where Z 0 = 1, can be rewritten as where the first line represents the contribution of the gauge vector multiplet and the second line that of the adjoint hypermultiplet. Here k ui and k ui denote, respectively, the number of boxes in the i-th row and in the i-th column of a Young tableaux Y u and are related to the Dynkin indices of the corresponding representation. These quantities can be extended for any integer i with the convention that k ui = 0 or k ui = 0 if the i-th row or the i-th column of Y u is empty. For example, for Y u = the k ui 's are (2, 0, 0, 0, . . .) and the k ui 's are (1, 1, 0, 0, . . .). Moreover we have (2.10) It is quite straightforward to check that the expressions (2.2) and (2.5) are reproduced by the compact formula (2.9) by selecting the appropriate Young tableaux. Following Nekrasov's prescription, we can obtain the generalized non-perturbative prepotential according to (2.11) In the limit ǫ ℓ → 0, the above expression computes the instanton contributions to the prepotential of the N = 2 * SYM theory, while the finite ǫ-dependent terms represent further non-perturbative corrections. Notice that in the limit m → 0, (2.9) correctly reduces to the partition function of the N = 4 SYM theory, namely to the Euler characteristic of the instanton moduli space (see for instance [41]).

Perturbative part
The compact expression (2.9) allows to "guess" the perturbative part of the partition function by applying the same formal reasoning of Section 3.10 of [6]. Indeed, in (2.9) we recognize the following universal (i.e. k-independent but a-dependent) factor which, if suitably interpreted and regularized [6,7], can be related to the perturbative part of the partition function of the N = 2 * theory in the ǫ-background. According to this idea, we are then led to write Using the following representation for the logarithm (2.14) where Λ is an arbitrary scale and summing over i and j, we can rewrite (2.13) as where (see also [18,35]) This function, which is related to the logarithm of the Barnes double Γ-function, can be easily computed by expanding for small values of ǫ 1 and ǫ 2 . As a result, F pert becomes a series in inverse powers of a 2 whose first few terms are (2.17) Here we have used (2.3) and introduced the convenient notation One can easily check that in the limit ǫ ℓ → 0 this expression correctly reproduces the 1-loop prepotential of the N = 2 * SU(2) gauge theory (see for instance [4]).

Generalized prepotential
The complete generalized prepotential is the sum of the classical, perturbative and nonperturbative parts. We now focus on the latter two terms which are directly related to the Nekrasov partition function. Just like the 1-loop piece (2.17), also the instanton terms (2.11) can be organized as a series expansion for small values of ǫ 1 and ǫ 2 , or equivalently for large values of a. Discarding a-independent terms, which are not relevant for the gauge theory dynamics, we write where the coefficients h ℓ are polynomials in m 2 , s 2 and p which can be explicitly derived from (2.17) as far as the perturbative part is concerned, and from the instanton partition functions (2.9), after using (2.11), for the non-perturbative part. Here we list the first few of these coefficients up to three instantons: It is interesting to notice that all h ℓ 's are proportional to 4m 2 − s 2 and, except for h 0 , also to 4m 2 +4p−s 2 . Explicit expressions for h ℓ with ℓ > 3 can be systematically derived from the generalized prepotential but they are not needed for our considerations.
Building on previous results obtained in ǫ ℓ → 0 limit from the SW curve [4,5] and on the analysis of [35] for the massless case, we expect that the expressions (2.20)-(2.23) are just the first terms in the instanton expansion of (quasi) modular functions of q. More precisely, we expect that h ℓ are (quasi) modular functions of weight 2ℓ that can be written solely in terms of the Eisenstein series E 2 , E 4 and E 6 (see Appendix A for our conventions and definitions). This is indeed what happens. In fact we have By using the small q expansion of the Eisenstein series one can check that the explicit instanton contributions we have computed using localization techniques are correctly recovered from the previous formulas. We stress that the fact that the various instanton terms nicely combine into expressions involving only the Eisenstein series is not obvious a priori and is a very strong a posteriori test on the numerical coefficients appearing in (2.20)-(2.23). It is quite remarkable that the explicit instanton results at low k can be nicely extrapolated and allow to reconstruct modular forms from which, by expanding in powers of q, one can obtain the contributions at any instanton number. We can also organize the generalized prepotential according to (1.3) and obtain the amplitudes F (n,g) as a series in inverse powers of a 2 with coefficients that are polynomials in E 2 , E 4 and E 6 . The first few of such amplitudes are: (2.28) Terms with higher values of n and g can be systematically generated without any difficulty from the h ℓ 's given in (2.24)-(2.27). The first term F (0,0) represents the prepotential of the N = 2 * SU(2) gauge theory and its expression (2.28) agrees with that found in [4] from the SW curve (see also [5]). The other terms are generalizations of those considered in [35] and more recently in [37] in particular limits (m → 0 or ǫ 2 → 0) where they drastically simplify.

Recursion relations
The generalized prepotential (2.19) is clearly holomorphic by construction but does not have nice transformation properties under the modular group since the coefficients h ℓ explicitly depend on the second Eisenstein series E 2 which is not a good modular function. Indeed, under Therefore, in order to have good modular properties we should replace everywhere E 2 with the shifted Eisenstein series E 2 = E 2 + 6 πi(τ 0 −τ 0 ) at the price, however, of loosing holomorphicity. This fact leads to the so-called holomorphic anomaly equation [22,23] (see also [28]). On the other hand, in the limitτ 0 → ∞, holding τ fixed so that E 2 → E 2 , we recover holomorphicity but loose good modular properties and obtain the so-called modular anomaly equation [42]. This equation can be rephrased in terms of a recursion relation satisfied by the h ℓ coefficients which allows to completely fix their dependence on E 2 .
To this aim let us consider the explicit expressions (2.24)-(2.27) and compute the derivatives of h ℓ with respect to E 2 . With simple algebra we find We have explicitly checked this relation for several values of ℓ > 3; we can thus regard it as a distinctive property of the ǫ-deformed N = 2 * low-energy theory. Notice that in the limit ǫ ℓ → 0, (2.36) reduces to the recursion relation satisfied by the coefficients of the prepotential of the N = 2 * SU(2) theory found in [4,5] from the SW curve, and that the linear term in the right hand side disappears in the so-called Nekrasov-Shatashvili limit [29] where one of the two deformation parameters vanishes and a generalized SW curve can be introduced [30,31]. Eq. (2.36) can be formulated also as a recursion relation for the amplitudes F (n,g) defined in (1.3). To see this, let us first extract the a-dependence and, in analogy with (2.19), write Notice that the coefficients f (n,g) ℓ , which are polynomials in the hypermultiplet mass m, have mass dimensions 2(1 + ℓ − n − g); therefore f (n,g) ℓ = 0 if n + g > ℓ + 1 (this condition can be easily checked on the explicit expressions (2.28)-(2.31). These definitions must be supplemented by the "initial conditions" which are obtained from (2.24). Inserting (2.39) in the recursion relation (2.36), we obtain where the ′ means that the sum is performed over all n 1 , n 2 , g 1 and g 2 such that n 1 +n 2 = n and g 1 + g 2 = g. Eq.
(2.41) shows that the coefficients f (n,g) ℓ and hence the amplitudes F (n,g) are recursively related to those with lower values of n and g, similarly to what can be deduced from the holomorphic anomaly equation [35].
3. The N = 2 SU(2) theory with N f = 4 We now consider the N = 2 SU(2) theory with N f flavor hypermultiplets in the fundamental representation of the gauge group. When N f = 4 the 1-loop β-function vanishes and the conformal invariance is broken only by the flavor masses m f (f = 1, ..., 4). Furthermore there are non-perturbative effects due to instantons which are nicely encoded in the exact SW solution [2]. We now discuss the generalizations of these effects induced by the ǫ ℓ deformation parameters in the Nekrasov partition function, following the same path described in the previous section for the N = 2 * theory.

Instanton partition functions
Using localization techniques, we can express the instanton partition functions Z k of the N f = 4 theory as sums of terms related to pairs of Young tableaux. Referring again the Appendix A of [39] for details, at k = 1 we have the following two contributions is the equivariant hypermultiplet mass in the ǫ-background 2 . Summing the two terms (3.1) and setting a 1 = −a 2 = a, we get The partition function Z 1 contains a part proportional to a 2 , a part which does not depend on a and a part containing a 2 in the denominator. In all a-dependent terms the flavor masses m f always occur in SO(8)-invariant combinations and thus in all such terms we can always express the mass dependence using the following quadratic, quartic and sextic SO(8) invariants: The a-independent terms in (3.3), instead, are not invariant under the SO(8) flavor group.
Indeed, neither f m f nor f <f ′ m f m f ′ respect this invariance. Notice, however, that a-independent terms in the partition functions, and hence in the prepotential, are irrelevant for the gauge theory dynamics, and thus can be neglected. We will always do so in presenting our results. The explicit expressions of the partition functions Z k for k > 1 are rather cumbersome; nevertheless it is possible to write the (grand-canonical) instanton partition function in a quite compact way using the connection with the Young tableaux. Indeed, denoting as x the instanton counting parameter and using the same notations introduced in Section 2.1, we have (3.5) 2 Note that in [39] the hypermultiplet masses were denoted −m f .
Here the second line represents the contribution of the gauge vector multiplet and the last line that of the fundamental hypermultiplets. From this expression, by selecting the appropriate Young tableaux, one can obtain the various terms of the instanton partition function and their dependence on the ǫ ℓ parameters.

Perturbative part
Also in the N f = 4 theory one can deduce the perturbative contribution to the partition function from the "universal" factor of the grand-canonical instanton partition function (3.5), namely which, of course, requires a suitable interpretation and regularization. Using this observation and following again [6,7], we can write the perturbative part of the prepotential as (3.7) which, after using (2.14) and summing over i and j, becomes where the function γ ǫ 1 ǫ 2 is defined in (2.16). Expanding the latter for small values of ǫ 1 and ǫ 2 and discarding as usual a-independent terms, we obtain where s and p are as in (2.18). One can easily check that in the limit ǫ ℓ → 0 this expression correctly reproduces the 1-loop prepotential of the N = 2 SU(2) N f = 4 theory (see for instance [3]). Notice the presence of a term proportional to a 2 which corresponds to a finite 1-loop renormalization of the gauge coupling constant.

Generalized prepotential
We now consider the instanton corrections to the prepotential of the N f = 4 theory which is given by (3.10) At k = 1, up to a-independent terms, from (3.1) we simply get The presence of an a 2 -term in F 1 signals that there is a renormalization of the gauge coupling constant at the 1-instanton level. Actually, the same thing occurs also at higher instanton numbers; indeed we find Combining these contributions with the perturbative one given by the first term in (3.8) and adding also the classical tree-level prepotential F cl = log x a 2 , we obtain log x − log 16 + 1 2 x + 13 64 that is a redefinition of the instanton expansion parameter and hence of the gauge coupling constant. By inverting this relation we get [43] x = 16 q 1 − 8q + 44q 2 − 192q 3 + · · · ) = θ 2 (q) 4 θ 3 (q) 4 (3.14) (see Appendix A for some properties of the Jacobi θ-functions). As pointed out for instance in [44], by setting one can show that τ 0 is precisely the modular parameter of the SW curve for the SU(2) N f = 4 theory appearing in the original paper [2]. This gauge coupling constant receives only corrections proportional to the hypermultiplet masses and as such is the strict analogue 3 of the gauge coupling constant τ 0 of the N = 2 * theory considered in Section 2. On the other hand, using (3.14) one can show that x is a cross-ratio of the four roots of the original SW curve [2]. From now on we always present the results for the N f = 4 theory in terms of q.
Expanding the complete prepotential F pert + F inst as in (2.19), the first coefficients h ℓ up to three instantons turn out to be We worked out also the expressions for a few other h ℓ 's with ℓ > 3 which however become rapidly very cumbersome and thus we do not write them here (see for example Appendix B where we give the detailed form of h 3 ). As in the N = 2 * model, also in the N f = 4 theory we can view the previous results as the first instanton terms of the expansion of (quasi) modular forms in powers of q. In this case, however, besides the Eisenstein series E 2 , E 4 and E 6 , also the Jacobi θ-functions θ 2 and θ 4 are needed. Matching the q-expansion of these modular functions with the explicit results (3.16)- (3.18), guided by what we already obtained in the ǫ ℓ → 0 limit [5] which suggests the existence of a recursion relation that fixes the E 2 dependence, we find 4 (3.21) 4 As compared to the results presented in [5,44], here all masses have been rescaled by a factor of √ 2, that is m there We have checked that a similar pattern occurs also in other h ℓ 's with ℓ > 3 (see Appendix B). Organizing the complete prepotential as an expansion in powers of s 2 and p as in (1.3), we can obtain the amplitudes F (n,g) , the first few of which are

27)
F (3,0) = 5E 2 2 + 13E 4 11520 a 4 · · · , F (2,1) = − 10E 2 2 + 17E 4 2880 a 4 · · · , (3.28) (3.29) One can easily check that F (0,0) in (3.22) completely agrees with the prepotential of the N = 2 SU(2) N f = 4 gauge theory as derived for example in [5]; notice also that in the massless limit, i.e. R, N, T 1 , T 2 → 0, these amplitude drastically simplify and precisely match the results presented in [35]. It is also interesting to observe that in the Nekrasov-Shatshvili limit where one of the ǫ ℓ 's vanishes, the amplitudes F (n,0) of the N f = 4 theory reduce to those of the N = 2 * theory upon setting T 1 = T 2 = N = 0 and R = m 2 . Indeed, with these positions and rescaling a → 2a, the amplitudes F (n,0) in (3.22)-(3.29) become twice the corresponding amplitudes of the N = 2 * theory given in (2.28)-(2.33). This simple relation does not hold away from the Nekrasov-Shatashvili limit: the amplitudes F (n,g) with g = 0 are in fact intrinsically different in the two theories, as a consequence of their different gravitational structure.

Recursion relations
Looking at the explicit expressions (3.19) -(3.21), it is not difficult to realize that the E 2 dependence of the h ℓ 's is quite simple and exhibits a recursive pattern. This points again to the existence of a recursion relation among the h ℓ 's involving their derivatives with respect to E 2 . Indeed, following the same steps described in Section 2.4, one can check that with the initial condition This recursion relation has exactly the same structure of that of the N = 2 * theory given in (2.36), the only difference being in the numerical coefficients. Notice that the coefficients of the quadratic terms can be matched by a rescaling of the h ℓ 's, but those of the linear terms proportional to ǫ 1 ǫ 2 remain different for the two theories; this is another signal of their intrinsically different behavior when a generic ǫ-background is considered. Finally, if we expand the h ℓ 's as in (2.39) we can reformulate the recursion relation (3.30) in terms of the partial amplitudes f (n,g) ℓ and get ∂f (n,g) ℓ where the ′ means that the sum is performed over all n 1 , n 2 , g 1 and g 2 such that n 1 +n 2 = n and g 1 + g 2 = g. This relation has to be supplemented by the initial conditions obtained from (3.19).
In the next section we will analyze the implications of the recursion relations and in particular their consequences on the modular transformation properties of the generalized prepotential.

Modular anomaly equations and S-duality
The fact that the generalized prepotential can be written in terms of (quasi) modular functions of the bare coupling constant allows to explore the modularity properties of the deformed theory and study how the Sl(2, Z) symmetry of the microscopic high-energy theory is realized in the effective low-energy theory. In the following we will concentrate on the SU(2) N f = 4 theory, even if our analysis and our methods can be equally well applied to the N = 2 * SU(2) model. Furthermore, we will focus on the generator S of the modular group, corresponding to the following transformation of the bare coupling constant Notice that this action implies that the instanton counting parameter x in the Nekrasov's partition of the N f = 4 theory, defined in (3.14), transforms as follows as one can readily check from the properties of the Jacobi θ-functions. This type of transformation is consistent with the interpretation of x as a cross-ratio, a fact that is also exploited in the AGT correspondence with the Liouville conformal blocks [32]. As discussed in [2], in the N f = 4 theory the modular group acts with triality transformations on the mass invariants (3.4); in particular one has In the deformed theory, these rules have to be supplemented by those that specify how Sl(2, Z) acts on the equivariant deformation parameters. Adapting to the present case the considerations made in [45] for the ǫ-deformed conformal Chern-Simons theory in three dimensions, we assume that S simply exchanges ǫ 1 and ǫ 2 with each other 5 . In particular this means that s = ǫ 1 + ǫ 2 and p = ǫ 1 ǫ 2 are left unchanged, i.e.
S : s → s , p → p . (4.4) Using the rules (4.1) -(4.4) and the modular properties of the Eisenstein series and Jacobi θ-functions, it is easy to show that the coefficients h ℓ of the generalized prepotential (see (3.21) and Appendix B) transform as quasi-modular forms of weight 2ℓ with anomalous terms due to the presence of the second Eisenstein series E 2 , namely where we have introduced the convenient notation D ≡ 12∂ E 2 . These transformation rules are formally identical to those of the underformed N f = 4 theory derived in [5] from the SW curve; however, since the h ℓ 's satisfy a modified recursion relation with a new term proportional to ǫ 1 ǫ 2 , the practical effects of (4.5) in the deformed theory are different from those of the undeformed case, as we shall see momentarily.
To proceed let us consider the pair made by a and its S-dual image S(a) ≡ a D , on which S acts as follows [1,2]: We therefore have S 2 (a) = −a . In the SW theory this relation is enforced by taking where F is the undeformed effective prepotential which is related to its S-dual by a Legendre transform: F − S(F) = 2πi a S(a) . (4.9) It seems natural to try the same thing also in the deformed theory. Recalling that the effective generalized prepotential is where the first term is the classical part, we therefore posit (4.11) Applying the S-duality rules (4.1) and (4.5), we obtain The expression in square brackets can be simplified using the recursion relation (3.30); like in the undeformed theory, the quadratic terms in the h's exactly cancel but, due to the new ǫ-dependent term in the deformed recursion relation, an uncanceled part proportional to ǫ 1 ǫ 2 remains. This simple calculation shows that in order to enforce the relation (4.7) when ǫ 1 ǫ 2 = 0, the standard definition (4.11) has to be modified by adding terms proportional to ǫ 1 ǫ 2 in the right hand side. In the sequel we will work out explicitly the first corrections and show how the relation (4.7) constrains the form of S(a).

S-duality at first order in ǫ 1 ǫ 2
To organize the calculation, we introduce a set of generating functions ϕ ℓ for the coefficients h ℓ according to In particular we have the following relations with the generalized prepotential F : where in the last line we have introduced the effective coupling τ .
As shown in Appendix C, the ϕ ℓ 's form a ring under the action of D due to the generalized modular anomaly equations (3.30). This ring structure will enable us to formally express everything as functions of the ϕ ℓ 's with coefficients that may depend on the product ǫ 1 ǫ 2 . Such a dependence is a consequence of the ǫ 1 ǫ 2 -term in the recursion relation (3.30) and is the only explicit dependence on the deformation parameters that will be relevant for our purposes, all the rest being implicit inside the ϕ ℓ 's and the h ℓ 's therein.

S(a)
where the X ℓ 's have to be determined by imposing the constraint (4.7). Applying S-duality to (4.15), it is straightforward to obtain therefore, in order to satisfy the relation (4.7), the expression in the square brackets above must vanish. Expanding this condition in ǫ 1 ǫ 2 , we obtain the following constraints where the symbol n means taking the coefficient of (ǫ 1 ǫ 2 ) n (notice that the ϕ ℓ 's defined in (4.13) do not have any explicit dependence on ǫ 1 ǫ 2 and thus ϕ ℓ n = δ n0 ϕ ℓ ; for the same reason we also have X ℓ n = δ n0 X ℓ ). Let us now compute S(ϕ 1 ). Using the S-duality rules (4.1) and (4.5), and exhibiting temporarily the dependencies on E 2 and a which are the only relevant ones for our purposes, we obtain Actually, this is a particular case of the more general result (4.20) Expanding the exponential and using the relation after some straightforward algebra to rearrange the various terms, we obtain where the functions Σ (ℓ) are defined by (4.23) As shown in Appendix C, these functions satisfy the remarkably simple relation that is a consequence of the ring properties obeyed by the functions ϕ ℓ , which in turn are due to the modular anomaly equations (3.30). In view of this we can therefore rewrite (4.22) as Note that the bare coupling τ 0 initially appearing in the right hand side of (4.20) has been dressed into the effective coupling τ . We now exploit this result and proceed perturbatively in ǫ 1 ǫ 2 to obtain explicit expressions. At the zeroth order in ǫ 1 ǫ 2 , from (4.25) we have where the last equality follows from (C.13). The constraint (4.18a) is therefore identically satisfied. This is no surprise since we have already shown that the relation (4.7) must be true up to terms proportional to ǫ 1 ǫ 2 . At the first order in the deformation parameters we get instead where we have used (C.13). Inserting this result into (4.18b) for n = 1, we obtain the following equation for X 1 (4.28) To solve it we take advantage of the S-duality relations at the zeroth order in ǫ 1 ǫ 2 , which are formally the same of the SW theory. Using (4.24) -(4.26) it is easy to show that 29) and also that Equipped with these results, one can check that a solution to (4.28) is given by In conclusion 6 we find that the S-dual image of a, which obeys the constraint (4.7) up to terms of order (ǫ 1 ǫ 2 ) 2 , is Observing that ϕ 3 = 2πi ∂ a τ , we can rewrite the ǫ 1 ǫ 2 -term above also as In the following we will investigate the implications of this result, while we refer to Appendix D for its extension to the second order in ǫ 1 ǫ 2 .

S-duality on the prepotential
An immediate consequence of the ǫ-correction in (4.34) is that S(a) is not simply proportional to the derivative of the prepotential F ; thus it is natural to expect that in the deformed theory the S-dual of the prepotential is not simply given by a Legendre transformation as it happens instead in the undeformed SW case (see (4.9)). In [38] the relation between F and S(F ) has been conjectured to be a deformed Fourier transformation. Here we reach the same conclusion, even though from a different perspective since for us all deviations from the undeformed theory are parametrized by the product ǫ 1 ǫ 2 . We can compute the first ǫ-corrections to the relation between F and S(F ) using the same methods of the previous subsection and the results given in Appendix C. The starting point is the relation between ϕ 0 and the generalized prepotential (see (4.14a)); from this we get the useful identity Using (4.15) and (4.22) for ℓ = 0, we can easily rewrite the right hand side and obtain where the dots stand for terms of order X 3 which are at least O (ǫ 1 ǫ 2 ) 3 . Notice that the difference Σ (1) − ϕ 1 is of order ǫ 1 ǫ 2 , as one can see from (4.26); thus the linear term in X gives contributions O (ǫ 1 ǫ 2 ) 2 , like the X 2 term. This means that the knowledge of the first order correction X 1 obtained in the previous subsection is enough to compute the correction to F − S(F ) at order (ǫ 1 ǫ 2 ) 2 . This mechanism actually works at all orders, namely the k-th order coefficient of F − S(F ) does not depend on X k but only on X j with j < k.
Using the explicit value of X 1 given in (4.31) and the expressions for the Σ (ℓ) 's given in Appendix C (see in particular (C.12) -(C.14)), after straightforward algebra we obtain (4.37) This shows that the simple Legendre transform relation (4.9), which holds in the underformed theory, does not work any more when ǫ 1 ǫ 2 = 0, as argued, from a different point of view, in [38]. In the next section, however, we will show that with a suitable redefinition of the prepotential F and of the coupling constant τ it is possible to recover the standard Legendre transform relation also in the ǫ 1 ǫ 2 -deformed theory.

Conclusions
The explicit first-order calculation of Section 4.1 shows that S(a) is not simply the derivative of the prepotential F . However, it is still a total derivative, as is clear from (4.34). This feature is maintained also at the second order. Indeed, as shown in Appendix D, the (ǫ 1 ǫ 2 ) 2 correction X 2 can be chosen as so that we can rewrite (4.15) in the following way In the deformed theory the S-duality transformation of the effective coupling τ does not have a simple form; in fact, using (4.14c) and the transformation properties of ϕ 2 , it is easy to show that (see (D.7)) However, there is a modified effective coupling on which S-duality acts in a simple way. This is (5.5) One can easily check that Thus, in the effective ǫ-deformed theory it is τ , and not τ , that exhibits the same behavior of the bare coupling τ 0 under S-duality. We also observe that if one uses τ , the expression of the extended prepotential F given in (5.3) simplifies and becomes This result seems to suggest that it is possible to write the higher order corrections only in terms of ϕ 3 which, being the triple derivative of the prepotential, is proportional to the Yukawa coupling C aaa , the rank-three symmetric tensor playing a crucial rôle in special geometry. Moreover, one can verify the simple Legendre transform relation F − S( F ) = 2πi a S(a) (5.8) up to terms of order (ǫ 1 ǫ 2 ) 3 . It is quite natural to expect that this pattern extends also to higher orders. Our detailed analysis shows that when both deformation parameters ǫ 1 and ǫ 2 are non-vanishing, besides the ǫ-dependent structures generated by the Nekrasov partition functions, the effective theory seems to require a new series of explicit ǫ 1 ǫ 2 -corrections in order to have S-duality acting in the proper way. These new corrections, being proportional to inverse powers of the coupling constant, appear to correspond to perturbative terms at higher loops and are absent in the Nekrasov-Shatashvili limit. We find remarkable that by using the modified prepotential F and the modified coupling τ , all S-duality relations acquire the standard simple form as in the undeformed theory (see (5.2), (5.6) and (5.8)). It would be very nice to see whether these results admit an interpretation in the context of special geometry or in a more general geometric set-up that allows to go beyond the perturbative approach in the deformation parameters we have used in this paper. It would be interesting also to study the recursion relations obeyed by the functions ϕ ℓ 's which can be iteratively obtained from the viscous Burgers equation satisfied by ϕ 1 (see (C.2)).
We conclude by observing that all S-duality formulas we have derived for the SU(2) N f = 4 theory can be obtained for the N = 2 * SU(2) theory as well. The only difference in this case is that every explicit occurrence of ǫ 1 ǫ 2 has to be replaced by (ǫ 1 ǫ 2 )/2 to take into account the different normalization of the viscous term in the modular anomaly recursion relation (see (2.36) as compared to (3.30)).

Acknowledgments
We thank Francesco Fucito and Francisco Morales for very useful discussions. This work was supported in part by the MIUR-PRIN contract 2009-KHZKRX.

A. Modular functions
We collect here some useful formulas involving the modular functions we used.
θ-functions: The Jacobi θ-functions are defined as for a, b = 0, 1 and q = e πiτ . We simplify the notation by writing, as usual, and admit the following series expansions θ 2 (0|τ ) = 2q 1 4 1 + q 2 + q 6 + q 12 + · · · , θ 3 (0|τ ) = 1 + 2q + 2q 4 + 2q 9 + · · · , θ 4 (0|τ ) = 1 − 2q + 2q 4 − 2q 9 + · · · . Eisenstein series: The first Eisenstein series can be expressed as follows: σ 3 (n) q 2n = 1 + 240q 2 + 2160q 4 + 6720q 6 + . . . , where σ k (n) is the sum of the k-th power of the divisors of n, i.e., σ k (n) = d|n d k . The series E 4 and E 6 are related to the θ-functions in the following way The series E 2 , E 4 and E 6 are connected among themselves by logarithmic q-derivatives according to Also the derivatives of the functions θ 4 a have simple expressions: Modular transformations: Under the Sl(2, Z) modular transformation the Eisenstein series E 4 and E 6 behave as modular forms of weight 4 and 6, respectively: The series E 2 , instead, is a quasi modular form of degree 2: Under the generators T and S of the modular group the θ-functions and the Dedekind η function transform as follows Here we give the explicit expression of the coefficient h 3 up to three instantons obtained using localization. It is given by Following the procedure described in the main text, we can rewrite h 3 in terms of (quasi) modular functions according to By expanding the modular functions in powers of q as shown in Appendix A, one can recover the instanton terms in (B.1).

C. Reformulating the modular anomaly equations
The modular anomaly equation (3.30) implies the following relation: where the functions ϕ ℓ 's have been defined in (4.13). Since the operators D and (−∂ a ) commute, by applying the latter to (C.1) and remembering that ϕ ℓ+1 = −∂ a ϕ ℓ , it is straightforward to obtain the action of D on any ϕ ℓ and verify that these functions form a ring under it. For example, at the next step we obtain which is, up to rescalings, the viscous Burgers equation with the viscosity ν proportional to ǫ 1 ǫ 2 .
In Section 4 the S-duality requirements were formulated in terms of the quantities Σ (ℓ) defined in (4.23), which we rewrite here for convenience as follows: From this definition it is easy to show that the following relation holds: In turn, this implies that Recalling that 2πiτ 0 − ϕ 2 = 2πiτ (see (4.14c)), this is tantamount to the recursion relation (4.24), namely Σ (ℓ+1) = − τ 0 τ ∂ a Σ (ℓ) , (C.8) which allows to easily obtain the expression of any Σ (ℓ) once Σ (0) is known.
To determine Σ (0) we start considering the quantities P where from the second equality on we have used that 2πiτ 0 − ϕ 2 = 2πiτ .
Applying the recursion formula (C.8) we can easily get the explicit expressions for the Σ (ℓ) 's that are needed in the calculations presented in Section 4 or in Appendix D. They are, for ℓ = 1: where the last step follows from the results given in Appendix C. For the denominator we take into account that Resorting again to (4.22) to evaluate τ 2 0 S(ϕ 2 ), we obtain Considering the structures involved in this relation, we can try an Ansatz such that X 2 is written as a total derivative:

(D.10)
With this position we find straightforwardly, using the formulae of Appendix C, that Our Ansatz thus satisfies the requirement (D.9) with still one free parameter. In Section 5 we chose to fix this arbitrariness by requiring that the modified prepotential F introduced in (5.2) differs from F by a series of corrections in powers of ǫ 1 ǫ 2 whose coefficients only involve ϕ 3 and the modified effective coupling τ defined in (5.5). It is easy to see that, starting with X 2 given in (D.10), the F term of order (ǫ 1 ǫ 2 ) 2 in (5.7) would contain a part proportional to ϕ 4 unless λ 1 assumes a specific value which, by virtue of (D.12), fixes also λ 2 . These values are: 13) which are those used in (5.1).