# Alternative way to evaluate $\int_0^{\pi /4} \frac{e^{\sec x}(1+\tan x)}{1-\sin x} \mathrm dx$

The question is to evaluate $$\int_0^{\pi /4} \frac{e^{\sec x}(1+\tan x)}{1-\sin x} \mathrm dx$$

I tried by rewriting the integral as $$\int_0^{\pi /4} \frac{e^{\sec x}(1+ \sin x)(1+\tan x)}{\cos^2 x} \mathrm dx$$

which can be rewritten as $$\int_0^{\pi /4} e^{\sec x} \sec^2 x \mathrm dx \text{. }+\int_0^{\pi /4} e^{\sec x} \sec x \tan x (1+ \sec x + \tan x) \mathrm dx$$ Now using integral by parts on second integral easily yield the result

Is there any other way to evaluate it?

• Easily how? I don't see any way to solve it easily... – Raffaele Dec 3 '17 at 11:16
• There is a simple primitive in this case: $e^{\sec x}\cos x/(1-\sin x)$. Maybe you can find a way to obtain it? – mickep Dec 3 '17 at 12:22

That seems like the simplest way to go about it. Or perhaps you could try using the Weierstrass substitution $t = \tan \frac{x}{2}$ which is quite popular and does reasonably well with trigonometric integrals, although I think the method you propose is easiest.

• You meant $t=\tan\frac{x}{2}$ – Raffaele Dec 3 '17 at 11:48
• @Raffaele Yes, fixed it thanks. – Luke Collins Dec 3 '17 at 13:08

$t=\tan\dfrac{x}{2}\to x=2\arctan t;\;dx=\dfrac{2dt}{1+t^2}$

We have the following formulas

$$\sin x=\frac{2t}{1+t^2};\;\cos x=\frac{1-t^2}{1+t^2};\;\tan x=\frac{2t}{1-t^2}$$

Substituting, $\tan\frac{\pi}{8}=\sqrt 2-1$

$$\int_0^{\pi /4} \frac{e^{\sec x}(1+\tan x)}{1-\sin x} dx=\int_0^{\sqrt{2}-1} \,\frac{e^{\frac{1+t^2}{1-t^2}}\left(1+\frac{2t}{1-t^2}\right)}{1-\frac{2t}{1+t^2}}\cdot \frac{2t}{1+t^2}$$

$$\int_0^{\sqrt{2}-1} \,\frac{2 e^{\frac{t^2+1}{1-t^2}} \left(t^2-2 t-1\right)}{(t-1)^3 (t+1)}\,dt=\left[-\frac{e^{\frac{t^2+1}{1-t^2}} (t+1)}{t-1}\right]_0^{\sqrt{2}-1} =e^{\sqrt{2}} \left(\sqrt{2}+1\right)-e$$

Hope this can be useful

• I think the end result should be doubled. In the final line you have lost the factor of 2 from your integral. – James Arathoon Dec 3 '17 at 12:14
• @JamesArathoon Thank you! I fixed it – Raffaele Dec 3 '17 at 15:05

For the easy route hinted at by the OP, I think you have to first notice that

$$\frac{d\left( e^{\sec x}\right)}{dx}=e^{\sec x}\sec x \tan x$$

Then via integration by parts we find that

$$\int e^{\sec x} \sec^2 x \tan x \;dx= e^{\sec x} \sec x - \int e^{\sec x} \sec x \tan x \;dx\tag{1}$$

and similarly after that

$$\int e^{\sec x} \sec x \tan^2 x \; dx= e^{\sec x} \tan x - \int e^{\sec x} \sec^2 x \; dx \tag{2}$$

Since the required integral is the sum of the four integrals in (1) and (2)

$$\int_0^{\pi /4} \frac{e^{\sec x}(1+\tan x)}{1-\sin x} \;dx = \int_0^{\pi /4} e^{\sec x} \sec^2 x \tan x + e^{\sec x} \sec x \tan x + e^{\sec x} \sec x \tan^2 x + e^{\sec x} \sec^2 x \;dx$$

we immediately have

$$\int_0^{\pi /4} \frac{e^{\sec x}(1+\tan x)}{1-\sin x} dx = \left[e^{\sec x}(\sec x + \tan x) \right]_0^{\pi/4}$$