The marginal revenue is given by MR = 25 - 5x - 2x^2 and marginal cost MC = 15 - 2x - x^2.

Profit is maximized when MR = MC

=> 25 - 5x - 2x^2 = 15 - 2x - x^2

=> x^2 + 3x - 10 = 0

=> x^2 + 5x - 2x - 10 = 0

=> x(x + 5) - 2(x + 5) = 0

=> (x - 2)(x + 5) = 0

=> x = 2 and x = -5

But as x cannot be negative, the root x = -5 can be eliminated.

Profit is maximized at an output of x = 2.

To find the maximum profit the value of revenue - cost at x = 2 has to be determined but this cannot be done as integration introduces a constant that cannot be determined.

**The profit is maximized at an output of 2 though the maximum profit cannot be determined.**