This post goes over the math required to show the difference between surplus and equilibrium in a perfectly competitive and monopolistically competitive market. Note that a monopolistically competitive market's math and graph will be the same for a monopoly or an oligopoly. Here are the equations to work with:

P = 40 - 8Q

MC = 8

To find equilibrium Q and P for the PC market we set MC=P
and solve for Q so:

8=40-8Q, add 8Q and subtract 8 from both sides to get:

8Q=32 or Q = 4

If Q equals 4, P = 8 (but we knew that already from MC)

To find equilibrium Q and P for the monopolistically
competitive market we need to double the slope of the inverse demand function
to get the marginal revenue function:

MR = 40 – 16Q

Set this equal to our MC to get:

40-16Q = 8 and add 16Q and subtract 8 from both sides to
get:

32 = 16Q, or Q = 2

With an equilibrium Q of two, we get a consumer price of 24
(by plugging 2 into our original inverse demand equation).

To find consumer surplus for the PC market, we take the
height of the triangle (40 – 8) times the base of the triangle (4) and then
divide by two. This gives us:

½(32*4) = 64

In this set up there is no producer surplus because marginal
cost is constant at 8, there is no difference between the price received and
the cost of production so unfortunately the producer gets no profit or surplus.

The consumer surplus for the monopolistically competitive
market can be found by taking the height of the triangle (40 – 24) times the
base of the triangle (2) and then divide by two to get:

½(16*2) = 16

So the consumer surplus in the MC market is substantially
less (in fact, it is 64-16= 48 less)

However, the producer surplus increases in the MC market
because the price charged is now higher than the marginal cost. To get the producer surplus we need to
multiply the height of the rectangle (24-8) by the base (2) to get:

16*2 =32.

The deadweight loss can be found by taking the total surplus
from PC and subtracting the total surplus from MC. This gives us:

64 – 16 – 32 = 16

So the deadweight loss that occurs from changing from a
perfectly competitive market to a monopolistically competitive market (without
given equations) is 32.

We can confirm this by calculating the area of the triangle
between the quantities and prices in the MC and the PC market:

½(2*16) = 16, so we know we did it right.

This can be seen in the graph below: