In this electrical engineering tutorial, I derive the maximum power transfer equation for a circuit. Using the Thevenin circuit model, the equation for the maximum power can be found by optimizing the power equation for the load resistor.
For more on how to find the Thevenin equivalent circuit: https://youtu.be/Zy6n3ZOfwsw