## Step 1: Define the symbolic representation of the problem
Let's denote the amount invested in the action movie as $x_1$ and the amount invested in the animation movie as $x_2$. The objective is to maximize earnings, which can be represented as $0.09x_1 + 0.06x_2$. The constraints are:
- $x_1 + x_2 \leq 500000$ (total investment not exceeding $500000)
- $x_2 \geq 3x_1$ (at least three times as much money invested in the animation movie than in the action movie)
- $x_2 \leq 400000$ (amount invested in the animation movie can be at most $400000)
- $x_1 \geq 0$ and $x_2 \geq 0$ (non-negativity constraints)

## 2: Convert the problem into a symbolic representation
The symbolic representation can be summarized as:
```json
{
'sym_variables': [('x1', 'action movie investment'), ('x2', 'animation movie investment')],
'objective_function': '0.09*x1 + 0.06*x2',
'constraints': [
    'x1 + x2 <= 500000',
    'x2 >= 3*x1',
    'x2 <= 400000',
    'x1 >= 0',
    'x2 >= 0'
]
}
```

## 3: Translate the symbolic representation into Gurobi code
Now, let's translate this into Gurobi code in Python:

```python
import gurobi

def solve_movie_investment_problem():
    # Create a new model
    model = gurobi.Model()

    # Define variables
    x1 = model.addVar(name="action_movie_investment", lb=0)
    x2 = model.addVar(name="animation_movie_investment", lb=0)

    # Objective function: maximize 0.09*x1 + 0.06*x2
    model.setObjective(0.09 * x1 + 0.06 * x2, gurobi.GRB.MAXIMIZE)

    # Constraints
    model.addConstr(x1 + x2 <= 500000, name="total_investment")
    model.addConstr(x2 >= 3 * x1, name="animation_vs_action")
    model.addConstr(x2 <= 400000, name="animation_limit")

    # Solve the model
    model.optimize()

    # Print the solution
    if model.status == gurobi.GRB.OPTIMAL:
        print(f"Optimal investment in action movie: ${x1.varValue:.2f}")
        print(f"Optimal investment in animation movie: ${x2.varValue:.2f}")
        print(f"Maximized earnings: ${0.09 * x1.varValue + 0.06 * x2.varValue:.2f}")
    else:
        print("The model is infeasible.")

solve_movie_investment_problem()
```