# Why do I get an incorrect graph when I plot a function with multiplication expressed by parentheses?

When plotting certain expressions with pgfplots it seems to give the wrong result. Consider the following

\documentclass{article}

\usepackage{pgfplots}

\pgfplotsset{
compat=1.7,
no marks
}

\begin{document}

\begin{tikzpicture}
\begin{axis}
\end{axis}
\end{tikzpicture}

\end{document}


in which I take (x)(x) to express y=x^2. If that is the case it should produce an U-shaped curve but it does not.

-

The problem is that pgfplots does not recognize any multiplication in (x)(x). You have to express multiplication explicitly, e.g. as x * x.

\documentclass{article}

\usepackage{pgfplots}

\pgfplotsset{
compat=1.7,
no marks
}

\begin{document}

\begin{tikzpicture}
\begin{axis}
\end{axis}
\end{tikzpicture}

\end{document}


\addplot uses the math parser of PGF and in the manual it says that

Parenthesis can be used to change the order of the evaluation.

But it does not say anything about parentheses being able to invoke the multiply function (which * does).

-