To solve the optimization problem described, we first need to translate the natural language description into a symbolic representation. This involves defining variables and formulating the objective function and constraints algebraically.

Let's define:
- $x_1$ as the amount invested in the son's company.
- $x_2$ as the amount invested in the friend's company.

The objective is to maximize earnings, given that the investments earn 8% in the son's company and 10% in the friend's company. Thus, the objective function can be represented as:
\[ \text{Maximize: } 0.08x_1 + 0.10x_2 \]

The constraints are:
1. The total amount invested is $50,000: \( x_1 + x_2 = 50000 \)
2. The amount invested in the son's company must be at least three times as much as the amount invested in the friend's company: \( x_1 \geq 3x_2 \)
3. At most $40,000 can be invested in the son's company: \( x_1 \leq 40000 \)
4. Non-negativity constraints since investments cannot be negative: \( x_1 \geq 0, x_2 \geq 0 \)

In symbolic representation with natural language objects:
```json
{
  'sym_variables': [('x1', 'amount invested in son\'s company'), ('x2', 'amount invested in friend\'s company')],
  'objective_function': '0.08*x1 + 0.10*x2',
  'constraints': ['x1 + x2 = 50000', 'x1 >= 3*x2', 'x1 <= 40000', 'x1 >= 0', 'x2 >= 0']
}
```

Now, let's implement this problem using Gurobi in Python:

```python
from gurobipy import *

# Create a new model
m = Model("Investment_Optimization")

# Define variables
x1 = m.addVar(lb=0, name="son_company")
x2 = m.addVar(lb=0, name="friend_company")

# Set the objective function
m.setObjective(0.08*x1 + 0.10*x2, GRB.MAXIMIZE)

# Add constraints
m.addConstr(x1 + x2 == 50000, "total_investment")
m.addConstr(x1 >= 3*x2, "son_vs_friend")
m.addConstr(x1 <= 40000, "max_son_investment")

# Optimize the model
m.optimize()

# Print results
if m.status == GRB.OPTIMAL:
    print("Optimal solution found:")
    print(f"Amount invested in son's company: {x1.x}")
    print(f"Amount invested in friend's company: {x2.x}")
    print(f"Total earnings: {m.objVal}")
else:
    print("No optimal solution found")
```