Question 4796
It's often helpful to draw yourself a diagram that graphically depicts the situation to be solved.

I don't know how to draw diagrams with this system but you can readily see that your picture would show a smaller rectangle centered inside of a larger rectangle. The smaller rectangle represents the area (40 cm^2) covered by the printed matter while the larger rectangle represents the page whose dimensions are 12 cm X 18 cm.

Let the width of the uniform margin be x cm.

Now you can set up your equation for finding x:

We'll need to write the equation for the area of the smaller rectangle in terms of x, the width of the margin.

The width othe smaller rectangle can be written:  W = 12-2x and the length can be written: L = 18-2x

The area. A = L*W = (18-2x)(12-2x) = 40 cm^2

So as not to take all the fun out of this for you, I'll let you work this out yourself: 

(18-2x)(12-2x) = 40 

Hint: You will get a quadratic equation that looks like this: 4x^2-60x+176 = 0

You need to solve this for x and when you do, you will find that there are two values of x (no surprise here since solutions to quadratic equations yield two roots).

What needs to be determined is...which value of x is the solution to the problem?  Both values are positive!  But only one of the values makes any physical sense in this problem. 

Try this.  If you run into insurmountable difficulties, post another question.