what is 5 40 oil?
In your case, 5W40 means that the oil behaves like a 5 weight oil at low temperatures so it flows easily. At higher temperatures, it behaves like a 40 weight oil, staying more viscous and so providing more protection.