0

I want to fill the area in the following figure, that mentioned in the caption.

\documentclass[11pt]{scrartcl}
\usepackage{graphicx}
\usepackage{amsmath}
\usepackage{float}
\usepackage{tikz}
\usetikzlibrary{patterns}

\begin{document} \begin{figure}[H] \centering \begin{tikzpicture}[domain=-1:12, range=-1:12, scale=0.7, thick, font=\small] \node [left, color=orange] at (0, 9) {$9$}; \node [below, color=orange] at (3, 0) {$3$}; \draw [ultra thick, color=cyan, smooth, samples = 1000, domain={0.57}:{14}] plot (\x, {8/\x)}); \draw [ultra thick, color=cyan, smooth, samples = 1000, domain={0}:{3}] plot (\x, {9 - \x^2}); \draw[->] (-1.5, 0) -- (15, 0) node [right] {$x_1$}; \draw[->] (0, -1.5) -- (0, 15) node [above] {$x_2$}; \end{tikzpicture} \caption{Fill the are $x_1^2 + x_2 \ge 9$ and $x_1x_2 \le 8$} \end{figure} \end{document}

See the following picture too. Please note that in that question there are two functions, but there are three, the $x$ axes in matter.

How to fill the area?

Lisbeth
  • 185

1 Answers1

2
\documentclass[tikz]{standalone}
\begin{document}
\begin{tikzpicture}[domain=-1:12, range=-1:12, scale=0.7, thick, font=\small]
\begin{scope}
\clip[smooth, samples = 1000, domain={0}:{3}]
    (0,8/0.57) -- plot (\x, {9 - \x^2}) -- (14,0) |- cycle;
\fill[red] [smooth, samples = 1000, domain={0.57}:{14}]
    (0,8/0.57) -- plot (\x, {8/\x)}) -- (14,0) -|  cycle;
\end{scope}

\draw[->] (-1.5, 0) -- (15, 0) node [right] {$x_1$};
\draw[->] (0, -1.5) -- (0, 15) node [above] {$x_2$};
\node [left, color=orange] at (0, 9) {$9$};
\node [below, color=orange] at (3, 0) {$3$};

\draw [ultra thick, color=cyan, smooth, samples = 1000, domain={0.57}:{14}] plot (\x, {8/\x)});
\draw [ultra thick, color=cyan, smooth, samples = 1000, domain={0}:{3}] plot (\x, {9 - \x^2});
\end{tikzpicture}
\end{document}

enter image description here

polyn
  • 5,614