# Shade where a function f lies below a function g [duplicate]

I have two functions:

f[x_] = 2 Cos[x]
g[x_] = -Sqrt[3]


I find the points of intersection.

sol = Solve[f[x] == g[x] && -2 Pi <= x <= 4 Pi, x]
pts = {x, f[x]} /. sol


I plot the two curves, the points, then I want to plot where the graph of f lies below the graph of g. I can fill the area between the curves:

Plot[{f[x], g[x]}, {x, -2 Pi, 4 Pi},
Filling -> {1 -> {2}},
Epilog -> {
Red, PointSize[Medium], Point[pts]
}]


But how can I fill the area between the curves only where the graph of f lies below the graph of g?

## marked as duplicate by Sjoerd C. de Vries, Dr. belisarius plotting StackExchange.ready(function() { if (StackExchange.options.isMobile) return; $('.dupe-hammer-message-hover:not(.hover-bound)').each(function() { var$hover = $(this).addClass('hover-bound'),$msg = $hover.siblings('.dupe-hammer-message');$hover.hover( function() { $hover.showInfoMessage('', { messageElement:$msg.clone().show(), transient: false, position: { my: 'bottom left', at: 'top center', offsetTop: -7 }, dismissable: false, relativeToBody: true }); }, function() { StackExchange.helpers.removeMessages(); } ); }); }); Oct 8 '15 at 22:13

Plot[{f[x], g[x]}, {x, -2 Pi, 4 Pi},
Filling -> 1 -> {{2}, {LightBlue, White}},
Epilog -> {Red, PointSize[Medium], Point[pts]}]


• Is this one of those methods that is still undocumented? – David Oct 8 '15 at 22:20
• No, it is in the documentation under the Details section of Filling (last entry in the first table you encounter there). – Sjoerd C. de Vries Oct 8 '15 at 22:24
• @SjoercC.deVries Got it. Thanks for the reference. – David Oct 9 '15 at 0:16