14

Are the following functions equal or one is the restriction of the other?

$f(x) = \ln(x^2)$

$g(x) = 2\ln(x)$

My book says that $g(x)$ is the restriction of $f(x)$ to $\mathbb{R^+}$ and I can verify that on my calculator.

But that doesn't make any sense to me. Shouldn't $2\ln(x) = \ln(x^2)$ ? Or is it because my calculator does $\ln(x)$ first, and then multiplies the result by 2, and so $x$ cannot take a negative value?

Does that mean that these functions are analitically equal but diferent in practice? Or does this happen just because this is the way my calculator is programmed?

Can someone explain this to me?

Mark Read
  • 2,183

3 Answers3

12

The function $f(x)$ has as domain $x\ne0$, $g(x)$ has $x>0$ as domain so they are different. In fact $\ln(-4)^2$ exists for the first function, not for the second one $2\ln(-4)=???$. You can transform the first function in $2\ln|x|$, but you must pay attention to put the absolute value so that the domain remains the same!

MattG88
  • 2,534
  • 2
  • 13
  • 15
  • 1
    But when $2\ln(x)$ becomes $\ln(x^2)$ its domain changes, so in this case you know the domain without modifying the function. However, what if you have a more complex function which you have to simplify in order to get the domain analitically, rather than using a calculator? What if the simplification changes the domain? Does that mean it is impossible to take the domain of that function analitically? – Mark Read Nov 21 '16 at 02:25
  • Ah. I understand now – Mark Read Nov 21 '16 at 02:28
  • Great!! Good job;-) – MattG88 Nov 21 '16 at 02:31
7

$\ln x^2 = 2 \ln \vert x \vert$

The logarithm of a negative number requires delving into the land of complex numbers. See here.

It turns out that $2\operatorname{Log}(-5) = 2\ln 5 +\pi i$ for the so-called principal branch of the complex logarithm, which is a good thing to Google if you're interested.

GFauxPas
  • 5,047
2

$\ln(x)$ domain is $\mathbb{R}^+$, so any function used as its argument must not have a range that exceeds $\mathbb{R}^+$. $x^2$'s range $\mathbb{R}^+$, whereas $x$'s range is $\mathbb{R}$.

adjan
  • 5,741