x = var('x')
p1 = plot((e^(-0.5*x)*cos(2*pi*x)),(x,0,6),rgbcolor=hue(0.4), legend_label='e^(-0.5*x)*cos(2*pi*x)')
p2 = plot((e^(-0.5*x)),(x,0,6),rgbcolor=hue(0.6), legend_label='e^(-0.5*x)')
x = text('x axis', (6,-0.1))
y = text('y axis', (0.5,1))
p = p1+p2+x+y
p.set_legend_options(shadow=true)
p.set_legend_options(loc=4)
show(p)