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

Let's define:
- \(x_1\) as the amount invested in Bob's farm.
- \(x_2\) as the amount invested in Joe's farm.

The objective is to maximize earnings, which can be calculated as the sum of 8% of the investment in Bob's farm and 6% of the investment in Joe's farm. Thus, the objective function can be represented algebraically as:
\[0.08x_1 + 0.06x_2\]

The constraints based on the problem description are:
1. The total amount invested cannot exceed $50,000: \(x_1 + x_2 \leq 50000\)
2. At least three times as much money should be invested in Bob's farm as in Joe's farm: \(x_1 \geq 3x_2\)
3. The amount invested in Bob's farm cannot exceed $40,000: \(x_1 \leq 40000\)
4. Investments cannot be negative: \(x_1 \geq 0\) and \(x_2 \geq 0\)

Thus, the symbolic representation of the problem is:
```json
{
    'sym_variables': [('x1', 'amount invested in Bob\'s farm'), ('x2', 'amount invested in Joe\'s farm')],
    'objective_function': '0.08*x1 + 0.06*x2',
    'constraints': ['x1 + x2 <= 50000', 'x1 >= 3*x2', 'x1 <= 40000', 'x1 >= 0', 'x2 >= 0']
}
```

To solve this problem using Gurobi in Python, we can use the following code:

```python
from gurobipy import *

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

# Define variables
x1 = m.addVar(vtype=GRB.CONTINUOUS, name="Bob_Farm", lb=0)
x2 = m.addVar(vtype=GRB.CONTINUOUS, name="Joe_Farm", lb=0)

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

# Add constraints
m.addConstr(x1 + x2 <= 50000, "Total_Investment")
m.addConstr(x1 >= 3*x2, "Bob_VS_Joe")
m.addConstr(x1 <= 40000, "Max_Bob")

# Optimize the model
m.optimize()

# Print the results
if m.status == GRB.OPTIMAL:
    print("Optimal solution found:")
    print(f"Amount to invest in Bob's farm: ${x1.x:.2f}")
    print(f"Amount to invest in Joe's farm: ${x2.x:.2f}")
    print(f"Total earnings: ${(0.08*x1.x + 0.06*x2.x):.2f}")
else:
    print("No optimal solution found.")
```