TITLE: Tripos Integral
QUESTION [21 upvotes]: Show that
$$\int_0^{\frac{\pi}{4}} \frac{\sin^2 x}{e^{2mx}(\cos x-m\sin x)^2}dx=\frac{1}{2m(1+m^2)}\left[\frac{1+m}{1-m}e^{-m\frac{\pi}{2}}-1\right]$$
This problem is from Edwards, Treatise on Integral Calculus II, pg.187.
It is a definite integral and is not likely to find the indefinite integral, at this point in the book Edwards has introduces the tricks of substituting $\frac{\pi}{4}-x$ for $x$, and expansion in series (and of course parts). Unfortunately, I haven't been able to make these tricks work out. My method has been to expand $\frac{\tan^2 x}{(1-m\tan x)^2}$ as a series in $m\tan x$, and integrate termwise but so far without success. Does anybody have any good ideas?

REPLY [3 votes]: It is actually not very difficult to obtain the correct antiderivative (for some reason i use $a$ for the integral parameter, not $m$).
The only non-trivial observation here is how to write the more compelx part of the integral as a derivative ($'$ denotes differentation w.r.t. $x$):
$$I = (2a)^{-1}\int \left(\frac{\cos(x)+a \sin(x)}{\cos(x)-a \sin(x)}\right)' \sin^2(x)e^{-2 a x}$$
integrating by parts, we can just cancel the annoying stuff:
$$
(2a)I = e^{-2 a x}\sin^2(x)\frac{\cos(x)+a \sin(x)}{\cos(x)-a \sin(x)} -\\
\int \left(\frac{\cos(x)+a \sin(x)}{\color{red}{\cos(x)-a \sin(x)}}\right)( \color{red}{\cos(x)-a \sin(x)}) \sin(x)e^{-2 a x} 
$$
the remaining integral is elementary:
$$
e^{2 a x}(2a)I =\sin^2(x)\frac{\cos(x)+a \sin(x)}{\cos(x)-a \sin(x)}+\frac{(\cos(x)+a \sin(x))^2}{a^2+1}
$$
this can be brought into the form indicated by @Claude Leibovici, but i don't have the right temper for stupid algebra like that at the moment