-
Notifications
You must be signed in to change notification settings - Fork 0
/
calc42-matching.tex
140 lines (135 loc) · 3.92 KB
/
calc42-matching.tex
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% BASED ON Hodge-King's
% IBL Week 4 Day 1 "Derivative Matching Revised"
% DIRECTIONS: typeset twice to get positioning right
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\documentclass[letterpaper,10pt]{article}
\usepackage{pgfplots}
\pgfplotsset{compat=1.13}
\thispagestyle{empty}
\pagestyle{empty}
\newcounter{card}
\newcommand\content[4]{
\begin{tikzpicture}[remember picture, overlay]
\draw (current page.north west)
++({(floor(\arabic{card}/5)+1/2)*1/3*8.5in},{(mod(\arabic{card},5)+1/2)*-1/5*11in}) coordinate (center);
\draw (center) node {
\begin{tikzpicture}
\begin{axis}[
axis equal image=false,
width=3in, height=2.4in,
grid=major, axis lines=center,
xmin=-3.1, xmax=3.1, xtick={-3,...,3},
ymin=-2.5, ymax=2.5, ytick={-2,...,2},
major tick length={0},
samples=299,
domain=-3:3,
% #4 = options for this particular graph, eg, xmax, ytick
#4
]
% #2 = list of functions/options to plot = {fn1/op1, fn2/op2, etc}
% global var \fncolor = color of plot & title
\foreach \function/\options in {#2}{
\edef\temp{\noexpand
\addplot[ultra thick, smooth, \fncolor, \options]{\function};
}
\temp
}
% #3 = coordinates of open circles = {(x1,y1) (x2,y2), etc}, note no comma btw pts
\addplot [\fncolor, only marks, very thick, mark=*, mark options={scale=1, fill=white}]
coordinates{#3};
% global var \titlef = title = f or f'
% global var \titlex = relative x position for title = number btw 0, 1
\node[\fncolor] at (axis description cs: \titlex,0.8) {\huge$\titlef$};
% #1 = card ID number/letter
\node at (axis description cs: 0.95,0.05) {\footnotesize#1};
\end{axis}
\end{tikzpicture}
};
% cut guides
\foreach \x/\y in {1/1, 1/-1, -1/1, -1/-1}
\draw[gray] (center) ++(\x*1/2*1/3*8.5in, \y*1/2*1/5*11in)
edge[-] ++(left:5mm)
edge[-] ++(right:5mm)
edge[-] ++(up:5mm)
edge[-] ++(down:5mm)
;
\end{tikzpicture}
\stepcounter{card}
}
\newcommand\contentb[2]{\content{#1}{{#2}/{}}{}{restrict y to domain=-2.5:2.5,}}
\newcommand\contentc[2]{\content{#1}{{#2}/{}}{}{
xmin=-6.3, xmax=6.3, xtick={-6.28319,-3.14159,3.14159, 6.28319},
xticklabels={$-2\pi$,$-\pi$,$\pi$, $2\pi$},
ymin=-1.25, ymax=1.25, ytick={-1,-0.5,0.5,1},
domain=-6.2:6.2
}}
\begin{document}
% FUNCTION CARDS
\def\fncolor{black}
\def\titlef{f}
\def\titlex{0.2}
\contentb 1{2*x-1}
\contentb 2{-2*x+1}
\contentb 3{abs(x)}
\contentb 4{x^2+2*x}
%\contentc 5{sin(deg(x)}
\contentb 5{-x^3/3+0.5}
\contentb 6{x^3-x}
\contentb 7{(x+1)^4-1}
\content 8{ln(x)/domain=0.01:3}{}{samples=300}
\contentb 9{x^3/3+1}
\contentb {10}{x^(-1)}
\contentb {11}{2/(1+2.7182818^(-4*x+4))}
\contentb {12}{(x+1)/abs(x+1)*abs(x+1)^(1/3)}
\contentb {13}{2.7182818^(-x^2)}
\content {14}{0.333*x^3+1/domain=-3:1, x+0.333/{samples=99, domain=1:3}}{}{}
\content {15}{-x^4+4*x^2/{}}{}
{ymin=-7.5, ymax=7.5, restrict y to domain=-7.5:7.5, ytick={-6,-3,...,6}}
% DERIVATIVE CARDS
\newpage
\def\fncolor{red}
\def\titlef{f'}
\def\titlex{0.8}
\setcounter{card}0
\contentb I2
\contentb E{-2}
\content O{-1/domain=-3:0, 1/domain=0:3}{(0,1) (0,-1)}{samples=2}
\contentb D{2*x+2}
%\contentc F{cos(deg(x))}
\contentb F{-x^2}
\contentb A{3*x^2-1}
\contentb M{4*(x+1)^3}
\content N{{1/x}/domain=0.1:3}{}{samples=30}
\contentb J{x^2}
\contentb K{-1*x^(-2)}
\contentb C{8*2.7182818^(-4*x+4)/(1+2.7182818^(-4*x+4))^2}
\content H{
{(1/3)*1/(x+1)^2^(1/3)}/domain=-3:-1.01,
{(1/3)*1/(x+1)^2^(1/3)}/domain=-0.99:3
}{}{}
\contentb B{-2*x*2.7182818^(-x^2)}
\content G{x^2/domain=-3:1, 1/domain=1:3}{}{}
\content L{-4*x^3+8*x/{}}{}
{ymin=-7.5, ymax=7.5, restrict y to domain=-7.5:7.5, ytick={-6,-3,...,6}}
% SOLUTIONS
\newpage
\section*{Solutions}
\begin{tabular}{rl}
1 & I %& $\div$
\\ 2 & E %& $\star$
\\ 3 & O %& =
\\ 4 & D %& $\triangle$
\\ 5 & F %& $\infty$
\\ 6 & A %& \&
\\ 7 & M %& @
\\ 8 & N %& $\square$
\\ 9 & J %& \#
\\ 10 & K %& \%
\\ 11 & C %& ?
\\ 12 & H %& !
\\ 13 & B %& $+$
\\ 14 & G %& $\heartsuit$
\\ 15 & L %& $\Rightarrow$
\end{tabular}
\end{document}