TITLE: How to calculate $\int_0^\infty \frac{1}{(1+x^2)(1+x^{2018})}\,dx$?
QUESTION [7 upvotes]: $$\int_0^\infty \frac{1}{(1+x^2)(1+x^{2018})}\,dx$$ 
My Calculus professor asked a challenge problem to one of my friends and asked her to evaluate it. I tried partial fractions to no avail and the trig substitution $x = \tan\theta$, but that leaves me with
$$\int_0^{\pi/2} \frac{1}{(1+\tan^{2018}\theta)}\,d\theta$$
which I do not know how to evaluate. Any help would be greatly appreciated!

REPLY [6 votes]: Let $$I=\int_0^{\infty} \frac {dx}{(1+x^n)(1+x^2)}$$
Now substitute $x=\frac 1y$ to get $$I=\int_0^{\infty} \frac {y^n dy}{(1+y^n)(1+y^2)}=\int_0^{\infty} \frac {x^n dx}{(1+x^n)(1+x^2)}$$
Now since $$I=\int_0^{\infty} \frac {dx}{(1+x^n)(1+x^2)}=\int_0^{\infty} \frac {(1+x^n-x^n)dx}{(1+x^n)(1+x^2)}=\int_0^{\infty} \frac {(1+x^n)dx}{(1+x^n)(1+x^2)}-\int_0^{\infty} \frac {x^n dx}{(1+x^n)(1+x^2)}=\arctan x\big\vert_0^{\infty}-I$$
Hence $$2I=\frac {\pi}{2}\Rightarrow I=\frac {\pi}{4}$$