The key is to sketch the diagram.

Using the disk/annulus method we see that a plane section of the solid of revolution taken perpendicular to the axis of revolution intersects the solid in an annulus with an outer radius $R$ and inner radius $r$.
Thus we use the formula for the area of an annulus to calculate the volumn.
\begin{equation}
V=\int_0^{\frac{\pi}{4}}\pi\left(R^2-r^2\right)\,dx
\end{equation}
For the solid on the left we see from the diagram that $R=2$ and $r=\sec(x)$ therefore
\begin{equation}
V=\pi \int_0^{\frac{\pi}{4}}4-\sec^2(x)\,dx
\end{equation}
For the solid on the right we see that $R=1+\sec(x)$ and $r=1$ therefore
\begin{equation}
V=\pi \int_0^{\frac{\pi}{4}}(1-\sec(x))^2-1\,dx
\end{equation}
Both are elementary integrals involving $\int \sec(x)\,dx$ and $\int \sec^2(x)\,dx$
I have provided a desmos annimation at https://www.desmos.com/calculator/gj0cf5rgxt where you can move the axis of revolution between values of $y=k$ for $k\in[-1,2]$ and where you can move the annular cross-section between values of $x=c$ for $c\in\left[0,\frac{\pi}{4}\right]$ by moving the sliders for $k$ and $c$.