Skip to content

Instantly share code, notes, and snippets.

@herodrigues
Created May 12, 2016 23:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save herodrigues/4fa3fd467995c4971bdac3ceacd3d181 to your computer and use it in GitHub Desktop.
Save herodrigues/4fa3fd467995c4971bdac3ceacd3d181 to your computer and use it in GitHub Desktop.

Vários exemplos aqui: http://www.texample.net/tikz/examples/area/mathematics/

$ f(x) = (x - 2)^4 - (x - 2)^3 + (x - 2)^2 + 1 $, $ x^* = 2 $ 

\vspace{2em}
\begin{center}
	\begin{tikzpicture}[scale=1.5,
		declare function={
		func(\x) = (\x - 2)^4 - (\x - 2)^3 + (\x - 2)^2 + 1;
		}]
	% draw grid  
		\draw[loosely dotted] (0,0) grid (4.0,5.0); 
	% draw axes 
		\draw[->] (-1,0) -- (4,0) node[right] {$x$};
	    \draw[->] (0,-1) -- (0,5) node[above] {$f(x)$};     
	% draw functions
		\draw[<->, blue, line width=0.25mm] plot[domain=0.9:3.3,samples=1000] (\x,{func(\x)});
	% node[below right] {$f(x) = (x - 2)^4 - (x - 2)^3 + (x - 2)^2 + 1$};
		\fill (2,1)  circle[red, radius=1pt]
		node[below] {$x^*$};
	\end{tikzpicture}
\end{center}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment