Which integration of tan x is correct?

105 Views Asked by At

Integration of tan x as given by http://www.wolframalpha.com is this: enter image description here

And my teacher suggested this one:
enter image description here

Are these both right answers?

3

There are 3 best solutions below

0
On BEST ANSWER

Note that $\cos x = \frac{1}{\sec x}$, and $\ln \frac{1}{x} = -\ln x$, for $x > 0$

0
On

Let $$\displaystyle I = \int \tan xdx = \int\frac{\sin x}{\cos x}dx\;,$$ Now Put $\cos x = t\;,$ then $\sin xdx = -dt$

So $$\displaystyle I = -\int\frac{1}{t}dt = -\ln |t|+\mathcal{C} = -\ln|\cos x|+\mathcal{C} = \ln\left|\frac{1}{\cos x}\right|+\mathcal{C} = \ln|\sec x|+\mathcal{C}$$

Above we have use $$\displaystyle \bullet \; n\ln(m) = \ln(m)^{n}$$

0
On

The second one $\;\ln |\sec x|+C$ is wrong for complex variable $x$. If you do not tell Alpha differently, it assumes you want a complex variable. The two answers agree (perhaps up to a constant term) on any interval in the real line where $\tan(x)$ is defined. In that sense, they are both right.