What is the code to represent a logarithm to the base 10? I would like to graph
y = log_{10}(3x + 1)
on the interval [-0.1, 6].
I would also like to graph the tangent line to the graph at (3, 1). The equation is
y = [3/(10 * ln(10))](x - 3) + 1.
\documentclass[10pt]{amsart}
\usepackage{tikz}
\usetikzlibrary{calc,angles,positioning,intersections,quotes,decorations.markings}
\usepackage{tkz-euclide}
\usetkzobj{all}
\usepackage{pgfplots}
\pgfplotsset{compat=1.11}
\setlength{\oddsidemargin}{0.0in}
\setlength{\evensidemargin}{0.0in} \setlength{\textwidth}{6.1in}
\setlength{\topmargin}{0.0in} \setlength{\textheight}{9in}
%http://pgfplots.sourceforge.net/pgfplots.pdf
\begin{document}
\noindent \hspace*{\fill}
\begin{tikzpicture}
\begin{axis}[width=6in,axis equal image,clip=false,
axis lines=middle,
xmin=-10,xmax=10,
domain=-10:10, samples=201,
xlabel=$x$,ylabel=$y$,
ymin=-2.5,ymax=2.5,
restrict y to domain=-2.5:2.5,
enlargelimits={abs=1cm},
axis line style={latex-latex},
ticklabel style={font=\tiny,fill=white},
xtick={\empty},ytick={\empty},
xlabel style={at={(ticklabel* cs:1)},anchor=north west},
ylabel style={at={(ticklabel* cs:1)},anchor=south west}
]
\addplot[samples=501,domain=-0.1:6,blue] {log(3x + 1)} node[above,pos=0.9]{$\scriptstyle{y} = f(x)$};
\draw [fill] (3,1) circle [radius=1.5pt];
\end{axis}
\end{tikzpicture}
\hspace{\fill}
\vskip0.2in
\end{document}
log10
. Note that you need specify multiplication specifically, so you have to say3*x
, not just3x
.log3(x).