Did prophet Muhammad ﷺ say something about wife beating in his last sermon and compared women to animals?
I have heard about a hadith in Musnad ahmed and tarikh al tabari are these authentic
The Prophet Muhammad ﷺ gave advice regarding good treatment of women and their rights and duties in his farewell sermon. This is recorded in Musnad Ahmad and Tarikh al-Tabari as you claim, but also in other more well known hadith collections such as:
فاتقوا الله في النساء ، فإنكم أخذتموهن بأمان الله ، واستحللتم فروجهن بكلمة الله ، ولكم عليهن أن لا يوطئن فرشكم أحدا تكرهونه ، فإن فعلن ذلك فاضربوهن ضربا غير مبرح ، ولهن عليكم رزقهن وكسوتهن بالمعروف
Fear Allah with regard to women, for you have taken them as a trust from Allah, and intimacy with them has become permissible to you by the Word of Allah. Your rights over them are that they should not allow anyone whom you dislike to tread on your bedding. If they do that, then hit them, but in manner that does not cause injury or leave a mark. Their rights over you are that you should provide for them and clothe them in a reasonable manner.
واستوصوا بالنساء خيرا فإنما هن عوان عندكم ليس تملكون منهن شيئا غير ذلك إلا أن يأتين بفاحشة مبينة فإن فعلن فاهجروهن في المضاجع واضربوهن ضربا غير مبرح فإن أطعنكم فلا تبغوا عليهن سبيلا ألا إن لكم على نسائكم حقا ولنسائكم عليكم حقا فأما حقكم على نسائكم فلا يوطئن فرشكم من تكرهون ولا يأذن في بيوتكم من تكرهون ألا وإن حقهن عليكم أن تحسنوا إليهن في كسوتهن وطعامهن
I order you to treat women well, for they are but like captives with you, you have no sovereignty beyond this over them, unless they manifest lewdness. If they do that, then abandon their beds, and beat them with a beating that is not painful. Then if they obey you, then there is no cause for you against them beyond that. Behold! There are rights for you upon your women, and rights for your women upon you. As for your rights upon them,then they are not to allow anyone on your bedding whom you dislike, nor to permit anyone whom you dislike in your homes. Behold! Indeed their rights upon you are that you treat them well in clothing them and feeding them.
This hadith is authentic, especially the first one.
It does not compare women to animals. One translator (Ismail K. Poonawala) of Tarikh Tabari has suggested the translation 'domestic animals' for the word عوان however the hadith commentators have noted that it means being like captives or prisoners. Which is because women are made obedient to men and because they are taught to remain in their homes and not permitted to leave without permission of their husbands. You can also see In what sense are wives "captives" in the hadith "...they are but captives with you..."?