# What exactly does $g^2(x)$ mean

I know there's (kind of?) some controversy as to what $g^2(x)$ means — it could be $g(g(x))$, or $(g(x))^2$ or even $g''(x)$. I'm taking a calculus course and assumed that $g^2(x)$ meant $g''(x)$, but it turns out that the solution saw this as $(g(x))^2$.

Here's the problem if it will clarify things:

If $P(x) = g^2(x)$, then $P'(x)$ equals...

(of course, there's a table given with values of g and g' accompanying the problem and answer choices, but I'm not including them here because of copyright.)

So in general, is there any way I can determine which one exactly the problem means when $g^2(x)$ appears?

• If the problem is referring to the $n$th derivative of a function, usually it is denoted as $g^{(n)}(x)$. – JBL Apr 24 '18 at 17:15
• Usually when I refer to the $n$th derivative with a superscript, I enclose it in parentheses. I.e., $g^{\prime\prime}(x) = g^{(2)}(x)$. – Clarinetist Apr 24 '18 at 17:15
• Well, in my opinion that's based on context. If the end of that sentence is $g^3(x)$, then I guess you know what is being spoken about. Generally, in my experience, for the derivative, we usually use a bracket around 2 for derivatives i.e. $g''(x) = g^{(2)}(x)$ – Naweed G. Seldon Apr 24 '18 at 17:16
• I think it's a good bet that $g^2(x)$ will always mean $g(x)^2$ in your calculus course. I have never seen it used to mean the second derivative, as others have already noted. – saulspatz Apr 24 '18 at 17:16
• ...$2g(x)g'(x)$ – Rudi_Birnbaum Apr 24 '18 at 17:24

If it means $g''(x)$, you should write $$g^{(2)}(x)$$

If it is $g(x).g (x)$, you will write $$(g(x))^2$$

so $g^2 (x)$ means $$g (g (x))$$

• However, with functions $g^2(x)$ often also means $(g(x))^2$. Think of $\sin$. $\sin^2(x)$ almost always means $(\sin(x))^2$. – johnnyb Apr 24 '18 at 21:06

It usually depends on the circumstance the problem is situated in.

For example, if you're doing calculus, it's probably good notation to avoid using $g^2$ to denote the 2nd derivative and simply use $g''$ as this avoids confusion. If you're doing something like linear algebra, the notation $T^n$ would probably mean matrix multiplication, i.e., $T^n = T\circ T\circ \cdots \circ T$.

For me, I usually use the following convention:

• $g(x)^2$ to denote square of $g(x)$
• $g^2(x)$ to denote $g\circ g$
• $g^{(2)}(x)$ to denote the 2nd derivative

Of course, there are probably special cases in which I may abuse notation just for sake of simplicity (e.g $\cos^2(x)$ is the square of $\cos$), but I think it's good practice to keep your notation uniform throughout your notes and textbooks. I would believe that most authors abide by this rule and would at least mention it in their text if they're changing notation.