Let x be the number of pieces of item A and y be the number of pieces of item B.

The feasible shaded region (OABC) is shown in graph, then four points O, A, B and C are critical points. Substituting the values of these points in profit equation, we get