Answer
$K_{max}=\frac{E^2}{E+\frac{mc^2}{2}}$ $(proved)$
Please see in step by step work.
Work Step by Step
Let $E$ is the energy of the incident photon, $E^\prime$ is the energy of the scattered photon, and $K$ is the kinetic energy of the recoiling electron.
According to conservation of energy,
$E=E^\prime+K$
or, $K=E-E^\prime$ ...................$(1)$
According to quantum theory of light,
$E=hf=\frac{ch}{\lambda}$
and $E^\prime=hf^\prime=\frac{ch}{\lambda^\prime}$
where the symbols have their usual meanings.
Now, we need to find the fractional energy loss for photons that scatter from the electrons:
$\text{frac}=\frac{\text{energy loss}}{\text{initial energy}}=\frac{E-E^\prime}{E}$
$\frac{E-E^\prime}{E}=\frac{\frac{ch}{\lambda}-\frac{ch}{\lambda^\prime}}{\frac{ch}{\lambda}}$
or, $\frac{E-E^\prime}{E}=\frac{\frac{1}{\lambda}-\frac{1}{\lambda^\prime}}{\frac{1}{\lambda}}$
or, $\frac{E-E^\prime}{E}=\frac{\lambda^\prime-\lambda}{\lambda^\prime}$
or, $\frac{E-E^\prime}{E}=\frac{\Delta\lambda}{\lambda+\Delta\lambda}$
where, $\Delta\lambda=\lambda^\prime-\lambda=\frac{h}{mc}(1-\cos\phi)$ is called the Compton wavelength. $\phi$ is the angle at which it is scattered from its initial direction of motion.
$\therefore \frac{E-E^\prime}{E}=\frac{\frac{h}{mc}(1-\cos\phi)}{\frac{ch}{E}+\frac{h}{mc}(1-\cos\phi)}$
Using eq. $1$, we can write
$\frac{K}{E}=\frac{\frac{h}{mc}(1-\cos\phi)}{\frac{ch}{E}+\frac{h}{mc}(1-\cos\phi)}$
For maximum kinetic energy ($K_{max}$), $\phi=180^{\circ}$
$\therefore \frac{K_{max}}{E}=\frac{\frac{h}{mc}(1-\cos180^{\circ})}{\frac{ch}{E}+\frac{h}{mc}(1-\cos180^{\circ})}$
or, $\frac{K_{max}}{E}=\frac{\frac{2h}{mc}}{\frac{ch}{E}+\frac{2h}{mc}}$
or, $\frac{K_{max}}{E}=\frac{\frac{2}{mc}}{\frac{mc^2+2E}{Emc}}$
or, $\frac{K_{max}}{E}=\frac{2E}{mc^2+2E}$
or, $K_{max}=\frac{E^2}{E+\frac{mc^2}{2}}$ $(proved)$