I'm not much into Physics now (no practice) but it is all given in your question.

P = IV -(I^2)R

P = I(24) -(I^2)(1.5)

P = 24I -1.5I^2

If you know derivatives,

dP/dI = 24 -3I

For maximum P, dP/dI = 0

0 = 24 -3I

3I = 24

I = 24/3 = 8 amperes ----------------answer.

If you are not into derivatives yet, use Analytic Geometry, or the properties of a parabola.

y = ax^2 +bx +c

at vertex, x = -b/2a

P = -1.5I^2 +24I +0 ---------(i)

at vertex, I = -24 / 2(-1.5) = -24 / -3 = 8 amperes

Since the parabola (i) has a negative coefficient for its I^2, then the parabola opens downward, so its vertex is for maximum P.

Therefore, I = 8 amperes for maximum P. ------answer.