I want to draw the graph the function $y=\sqrt{x}$ (and label it above the graph of the function) in an $x-y$ plane. Then I need to put a filled dot on the point $(4,0)$ (I want to label $(4,0)$ beneath the dot, and I also I need to put a filled dot on an arbitrary point on the graph of the function and label $(x,y)$ above the point. I need the graph for the following problem:\
Find the point $(x,y)$ on the graph of $y=\sqrt{x}$\ \ nearest the point $(4,0)$.\
I did the following, but for some reason I couldn't even get the graph of the square root function. Thanks!
\documentclass{article}
\usepackage{tikz}
\begin{document}
\begin{tikzpicture}
\draw[->] (-3,0) -- (7,0) node[right] {$x$};
\draw[->] (0,-3) -- (0,4) node[above] {$y$};
\draw[scale=0.5,domain=0:9,smooth,variable=\x,blue] plot ({\x},{\sqrt{\x}});
\end{tikzpicture}
\end{document}
Best Answer
Use
pgfplots
: