Answer
The maximum value of the power is
$$\frac{E^{2}}{4 r}$$
and this occurs when $R=r $.
Work Step by Step
Let the power (in watts) in the external resistor is
$$
P(R)=\frac{E^{2} R}{(R+r)^{2}}
$$
$\Rightarrow$
$$
\begin{aligned} P^{\prime}(R) &=\frac{(R+r)^{2} \cdot E^{2}-E^{2} R \cdot 2(R+r)}{\left[(R+r)^{2}\right]^{2}} \\
&=\frac{\left(R^{2}+2 R r+r^{2}\right) E^{2}-2 E^{2} R^{2}-2 E^{2} R r}{(R+r)^{4}} \\
&=\frac{E^{2} r^{2}-E^{2} R^{2}}{(R+r)^{4}} \\
&=\frac{E^{2}\left(r^{2}-R^{2}\right)}{(R+r)^{4}} \\
&=\frac{E^{2}(r+R)(r-R)}{(R+r)^{4}} \\
&=\frac{E^{2}(r-R)}{(R+r)^{3}} \end{aligned}
$$
To determine the critical numbers of $P(R) $set $P^{\prime }(R) $ equal to zero
$$
P^{\prime}(R)=0 \Rightarrow R=r
$$
$$
\Rightarrow P(r)=\frac{E^{2} r}{(r+r)^{2}}=\frac{E^{2} r}{4 r^{2}}=\frac{E^{2}}{4 r}
$$
$$
\begin{array}{|c|c|c|}\hline \text { Interval } & {R \lt r} & {R=r} & {R\gt r} \\ \hline \text { Sign of } P^{\prime}(R) & {P^{\prime}(R) >0} & {P^{\prime}(R)
=0} & {P^{\prime}(R) \lt 0} \\ \hline \text { Conclusion } & {\text { Increasing }} & {\text { critical }} & {\text { Decreasing }} \\ \hline\end{array}
$$
Thus, the maximum value of the power is $\frac{E^{2}}{4 r}$
and this occurs when $R=r $.