26

I ran across these two notations for the log function (squared), which one is more conventional.

$\log^2(n)$ or $[\log(n)]^2$

1 Answers1

24

Most people will use $\log^2(n)$ and there is no problem with that. If you want to be absolutely certain no one will think you are talking about $\log\log n$, then you can write $\bigl(\log(n)\bigr)^2$

Gerry Myerson
  • 179,216
  • When there is only one variable in the argument, it is common to write $\log^2n$. – Austin Mohr Mar 26 '12 at 00:22
  • How about for $ln$ (natural log), do most people use $ln^2(x)$ as well? – Roronoa Zoro Mar 26 '12 at 00:26
  • 11
    Grownups use $\log$ for the natural log. If you want to be absolutely certain that no one will think you are talking about common logartihms, you can use $\ln$. If for some reason you want to talk about common logs and you want to be certain no one will misunderstand, you can write $\log_{10}$. – Gerry Myerson Mar 26 '12 at 00:48
  • 17
    @GerryMyerson "Grownups use log for the natural log."

    I believe most mathematicians is a more appropriate noun.

    – 000 Mar 26 '12 at 00:54
  • Wow, using $\log^2(n)$ to stand for $(\log n)^2$ seems terrible. It looks like function iteration, i.e. $\log \log n$. How do people know what they are talking about? Context? – Ray Toal Jan 22 '14 at 04:48
  • @Ray, yes, context. But I think it's a bit unusual to use $\log^2n$ for $\log\log n$. – Gerry Myerson Jan 22 '14 at 18:48
  • 2
    Interesting, and thank you. That bothers me no end, though. It bothered Babbage, too, from what I understand, at least if one believes what Wikipedians have written about Abuse of Notation. – Ray Toal Jan 22 '14 at 23:47
  • 2
    There's a lot of notation inconsistencies. $f^2 (n)$ usually means $f(f(n))$ not $f(n)^2$, yet $\sin^2 x$ means $(\sin x)^2$. IMO it boils down to the fact that $\log \log x$ is not very commonly used, and $\sin \sin x$ (as far as I know) makes no sense to ever use since $\sin x$ puts in an angle and gives you a ratio, so you would be giving a ratio to be interpreted as an angle to give a ratio. – MT_ Jan 26 '14 at 16:30
  • Well, the antiderivative of (sin x + 1), a perfectly legitimate function, I may add, is (cos x + x), which does the same sort of ratio / angle mixing... I personally find the abuse of notation annoying for even trig functions. – k_g Jul 17 '14 at 23:39
  • 5
    @MichaelT, "$\log\log x$ is not very commonly used" --- this will come as news to fans of Analytic Number Theory, who have grown accustomed to that and $\log\log\log x$, and even $\log\log\log\log x$. – Gerry Myerson Jul 17 '14 at 23:51
  • is log log n same as log^2 n? Can log^2 n be simplified further? – Mayank Jan 31 '17 at 19:35
  • @May, $\log\log n$ is certainly not the same as $(\log n)^2$ – just plug in any value of $n$, and see for yourself – and $(\log n)^2$ is pretty simple already. – Gerry Myerson Jan 31 '17 at 22:25
  • @GerryMyerson vast majority of computer scientists consider $\log$ to be log base 2 – Quantum Guy 123 Jun 30 '22 at 17:35
  • @QuantumGuy123 well, computer scientists use logs mostly inside the O-notation, and there the base is kind of irrelevant – trolley813 Mar 23 '24 at 23:15