**Answer:**

**The amount invested in funds that earned 12% profit is 31000 **

**The amount invested in stock that suffered 5% loss is 6,000.**

**Step-by-step explanation:**

Let x be the amount invested in funds that earned 12%.

Then the amount invested in stock that suffered 5% loss is 37000 - x.

The profit from investment in funds is = 12% of x

= 0.12·x

The loss from investment in stock is = 5% of (37000 - x)

= 0.05 × (37000 - x)

The net profit is 0.12·x - 0.05 × (37000 - x)

As the net profit given in the problem is $3420, we have :

0.12·x - 0.05 × (37000 - x) = 3420

Solving for x, we have :

12·x - 5 × (37000 - x) = 342000 (multiply both sides by 100)

12·x - 185000 + 5·x = 342000

17·x = 527000

**⇒ x = 31000**

**Hence, The amount invested in funds that earned 12% profit is 31000 and the amount invested in stock that suffered 5% loss is 37000 - x = 37000 - 31000 = 6,000.**