Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 23 additions & 3 deletions source/calculus/source/04-IN/01.ptx
Original file line number Diff line number Diff line change
Expand Up @@ -109,9 +109,29 @@
<activity>
<introduction> <p>
The graph of <m>g(t)</m> and the areas <m>A_1, A_2, A_3</m> are given below. </p>
<figure xml:id="figure-signed-areas">
<image width="100%" source="fig2d.JPG" />
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this mean we can also delete the fig2d.JPG file? Note that it will still be archived on Github so it's not permanently deleted.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i think so? i was going to wait to delete the .jpg and .png files until the pull requests were final for each module.

</figure>
<figure xml:id="figure-signed-areas">
<sidebyside widths="50% 50%">
<image>
<sageplot>
x = var('x')
f = -0.0019378058*x^5+0.0272617825*x^4-0.0281391103*x^3-0.6767556453*x^2 + 1.6980068882*x-0.0048902147
p = plot(f,(x,0,10),thickness=2, gridlines=True, aspect_ratio=1.5, axes_labels=('$t$','$g(t)$'))
p
</sageplot>
</image>
<image>
<sageplot>
x = var('x')
f = -0.0019378058*x^5+0.0272617825*x^4-0.0281391103*x^3-0.6767556453*x^2 + 1.6980068882*x-0.0048902147
p = plot(f,(x,0,10),thickness=2, gridlines=True, aspect_ratio=1.5, fill=True, axes_labels=('$t$','$g(t)$'))
a1 = text("$A_1 = 2$",(1.25,0.5), fontsize=12, color='black')
a2 = text("$A_2 = 2.5$", (4.75, -0.5), fontsize=12, color='black')
a3 = text("$A_3 = 9$", (8.25,1.75), fontsize=12, color='black')
p+a1+a2+a3
</sageplot>
</image>
</sidebyside>
</figure>
</introduction>
<task> <p> Find <m>\int_{3}^{3} g(t) \, dt</m></p></task>
<task> <p> Find <m>\int_{3}^{6} g(t) \, dt</m></p></task>
Expand Down
175 changes: 107 additions & 68 deletions source/calculus/source/04-IN/02.ptx
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,26 @@
axes for plotting <m>y = v(t)</m>;
at right, for plotting
<m>y = s(t)</m>.</caption>
<sidebyside widths="50% 50%">
<image>
<sageplot>
x = var('x')
f = 0
ticks = [True,[a for a in (1..8)]]
p = plot(f,(x,0,2.25), thickness=0, ymin = 0.25, ymax = 8.25, gridlines='minor', axes_labels=('hrs','mph'), axes_labels_size=1, aspect_ratio=.25, ticks=ticks)
p
</sageplot>
</image>
<image>
<sageplot>
x = var('x')
f = 0
ticks = [True,[a for a in (1..8)]]
p = plot(f,(x,0,2.25), thickness=0, ymin = 0.25, ymax = 8.25, gridlines='minor', axes_labels=('hrs','miles'), axes_labels_size=1, aspect_ratio=.25, ticks=ticks)
p
</sageplot>
</image>
</sidebyside>
<image width="100%" source="4_1_PA1" />
</figure>

Expand Down Expand Up @@ -130,7 +150,27 @@

<figure xml:id="F-4-1-Act1" permid="qNs">
<caption>The graph of <m>y = v(t)</m>.</caption>
<image source="4_1_Act1" />
<image>
<sageplot>
x = var('x')
f = (x-1)^3 + 2.5
p = plot(f, (x,-.25,2.25), thickness=2, ymin=0, ymax = 3.5, gridlines=True, axes_labels=('hrs','mph'), axes_labels_size=1, aspect_ratio=.6)
a = text("$y = v(t)$",(1, 2.65), fontsize=12, color='black')
p + a
</sageplot>
</image>
<!--
<image>
<sageplot>
x = var('x')
f = (x-1)^3 + 2.5
ticks = [[a for a in (.25,.5..3.5)],[a for a in (.25,.5..3.5)]]
p = plot(f, (x,-.25,2.25), thickness=2, ymin=0, ymax = 3.5, gridlines=True, axes_labels=('hrs','mph'), axes_labels_size=1, aspect_ratio=.6, ticks=ticks)
a = text("$y = v(t)$",(1, 2.65), fontsize=12, color='black')
p + a
</sageplot>
</image>
-->
</figure>
</sidebyside>
</introduction>
Expand Down Expand Up @@ -214,51 +254,64 @@
<figure xml:id="fig-riemann-sum-generic">
<caption>A generic Riemann sum.</caption>
<image width="100%">
<latex-image>
\begin{tikzpicture}
\draw[thick] (0,0) -- (5,0);
\draw[fill=gray!50] (0, 0) rectangle (0.8, 1);
\draw[fill=gray!50] (0.8, 0) rectangle (1.9, 1.75);
\draw[fill=gray!50] (1.9, 0) rectangle (3.4, -1.2);
\draw[fill=gray!50] (3.4, 0) rectangle (4.2, 0.85);
\draw[fill=gray!50] (4.2, 0) rectangle (5.7, 0.35);
\draw[fill=gray!50] (5.7, 0) rectangle (6, -0.5);
\draw[fill=black] (0.2, 1.0) circle (0.05);
\draw[fill=black] (1.55, 1.75) circle (0.05);
\draw[fill=black] (2.15, -1.2) circle (0.05);
\draw[fill=black] (3.8, 0.85) circle (0.05);
\draw[fill=black] (4.5, 0.35) circle (0.05);
\draw[fill=black] (6.0, -0.5) circle (0.05);
\node[above, font=\tiny] at (0.2, 1.0) {$(s_1, f(s_1))$};
\node[above, font=\tiny] at (1.55, 1.75) {$(s_2, f(s_2))$};
\node[below, font=\tiny] at (2.15, -1.2) {$(s_3, f(s_3))$};
\node[above, font=\tiny] at (3.8, 0.85) {$(s_4, f(s_4))$};
\node[above, font=\tiny] at (4.5, 0.35) {$(s_5, f(s_5))$};
\node[below, font=\tiny] at (6.0, -0.5) {$(s_6, f(s_6))$};
\draw[thick, style=dashed, color=blue]
(0, 0.8) .. controls (0.1, 0.9) and (0.1, 1.1) ..
(0.2, 1.0) .. controls (1, 2) and (1, -1.0) ..
(1.55, 1.75) .. controls (1.8, -0.42) and (2.1, 1.9) ..
(2.15, -1.2) .. controls (2.6, -1.3) and (3.2, -1.1) ..
(3.8, 0.85) .. controls (3.9, 0.9) and (3.9, 0.8) ..
(4.5, 0.35) .. controls (4.6, 0.4) and (4.6, 0.3) ..
(6.0, -0.5)
;
\node[font=\tiny] at (0,-0.15) {$x_0$};
\node[font=\tiny] at (0.8,-0.15) {$x_1$};
\node[font=\tiny] at (1.9,-0.15) {$x_2$};
\node[font=\tiny] at (3.4,-0.15) {$x_3$};
\node[font=\tiny] at (4.2,-0.15) {$x_4$};
\node[font=\tiny] at (5.7,-0.15) {$x_5$};
\node[font=\tiny] at (6,-0.15) {$x_6$};
\end{tikzpicture}

%(2.15, -1.2)
%(3.8, 0.85)
%(4.5, 0.35)
%(6.0, -0.5)

</latex-image>
<sageplot>
# Import necessary library
from sage.plot.graphics import Graphics

# Create a new graphics object
geometry = Graphics()

# Add rectangles
rectangles = [
((0, 0), (0.8, 1)),
((0.8, 0), (1.9, 1.75)),
((1.9, 0), (3.4, -1.2)),
((3.4, 0), (4.2, 0.85)),
((4.2, 0), (5.7, 0.35)),
((5.7, 0), (6, -0.5)),
]
for rect in rectangles:
geometry += polygon2d(
[rect[0], (rect[1][0], rect[0][1]), rect[1], (rect[0][0], rect[1][1])],
fill=True, color='lightgray', edgecolor='black'
)

# Add points and their labels
points = [
(0.2, 1.0, "$(s_1, f(s_1))$", "above"),
(1.55, 1.75, "$(s_2, f(s_2))$", "above"),
(2.15, -1.2, "$(s_3, f(s_3))$", "below"),
(3.8, 0.85, "$(s_4, f(s_4))$", "above"),
(4.5, 0.35, "$(s_5, f(s_5))$", "above"),
(6.0, -0.5, "$(s_6, f(s_6))$", "below"),
]
for (x, y, label, position) in points:
geometry += point((x, y), color="black", size=20)
geometry += text(label, (x, y + (0.2 if position == "above" else -0.2)), fontsize=12, color="black")

# Add x-axis labels
x_labels = [
(0, "$x_0$"), (0.8, "$x_1$"), (1.9, "$x_2$"), (3.4, "$x_3$"),
(4.2, "$x_4$"), (5.7, "$x_5$"), (6, "$x_6$")
]
for (x, label) in x_labels:
geometry += text(label, (x, -0.15), fontsize=12, color="black")

# Define the Bézier path
bezier_segments = [
bezier_path([[(0, 0.8), (0.1, 0.9), (0.1, 1.1), (0.2, 1.0)]], alpha=0.75, color = 'blue', thickness=2, linestyle='dashed'),
bezier_path([[(0.2, 1.0), (1, 2), (1, -1.0), (1.55, 1.75)]], alpha=0.75, color = 'blue', thickness=2, linestyle='dashed'),
bezier_path([[(1.55, 1.75), (1.8, -0.42), (2.1, 1.9), (2.15, -1.2)]], alpha=0.75, color = 'blue', thickness=2, linestyle='dashed'),
bezier_path([[(2.15, -1.2), (2.6, -1.3), (3.2, -1.1), (3.8, 0.85)]], alpha=0.75, color = 'blue', thickness=2, linestyle='dashed'),
bezier_path([[(3.8, 0.85), (3.9, 0.9), (3.9, 0.8), (4.5, 0.35)]], alpha=0.75, color = 'blue', thickness=2, linestyle='dashed'),
bezier_path([[(4.5, 0.35), (4.6, 0.4), (4.6, 0.3), (6.0, -0.5)]], alpha=0.75, color = 'blue', thickness=2, linestyle='dashed')
]

# Add the Bézier curves to the graphics
geometry += sum(bezier_segments, Graphics())
geometry.axes(False)
geometry
</sageplot>
</image>
</figure>

Expand Down Expand Up @@ -374,36 +427,22 @@
<p>
Explain how to approximate the area under the curve
<me>
f(x) = -\frac{1}{5} (x-4)(x-10)(x-12)
f(x) = \frac{1}{5} (x-4)(x-10)(x-12)
</me> on the
interval <m>[4,10]</m> using a right Riemann
sum with 3 subintervals.
</p>
<image>
<description>The graph of the function <m>f(x) = -1/5 (x-4)(x-10)(x-12)</m>
<description>The graph of the function <m>f(x) = 1/5 (x-4)(x-10)(x-12)</m>
crosses the <m>x</m>-axis upward at <m>(4,0)</m> and downward at <m>(10,0)</m>
with a maximum at about <m>(6.3, 9.7)</m>.
</description>
<latex-image>
\begin{tikzpicture}
\begin{axis}[
axis lines=middle,
grid=both,
xmin=3,
xmax=11,
ymin=-1,
ymax=12,
xlabel=$x$,
ylabel=$y$,
xtick={3,4,...,10},
ytick={0,1,...,12},
legend pos=north east,
]
\addplot[domain=3:11, smooth, thick, blue] {1/5*(x-4)*(x-10)*(x-12)};
\addlegendentry{{\tiny $f(x)=\frac{1}{5}(x-4)(x-10)(x-12)$}}
\end{axis}
\end{tikzpicture}
</latex-image>
<sageplot>
x = var('x')
f = 0.2*(x-4)*(x-10)*(x-12)
p = plot(f,(x,3,10.5),gridlines=True,ymin = -1, ymax = 11, thickness=2, axes_labels=('$x$','$y$'))
p
</sageplot>
</image>
</statement>
<solution>
Expand Down
85 changes: 77 additions & 8 deletions source/calculus/source/04-IN/05.ptx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,15 @@
</introduction>

<figure xml:id="in5-figure-1">
<image width="50%" source="area1.png" />
<image width="50%">
<sageplot>
x= var('x')
f = 0.5*x+2
ticks = [[-4,-3,-2,-1,0,1,2,3,4,5,6,7,8],[1,2,3,4,5,6]]
p = plot(f,(x,-4,8),gridlines=True, thickness=2, axes_labels=('$x$','$f(x)$'), aspect_ratio=1.25, ticks=ticks)
p
</sageplot>
</image>
</figure>
</activity>

Expand All @@ -27,7 +35,14 @@
<p>Approximate the area under the curve <m>f(x)=(x-1)^2+2</m> on the interval <m>[1,5]</m> using a <b>left</b> Riemann sum with four uniform subdivisions. Draw your rectangles on the graph.</p>
</introduction>
<figure xml:id="in5-figure-2">
<image width="50%" source="riemann1.png" />
<image width="50%">
<sageplot>
x = var('x')
f = (x-1)^2 + 2
p = plot(f,(x,0,5), gridlines=True, thickness=2, axes_labels=('$x$','$f(x)$'), aspect_ratio = .25)
p
</sageplot>
</image>
</figure>
</activity>

Expand Down Expand Up @@ -96,21 +111,44 @@
<task>
<p> <m> \displaystyle \int_0^2 \left(x^2+3\right) \, dx </m></p>
<figure xml:id="in5-figure-3">
<image width="50%" source="x2plus3.png" />
<image width="50%">
<sageplot>
x = var('x')
f = x^2 + 3
ticks = [True, [1..12]]
p = plot(f,(x,-3,3), ymin = 0, gridlines=True, thickness=2, axes_labels=('$x$','$y$'),ticks=ticks)
p
</sageplot>
</image>
</figure>
</task>

<task>
<p> <m> \displaystyle \int_1^4 \left(\sqrt{x}\right) \, dx </m></p>
<figure xml:id="in5-figure-4">
<image width="50%" source="sqrtx.png" />
<image width="50%">
<sageplot>
x = var('x')
f = sqrt(x)
p = plot(f,(x,0,6), gridlines=True, thickness=2, axes_labels=('$x$','$y$'))
p
</sageplot>
</image>
</figure>
</task>

<task>
<p> <m> \displaystyle \int_{-\pi/4}^{\pi/2} \left(\cos x\right) \, dx </m></p>
<figure xml:id="in5-figure-5">
<image width="50%" source="cosx.png" />
<image width="50%">
<sageplot>
x = var('x')
f = cos(x)
ticks = [[-pi/2, -pi/4,0,pi/4,pi/2,3*pi/4,pi],True]
p = plot(f,(x,-pi/2,pi), gridlines='minor', thickness=2, axes_labels=('$x$','$y$'), tick_formatter=[pi,None], ticks=ticks)
p
</sageplot>
</image>
</figure>
</task>
</activity>
Expand All @@ -124,7 +162,14 @@
</ol>
</p>
<figure xml:id="in5-figure-6">
<image width="50%" source="linedefint.png" />
<image width="50%">
<sageplot>
x = var('x')
f = 2*x-6
p = plot(f,(x,0,8), gridlines=True, thickness=2, axes_labels=('$x$','$f(x)$'))
p
</sageplot>
</image>
</figure>
<p>What do you notice?</p>
</introduction>
Expand All @@ -134,7 +179,14 @@
<introduction>
<p>Find the area bounded by the curves <m>f(x)=e^x-2</m>, the <m>x</m>-axis, <m>x=0</m>, and <m>x=1</m>. </p>
<figure xml:id="in5-figure-7">
<image width="50%" source="exminus2.png" />
<image width="50%">
<sageplot>
x = var('x')
f = exp(x)-2
p = plot(f,(x,-1,1.5), gridlines=True, thickness=2, axes_labels=('$x$','$f(x)$'))
p
</sageplot>
</image>
</figure>
</introduction>
</activity>
Expand All @@ -147,12 +199,29 @@
<p><m>y=\frac{1}{x^2}</m></p>
<figure xml:id="in5-figure-8">
<image width="50%" source="defintarea1.png" />
<image width="50%">
<sageplot>
x = var('x')
f = 1/x^2
p1 = plot(f,(x,.5,3.5), gridlines=True, thickness=2, axes_labels=('$x$','$y$'))
p2 = plot(f,(x,1,3),fill=True)
p1+p2
</sageplot>
</image>
</figure>
</task>
<task>
<p><m>y=3x^2-x^3</m></p>
<figure xml:id="in5-figure-9">
<image width="50%" source="defintarea2.png" />
<image width="50%">
<sageplot>
x=var('x')
f = 3*x^2-x^3
p1 = plot(f,(x,-1,4),ymin = -2, thickness=2,gridlines=True, axes_labels=('$x$','$y$'))
p2 = plot(f,(x,0,2),fill=True)
p1+p2
</sageplot>
</image>
</figure>
</task>
</activity>
Expand Down
Loading