Professional Documents
Culture Documents
Các ví dụ được lấy từ trang: https://texmath.com. Các bạn quan tâm đến chức năng vẽ hình bằng
gói TikZ có thể vào trang web này để tham khảo thêm.
\begin{tikzpicture}
\draw (0,0)--(1,1)--(2,1)--(2,0);
\draw [dotted, red] (3,0)--(4,1)--(5,1)--(5,0)node[below]{Math2IT};
\end{tikzpicture}
Math2IT
- Vẽ đường tròn:
\begin{tikzpicture}
\draw (0,0) circle (1cm);
\draw [dashed, line width=0.2cm, blue, fill=yellow] (3,0) circle (1);
\end{tikzpicture}
\begin{tikzpicture}
\draw (0,0) rectangle (2,1);
\draw [fill=green] (3,0) rectangle (5,1);
\draw [fill=yellow] (6,0) rectangle (8,1);
\draw node at (7,0.5) {Latex};
\end{tikzpicture}
Latex
- Vẽ đường cong:
1
2 MỤC LỤC
\begin{tikzpicture}
\draw (0,0) to [out=90,in=180] (3,2);
\draw [->, very thick, green] (4,0) to [out=-30,in=120] (7,2);
\draw [->, very thick, orange] (8,0) to [out=-30,in=120] (11,2) to (12,2);
\end{tikzpicture}
\begin{tikzpicture}
\draw [->,very thick] (-4,0)--(4,0);
\draw [->,very thick] (0,-4)--(0,4);
\draw [very thin,gray,step=1] (-4,-4) grid (4,4);
\draw (0,4) node [below left]{$y$};
\draw (4,0) node [below left] {$x$};
\draw (0,0) node [below left] {O};
\end{tikzpicture}
O x
\begin{tikzpicture}
\draw [<->] (0,2)--(0,0)--(7,0); % Hệ trục tọa độ
\draw [domain=0:2*pi, blue,] plot (\x, {sin(\x r)});
\end{tikzpicture}
0.3. VẼ SỬ DỤNG VÒNG LẶP 3
\begin{tikzpicture}
\draw [dashed,gray,step=1,xstep=pi/2] (-0.1,-1.9) grid (6.9,1.9);
\draw [<->] (0,2)--(0,0)--(7,0); % Hệ trục tọa độ
\draw [domain=0:2*pi, blue,] plot (\x, {sin(\x r)});
\end{tikzpicture}
\begin{tikzpicture}[domain=0:4]
\draw[thin,color=gray!50] (-0.1,-1.1) grid (3.9,3.9);
\draw[->] (-0.2,0) -- (4.2,0) node[right] {$x$};
\draw[->] (0,-1.2) -- (0,4.2) node[above] {$f(x)$};
\draw[color=red] plot (\x,\x) node[right] {$f(x)= x$};
\draw[color=blue] plot (\x,{sin(\x r)}) node[right] {$f(x)= \sin x$};
\draw[color=orange] plot (\x,{0.05*exp(\x)}) node[right] {$f(x)= \frac{1}{20} e^x$};
\end{tikzpicture}
f (x)
f (x) = x
1 x
f (x) = 20 e
f (x) = sin x
0 1 2 3 4 5 6 7 8 9 10 x
\begin{tikzpicture}
\draw [->] (-1,0) --(11,0) node [below] {$x$};
\foreach \x in {0,1,2,3,4,5,6,7,8,9,10}
\draw (\x,0.1)--(\x,-0.1) node [below] {\x};
\end{tikzpicture}
0 1 2 3 4 5 6 7 8 9 10 x
\begin{tikzpicture}
\draw [->] (0,0)--(4*pi,0);
\foreach \x/\lab in {pi/$\pi$,2*pi/$2\pi$,3*pi/$3\pi$}{
\draw (\x,-0.1)--(\x,0.1);
\draw node [below] at (\x,-0.05) {\lab};
}
\end{tikzpicture}
π 2π 3π
x −∞ +∞
f ′ (x) +
+∞
f (x)
−∞
0.4. VẼ BẢNG BIẾN THIÊN 5
/.8, /.8, /2 tương ứng là độ rộng của 3 hàng ở cột thứ nhất.
\begin{tikzpicture}
\tkzTabInit
[lgt=3,espcl=5] % tùy chọn
{$x$/1.2, $f’(x)$/1, $f(x)$/2.5} % cột đầu tiên
{$-\infty$, $-\dfrac{b}{2a}$, $+\infty$} % hàng 1 cột 2
\tkzTabLine{,-,0,+,} % hàng 2 cột 2
\tkzTabVar{+/ $+\infty$, -/ $-\dfrac{\Delta}{4a}$ , +/ $+\infty$} % hàng 3 cột 2
\end{tikzpicture}
b
x −∞ − +∞
2a
f ′ (x) − 0 +
+∞ +∞
f (x)
∆
−
4a
\begin{tikzpicture}
\tkzTab
[lgt=1.5,espcl=3] % tùy chọn
{$x$/1, $f’(x)$/1, $f(x)$/2.5} % cột đầu tiên
{$-\infty$, $x_1$, $x_2$, $+\infty$} % hàng 1 cột 2
{,+,0,-,0,+,} % hàng 2 cột 2
{-/ $-\infty$, +/ $f(x_1)$, -/ $f(x_2)$ , +/ $+\infty$} % hàng 3 cột 2
\end{tikzpicture}
6 MỤC LỤC
x −∞ x1 x2 +∞
f ′ (x) + 0 − 0 +
f (x1 ) +∞
f (x)
−∞ f (x2 )
\begin{tikzpicture}
\tkzTabInit
[lgt=2,espcl=4] % tùy chọn
{$x$/0.8,$f’(x)$/0.8, $f(x)$/2} % cột đầu tiên
{$-\infty$,$x_0$,$+\infty$} % hàng 1 cột 2
\tkzTabLine{,+,0,+,} % hàng 2 cột 2
\tkzTabVar{-/ $-\infty$ , R/ , +/ $+\infty$} % hàng 3 cột 2 (2 điểm đầu)
\tkzTabIma{1}{3}{2}{$f(x_0)$} % hàng 3 cột 2 (điểm giữa)
\end{tikzpicture}
x −∞ x0 +∞
f ′ (x) + 0 +
+∞
f (x) f (x0 )
−∞
\begin{tikzpicture}
\tkzTabInit
[lgt=2,espcl=0.02\linewidth] % tùy chọn
{$x$/.8, $f’(x)$/.8, $f(x)$/2} % cột đầu tiên
{$-\infty$,$+\infty$} % hàng 1 cột 2
\tkzTabLine{,+,} % hàng 2 cột 2
\tkzTabVar{-/ $-\infty$ , +/ $+\infty$} % hàng 3 cột 2
\end{tikzpicture}
x −∞ +∞
f ′ (x) +
+∞
f (x)
−∞
\begin{tikzpicture}
\tkzTab
[lgt=2,espcl=2.5] % tùy chọn
{$x$/1, $f’(x)$/1, $f(x)$/2.5} % cột đầu tiên
{$-\infty$, $x_1$, $x_2$, $x_3$, $+\infty$} % hàng 1 cột 2
{,-,0,+,0,-,0,+,} % hàng 2 cột 2
{+/ $+\infty$, -/ $f(x_1)$, +/ $f(x_2)$, -/ $f(x_3)$ , +/ $+\infty$} % hàng 3 cột 2
\end{tikzpicture}
x −∞ x1 x2 x3 +∞
f ′ (x) − 0 + 0 − 0 +
+∞ f (x2 ) +∞
f (x)
f (x1 ) f (x3 )
\begin{tikzpicture}
\tkzTabInit
[lgt=2,espcl=5] % tùy chọn
{$x$/1, $f’(x)$/1, $f(x)$/2.5} % cột đầu tiên
{$-\infty$, $-\dfrac{b}{2a}$, $+\infty$} % hàng 1 cột 2
\tkzTabLine{,-,0,+,} % hàng 2 cột 2
\tkzTabVar{+/ $+\infty$, -/ $-\dfrac{\Delta}{4a}$ , +/ $+\infty$} % hàng 3 cột 2
\end{tikzpicture}
b
x −∞ − +∞
2a
f ′ (x) − 0 +
+∞ +∞
f (x)
∆
−
4a
ax + b
0.4.5 Hàm phân thức bậc nhất y =
cx + d
\begin{tikzpicture}
\tkzTab
[lgt=2,espcl=4] % tùy chọn
{$x$/1, $f’(x)$/0.8, $f(x)$/2} % cột đầu tiên
{$-\infty$, $-\dfrac{d}{c}$, $+\infty$} % hàng 1 cột 2
{,+,d,+,} % hàng 2 cột 2
{-/ $\dfrac{a}{c}$, +D-/ $+\infty$ / $-\infty$, +/ $\dfrac{a}{c}$} % hàng 3 cột 2
\end{tikzpicture}
8 MỤC LỤC
d
x −∞ − +∞
c
f ′ (x) + +
+∞ a
c
f (x) a
c −∞
ax2 + bx + c
0.4.6 Hàm phân thức bậc hai y =
dx + e
- Nếu f ′ (x) = 0 có 2 nghiệm thực phân biệt x1 , x2 :
\begin{tikzpicture}
\tkzTab
[lgt=2,espcl=2] % tùy chọn
{$x$/0.8, $f’(x)$/0.8, $f(x)$/2} % cột đầu tiên
{$-\infty$, $x_1$, $-\frac{e}{d}$, $x_2$, $+\infty$} % hàng 1 cột 2
{,-,0,+,d,+,0,-,} % hàng 2 cột 2
{+/ $+\infty$, -/ $f(x_1)$, +D-/ $+\infty$ / $-\infty$, +/ $f(x_2)$, -/ $-\infty$}
% hàng 3 cột 2
\end{tikzpicture}
x −∞ x1 − de x2 +∞
f ′ (x) − 0 + + 0 −
+∞ +∞ f (x2 )
f (x)
f (x1 ) −∞ −∞
\begin{tikzpicture}
\tkzTab
[lgt=2,espcl=4] % tùy chọn
{$x$/1, $f’(x)$/0.8, $f(x)$/2} % cột đầu tiên
{$-\infty$, $-\dfrac{e}{d}$, $+\infty$} % hàng 1 cột 2
{,+,d,+,} % hàng 2 cột 2
{-/ $-\infty$, +D-/ $+\infty$ / $-\infty$, +/ $+\infty$} % hàng 3 cột 2
\end{tikzpicture}
0.4. VẼ BẢNG BIẾN THIÊN 9
e
x −∞ − +∞
d
f ′ (x) + +
+∞ +∞
f (x)
−∞ −∞
x −∞ −1 1 +∞
f ′ (x) − +
+∞ +∞
f (x)
0 0
\begin{tikzpicture}
\tkzTabInit
[lgt=2,espcl=4,nocadre] % tùy chọn
{$x$/0.8,$f’(x)$/0.8, $f(x)$/2} % cột đầu tiên
{$-\infty$,$x_0$,$+\infty$} % hàng 1 cột 2
\tkzTabLine{,+,0,+,} % hàng 2 cột 2
\tkzTabVar{-/ $-\infty$ , R/ , +/ $+\infty$} % hàng 3 cột 2 (2 điểm đầu)
\tkzTabIma{1}{3}{2}{$f(x_0)$} % hàng 3 cột 2 (điểm giữa)
\end{tikzpicture}
10 MỤC LỤC
x −∞ x0 +∞
f ′ (x) + 0 +
+∞
f (x) f (x0 )
−∞
\begin{tikzpicture}
\tkzTabInit{$x$ /1, $f’(x)$ /1, $f(x)$ /3}
{$-\infty$, 0, $1$ , $2$, $3$, $+\infty$}
\tkzTabLine{, +, , h, , -, z, -, d, h, }
\tkzTabVar{-/ $-10$,+CH/ $+\infty$, +/$2$, R/,-DH/ $-\infty$, //}
\tkzTabIma{3}{5}{4}{$\pi$}
\end{tikzpicture}
x −∞ 0 1 2 3 +∞
f ′ (x) + − 0 −
+∞ 2
f (x) π
−10 −∞