# Why isn't the graph of $\ln(\tan(x^2))$ same as that of $2\ln(\tan(x))$, when they should be according to the power rule?

Recently, I was trying to graph the function $\ln(\tan(x^2))$ without derivatives or any calculator whatsoever. To get the answer, I used the graphing software Desmos, and was playing around when I saw that the graphs of $\ln(\tan(x^2))$ and $2\ln(\tan(x))$ are not the same. This goes against what I learned in high school, of the power rule property of $\ln$ and $\log$. Maybe it's a stupid question, I feel it is, but I can't see why and it is gnawing at me. Please explain. This is my first post, sorry if it's not properly formatted.

Note that $\tan(x^2) \neq (\tan x)^2$, and so $$\ln((\tan x)^2) =2\ln(\tan x)$$ but $$\ln(\tan (x^2)) \neq 2\ln(\tan x)$$

Edit: As noted in the other answer, you have to check the domain. Here's what I got when I tried Desmos: (they overlap when $x\in (0,\pi/2)$ mod $\pi$)

• Thanks for responding! I entered that into Desmos and once again, the graphs did not turn out the same. – cgug123 Sep 24 '16 at 16:26
• @cgug123 What did you plug in Desmos? wolframalpha.com/input/… – trang1618 Sep 24 '16 at 16:30
• @cgug123 you have to be careful with the domain as well. – trang1618 Sep 24 '16 at 16:37
• I put 2ln(tanx) and ln((tanx)^2). Sorry I don't know how to format it properly on a computer. – cgug123 Sep 24 '16 at 16:46
• The wolframalpha link I gave in the above comment show you the three curves, where two of them overlap. – trang1618 Sep 24 '16 at 16:50

It's because the identity $\log x^n = n \log x$ holds only for $x > 0$.

Thus, here we must have $\tan x > 0$, or $x \in (0, \frac \pi 2) \mod \pi$