Calculating $\int_0^{\pi/3}\cos^2x+\dfrac{1}{\cos^2x}\mathrm{d}\,x$ I've been given the following exercise:

Show that the exact value of $$\int_0^{\pi/3}\cos^2x+\frac{1}{\cos^2x}\,\mathrm{d}x = \frac{\pi}{6}+\frac{9}{8}\sqrt{3}$$

Can someone help me with this?
 A: $\displaystyle \int \cos^2 x+\dfrac{1}{\cos^2 x}\,dx$
$=\displaystyle \int \dfrac{1}{2}(1+\cos 2x)+\sec^2 x\,dx$
$=\dfrac{1}{2}x+\dfrac{1}{4}\sin 2x+\tan x+C$
So integrating between the limits 
$\left[0,\dfrac{\pi}{3}\right]$
$=\dfrac{\pi}{6}+\dfrac{1}{4}\sin \dfrac{2\pi}{3}+\tan \dfrac{\pi}{3}-0$
$=\dfrac{\pi}{6}+\dfrac{1}{4}\times \dfrac{\sqrt{3}}{2}+\sqrt{3}$
$=\dfrac{\pi}{6}+\sqrt{3}\left(\dfrac{1}{8}+1\right)$
$=\dfrac{\pi}{6}+\dfrac{9}{8}\sqrt{3}$
A: We can separate the integral into $$\int_{0}^{\frac{\pi}{3}} \cos^{2}(x) + \sec^{2}(x) dx = \int_{0}^{\frac{\pi}{3}}\cos^{2}(x)dx  +\int_{0}^{\frac{\pi}{3}} \sec^{2}(x) dx =I_1 + I_2$$. For the first integral we have $$ I_1 = \int_{0}^{\frac{\pi}{3}} \cos^{2}(x) dx =\int_{0}^{\frac{\pi}{3}} \frac{1+\cos 2x}{2} dx = \frac{2x+\sin 2x}{4}$$ For the second integral, we have $$I_2 =\int_{0}^{\frac{\pi}{3}} \sec^{2}(x) dx = \tan x $$. Substitute the limits $0$ to $\frac{\pi}{3}$ We have $\frac{\pi}{6}+\frac{\sqrt3}{8} + \sqrt3 = \frac{\pi}{3} + \frac{9\sqrt3}{8}$. We are done.
A: This is an answer that requires the knowledge of simple functions such as $\tan$, you can do it without knowing $\sec$ and e.c. Other answers are great, but I am unsure you know all the functions they use.
You can also notice that $\frac{d}{dx}\tan(x)=\frac{1}{\cos(x)^2}$ and that $\cos(x)^2= \frac{1+cos(2x)}{2}$ Thus giving us:
$$\int^{\frac{\pi}{3}}_{0}\cos(x)^2+\frac{1}{\cos(x)^2}dx=\int^{\frac{\pi}{3}}_{0}\frac{1+\cos(2x)}{2}dx+ \left [ \tan(x) \right ]_0^{\frac{\pi}{3}}=\frac{1}{2}\int^{\frac{\pi}{3}}_{0}\cos(2x)dx+\frac{1}{2}\int^{\frac{\pi}{3}}_{0}dx+ \sqrt{3}$$
Now make a variable change:
$u=2x \rightarrow du=2dt$ so $\frac{du}{2}=dt$. We have now:
$$\frac{1}{4}\int^{u(\frac{\pi}{3})}_{0}\cos(u)dx+\frac{1}{2}\int^{\frac{\pi}{3}}_{0}dx+ \sqrt{3}=\frac{1}{4}\left [ sin(x) \right ]_{0}^{\frac{2\pi}{3}}+\frac{1}{2}\left [ x \right ]_0^{\frac{\pi}{3}}+ \sqrt{3}=\frac{\sqrt{3}}{8}+\frac{\pi}{6} + \sqrt{3}=\frac{9\sqrt{3}}{8}+\frac{\pi}{6}$$
