All excellent suggestions above. Penetrating oil or Ed's Red is the first step in every case.
In addition, I've:
>attached the frozen shaft between two trees. Chain on one end, Come-A-Long on the other. Put some tension on and bang on the shaft with a hammer. It is tough to do if the plastic safety cover is on it.
>attached the shaft to the tractor and a tree and drove away slowly. Warning: possible damage.
But whatever you do to get it apart, the best follow-up is to store the PTO shaft in two pieces. It NEVER gets stuck that way. Remember that the shaft only goes back together one way so mark one face of the shaft ends with paint so you just have to line up the paint on both pieces. Before the paint idea, it seemed that the last try to line up the shaft was the only one that finally worked.
Also, I hose down the shaft with WD-40 when putting it back together. Grease seems too heavy and can dry and stiffen over time. Oil is OK but can get gummy while seeming to absorb dirt. Bottom line: lube it with something handy.