## Step 1: Define the symbolic representation of the variables
The variables are ['hours worked by Peggy', 'hours worked by Ringo', 'hours worked by Paul', 'hours worked by John'] which can be represented symbolically as $x_1, x_2, x_3, x_4$ respectively.

## Step 2: Convert the objective function into a symbolic representation
The objective function to minimize is $8.42x_1^2 + 7.34x_1x_2 + 8.88x_1x_3 + 4.77x_1x_4 + 4.14x_2^2 + 5.67x_2x_3 + 5.93x_2x_4 + 4.4x_3^2 + 3.85x_3x_4 + 1.71x_4^2 + 5.22x_2 + 8.13x_3 + 2.91x_4$.

## 3: Define the constraints in symbolic notation
The constraints are:
1. $12x_1 \leq 122$
2. $6x_2 \leq 122$
3. $5x_3 \leq 122$
4. $7x_4 \leq 122$
5. $5x_3 + 7x_4 \geq 12$
6. $12x_1 + 5x_3 \geq 23$
7. $6x_2^2 + 5x_3^2 + 7x_4^2 \geq 23$
8. $12x_1 + 6x_2 + 5x_3 + 7x_4 \geq 23$
9. $-4x_2^2 + 4x_4^2 \geq 0$
10. $4x_1^2 - 5x_3^2 \geq 0$
11. $12x_1 + 6x_2 + 7x_4 \leq 60$
12. $12x_1 + 5x_3 + 7x_4 \leq 34$
13. $12x_1 + 6x_2 + 5x_3 \leq 113$
14. $x_1$ is an integer
15. $x_3$ is an integer

## 4: Create a symbolic representation of the problem
```json
{
'sym_variables': [
    ('x1', 'hours worked by Peggy'),
    ('x2', 'hours worked by Ringo'),
    ('x3', 'hours worked by Paul'),
    ('x4', 'hours worked by John')
],
'objective_function': '8.42*x1^2 + 7.34*x1*x2 + 8.88*x1*x3 + 4.77*x1*x4 + 4.14*x2^2 + 5.67*x2*x3 + 5.93*x2*x4 + 4.4*x3^2 + 3.85*x3*x4 + 1.71*x4^2 + 5.22*x2 + 8.13*x3 + 2.91*x4',
'constraints': [
    '12*x1 <= 122',
    '6*x2 <= 122',
    '5*x3 <= 122',
    '7*x4 <= 122',
    '5*x3 + 7*x4 >= 12',
    '12*x1 + 5*x3 >= 23',
    '6*x2^2 + 5*x3^2 + 7*x4^2 >= 23',
    '12*x1 + 6*x2 + 5*x3 + 7*x4 >= 23',
    '-4*x2^2 + 4*x4^2 >= 0',
    '4*x1^2 - 5*x3^2 >= 0',
    '12*x1 + 6*x2 + 7*x4 <= 60',
    '12*x1 + 5*x3 + 7*x4 <= 34',
    '12*x1 + 6*x2 + 5*x3 <= 113'
]
}
```

## 5: Write the Gurobi code for the optimization problem
```python
import gurobi

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

    # Define the variables
    x1 = model.addVar(name='hours_worked_by_Peggy', vtype=gurobi.GRB.INTEGER, lb=0)
    x2 = model.addVar(name='hours_worked_by_Ringo', vtype=gurobi.GRB.CONTINUOUS, lb=0)
    x3 = model.addVar(name='hours_worked_by_Paul', vtype=gurobi.GRB.INTEGER, lb=0)
    x4 = model.addVar(name='hours_worked_by_John', vtype=gurobi.GRB.CONTINUOUS, lb=0)

    # Define the objective function
    model.setObjective(8.42*x1**2 + 7.34*x1*x2 + 8.88*x1*x3 + 4.77*x1*x4 + 
                       4.14*x2**2 + 5.67*x2*x3 + 5.93*x2*x4 + 
                       4.4*x3**2 + 3.85*x3*x4 + 1.71*x4**2 + 
                       5.22*x2 + 8.13*x3 + 2.91*x4, gurobi.GRB.MINIMIZE)

    # Add constraints
    model.addConstr(12*x1 <= 122)
    model.addConstr(6*x2 <= 122)
    model.addConstr(5*x3 <= 122)
    model.addConstr(7*x4 <= 122)
    model.addConstr(5*x3 + 7*x4 >= 12)
    model.addConstr(12*x1 + 5*x3 >= 23)
    model.addConstr(6*x2**2 + 5*x3**2 + 7*x4**2 >= 23)
    model.addConstr(12*x1 + 6*x2 + 5*x3 + 7*x4 >= 23)
    model.addConstr(-4*x2**2 + 4*x4**2 >= 0)
    model.addConstr(4*x1**2 - 5*x3**2 >= 0)
    model.addConstr(12*x1 + 6*x2 + 7*x4 <= 60)
    model.addConstr(12*x1 + 5*x3 + 7*x4 <= 34)
    model.addConstr(12*x1 + 6*x2 + 5*x3 <= 113)

    # Optimize the model
    model.optimize()

    # Print the solution
    if model.status == gurobi.GRB.OPTIMAL:
        print('Objective: ', model.objVal)
        print('Hours worked by Peggy: ', x1.varValue)
        print('Hours worked by Ringo: ', x2.varValue)
        print('Hours worked by Paul: ', x3.varValue)
        print('Hours worked by John: ', x4.varValue)
    else:
        print('No optimal solution found')

optimize_problem()
```