I do not have almost any experience with pgfplot and I am having some problems with something which seemed really easy.
What I want to do is filling the area between a function and two vertical lines identified by the intersection of a horizontal line with the function.
I found the intersections and I could draw correctly the vertical lines but I cannot understand how to fill the area
Following there is the code I managed to produce so far.
\documentclass{article}
\usepackage{tikz}
\usepackage{pgfplots}
\usetikzlibrary{calc,intersections}
\begin{document}
\begin{figure}
\centering
\begin{tikzpicture}
\begin{axis}[scale=1]
\addplot+[name path global=GraphCurve, domain=0.5:1.5, samples=400, color=black, mark=none]{0.09*x^2/sqrt((1-x^2)^2+(0.09*x)^2)};
\addplot+[name path global=HorizontalLine, domain=0.5:1.5,mark=none, opacity=0]{0.5};
\path[dashed,name intersections={of=GraphCurve and HorizontalLine,name=i}] (i-2)%
\pgfextra{\pgfgetlastxy{\macrox}{\macroy}%
\global\let\macrox\macrox};
\def \xinta {\macrox}
\draw[name path global=vert1, dashed](i-2) -- (\xinta,0);
\path (i-1)
\pgfextra{\pgfgetlastxy{\macrox}{\macroy}%
\global\let\macrox\macrox};
\def \xintb {\macrox}
\draw[name path global=vert2,dashed](i-1) -- (\xintb,0);
\coordinate [label=left:$A$](A) at (i-1);
\coordinate [label=right:$B$](B) at (i-2);
\end{axis}
\end{tikzpicture}
\caption{This picture has been created with Pgfplots}
\end{figure}
\end{document}
Can anybody help with this?

pgfplots1.8 has issues withname path global. It doesn't recognize the names on my MikTeX machine. I'll try to check it again later. – percusse Apr 04 '13 at 21:06\tikz@intersect@def, the switching from\lets to\defs is the culprit. Changing it back, and the example works again. – Qrrbrbirlbel Apr 04 '13 at 23:02