Let n cells are connected in series, and such m series are connected in parallel. Let the emf of each cell be E and the internal resistance be r.This battery of cells is sending current in an external resistance R. Then current in the external circuit be i, then i=nr+mRmnE
It is clear from this equation, that for current to be maximum the value of (nr+mR) should be minimum.
i.e., nr+mR=[nr−mR]2+2mnRr
It's minimum value is zero.
i.e., [nr−mR]2=0 nr−mR=0 nr=mR R=mnr
but mnr is the internal resistance of the whole battery. Thus, current is maximum when the internal resistance of battery is equal to external resistance.