If a person does not recite “allahumma salli ala Muhammadiw wa ali Muhammad” in the tashahhud of his salaat. Is the salaat valid?

If the person deliberately did not recite it then yes the Salat is invalid. But if someone forgot to recite it then it is valid.