Hi I went to hostipal for a back pain they did X-ray and said everything is good its a muscle problem can they detec easy cancer from X-ray.?

Not really. Standard x-rays can sometimes detect signs of cancer, but are not sufficient to rule it out if there is a clinical suspicion. CT/MRI are far superior.
Cancer. Workup for spine cancer is indicated for rest pain weight loss or history of past malignancy acute onset back is usually a muscular pain the best test to determine is palpation on the physical exam even xrays are controversial in the evaluation of nontraumatic new back pain but to answer question xray can see big problems inspine from cancer unless you a prior history of cancer i wouldnt worry.
Back xray cancer. If your question is that can we diagnose cancer in the bones of the spine on xrays, most of the time you will be able to see some abnormality like lesions due to primary tumour and metastatic tumour on the xrays.But you may miss some early cancers on xrays and you need other imaging if you suspect cancer.