## MathSofiya 3 years ago $\int cosxsec^2xdx$ I forgot how to do this integral manually this is what wolf had to say http://www.wolframalpha.com/input/?i=integral+of+cosxsec^2x how how do I do it manually?

1. Valpey

2. bahrom7893

Oh, sorry: Cosx/Cos^2x = 1/Cosx = Secx

3. bahrom7893

Well actually you'd keep it as 1/Cox, and use integration by parts

4. MathSofiya

wait a second $\int cosx\frac 1{cos^2x}dx?$

5. Valpey

Yes.

6. bahrom7893

Sorry for the confusion.. Let's start over: Cosx*Sec^2x = Cosx/Cos^2x = 1/Cosx, since Secx = 1/Cosx

7. MathSofiya

$\int\frac 1{cosx}dx$

8. Valpey

$\int{\cos{x}*\frac{1}{1-\sin^2{x}}}\ dx$

9. bahrom7893

Well that I just had memorized, but actually i bet you don't simplify it down to 1/Cos, I was probably wrong again, you keep it as Cos/Cos^2 and then do what Valpey told you to

10. MathSofiya

why did you change it? wouldn't it make more sense to cancel one cosine out?

11. bahrom7893

No

12. Valpey

Let u = sin(x) du = cos(x)dx $\int{\frac{du}{1-u^2}}$

13. bahrom7893

Actually this would be the easiest option, imo: Cos^2(u) = (1/2)+(Cos(2u))/2

14. bahrom7893

ok let Valpey, finish this, otherwise you'll get confused.

15. MathSofiya

sure

16. MathSofiya

do I multiply the integral by $\ frac {1+u^2}{1+u^2}$

17. MathSofiya

$\frac {1+u^2}{1+u^2}$

18. experimentX

$\int \sec x dx = \log \left | \sec x + \tan x\right | = \log \left| \tan \left( {x \over 2} + {\pi \over 4}\right)\right |$ wikipedia says it's quite a problem http://en.wikipedia.org/wiki/Integral_of_the_secant_function

19. MathSofiya

makes sense, thank you!

20. Valpey

Oh, duh! My bad.$\int\frac{1}{1-u^2}du=\int\frac{1}{(1-u)(1+u)}du=\frac{1}{2}\int\frac{1+1}{(1-u)(1+u)}du$$=\frac{1}{2}\int\Big(\frac{1+u}{(1-u)(1+u)}+\frac{1-u}{(1-u)(1+u)}\Big)du$$=\frac{1}{2}\int\frac{1+u}{(1-u)(1+u)}du+\frac{1}{2}\int\frac{1-u}{(1-u)(1+u)}du=\frac{1}{2}\int\frac{1}{1-u}du+\frac{1}{2}\int\frac{1}{1+u}du$ $=\frac{1}{2}(-\log(1-u))+\frac{1}{2}(\log(1+u))$ $\frac{1}{2}\Big(\log(1+\sin x)-\log(1+\sin x)\Big)$

21. Valpey

*$\frac{1}{2}\Big(\log(1+\sin x)-\log(1-\sin x)\Big)$

22. Valpey

Oh yeah, I need absolute values. $\frac{1}{2}\Big(\log|1+\sin x|−\log|1−\sin x|\Big)$Which is also$\frac{1}{2}\log\frac{|1+\sin x|}{|1−\sin x|}$, but now I'm just cheating off Wikipedia.

23. TuringTest

@MathSofiya still want help with$\int\cos x\sec^2xdx$?

24. TuringTest

it seems that everyone here has forgotten the simple trick to this integral...

25. MathSofiya

see there had to be a simpler way

26. TuringTest

$\cos x\sec^2x=\cos x\cdot\frac1{\cos^2 x}=\frac1{\cos x}=\sec x$so$\int\cos x\sec^2 xdx=\int\sec xdx$now the great trick for this integral: multiply by${\sec x+\tan x\over\sec x+\tan x}$and watch what happens (yes I know the idea is not obvious, but once you see it try to remember it)

27. TuringTest

$\int\sec x\left({\sec x+\tan x\over\sec x+\tan x}\right)dx=\int{\sec^2x+\sec x\tan x\over\sec x+\tan x}dx$magically the top is now the derivative of the bottom:$u=\sec x+\tan x\implies du=\sec^2x+\sec x\tan xdx$$\int\frac1udu=\ln|u|+C=\ln|\sec x+\tan x|+C$

28. TuringTest

that is the standard approach for this well-known integral

29. MathSofiya

oh I see. So is it just a matter of doing many integrals and then coming to this conclusion? I wouldn't have thought of that, and yet again I haven't reviewed my integrals much.

30. MathSofiya

but yes it makes sense now I see it.

31. TuringTest

I don't think I would have thought of this had I not known this integral either, I'm sure whoever discovered this trick spent quite some time on it. Fortunately, most integral tricks are far more obvious, this is just one of the more esoteric, yet directly effective tricks. There are few integrals that require such a non-obvious algebraic manipulation, most are easier too see. That is why I say, memorize this one, it is a classic and will serve you in the future :)

32. MathSofiya

I shall memorize this integral =P (honestly I will) And as always, Thanks Turing!