## Step 1: Define the symbolic representation of the problem

Let's denote the amount invested in the rapper as $x_1$ and the amount invested in the pop artist as $x_2$. The objective is to maximize the earnings, which can be represented as $0.05x_1 + 0.03x_2$.

## Step 2: Identify the constraints

The constraints given are:
1. The total amount invested is at most $400,000: $x_1 + x_2 \leq 400,000$.
2. The amount invested in the pop artist is at most $250,000: $x_2 \leq 250,000$.
3. The amount invested in the pop artist is at least three times the amount invested in the rapper: $x_2 \geq 3x_1$.
4. Non-negativity constraints: $x_1 \geq 0$ and $x_2 \geq 0$.

## 3: Symbolic representation in JSON format

```json
{
    'sym_variables': [('x1', 'amount invested in the rapper'), ('x2', 'amount invested in the pop artist')],
    'objective_function': '0.05*x1 + 0.03*x2',
    'constraints': [
        'x1 + x2 <= 400000',
        'x2 <= 250000',
        'x2 >= 3*x1',
        'x1 >= 0',
        'x2 >= 0'
    ]
}
```

## 4: Convert the problem into Gurobi code

```python
import gurobipy as gp

# Create a new model
model = gp.Model("Investment_Problem")

# Define the variables
x1 = model.addVar(name="rapper_investment", lb=0)  # Amount invested in the rapper
x2 = model.addVar(name="pop_artist_investment", lb=0)  # Amount invested in the pop artist

# Objective function: maximize earnings
model.setObjective(0.05 * x1 + 0.03 * x2, gp.GRB.MAXIMIZE)

# Constraints
model.addConstr(x1 + x2 <= 400000, name="total_investment")
model.addConstr(x2 <= 250000, name="pop_artist_limit")
model.addConstr(x2 >= 3 * x1, name="pop_artist_to_rapper_ratio")

# Solve the model
model.optimize()

# Print the solution
if model.status == gp.GRB.OPTIMAL:
    print(f"Optimal investment in rapper: ${x1.varValue:.2f}")
    print(f"Optimal investment in pop artist: ${x2.varValue:.2f}")
    print(f"Max earnings: ${0.05 * x1.varValue + 0.03 * x2.varValue:.2f}")
else:
    print("The model is infeasible.")
```