what is wrong with the transmission on 1997 Pontiac Grand Prix GTP

the car intermittently has a hard time shifting into gear and it feels as if the transmission is slipping. I can drive to work for 40 minutes and it will be fine, then on the way home it may start having a hard time shifting into gear and sometimes the speedometer wont work. What could this be??

Sounds like the apply piston seals in the transmission are worn. This is why the trans slips when cold. After it warms up the seals swell a little and become more flexible allowing it to shift. There is a product that might help your situation. Lucas transmission treatment (conditioner) You can find it at your local auto parts store. After putting it in it may
take 50 miles or so to work. This may or may not help but it worth a try.