如何同时绘制 arccos 和 sqrt

如何同时绘制 arccos 和 sqrt

我正在尝试绘制函数 y=4/pi * arccos(x/4) 和 2-sqrt(x)(见图)。这来自 AP Central。我无法确定要使用哪个合适的轴来显示这两个图像。我可以毫无困难地绘制平方根函数,但尝试添加反三角函数却让我感到困惑。

任何帮助都将不胜感激。我尝试用 Google 搜索,但没有找到。


\documentclass[11pt,letterpaper]{article}
\usepackage[utf8]{inputenc}
\usepackage{adjustbox}
\usepackage{fullpage}
\usepackage[top=2cm, bottom=4.5cm, left=2.5cm, right=2.5cm]{geometry}
\usepackage{amsmath,amsthm,amsfonts,amssymb,amscd}
\usepackage{multicol}
\usepackage{enumerate}
\usepackage{fancyhdr}
\usepackage{tikz}
\usepackage{pgfplots}
\pgfplotsset{compat=newest}
\usepackage{amssymb}
\usetikzlibrary{decorations.pathmorphing}
\usetikzlibrary{plotmarks}
\usetikzlibrary{arrows}
\usetikzlibrary{shapes.misc, positioning}
\usetikzlibrary{arrows,shapes,positioning,snakes}
\usetikzlibrary{decorations.markings}
\usetikzlibrary{arrows.meta,bending}
\tikzset{font=\footnotesize}




\setlength{\parindent}{0.0in}
\setlength{\parskip}{0.05in}
\newcommand*{\dprime}{^{\prime\prime}\mkern-1.2mu}
\newcommand*{\trprime}{^{\prime\prime\prime}\mkern-1.2mu}
% Edit these as appropriate
\newcommand\course{AP Calculus AB}
\pagestyle{fancy}
\headheight 35pt
\lhead{Mark Sparks}
\chead{\textbf{Topic 8.5 Finding the Area Between Curves \\ Expressed as Functions of \(x\) }}
\rhead{\course \\ \today}
\lfoot{Mr. Bennett}
\cfoot{Flint Hill Upper School}
\rfoot{\small\thepage}
\headsep 1.5em
\renewcommand{\baselinestretch}{1.5} 
\renewcommand{\arraystretch}{1.5} 



\begin{document}


\subsection*{AP Test Preparation}

\begin{center}
    \begin{tikzpicture}[scale=.75]
                \begin{axis}[thick,
                        scale only axis,
                    grid=major,
                        axis lines=middle,
                        inner axis line style={-Triangle},
                        ytick={-1,0,...,3},
                        xtick={-1,0,...,5},
                        ymin=-1,
                        ymax=3,
                        xmin=-1,
                        xmax=5,
                    ]
                    \addplot[thick,samples=1000,domain=0:4]{2-sqrt(x)};
                    \addplot[thick,samples=1000,domain=0:4]{1.27324*acos(x/4)
                
                    \node at (2,1){\(R\)};  
                    
                \end{axis}
            \end{tikzpicture}


                        

\end{center}
\begin{enumerate}
    \item Let \(R\) be the region in the first quadrant bounded above by the graph of \(y=\dfrac{4}{\pi}\cos^{-1}\left(\dfrac{x}{4}\right)\) and below by the graph of \(y=2-\sqrt{x}\), as shown in the figure above.  What is the area of the region?
    
    A. \(\dfrac{4}{3}\) \\
    
    B. \(\dfrac{16}{\pi}+\dfrac{8}{3}\) \\
    
    C. \(\dfrac{16}{\pi}-\dfrac{8}{3}\) \\
    
    D. \(\dfrac{16}{3}\) \\
    
        \rule{\textwidth}{.5pt}
    
\end{enumerate}


\end{document}

在此处输入图片描述

答案1

我认为你的代码有2个错误。

首先,\addplot[thick,samples=1000,domain=0:4]{1.27324*acos(x/4)您错过了闭合的括号和半柱};

其次,该acos函数以度为单位返回结果。因此 acos(0) 返回 90。如果结果以弧度为单位,则将其乘以 pi/180。正如您将 (4/pi) * acos(x) 一样,并且 (pi/180) * (4/pi) 为 1/45(约 0.02222),因此,只需替换

\addplot[thick,samples=1000,domain=0:4]{1.27324*acos(x/4)

经过

\addplot[thick,samples=1000,domain=0:4]{0.02222*acos(x/4)};

您将获得:

在此处输入图片描述

相关内容