I substituted u and w like you said but in the end I got back the same integral again. Dunno where am going wrong. Am I supposed to substitute u in terms of w?
So what I did, I substituted x = \tan (\theta) and the limits to -\frac {\pi} {2} to +\frac {\pi} {2}. {\sec (\theta)}^2 cancels out leaving behind \int {\cos{\tan(\theta)}} \, dx. I'm stuck after that