I am trying to recreate a graph from the 2024 AP Daily Practice Session. I need to fill in the area of R and directly below it. I have tried FillBetween Command and Soft Clip, but I am just not able to get the correct Clip. From the graph, I have the R shaded, but you can see there is extra shading above and below. Any help is much appreciated.
Nick
\documentclass[12pt,a4paper]{article}
\usepackage{amsmath,amsfonts,amssymb}
\usepackage{parskip}
\usepackage{fancyhdr}
\usepackage[margin=1in]{geometry}
\usepackage{tabularray}
\usepackage{enumitem}
\usepackage{soul}
\usepackage{multicol}
\usepackage[many]{tcolorbox}
\usepackage{ragged2e}
\usepackage{tikz,pgfplots}
\usetikzlibrary{arrows.meta}
\usetikzlibrary{backgrounds}
\pgfplotsset{compat=newest}
\usetikzlibrary{calc}
\usepgfplotslibrary{fillbetween}
\pagestyle{fancy}
\fancyhead[L]{Polar Curves on Calc BC}
\fancyhead[R]{Name:\enspace\makebox[2in]{\hrulefill}}
\fancyfoot[C]{BC Calculus}
\fancyfoot[R]{\thepage}
\fancyfoot[L]{Created By: Mr. Bennett}
\renewcommand{\headrulewidth}{0.4pt}
\renewcommand{\footrulewidth}{2pt}
\newcommand*{\myprime}{^{\prime}\mkern-1.2mu}
\newcommand*{\dprime}{^{\prime\prime}\mkern-1.2mu}
\newcommand*{\trprime}{^{\prime\prime\prime}\mkern-1.2mu}
\addtolength{\topmargin}{-2.49998pt}
%For Polar
\pgfplotsset{
interpret as polar/.style={
x filter/.code=\pgfmathparse{cos(rawx)*rawy},
y filter/.code=\pgfmathparse{sin(rawx)*rawy}
}
}
\begin{document}
\subsection*{\hl{What Do We Need To Know?}}
\begin{Center}
\begin{tblr}{width=\textwidth,hlines={1pt},vlines={1pt},colspec={Q[m]Q[m]Q[m]Q[m]}}
{Conversion \\ Formulas} & \(x=r\cos\big(\theta\big)\)\, \(y=r\sin\big(\theta\big)\) & {Slope of the\\ Tangent to a Polar Curve} & \(\dfrac{dy}{dx}=\dfrac{dy/d\theta}{dx/d\theta}\)\\
{Area Bounded \\ by a Polar Curve} & \(A=\displaystyle\frac{1}{2}\int_{a}^{b}\left[f\big(\theta\big)\right]^2\, d\theta\) & {Distance to the \\ Origin} & \(r=f\big(\theta\big)\) \\
\end{tblr}
\end{Center}
\begin{Center}
\begin{tikzpicture}
\begin{axis}[
axis lines=center,
axis equal image,
enlargelimits=true
]
\addplot[name path=A,
red, thick,
domain=0:360,
samples=360,
smooth,
interpret as polar
]
(x,{4-3*cos(x)});
\addplot[name path=B,
blue, thick,
domain=0:360,
samples=360,
smooth,
interpret as polar
] (x,{5*cos(x)});
\addplot[fill=blue!30,opacity=0.5]fill between[of = A and B,soft clip={domain=-pi/2:pi/2}];
\node at (.75,1){\(R\)};
\end{axis}
\end{tikzpicture}
\end{Center}
\begin{enumerate}
\item Let \(R\) be the region that is inside the graph of \(r=4-\cos \theta\) and also inside the graph of \(r=5\cos\theta\), as shaded in the figure above. What is the area of \(R\)?
\begin{enumerate}[itemsep=.15in,label=(\Alph*)]
\item 2.261
\item 3.764
\item 11.398
\item 23.999
\end{enumerate}
\end{enumerate}
\rule{\textwidth}{1pt}
\end{document}