Try to rewrite the equation;
You know that 5 can be written as log3(3^5)
log3(3^5)=log3(x^2+18) <-- you can now cancel out log3
3^5=x^2+18
243-18=x^2
225=x^2
√225=x
+-15=x
You see that even if x is negative, the squared will always give a positive answer. Therefore, +15 and -15 are both possible answers.
Hope I helped :)