How can I get an union between two 2D polygons

I want to get a union polygon with two 2D polygons as shown in attached file.

How should I do?

Attachments: