如何制作这个图形?

如何制作这个图形?

我可以做到这一点

\begin{center}
\begin{tikzpicture}
\fill [red!50, domain=1:3, variable=\x]
  (1, 0)
  -- plot ({\x}, {2.2/(\x)})
  -- (3, 0)
  -- cycle;      \draw[->] (-1,0) -- (7,0) node[right] {$x$};
   \draw[->] (0,-1) -- (0,4) node[above] {$y$};
   \draw[scale=1.5,domain=0.35:4,smooth, variable=\x,black, ultra thick] plot ({\x},{1/(\x)});
\draw[dashed] (3,0)--(3,0.75);
\draw[dashed] (0,0.75)--(3,0.75);
    \node at (-0.5,0.75){$\frac{1}{b}$};
    \node at (3,-0.3){$b$};
        \node at (1,-0.3){$a$};
  \node at (-0.5,2.2) {$\frac{1}{a}$};
\draw[dashed] (1,0)--(1,2.2);
\draw[dashed] (0,2.2)--(1,2.2);
\node at (1,2.2) {$\bullet$};
    \node at (3,0.75) {$\bullet$};
\end{tikzpicture}
\end{center}

但我不能 在此处输入图片描述

答案1

\documentclass{scrartcl}
\usepackage{tikz}
\usetikzlibrary{calc,arrows.meta,intersections,patterns}
\begin{document}
\begin{center}
  \begin{tikzpicture}[>={Triangle[length=.5cm]}]
  \pgfmathdeclarefunction{func}{1}{\pgfmathparse{.7/(.3*#1)}}
  \draw[->] (-1,0) -- (7,0) node[below] {$x$};
  \draw[->] (0,-1) -- (0,4) node[left] {$y$};
  \draw[domain=0.5:6,smooth, variable=\x,black, ultra thick]
    plot ({\x},{func(\x)});
  \node[below] at (1,0) {\strut$a$};
  \node[below] at (2,0) {\strut$c$};
  \node[below] at (3,0) {\strut$d$};
  \node[below] at (4,0) {\strut$e$};
  \node[below] at (5,0) {\strut$b$};
  \foreach \n in {1,...,5}
    \draw[very thin] (\n,0) -- (\n,{func(\n)});
  \foreach \n [remember=\n as \lastn (initially 1)] in {2,...,5}
    \filldraw[very thin,pattern=north west lines] (\n,{func(\n)}) rectangle (\lastn,0);
  \end{tikzpicture}
\end{center}
\end{document}

在此处输入图片描述

相关内容