वृथा

Etymology
Probably from the instrumental case of an unattested, a derivative of the root.

The "in vain" meaning is a semantic extension of the original "at will" meaning, via "at will" > "wantonly" > "aimless, without a plan" > "in vain".

Adverb

 * 1) at will, at pleasure, at random, easily, lightly, wantonly, frivolously
 * 2) in vain, vainly, uselessly, fruitlessly, idly
 * 3) wrongly, falsely, incorrectly, unduly