Answer
From Gauss's law for magnetism, the flux through S1 is equal to that through S2. Then we have :
$\ {phi (S1) = phi (S2)}$
Work Step by Step
The portion of xz plane that lies whitin the cylinder. Here the normal direction of S2 is +y; Therefore:
$\ {phi (S1) = phi (S2)}$ -->
$\int \limits_{-r}^{r} B(x)Ldx$ = $2\int \limits_{-r}^{r} B_{left}(x)Ldx$
We also know that:
$B_{left}(x)$= $\frac {\mu i} {2 \pi}\frac{1}{2r-x}$
So, we have finally:
$2\int \limits_{-r}^{r} B_{left}(x)Ldx$ =$\frac {\mu I L}{\pi}$ Ln(3)