Amplifying Sinusoid From Microcontroller to ~40V 3-5A
The opamp or any linear solution will dissipate a lot of power. Also look at the graphs to see how close the output can get to Vcc. Here is an example calculation with the LM675 assuming a constant resistive load. You need to keep the case temperature near ambient to get the most power out. Something like 4 x 4 inches with lots of fins and a fan.