The formula for finding the height of an octagon from only one side is h=s(1 + the square root of 2). S is the length of one side. Your formula would be h=18(1 + the square root of 2). h=18+18(the square root of 2)
h=18 + 25.4558
h=43.4558
Hope this helps!! :) And the decimal is rounded, just so you know ;). If your teacher likes everything in simplest radical form, then just don't convert the 18*the square root of 2 into a decimal and solve as you normally would.
X is just an unknown variable which can be substituted as another variating condition. I.E Function of x can be written as Function of a. If no other condition is present.