Solve $ \int_\frac{-π}{3}^{\frac{π}{3}}\frac{\cos^2(x)-\sin^2(x)}{\cos^2(x)}dx$ I came across this question in my textbook and have been trying to solve it for a while but I seem to have made a mistake somewhere.
$$ \int_\frac{-π}{3}^{\frac{π}{3}}\frac{\cos^2(x)-\sin^2(x)}{\cos^2(x)}dx$$ and here is what I did. First I simplified the equation as $$ \int_\frac{-π}{3}^{\frac{π}{3}}(1-\tan^2(x))dx=x|_{\frac{-π}{3}}^{\frac{π}{3}}-\int_\frac{-π}{3}^{\frac{π}{3}}(\tan^2(x))dx$$
Then I simplified $\tan^2(x)\equiv\frac{\sin^2(x)}{\cos^2(x)}, \sin^2(x)\equiv1-\cos^2(x)$ so it becomes,  $\tan^2(x)\equiv\frac{1-\cos^2(x)}{\cos^2(x)}=\frac{1}{\cos^2(x)}-1$ making the overall integral 
$$\int_\frac{-π}{3}^{\frac{π}{3}}(1-\tan^2(x))dx=x|_{\frac{-π}{3}}^{\frac{π}{3}}-\int_\frac{-π}{3}^{\frac{π}{3}}(\frac{1}{\cos^2(x)}-1)dx$$
$$=x|_{\frac{-π}{3}}^{\frac{π}{3}}-\int_\frac{-π}{3}^{\frac{π}{3}}\frac{1}{\cos^2(x)}dx-\int_\frac{-π}{3}^{\frac{π}{3}}1dx=x|_{\frac{-π}{3}}^{\frac{π}{3}}-x|_{\frac{-π}{3}}^{\frac{π}{3}}-\int_\frac{-π}{3}^{\frac{π}{3}}\frac{1}{\cos^2(x)}dx$$
I know that $\int\frac{1}{\cos^2(x)}dx=\tan(x)+c$ but that's off by heart and not because I can work it out. Since $x|_{\frac{-π}{3}}^{\frac{π}{3}}-x|_{\frac{-π}{3}}^{\frac{π}{3}}=0$, the final equation becomes 
$$\int_\frac{-π}{3}^{\frac{π}{3}}\frac{\cos^2(x)-\sin^2(x)}{\cos^2(x)}dx=\tan(x)|_{\frac{-π}{3}}^{\frac{π}{3}}=2 \sqrt3$$
Is what I did correct because I feel like I've made a mistake somewhere but can't find it. Also why does $\int\frac{1}{\cos^2(x)}dx=\tan(x)+c$. 
EDIT - Made an error in $\int\frac{1}{\cos^2(x)}dx=\tan^2(x)+c$, it's actually $\int\frac{1}{\cos^2(x)}dx=\tan(x)+c$.

To simplify, try this approach of $\tan^2 x = \sec^2 x - 1$ to get
$$\int_{-\pi/3}^{\pi/3}(2-\sec^2 x)dx = 2 \cdot \int^{\pi/3}_{0}(2-\sec^2 x)dx$$
To get $2 \cdot[2x-\tan x]_{0}^{\pi/3}$ = $\frac{4\pi}{3} - 2\sqrt{3}$
