From Latin vidua.
In the Middle Ages, jurists introduced a learned Latin borrowing vídua to replace the inherited Old Catalan form viuva (from a Vulgar Latin *viduva). The current form viuda supposedly emerged as a compromise between the two forms. The masculine form was derived from the feminine. Cf. also Spanish viuda, which may have influenced it.