Ford F-150 shaking at 40 mph?

Ok so I have an 2008 Ford F-150 that starts this hard shaking if your going 40mph. The thing is, if your going below 40 or above 40 it doesn't shake. The check engine light is on and when I had it hooked up it said cylinder 5 misfire and something about oxygen. I changed the whole spark plug setup for cylinder 5 but it's still shaking and engine light on. Any ideas about what it could be? I'm so close to paying the truck off so go figure something would go wrong!

You need your alignment fixed.

As others have said, get the alignment checked, but if that checks out ok, check the wheel balance. I've had out-of-balance wheels that would only shake at certain speeds, too.

Get an alignment and make sure your Axle is ok.

At around that speed the transmission shifts into OD. It could be too 'soon' for that shift & cause the engine to run too slow & 'lug'. You should be able to turn the OD off, so turn it off & see if that helps…

You have an engine misfire problem with cylinder #5, just fix it! Alignment does not cause shaking period.

By your description, it sounds like a tire balance. That is generally where an imbalance shows up. If it goes away above and below the shake, it's more than likely a balance problem. Have it looked at because faulty tie rods etc. Could be lurking. Be safe.