Solving $\int_{-\pi/4}^{\pi/4}\frac{x^7- x + 1}{\cos^2x}~\mathrm dx$ In my homework I need to solve the integral: (Homework, so I would like a hint more than a full solution)
$$
\int_{-\pi/4}^{\pi/4}\frac{x^7- x + 1}{\cos^2x}~\mathrm dx
$$
What I tried:
We can use integration by parts, knowing that: 
$$
(\tan x)' = \frac{1}{\cos^2x}
$$
Therefore it seems fit to take: 
$$
u = (x^7 - x + 1), v' = \frac{1}{cos^2x}
$$
Now doing the integration I get: 
$$
\int_{-\pi/4}^{\pi/4}\frac{x^7- x + 1}{\cos^2x}~\mathrm dx = (x^7-x+1)\tan^2x - \int_{-\pi/4}^{\pi/4}(7x^6 - 1)\tan^2x~\mathrm dx
$$
Now I need to solve the new right term I get: 
$$
\int_{-\pi/4}^{\pi/4}(7x^6 -1)\tan^2x~\mathrm dx
$$
And again, it seems that it goes the way of integration by parts, but, because of the $x^6$ I will need again and again to do the integration by parts...
So, whats wrong?
 A: $$ \int_{-\frac{\pi}{4}}^{\frac{\pi}{4}}{\frac{x^{7}-x+1}{\cos^{2}{x}}\,\mathrm{d}x}=\int_{-\frac{\pi}{4}}^{\frac{\pi}{4}}{\frac{x^{7}-x}{\cos^{2}{x}}\,\mathrm{d}x}+\int_{-\frac{\pi}{4}}^{\frac{\pi}{4}}{\frac{\mathrm{d}x}{\cos^{2}{x}}} $$
Since $ x\mapsto\frac{x^{7}-x}{\cos^{2}{x}} $ is an odd function, we have that : $$ \int_{-\frac{\pi}{4}}^{\frac{\pi}{4}}{\frac{x^{7}-x}{\cos^{2}{x}}\,\mathrm{d}x}=0 $$
And $$ \int_{-\frac{\pi}{4}}^{\frac{\pi}{4}}{\frac{\mathrm{d}x}{\cos^{2}{x}}}=\bigg[\tan{x}\bigg]_{-\frac{\pi}{4}}^{\frac{\pi}{4}}=2 $$
Thus $$ \int_{-\frac{\pi}{4}}^{\frac{\pi}{4}}{\frac{x^{7}-x+1}{\cos^{2}{x}}\,\mathrm{d}x}=2 $$
A: $$\dots=\int_{-\pi/4}^{\pi/4}\frac{x^7- x}{\cos^2x}~\mathrm dx+ \int_{-\pi/4}^{\pi/4}\frac{ 1}{\cos^2x}~\mathrm dx=$$
$$ 0+ \int_{-\pi/4}^{\pi/4}\frac{ 1}{\cos^2x}~\mathrm dx= 2\int_{0}^{\pi/4}\frac{ 1}{~\mathrm cos^2x}~\mathrm dx=\dots$$ 
A: Following your way you get 
$$\int_{-\pi/4}^{\pi/4}\frac{x^7- x + 1}{\cos^2x}~\mathrm dx$$ $$ = \left[(x^7-x+1)\color{blue}{\tan x}\right]_{-\frac{\pi}{4}}^{\frac{\pi}{4}} - \int_{-\pi/4}^{\pi/4}\underbrace{(7x^6 - 1)\color{blue}{\tan x}}_{odd}~\mathrm dx$$
$$= 2-0 = 2$$
