<s>[INST] 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?
 [/INST] 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.
</s>