$$ \iint_S f(\nabla \times \mathbf{A}) \cdot d\mathbf{S} = \oint_{\partial S} f \mathbf{A} \cdot d\mathbf{r} - \iint_S \mathbf{A} \times (\nabla f) \cdot d\mathbf{S} $$
Is anything wrong with this. My textbook says it should be
$$ \iint_S f(\nabla \times \mathbf{A}) \cdot d\mathbf{S} = \oint_{\partial S} f \mathbf{A} \cdot d\mathbf{r} + \iint_S \mathbf{A} \times (\nabla f) \cdot d\mathbf{S} $$
Which of the two is correct? I used integration by parts and Stoke's theorem.