Answer :

The easiest way is to arrange the eighteen matches as in Diagrams 1 and 2, making the length of the perpendicular AB equal to a match and a half. 
Then, if the matches are an inch in length, Fig. 1 contains two square inches and Fig. 2 contains six square inches—4 × 1½. 

The second case (2) is a little more difficult to solve. 
The solution is given in Figs. 3 and 4. For the purpose of construction, place matches temporarily on the dotted lines. 
Then it will be seen that as 3 contains five equal equilateral triangles and 4 contains fifteen similar triangles, one figure is three times as large as the other, and exactly eighteen matches are used.

Math Genius