6 should also be an answer.
We are given X [a constant] and only one temporary variable to store data that are required later.
Because the purpose of temporary variables are to store information calculated using work variables for reuse later, any average programmer would interpret it as “only one temporary variable beside a work variable????”. And they would solve it like this.
(1) temp = X;
(1) temp = temp*temp; // +1 operation [$X^2$], this is stored for reuse
(2) A = temp+4; // +1 operation [$X^2+4$]
(2) A = temp*(A); // +1 operation [$X^2(X^2+4)$], and used here
(3) A = A + 6; // +1 operation [$X^2(X^2+4)+6$]
(4) A = X*(A); // +1 operation [$X(X^2(X^2+4)+6)$]
(5) A = A+5; // +1 operation [$X(X^2(X^2+4)+6)+5$]
6 arithmetic operations overall.
So in conclusion the question could have been more informative on the constraints.