how to integrate tan x/(sec x+tan x)?

the complete question is to integrate x.tan x/(sec x+tan x) in the limit 0 to pi, (0 is lower limit and pi is upper limit).

Relevance
• 7 years ago

x * tan(x) * dx / (sec(x) + tan(x)) =>

x * tan(x) * (sec(x) - tan(x)) * dx / (sec(x)^2 - tan(x)^2) =>

x * (tan(x) * sec(x) - tan(x)^2) * dx / 1 =>

x * (sec(x) * tan(x) - sec(x)^2 + 1) * dx

u = x

du = dx

dv = sec(x) * tan(x) * dx - sec(x)^2 * dx + dx

v = sec(x) - tan(x) + x

int(u * dv) =>

u * v - int(v * du) =>

x * (sec(x) - tan(x) + x) - int((sec(x) - tan(x) + x) * dx) =>

x * (sec(x) - tan(x) + x) - int(sec(x) * dx) + int(tan(x) * dx) - int(x * dx) =>

x * (sec(x) - tan(x) + x) - ln|sec(x) + tan(x)| - ln|cos(x)| - (1/2) * x^2 + C =>

x * ((1 - sin(x)) / cos(x) + x) - ln|cos(x) * (sec(x) + tan(x))| - (1/2) * x^2 + C =>

x * (cos(x)^2 / (cos(x) * (1 + sin(x))) + x^2 - ln|1 + sin(x)| - (1/2) * x^2 + C =>

x * (cos(x) / (1 + sin(x)) - ln|1 + sin(x)| + (1/2) * x^2 + C

From 0 to pi

pi * (cos(pi) / (1 + sin(pi)) - 0 * (cos(0) / (1 + sin(0)) - ln|1 + sin(pi)| + ln|1 + sin(0)| + (1/2) * pi^2 - (1/2) * 0^2 =>

pi * (-1 / (1 + 0)) - 0 * (1 / (1 + 0)) - ln|1 + 0| + ln|1 + 0| + (1/2) * pi^2 =>

-pi + pi^2 / 2 =>

(1/2) * pi * (pi - 2)

You should note that your original function is not continuous along the interval. It is only through some tweaking that this result emerges