diff --git a/CwJ/alternatives/plotly_plotting.jmd b/CwJ/alternatives/plotly_plotting.jmd
index e887b5d..84eaae5 100644
--- a/CwJ/alternatives/plotly_plotting.jmd
+++ b/CwJ/alternatives/plotly_plotting.jmd
@@ -1,5 +1,10 @@
# JavaScript based plotting libraries
+!!! alert "Not working with quarto"
+ Currently, the plots generated here are not rendering within quarto.
+
+
+
This section uses this add-on package:
```julia
diff --git a/CwJ/derivatives/mean_value_theorem.jmd b/CwJ/derivatives/mean_value_theorem.jmd
index ddb846e..af71977 100644
--- a/CwJ/derivatives/mean_value_theorem.jmd
+++ b/CwJ/derivatives/mean_value_theorem.jmd
@@ -396,7 +396,39 @@ That is the function $f(x)$, minus the secant line between $(a,f(a))$ and $(b, f
nothing
```
-An interactive example can be found at [jsxgraph](http://jsxgraph.uni-bayreuth.de/wiki/index.php?title=Mean_Value_Theorem).
+```=html
+
+```
+
+```ojs
+//| echo: false
+//| output: false
+
+JXG = require("jsxgraph");
+
+board = JXG.JSXGraph.initBoard('jsxgraph', {boundingbox: [-5, 10, 7, -6], axis:true});
+p = [
+ board.create('point', [-1,-2], {size:2}),
+ board.create('point', [6,5], {size:2}),
+ board.create('point', [-0.5,1], {size:2}),
+ board.create('point', [3,3], {size:2})
+];
+f = JXG.Math.Numerics.lagrangePolynomial(p);
+graph = board.create('functiongraph', [f,-10, 10]);
+
+g = function(x) {
+ return JXG.Math.Numerics.D(f)(x)-(p[1].Y()-p[0].Y())/(p[1].X()-p[0].X());
+};
+
+r = board.create('glider', [
+ function() { return JXG.Math.Numerics.root(g,(p[0].X()+p[1].X())*0.5); },
+ function() { return f(JXG.Math.Numerics.root(g,(p[0].X()+p[1].X())*0.5)); },
+ graph], {name:' ',size:4,fixed:true});
+board.create('tangent', [r], {strokeColor:'#ff0000'});
+line = board.create('line',[p[0],p[1]],{strokeColor:'#ff0000',dash:1});
+```
+
+This interactive example can also be found at [jsxgraph](http://jsxgraph.uni-bayreuth.de/wiki/index.php?title=Mean_Value_Theorem). It shows a cubic polynomial fit to the ``4`` adjustable points labeled A through D. The secant line is drawn between points A and B with a dashed line. A tangent line -- with the same slope as the secant line -- is identified at a point ``(\alpha, f(\alpha))`` where ``\alpha`` is between the points A and B. That this can always be done is a conseuqence of the mean value theorem.
##### Example
diff --git a/CwJ/derivatives/newtons_method.jmd b/CwJ/derivatives/newtons_method.jmd
index 8c0390a..f4ddcc2 100644
--- a/CwJ/derivatives/newtons_method.jmd
+++ b/CwJ/derivatives/newtons_method.jmd
@@ -285,6 +285,96 @@ gif(anim, imgfile, fps = 1)
ImageFile(imgfile, caption)
```
+----
+
+This interactive graphic (built using [JSXGraph](https://jsxgraph.uni-bayreuth.de/wp/index.html)) allows the adjustment of the point `x0`, initially at ``0.85``. Five iterations of Newton's method are illustrated. Different positions of `x0` clearly converge, others will not.
+
+```=html
+
+```
+
+```ojs
+//| echo: false
+//| output: false
+
+JXG = require("jsxgraph");
+
+// newton's method
+
+b = JXG.JSXGraph.initBoard('jsxgraph', {
+ boundingbox: [-3,5,3,-5], axis:true
+});
+
+
+f = function(x) {return x*x*x*x*x - x - 1};
+fp = function(x) { return 4*x*x*x*x - 1};
+x0 = 0.85;
+
+nm = function(x) { return x - f(x)/fp(x);};
+
+l = b.create('point', [-1.5,0], {name:'', size:0});
+r = b.create('point', [1.5,0], {name:'', size:0});
+xaxis = b.create('line', [l,r])
+
+
+P0 = b.create('glider', [x0,0,xaxis], {name:'x0'});
+P0a = b.create('point', [function() {return P0.X();},
+ function() {return f(P0.X());}], {name:''});
+
+P1 = b.create('point', [function() {return nm(P0.X());},
+ 0], {name:''});
+P1a = b.create('point', [function() {return P1.X();},
+ function() {return f(P1.X());}], {name:''});
+
+P2 = b.create('point', [function() {return nm(P1.X());},
+ 0], {name:''});
+P2a = b.create('point', [function() {return P2.X();},
+ function() {return f(P2.X());}], {name:''});
+
+P3 = b.create('point', [function() {return nm(P2.X());},
+ 0], {name:''});
+P3a = b.create('point', [function() {return P3.X();},
+ function() {return f(P3.X());}], {name:''});
+
+P4 = b.create('point', [function() {return nm(P3.X());},
+ 0], {name:''});
+P4a = b.create('point', [function() {return P4.X();},
+ function() {return f(P4.X());}], {name:''});
+P5 = b.create('point', [function() {return nm(P4.X());},
+ 0], {name:'x5', strokeColor:'black'});
+
+
+
+
+
+P0a.setAttribute({fixed:true});
+P1.setAttribute({fixed:true});
+P1a.setAttribute({fixed:true});
+P2.setAttribute({fixed:true});
+P2a.setAttribute({fixed:true});
+P3.setAttribute({fixed:true});
+P3a.setAttribute({fixed:true});
+P4.setAttribute({fixed:true});
+P4a.setAttribute({fixed:true});
+P5.setAttribute({fixed:true});
+
+sc = '#000000';
+b.create('segment', [P0,P0a], {strokeColor:sc, strokeWidth:1});
+b.create('segment', [P0a, P1], {strokeColor:sc, strokeWidth:1});
+b.create('segment', [P1,P1a], {strokeColor:sc, strokeWidth:1});
+b.create('segment', [P1a, P2], {strokeColor:sc, strokeWidth:1});
+b.create('segment', [P2,P2a], {strokeColor:sc, strokeWidth:1});
+b.create('segment', [P2a, P3], {strokeColor:sc, strokeWidth:1});
+b.create('segment', [P3,P3a], {strokeColor:sc, strokeWidth:1});
+b.create('segment', [P3a, P4], {strokeColor:sc, strokeWidth:1});
+b.create('segment', [P4,P4a], {strokeColor:sc, strokeWidth:1});
+b.create('segment', [P4a, P5], {strokeColor:sc, strokeWidth:1});
+
+b.create('functiongraph', [f, -1.5, 1.5])
+
+```
+
+
##### Example: numeric not algebraic
diff --git a/CwJ/integrals/area.jmd b/CwJ/integrals/area.jmd
index 34fd530..16e0580 100644
--- a/CwJ/integrals/area.jmd
+++ b/CwJ/integrals/area.jmd
@@ -1430,11 +1430,49 @@ The area under a curve approximated by a Riemann sum.
# url = "riemann.js"
#CalculusWithJulia.WeaveSupport.JSXGraph(:integrals, url, caption)
# This is just wrong...
-url = "https://raw.githubusercontent.com/jverzani/CalculusWithJulia.jl/master/CwJ/integrals/riemann.js"
-url = "./riemann.js"
-CalculusWithJulia.WeaveSupport.JSXGraph(url, caption)
+#CalculusWithJulia.WeaveSupport.JSXGraph(url, caption)
+nothing
```
+```=html
+
+```
+
+```ojs
+//| echo: false
+//| output: false
+JXG = require("jsxgraph");
+
+b = JXG.JSXGraph.initBoard('jsxgraph', {
+ boundingbox: [-0.5,0.3,1.5,-1/4], axis:true
+});
+
+g = function(x) { return x*x*x*x + 10*x*x - 60* x + 100}
+f = function(x) {return 1/Math.sqrt(g(x))};
+
+type = "right";
+l = 0;
+r = 1;
+rsum = function() {
+ return JXG.Math.Numerics.riemannsum(f,n.Value(), type, l, r);
+};
+n = b.create('slider', [[0.1, -0.05],[0.75,-0.05], [2,1,50]],{name:'n',snapWidth:1});
+
+graph = b.create('functiongraph', [f, l, r]);
+os = b.create('riemannsum',
+ [f,
+ function(){ return n.Value();},
+ type, l, r
+ ],
+ {fillColor:'#ffff00', fillOpacity:0.3});
+
+b.create('text', [0.1,0.25, function(){
+ return 'Riemann sum='+(rsum().toFixed(4));
+}]);
+```
+
+
+
The interactive graphic shows the area of a right-Riemann sum for different partitions. The function is
diff --git a/CwJ/limits/limits.jmd b/CwJ/limits/limits.jmd
index 43a9058..2a2d5e7 100644
--- a/CwJ/limits/limits.jmd
+++ b/CwJ/limits/limits.jmd
@@ -384,6 +384,43 @@ get close to $c$ - allows us to gather quickly if a function seems to
have a limit at $c$, though the precise value of $L$ may be hard to identify.
+##### Example
+
+This example illustrates the same limit a different way. Sliding the ``x`` value towards ``0`` shows ``f(x) = \sin(x)/x`` approaches a value of ``1``.
+
+
+```=html
+
+```
+
+```ojs
+//| echo: false
+//| output: false
+
+JXG = require("jsxgraph")
+
+b = JXG.JSXGraph.initBoard('jsxgraph', {
+ boundingbox: [-6, 1.2, 6,-1.2], axis:true
+});
+
+f = function(x) {return Math.sin(x) / x;};
+graph = b.create("functiongraph", [f, -6, 6])
+seg = b.create("line", [[-6,0], [6,0]], {fixed:true});
+
+X = b.create("glider", [2, 0, seg], {name:"x", size:4});
+P = b.create("point", [function() {return X.X()}, function() {return f(X.X())}], {name:""});
+Q = b.create("point", [0, function() {return P.Y();}], {name:"f(x)"});
+
+segup = b.create("segment", [P,X], {dash:2});
+segover = b.create("segment", [P, [0, function() {return P.Y()}]], {dash:2});
+
+
+txt = b.create('text', [2, 1, function() {
+ return "x = " + X.X().toFixed(4) + ", f(x) = " + P.Y().toFixed(4);
+}]);
+```
+
+
##### Example
@@ -436,8 +473,6 @@ $g(x) = (x-3)/(x+3)$ when $x \neq 2$. The function $g(x)$ is
$g(2) = (2 - 3)/(2 + 3) = -0.2$ it would be made continuous, hence the
term removable singularity.
-
-
## Numerical approaches to limits
The investigation of $\lim_{x \rightarrow 0}(1 + x)^{1/x}$ by
diff --git a/Project.toml b/Project.toml
index 0429915..217b330 100644
--- a/Project.toml
+++ b/Project.toml
@@ -1,7 +1,7 @@
name = "CalculusWithJuliaNotes"
uuid = "8cd3c377-0a30-4ec5-b85a-75291d749efe"
authors = ["jverzani and contributors"]
-version = "0.1.0"
+version = "0.1.1"
[compat]
julia = "1"
diff --git a/quarto/ODEs/differential_equations.qmd b/quarto/ODEs/differential_equations.qmd
index 054e4c9..0097bb5 100644
--- a/quarto/ODEs/differential_equations.qmd
+++ b/quarto/ODEs/differential_equations.qmd
@@ -1,33 +1,7 @@
# The `DifferentialEquations` suite
-```{julia}
-#| echo: false
-
-import Logging
-Logging.disable_logging(Logging.Info) # or e.g. Logging.Info
-Logging.disable_logging(Logging.Warn)
-
-import SymPy
-function Base.show(io::IO, ::MIME"text/html", x::T) where {T <: SymPy.SymbolicObject}
- println(io, " ")
- println(io, "\\[")
- println(io, sympy.latex(x))
- println(io, "\\]")
- println(io, "")
-end
-
-# hack to work around issue
-import Markdown
-import CalculusWithJulia
-function CalculusWithJulia.WeaveSupport.ImageFile(d::Symbol, f::AbstractString, caption; kwargs...)
- nm = joinpath("..", string(d), f)
- u = ""
- Markdown.parse(u)
-end
-
-nothing
-```
+{{< include ../_common_code.qmd >}}
This section uses these add-on packages:
diff --git a/quarto/ODEs/euler.qmd b/quarto/ODEs/euler.qmd
index 86391b4..535b62e 100644
--- a/quarto/ODEs/euler.qmd
+++ b/quarto/ODEs/euler.qmd
@@ -1,33 +1,7 @@
# Euler's method
-```{julia}
-#| echo: false
-
-import Logging
-Logging.disable_logging(Logging.Info) # or e.g. Logging.Info
-Logging.disable_logging(Logging.Warn)
-
-import SymPy
-function Base.show(io::IO, ::MIME"text/html", x::T) where {T <: SymPy.SymbolicObject}
- println(io, " ")
- println(io, "\\[")
- println(io, sympy.latex(x))
- println(io, "\\]")
- println(io, "")
-end
-
-# hack to work around issue
-import Markdown
-import CalculusWithJulia
-function CalculusWithJulia.WeaveSupport.ImageFile(d::Symbol, f::AbstractString, caption; kwargs...)
- nm = joinpath("..", string(d), f)
- u = ""
- Markdown.parse(u)
-end
-
-nothing
-```
+{{< include ../_common_code.qmd >}}
This section uses these add-on packages:
diff --git a/quarto/ODEs/odes.qmd b/quarto/ODEs/odes.qmd
index 5df743b..8aaed8e 100644
--- a/quarto/ODEs/odes.qmd
+++ b/quarto/ODEs/odes.qmd
@@ -1,33 +1,7 @@
# ODEs
-```{julia}
-#| echo: false
-
-import Logging
-Logging.disable_logging(Logging.Info) # or e.g. Logging.Info
-Logging.disable_logging(Logging.Warn)
-
-import SymPy
-function Base.show(io::IO, ::MIME"text/html", x::T) where {T <: SymPy.SymbolicObject}
- println(io, " ")
- println(io, "\\[")
- println(io, sympy.latex(x))
- println(io, "\\]")
- println(io, "")
-end
-
-# hack to work around issue
-import Markdown
-import CalculusWithJulia
-function CalculusWithJulia.WeaveSupport.ImageFile(d::Symbol, f::AbstractString, caption; kwargs...)
- nm = joinpath("..", string(d), f)
- u = ""
- Markdown.parse(u)
-end
-
-nothing
-```
+{{< include ../_common_code.qmd >}}
This section uses these add-on packages:
diff --git a/quarto/ODEs/process.jl b/quarto/ODEs/process.jl
deleted file mode 100644
index 067dff1..0000000
--- a/quarto/ODEs/process.jl
+++ /dev/null
@@ -1,27 +0,0 @@
-using WeavePynb
-using Mustache
-
-mmd(fname) = mmd_to_html(fname, BRAND_HREF="../toc.html", BRAND_NAME="Calculus with Julia")
-## uncomment to generate just .md files
-mmd(fname) = mmd_to_md(fname, BRAND_HREF="../toc.html", BRAND_NAME="Calculus with Julia")
-
-fnames = [
- "odes",
- "euler"
- ]
-
-
-
-function process_file(nm, twice=false)
- include("$nm.jl")
- mmd_to_md("$nm.mmd")
- markdownToHTML("$nm.md")
- twice && markdownToHTML("$nm.md")
-end
-
-process_files(twice=false) = [process_file(nm, twice) for nm in fnames]
-
-"""
-## TODO ODEs
-
-"""
diff --git a/quarto/ODEs/solve.qmd b/quarto/ODEs/solve.qmd
index cee804a..79e67f7 100644
--- a/quarto/ODEs/solve.qmd
+++ b/quarto/ODEs/solve.qmd
@@ -1,33 +1,7 @@
# The problem-algorithm-solve interface
-```{julia}
-#| echo: false
-
-import Logging
-Logging.disable_logging(Logging.Info) # or e.g. Logging.Info
-Logging.disable_logging(Logging.Warn)
-
-import SymPy
-function Base.show(io::IO, ::MIME"text/html", x::T) where {T <: SymPy.SymbolicObject}
- println(io, " ")
- println(io, "\\[")
- println(io, sympy.latex(x))
- println(io, "\\]")
- println(io, "")
-end
-
-# hack to work around issue
-import Markdown
-import CalculusWithJulia
-function CalculusWithJulia.WeaveSupport.ImageFile(d::Symbol, f::AbstractString, caption; kwargs...)
- nm = joinpath("..", string(d), f)
- u = ""
- Markdown.parse(u)
-end
-
-nothing
-```
+{{< include ../_common_code.qmd >}}
This section uses these add-on packages:
diff --git a/quarto/README-quarto.md b/quarto/README-quarto.md
index fa69055..1325e56 100644
--- a/quarto/README-quarto.md
+++ b/quarto/README-quarto.md
@@ -1,11 +1,13 @@
## TODO
-* download .jl file (if we have .jmd)
+* download links to Pluto .jl files (if we have .jmd, but we might deprecate...)
+* PlotlyLight
+* mermaid, ojs?
+
DONE * clean up edit link
DONE * remove pinned header
DONE * clean up directory
-* JSXGraph files
-* mermaid, ojs?
+DONE (?) * JSXGraph files
# CalculusWithJulia via quarto
@@ -24,6 +26,7 @@ To compile the pages through quarto
* bump the version number in `_quarto.yml`, `Project.toml`
* run `quarto publish gh-pages` to publish
+* or `quarto publish gh-pages --no-render` to avoid re-rendering, when just done
* should also push project to github
* no need to push `_freeze` the repo, as files are locally rendered for now.
diff --git a/quarto/_common_code.qmd b/quarto/_common_code.qmd
index 84ad584..824af09 100644
--- a/quarto/_common_code.qmd
+++ b/quarto/_common_code.qmd
@@ -24,5 +24,4 @@ function CalculusWithJulia.WeaveSupport.ImageFile(d::Symbol, f::AbstractString,
end
nothing
-print("all loaded boss")
```
diff --git a/quarto/alternatives/plotly_plotting.qmd b/quarto/alternatives/plotly_plotting.qmd
index 19749f2..a35a9d7 100644
--- a/quarto/alternatives/plotly_plotting.qmd
+++ b/quarto/alternatives/plotly_plotting.qmd
@@ -1,33 +1,13 @@
# JavaScript based plotting libraries
-```{julia}
-#| echo: false
+{{< include ../_common_code.qmd >}}
-import Logging
-Logging.disable_logging(Logging.Info) # or e.g. Logging.Info
-Logging.disable_logging(Logging.Warn)
+:::{.callout-note}
+## Not working with quarto
+Currently, the plots generated here are not rendering within quarto.
-import SymPy
-function Base.show(io::IO, ::MIME"text/html", x::T) where {T <: SymPy.SymbolicObject}
- println(io, " ")
- println(io, "\\[")
- println(io, sympy.latex(x))
- println(io, "\\]")
- println(io, "")
-end
-
-# hack to work around issue
-import Markdown
-import CalculusWithJulia
-function CalculusWithJulia.WeaveSupport.ImageFile(d::Symbol, f::AbstractString, caption; kwargs...)
- nm = joinpath("..", string(d), f)
- u = ""
- Markdown.parse(u)
-end
-
-nothing
-```
+:::
This section uses this add-on package:
diff --git a/quarto/derivatives/curve_sketching.qmd b/quarto/derivatives/curve_sketching.qmd
index 3a05bef..729f29a 100644
--- a/quarto/derivatives/curve_sketching.qmd
+++ b/quarto/derivatives/curve_sketching.qmd
@@ -1,33 +1,7 @@
# Curve Sketching
-```{julia}
-#| echo: false
-
-import Logging
-Logging.disable_logging(Logging.Info) # or e.g. Logging.Info
-Logging.disable_logging(Logging.Warn)
-
-import SymPy
-function Base.show(io::IO, ::MIME"text/html", x::T) where {T <: SymPy.SymbolicObject}
- println(io, " ")
- println(io, "\\[")
- println(io, sympy.latex(x))
- println(io, "\\]")
- println(io, "")
-end
-
-# hack to work around issue
-import Markdown
-import CalculusWithJulia
-function CalculusWithJulia.WeaveSupport.ImageFile(d::Symbol, f::AbstractString, caption; kwargs...)
- nm = joinpath("..", string(d), f)
- u = ""
- Markdown.parse(u)
-end
-
-nothing
-```
+{{< include ../_common_code.qmd >}}
This section uses the following add-on packages:
diff --git a/quarto/derivatives/derivatives.qmd b/quarto/derivatives/derivatives.qmd
index 9ea180c..1ed4c5a 100644
--- a/quarto/derivatives/derivatives.qmd
+++ b/quarto/derivatives/derivatives.qmd
@@ -1,33 +1,7 @@
# Derivatives
-```{julia}
-#| echo: false
-
-import Logging
-Logging.disable_logging(Logging.Info) # or e.g. Logging.Info
-Logging.disable_logging(Logging.Warn)
-
-import SymPy
-function Base.show(io::IO, ::MIME"text/html", x::T) where {T <: SymPy.SymbolicObject}
- println(io, " ")
- println(io, "\\[")
- println(io, sympy.latex(x))
- println(io, "\\]")
- println(io, "")
-end
-
-# hack to work around issue
-import Markdown
-import CalculusWithJulia
-function CalculusWithJulia.WeaveSupport.ImageFile(d::Symbol, f::AbstractString, caption; kwargs...)
- nm = joinpath("..", string(d), f)
- u = ""
- Markdown.parse(u)
-end
-
-nothing
-```
+{{< include ../_common_code.qmd >}}
This section uses these add-on packages:
diff --git a/quarto/derivatives/first_second_derivatives.qmd b/quarto/derivatives/first_second_derivatives.qmd
index 0e68c22..c312726 100644
--- a/quarto/derivatives/first_second_derivatives.qmd
+++ b/quarto/derivatives/first_second_derivatives.qmd
@@ -1,33 +1,7 @@
# The first and second derivatives
-```{julia}
-#| echo: false
-
-import Logging
-Logging.disable_logging(Logging.Info) # or e.g. Logging.Info
-Logging.disable_logging(Logging.Warn)
-
-import SymPy
-function Base.show(io::IO, ::MIME"text/html", x::T) where {T <: SymPy.SymbolicObject}
- println(io, " ")
- println(io, "\\[")
- println(io, sympy.latex(x))
- println(io, "\\]")
- println(io, "")
-end
-
-# hack to work around issue
-import Markdown
-import CalculusWithJulia
-function CalculusWithJulia.WeaveSupport.ImageFile(d::Symbol, f::AbstractString, caption; kwargs...)
- nm = joinpath("..", string(d), f)
- u = ""
- Markdown.parse(u)
-end
-
-nothing
-```
+{{< include ../_common_code.qmd >}}
This section uses these add-on packages:
diff --git a/quarto/derivatives/implicit_differentiation.qmd b/quarto/derivatives/implicit_differentiation.qmd
index 1232992..9401b88 100644
--- a/quarto/derivatives/implicit_differentiation.qmd
+++ b/quarto/derivatives/implicit_differentiation.qmd
@@ -1,33 +1,7 @@
# Implicit Differentiation
-```{julia}
-#| echo: false
-
-import Logging
-Logging.disable_logging(Logging.Info) # or e.g. Logging.Info
-Logging.disable_logging(Logging.Warn)
-
-import SymPy
-function Base.show(io::IO, ::MIME"text/html", x::T) where {T <: SymPy.SymbolicObject}
- println(io, " ")
- println(io, "\\[")
- println(io, sympy.latex(x))
- println(io, "\\]")
- println(io, "")
-end
-
-# hack to work around issue
-import Markdown
-import CalculusWithJulia
-function CalculusWithJulia.WeaveSupport.ImageFile(d::Symbol, f::AbstractString, caption; kwargs...)
- nm = joinpath("..", string(d), f)
- u = ""
- Markdown.parse(u)
-end
-
-nothing
-```
+{{< include ../_common_code.qmd >}}
This section uses these add-on packages:
diff --git a/quarto/derivatives/lhospitals_rule.qmd b/quarto/derivatives/lhospitals_rule.qmd
index fe0e82a..29c0f9e 100644
--- a/quarto/derivatives/lhospitals_rule.qmd
+++ b/quarto/derivatives/lhospitals_rule.qmd
@@ -1,33 +1,7 @@
# L'Hospital's Rule
-```{julia}
-#| echo: false
-
-import Logging
-Logging.disable_logging(Logging.Info) # or e.g. Logging.Info
-Logging.disable_logging(Logging.Warn)
-
-import SymPy
-function Base.show(io::IO, ::MIME"text/html", x::T) where {T <: SymPy.SymbolicObject}
- println(io, " ")
- println(io, "\\[")
- println(io, sympy.latex(x))
- println(io, "\\]")
- println(io, "")
-end
-
-# hack to work around issue
-import Markdown
-import CalculusWithJulia
-function CalculusWithJulia.WeaveSupport.ImageFile(d::Symbol, f::AbstractString, caption; kwargs...)
- nm = joinpath("..", string(d), f)
- u = ""
- Markdown.parse(u)
-end
-
-nothing
-```
+{{< include ../_common_code.qmd >}}
This section uses these add-on packages:
diff --git a/quarto/derivatives/linearization.qmd b/quarto/derivatives/linearization.qmd
index 6c0c3b4..677270a 100644
--- a/quarto/derivatives/linearization.qmd
+++ b/quarto/derivatives/linearization.qmd
@@ -1,33 +1,7 @@
# Linearization
-```{julia}
-#| echo: false
-
-import Logging
-Logging.disable_logging(Logging.Info) # or e.g. Logging.Info
-Logging.disable_logging(Logging.Warn)
-
-import SymPy
-function Base.show(io::IO, ::MIME"text/html", x::T) where {T <: SymPy.SymbolicObject}
- println(io, " ")
- println(io, "\\[")
- println(io, sympy.latex(x))
- println(io, "\\]")
- println(io, "")
-end
-
-# hack to work around issue
-import Markdown
-import CalculusWithJulia
-function CalculusWithJulia.WeaveSupport.ImageFile(d::Symbol, f::AbstractString, caption; kwargs...)
- nm = joinpath("..", string(d), f)
- u = ""
- Markdown.parse(u)
-end
-
-nothing
-```
+{{< include ../_common_code.qmd >}}
This section uses these add-on packages:
diff --git a/quarto/derivatives/mean_value_theorem.qmd b/quarto/derivatives/mean_value_theorem.qmd
index a28f9ad..6f36a58 100644
--- a/quarto/derivatives/mean_value_theorem.qmd
+++ b/quarto/derivatives/mean_value_theorem.qmd
@@ -1,33 +1,7 @@
# The mean value theorem for differentiable functions.
-```{julia}
-#| echo: false
-
-import Logging
-Logging.disable_logging(Logging.Info) # or e.g. Logging.Info
-Logging.disable_logging(Logging.Warn)
-
-import SymPy
-function Base.show(io::IO, ::MIME"text/html", x::T) where {T <: SymPy.SymbolicObject}
- println(io, " ")
- println(io, "\\[")
- println(io, sympy.latex(x))
- println(io, "\\]")
- println(io, "")
-end
-
-# hack to work around issue
-import Markdown
-import CalculusWithJulia
-function CalculusWithJulia.WeaveSupport.ImageFile(d::Symbol, f::AbstractString, caption; kwargs...)
- nm = joinpath("..", string(d), f)
- u = ""
- Markdown.parse(u)
-end
-
-nothing
-```
+{{< include ../_common_code.qmd >}}
This section uses these add-on packages:
@@ -390,7 +364,39 @@ That is the function $f(x)$, minus the secant line between $(a,f(a))$ and $(b, f
nothing
```
-An interactive example can be found at [jsxgraph](http://jsxgraph.uni-bayreuth.de/wiki/index.php?title=Mean_Value_Theorem).
+```{=html}
+
+```
+
+```{ojs}
+//| echo: false
+//| output: false
+
+JXG = require("jsxgraph");
+
+board = JXG.JSXGraph.initBoard('jsxgraph', {boundingbox: [-5, 10, 7, -6], axis:true});
+p = [
+ board.create('point', [-1,-2], {size:2}),
+ board.create('point', [6,5], {size:2}),
+ board.create('point', [-0.5,1], {size:2}),
+ board.create('point', [3,3], {size:2})
+];
+f = JXG.Math.Numerics.lagrangePolynomial(p);
+graph = board.create('functiongraph', [f,-10, 10]);
+
+g = function(x) {
+ return JXG.Math.Numerics.D(f)(x)-(p[1].Y()-p[0].Y())/(p[1].X()-p[0].X());
+};
+
+r = board.create('glider', [
+ function() { return JXG.Math.Numerics.root(g,(p[0].X()+p[1].X())*0.5); },
+ function() { return f(JXG.Math.Numerics.root(g,(p[0].X()+p[1].X())*0.5)); },
+ graph], {name:' ',size:4,fixed:true});
+board.create('tangent', [r], {strokeColor:'#ff0000'});
+line = board.create('line',[p[0],p[1]],{strokeColor:'#ff0000',dash:1});
+```
+
+This interactive example can also be found at [jsxgraph](http://jsxgraph.uni-bayreuth.de/wiki/index.php?title=Mean_Value_Theorem). It shows a cubic polynomial fit to the $4$ adjustable points labeled A through D. The secant line is drawn between points A and B with a dashed line. A tangent line – with the same slope as the secant line – is identified at a point $(\alpha, f(\alpha))$ where $\alpha$ is between the points A and B. That this can always be done is a conseuqence of the mean value theorem.
##### Example
diff --git a/quarto/derivatives/more_zeros.qmd b/quarto/derivatives/more_zeros.qmd
index 189d89c..2544101 100644
--- a/quarto/derivatives/more_zeros.qmd
+++ b/quarto/derivatives/more_zeros.qmd
@@ -1,33 +1,7 @@
# Derivative-free alternatives to Newton's method
-```{julia}
-#| echo: false
-
-import Logging
-Logging.disable_logging(Logging.Info) # or e.g. Logging.Info
-Logging.disable_logging(Logging.Warn)
-
-import SymPy
-function Base.show(io::IO, ::MIME"text/html", x::T) where {T <: SymPy.SymbolicObject}
- println(io, " ")
- println(io, "\\[")
- println(io, sympy.latex(x))
- println(io, "\\]")
- println(io, "")
-end
-
-# hack to work around issue
-import Markdown
-import CalculusWithJulia
-function CalculusWithJulia.WeaveSupport.ImageFile(d::Symbol, f::AbstractString, caption; kwargs...)
- nm = joinpath("..", string(d), f)
- u = ""
- Markdown.parse(u)
-end
-
-nothing
-```
+{{< include ../_common_code.qmd >}}
This section uses these add-on packages:
diff --git a/quarto/derivatives/newtons_method.qmd b/quarto/derivatives/newtons_method.qmd
index bc567f0..803f49b 100644
--- a/quarto/derivatives/newtons_method.qmd
+++ b/quarto/derivatives/newtons_method.qmd
@@ -1,33 +1,7 @@
# Newton's method
-```{julia}
-#| echo: false
-
-import Logging
-Logging.disable_logging(Logging.Info) # or e.g. Logging.Info
-Logging.disable_logging(Logging.Warn)
-
-import SymPy
-function Base.show(io::IO, ::MIME"text/html", x::T) where {T <: SymPy.SymbolicObject}
- println(io, " ")
- println(io, "\\[")
- println(io, sympy.latex(x))
- println(io, "\\]")
- println(io, "")
-end
-
-# hack to work around issue
-import Markdown
-import CalculusWithJulia
-function CalculusWithJulia.WeaveSupport.ImageFile(d::Symbol, f::AbstractString, caption; kwargs...)
- nm = joinpath("..", string(d), f)
- u = ""
- Markdown.parse(u)
-end
-
-nothing
-```
+{{< include ../_common_code.qmd >}}
This section uses these add-on packages:
@@ -311,6 +285,97 @@ gif(anim, imgfile, fps = 1)
ImageFile(imgfile, caption)
```
+---
+
+
+This interactive graphic (built using [JSXGraph](https://jsxgraph.uni-bayreuth.de/wp/index.html)) allows the adjustment of the point `x0`, initially at $0.85$. Five iterations of Newton's method are illustrated. Different positions of `x0` clearly converge, others will not.
+
+
+```{=html}
+
+```
+
+```{ojs}
+//| echo: false
+//| output: false
+
+JXG = require("jsxgraph");
+
+// newton's method
+
+b = JXG.JSXGraph.initBoard('jsxgraph', {
+ boundingbox: [-3,5,3,-5], axis:true
+});
+
+
+f = function(x) {return x*x*x*x*x - x - 1};
+fp = function(x) { return 4*x*x*x*x - 1};
+x0 = 0.85;
+
+nm = function(x) { return x - f(x)/fp(x);};
+
+l = b.create('point', [-1.5,0], {name:'', size:0});
+r = b.create('point', [1.5,0], {name:'', size:0});
+xaxis = b.create('line', [l,r])
+
+
+P0 = b.create('glider', [x0,0,xaxis], {name:'x0'});
+P0a = b.create('point', [function() {return P0.X();},
+ function() {return f(P0.X());}], {name:''});
+
+P1 = b.create('point', [function() {return nm(P0.X());},
+ 0], {name:''});
+P1a = b.create('point', [function() {return P1.X();},
+ function() {return f(P1.X());}], {name:''});
+
+P2 = b.create('point', [function() {return nm(P1.X());},
+ 0], {name:''});
+P2a = b.create('point', [function() {return P2.X();},
+ function() {return f(P2.X());}], {name:''});
+
+P3 = b.create('point', [function() {return nm(P2.X());},
+ 0], {name:''});
+P3a = b.create('point', [function() {return P3.X();},
+ function() {return f(P3.X());}], {name:''});
+
+P4 = b.create('point', [function() {return nm(P3.X());},
+ 0], {name:''});
+P4a = b.create('point', [function() {return P4.X();},
+ function() {return f(P4.X());}], {name:''});
+P5 = b.create('point', [function() {return nm(P4.X());},
+ 0], {name:'x5', strokeColor:'black'});
+
+
+
+
+
+P0a.setAttribute({fixed:true});
+P1.setAttribute({fixed:true});
+P1a.setAttribute({fixed:true});
+P2.setAttribute({fixed:true});
+P2a.setAttribute({fixed:true});
+P3.setAttribute({fixed:true});
+P3a.setAttribute({fixed:true});
+P4.setAttribute({fixed:true});
+P4a.setAttribute({fixed:true});
+P5.setAttribute({fixed:true});
+
+sc = '#000000';
+b.create('segment', [P0,P0a], {strokeColor:sc, strokeWidth:1});
+b.create('segment', [P0a, P1], {strokeColor:sc, strokeWidth:1});
+b.create('segment', [P1,P1a], {strokeColor:sc, strokeWidth:1});
+b.create('segment', [P1a, P2], {strokeColor:sc, strokeWidth:1});
+b.create('segment', [P2,P2a], {strokeColor:sc, strokeWidth:1});
+b.create('segment', [P2a, P3], {strokeColor:sc, strokeWidth:1});
+b.create('segment', [P3,P3a], {strokeColor:sc, strokeWidth:1});
+b.create('segment', [P3a, P4], {strokeColor:sc, strokeWidth:1});
+b.create('segment', [P4,P4a], {strokeColor:sc, strokeWidth:1});
+b.create('segment', [P4a, P5], {strokeColor:sc, strokeWidth:1});
+
+b.create('functiongraph', [f, -1.5, 1.5])
+
+```
+
##### Example: numeric not algebraic
diff --git a/quarto/derivatives/numeric_derivatives.qmd b/quarto/derivatives/numeric_derivatives.qmd
index 32243af..afbcc90 100644
--- a/quarto/derivatives/numeric_derivatives.qmd
+++ b/quarto/derivatives/numeric_derivatives.qmd
@@ -1,33 +1,7 @@
# Numeric derivatives
-```{julia}
-#| echo: false
-
-import Logging
-Logging.disable_logging(Logging.Info) # or e.g. Logging.Info
-Logging.disable_logging(Logging.Warn)
-
-import SymPy
-function Base.show(io::IO, ::MIME"text/html", x::T) where {T <: SymPy.SymbolicObject}
- println(io, " ")
- println(io, "\\[")
- println(io, sympy.latex(x))
- println(io, "\\]")
- println(io, "")
-end
-
-# hack to work around issue
-import Markdown
-import CalculusWithJulia
-function CalculusWithJulia.WeaveSupport.ImageFile(d::Symbol, f::AbstractString, caption; kwargs...)
- nm = joinpath("..", string(d), f)
- u = ""
- Markdown.parse(u)
-end
-
-nothing
-```
+{{< include ../_common_code.qmd >}}
This section uses these add-on packages:
diff --git a/quarto/derivatives/optimization.qmd b/quarto/derivatives/optimization.qmd
index 5171032..1c0d17b 100644
--- a/quarto/derivatives/optimization.qmd
+++ b/quarto/derivatives/optimization.qmd
@@ -1,33 +1,7 @@
# Optimization
-```{julia}
-#| echo: false
-
-import Logging
-Logging.disable_logging(Logging.Info) # or e.g. Logging.Info
-Logging.disable_logging(Logging.Warn)
-
-import SymPy
-function Base.show(io::IO, ::MIME"text/html", x::T) where {T <: SymPy.SymbolicObject}
- println(io, " ")
- println(io, "\\[")
- println(io, sympy.latex(x))
- println(io, "\\]")
- println(io, "")
-end
-
-# hack to work around issue
-import Markdown
-import CalculusWithJulia
-function CalculusWithJulia.WeaveSupport.ImageFile(d::Symbol, f::AbstractString, caption; kwargs...)
- nm = joinpath("..", string(d), f)
- u = ""
- Markdown.parse(u)
-end
-
-nothing
-```
+{{< include ../_common_code.qmd >}}
This section uses these add-on packages:
diff --git a/quarto/derivatives/process.jl b/quarto/derivatives/process.jl
deleted file mode 100644
index 3ef5ee5..0000000
--- a/quarto/derivatives/process.jl
+++ /dev/null
@@ -1,44 +0,0 @@
-using WeavePynb
-
-using CwJWeaveTpl
-
-
-
-fnames = [
- "derivatives", ## more questions
- "numeric_derivatives",
-
- "mean_value_theorem",
- "optimization",
- "curve_sketching",
-
- "linearization",
- "newtons_method",
- "lhopitals_rule", ## Okay - -but could beef up questions..
-
-
- "implicit_differentiation", ## add more questions?
- "related_rates",
- "taylor_series_polynomials"
-]
-
-
-process_file(nm; cache=:off) = CwJWeaveTpl.mmd(nm * ".jmd", cache=cache)
-
-function process_files(;cache=:user)
- for f in fnames
- @show f
- process_file(f, cache=cache)
- end
-end
-
-
-
-
-"""
-## TODO derivatives
-
-tangent lines intersect at avearge for a parabola
-
-Should we have derivative results: inverse functions, logarithmic differentiation...
-"""
diff --git a/quarto/derivatives/related_rates.qmd b/quarto/derivatives/related_rates.qmd
index 03e982b..e61753e 100644
--- a/quarto/derivatives/related_rates.qmd
+++ b/quarto/derivatives/related_rates.qmd
@@ -1,33 +1,7 @@
# Related rates
-```{julia}
-#| echo: false
-
-import Logging
-Logging.disable_logging(Logging.Info) # or e.g. Logging.Info
-Logging.disable_logging(Logging.Warn)
-
-import SymPy
-function Base.show(io::IO, ::MIME"text/html", x::T) where {T <: SymPy.SymbolicObject}
- println(io, " ")
- println(io, "\\[")
- println(io, sympy.latex(x))
- println(io, "\\]")
- println(io, "")
-end
-
-# hack to work around issue
-import Markdown
-import CalculusWithJulia
-function CalculusWithJulia.WeaveSupport.ImageFile(d::Symbol, f::AbstractString, caption; kwargs...)
- nm = joinpath("..", string(d), f)
- u = ""
- Markdown.parse(u)
-end
-
-nothing
-```
+{{< include ../_common_code.qmd >}}
This section uses these add-on packaages:
diff --git a/quarto/derivatives/symbolic_derivatives.qmd b/quarto/derivatives/symbolic_derivatives.qmd
index 7d30bfa..c3b1149 100644
--- a/quarto/derivatives/symbolic_derivatives.qmd
+++ b/quarto/derivatives/symbolic_derivatives.qmd
@@ -1,33 +1,7 @@
# Symbolic derivatives
-```{julia}
-#| echo: false
-
-import Logging
-Logging.disable_logging(Logging.Info) # or e.g. Logging.Info
-Logging.disable_logging(Logging.Warn)
-
-import SymPy
-function Base.show(io::IO, ::MIME"text/html", x::T) where {T <: SymPy.SymbolicObject}
- println(io, " ")
- println(io, "\\[")
- println(io, sympy.latex(x))
- println(io, "\\]")
- println(io, "")
-end
-
-# hack to work around issue
-import Markdown
-import CalculusWithJulia
-function CalculusWithJulia.WeaveSupport.ImageFile(d::Symbol, f::AbstractString, caption; kwargs...)
- nm = joinpath("..", string(d), f)
- u = ""
- Markdown.parse(u)
-end
-
-nothing
-```
+{{< include ../_common_code.qmd >}}
This section uses this add-on package:
diff --git a/quarto/derivatives/taylor_series_polynomials.qmd b/quarto/derivatives/taylor_series_polynomials.qmd
index 328327b..cb6f8ec 100644
--- a/quarto/derivatives/taylor_series_polynomials.qmd
+++ b/quarto/derivatives/taylor_series_polynomials.qmd
@@ -1,33 +1,7 @@
# Taylor Polynomials and other Approximating Polynomials
-```{julia}
-#| echo: false
-
-import Logging
-Logging.disable_logging(Logging.Info) # or e.g. Logging.Info
-Logging.disable_logging(Logging.Warn)
-
-import SymPy
-function Base.show(io::IO, ::MIME"text/html", x::T) where {T <: SymPy.SymbolicObject}
- println(io, " ")
- println(io, "\\[")
- println(io, sympy.latex(x))
- println(io, "\\]")
- println(io, "")
-end
-
-# hack to work around issue
-import Markdown
-import CalculusWithJulia
-function CalculusWithJulia.WeaveSupport.ImageFile(d::Symbol, f::AbstractString, caption; kwargs...)
- nm = joinpath("..", string(d), f)
- u = ""
- Markdown.parse(u)
-end
-
-nothing
-```
+{{< include ../_common_code.qmd >}}
This section uses these add-on packages:
diff --git a/quarto/differentiable_vector_calculus/plots_plotting.qmd b/quarto/differentiable_vector_calculus/plots_plotting.qmd
index f1b74c0..fe9a3a3 100644
--- a/quarto/differentiable_vector_calculus/plots_plotting.qmd
+++ b/quarto/differentiable_vector_calculus/plots_plotting.qmd
@@ -1,33 +1,7 @@
# 2D and 3D plots in Julia with Plots
-```{julia}
-#| echo: false
-
-import Logging
-Logging.disable_logging(Logging.Info) # or e.g. Logging.Info
-Logging.disable_logging(Logging.Warn)
-
-import SymPy
-function Base.show(io::IO, ::MIME"text/html", x::T) where {T <: SymPy.SymbolicObject}
- println(io, " ")
- println(io, "\\[")
- println(io, sympy.latex(x))
- println(io, "\\]")
- println(io, "")
-end
-
-# hack to work around issue
-import Markdown
-import CalculusWithJulia
-function CalculusWithJulia.WeaveSupport.ImageFile(d::Symbol, f::AbstractString, caption; kwargs...)
- nm = joinpath("..", string(d), f)
- u = ""
- Markdown.parse(u)
-end
-
-nothing
-```
+{{< include ../_common_code.qmd >}}
This section uses these add-on packages:
diff --git a/quarto/differentiable_vector_calculus/polar_coordinates.qmd b/quarto/differentiable_vector_calculus/polar_coordinates.qmd
index 0532ccf..bb4d4fb 100644
--- a/quarto/differentiable_vector_calculus/polar_coordinates.qmd
+++ b/quarto/differentiable_vector_calculus/polar_coordinates.qmd
@@ -1,33 +1,7 @@
# Polar Coordinates and Curves
-```{julia}
-#| echo: false
-
-import Logging
-Logging.disable_logging(Logging.Info) # or e.g. Logging.Info
-Logging.disable_logging(Logging.Warn)
-
-import SymPy
-function Base.show(io::IO, ::MIME"text/html", x::T) where {T <: SymPy.SymbolicObject}
- println(io, " ")
- println(io, "\\[")
- println(io, sympy.latex(x))
- println(io, "\\]")
- println(io, "")
-end
-
-# hack to work around issue
-import Markdown
-import CalculusWithJulia
-function CalculusWithJulia.WeaveSupport.ImageFile(d::Symbol, f::AbstractString, caption; kwargs...)
- nm = joinpath("..", string(d), f)
- u = ""
- Markdown.parse(u)
-end
-
-nothing
-```
+{{< include ../_common_code.qmd >}}
This section uses these add-on packages:
diff --git a/quarto/differentiable_vector_calculus/process.jl b/quarto/differentiable_vector_calculus/process.jl
deleted file mode 100644
index aeee5ed..0000000
--- a/quarto/differentiable_vector_calculus/process.jl
+++ /dev/null
@@ -1,36 +0,0 @@
-using WeavePynb
-using Mustache
-
-mmd(fname) = mmd_to_html(fname, BRAND_HREF="../toc.html", BRAND_NAME="Calculus with Julia")
-## uncomment to generate just .md files
-#mmd(fname) = mmd_to_md(fname, BRAND_HREF="../toc.html", BRAND_NAME="Calculus with Julia")
-
-
-
-
-fnames = ["polar_coordinates",
- "vectors",
- "vector_valued_functions",
- "scalar_functions",
- "scalar_functions_applications",
- "vector_fields"
-]
-
-function process_file(nm, twice=false)
- include("$nm.jl")
- mmd_to_md("$nm.mmd")
- markdownToHTML("$nm.md")
- twice && markdownToHTML("$nm.md")
-end
-
-process_files(twice=false) = [process_file(nm, twice) for nm in fnames]
-
-
-"""
-## TODO differential_vector_calcululs
-
-### Add questions for scalar_function_applications
-* Newton's method??
-* optimization. Find least squares for perpendicular distance using the same 3 points...??
-
-"""
diff --git a/quarto/differentiable_vector_calculus/scalar_functions.qmd b/quarto/differentiable_vector_calculus/scalar_functions.qmd
index 5d151b4..7f4cb13 100644
--- a/quarto/differentiable_vector_calculus/scalar_functions.qmd
+++ b/quarto/differentiable_vector_calculus/scalar_functions.qmd
@@ -1,33 +1,7 @@
# Scalar functions
-```{julia}
-#| echo: false
-
-import Logging
-Logging.disable_logging(Logging.Info) # or e.g. Logging.Info
-Logging.disable_logging(Logging.Warn)
-
-import SymPy
-function Base.show(io::IO, ::MIME"text/html", x::T) where {T <: SymPy.SymbolicObject}
- println(io, " ")
- println(io, "\\[")
- println(io, sympy.latex(x))
- println(io, "\\]")
- println(io, "")
-end
-
-# hack to work around issue
-import Markdown
-import CalculusWithJulia
-function CalculusWithJulia.WeaveSupport.ImageFile(d::Symbol, f::AbstractString, caption; kwargs...)
- nm = joinpath("..", string(d), f)
- u = ""
- Markdown.parse(u)
-end
-
-nothing
-```
+{{< include ../_common_code.qmd >}}
This section uses these add-on packages:
diff --git a/quarto/differentiable_vector_calculus/scalar_functions_applications.qmd b/quarto/differentiable_vector_calculus/scalar_functions_applications.qmd
index f71c36a..58a646f 100644
--- a/quarto/differentiable_vector_calculus/scalar_functions_applications.qmd
+++ b/quarto/differentiable_vector_calculus/scalar_functions_applications.qmd
@@ -1,33 +1,7 @@
# Applications with scalar functions
-```{julia}
-#| echo: false
-
-import Logging
-Logging.disable_logging(Logging.Info) # or e.g. Logging.Info
-Logging.disable_logging(Logging.Warn)
-
-import SymPy
-function Base.show(io::IO, ::MIME"text/html", x::T) where {T <: SymPy.SymbolicObject}
- println(io, " ")
- println(io, "\\[")
- println(io, sympy.latex(x))
- println(io, "\\]")
- println(io, "")
-end
-
-# hack to work around issue
-import Markdown
-import CalculusWithJulia
-function CalculusWithJulia.WeaveSupport.ImageFile(d::Symbol, f::AbstractString, caption; kwargs...)
- nm = joinpath("..", string(d), f)
- u = ""
- Markdown.parse(u)
-end
-
-nothing
-```
+{{< include ../_common_code.qmd >}}
This section uses these add-on packages:
diff --git a/quarto/differentiable_vector_calculus/vector_fields.qmd b/quarto/differentiable_vector_calculus/vector_fields.qmd
index 6c207ea..ea8da2e 100644
--- a/quarto/differentiable_vector_calculus/vector_fields.qmd
+++ b/quarto/differentiable_vector_calculus/vector_fields.qmd
@@ -1,33 +1,7 @@
# Functions $R^n \rightarrow R^m$
-```{julia}
-#| echo: false
-
-import Logging
-Logging.disable_logging(Logging.Info) # or e.g. Logging.Info
-Logging.disable_logging(Logging.Warn)
-
-import SymPy
-function Base.show(io::IO, ::MIME"text/html", x::T) where {T <: SymPy.SymbolicObject}
- println(io, " ")
- println(io, "\\[")
- println(io, sympy.latex(x))
- println(io, "\\]")
- println(io, "")
-end
-
-# hack to work around issue
-import Markdown
-import CalculusWithJulia
-function CalculusWithJulia.WeaveSupport.ImageFile(d::Symbol, f::AbstractString, caption; kwargs...)
- nm = joinpath("..", string(d), f)
- u = ""
- Markdown.parse(u)
-end
-
-nothing
-```
+{{< include ../_common_code.qmd >}}
This section uses these add-on packages:
diff --git a/quarto/differentiable_vector_calculus/vector_valued_functions.qmd b/quarto/differentiable_vector_calculus/vector_valued_functions.qmd
index 52c3155..4d7ec1d 100644
--- a/quarto/differentiable_vector_calculus/vector_valued_functions.qmd
+++ b/quarto/differentiable_vector_calculus/vector_valued_functions.qmd
@@ -1,33 +1,7 @@
# Vector-valued functions, $f:R \rightarrow R^n$
-```{julia}
-#| echo: false
-
-import Logging
-Logging.disable_logging(Logging.Info) # or e.g. Logging.Info
-Logging.disable_logging(Logging.Warn)
-
-import SymPy
-function Base.show(io::IO, ::MIME"text/html", x::T) where {T <: SymPy.SymbolicObject}
- println(io, " ")
- println(io, "\\[")
- println(io, sympy.latex(x))
- println(io, "\\]")
- println(io, "")
-end
-
-# hack to work around issue
-import Markdown
-import CalculusWithJulia
-function CalculusWithJulia.WeaveSupport.ImageFile(d::Symbol, f::AbstractString, caption; kwargs...)
- nm = joinpath("..", string(d), f)
- u = ""
- Markdown.parse(u)
-end
-
-nothing
-```
+{{< include ../_common_code.qmd >}}
This section uses these add-on packages:
diff --git a/quarto/differentiable_vector_calculus/vectors.qmd b/quarto/differentiable_vector_calculus/vectors.qmd
index 7d0b3c8..e35ab11 100644
--- a/quarto/differentiable_vector_calculus/vectors.qmd
+++ b/quarto/differentiable_vector_calculus/vectors.qmd
@@ -1,33 +1,7 @@
# Vectors and matrices
-```{julia}
-#| echo: false
-
-import Logging
-Logging.disable_logging(Logging.Info) # or e.g. Logging.Info
-Logging.disable_logging(Logging.Warn)
-
-import SymPy
-function Base.show(io::IO, ::MIME"text/html", x::T) where {T <: SymPy.SymbolicObject}
- println(io, " ")
- println(io, "\\[")
- println(io, sympy.latex(x))
- println(io, "\\]")
- println(io, "")
-end
-
-# hack to work around issue
-import Markdown
-import CalculusWithJulia
-function CalculusWithJulia.WeaveSupport.ImageFile(d::Symbol, f::AbstractString, caption; kwargs...)
- nm = joinpath("..", string(d), f)
- u = ""
- Markdown.parse(u)
-end
-
-nothing
-```
+{{< include ../_common_code.qmd >}}
This section uses these add-on package:
diff --git a/quarto/integral_vector_calculus/div_grad_curl.qmd b/quarto/integral_vector_calculus/div_grad_curl.qmd
index 1e51fe5..659c9a3 100644
--- a/quarto/integral_vector_calculus/div_grad_curl.qmd
+++ b/quarto/integral_vector_calculus/div_grad_curl.qmd
@@ -1,33 +1,7 @@
# The Gradient, Divergence, and Curl
-```{julia}
-#| echo: false
-
-import Logging
-Logging.disable_logging(Logging.Info) # or e.g. Logging.Info
-Logging.disable_logging(Logging.Warn)
-
-import SymPy
-function Base.show(io::IO, ::MIME"text/html", x::T) where {T <: SymPy.SymbolicObject}
- println(io, " ")
- println(io, "\\[")
- println(io, sympy.latex(x))
- println(io, "\\]")
- println(io, "")
-end
-
-# hack to work around issue
-import Markdown
-import CalculusWithJulia
-function CalculusWithJulia.WeaveSupport.ImageFile(d::Symbol, f::AbstractString, caption; kwargs...)
- nm = joinpath("..", string(d), f)
- u = ""
- Markdown.parse(u)
-end
-
-nothing
-```
+{{< include ../_common_code.qmd >}}
This section uses these add-on packages:
diff --git a/quarto/integral_vector_calculus/double_triple_integrals.qmd b/quarto/integral_vector_calculus/double_triple_integrals.qmd
index 41ccc94..74746b4 100644
--- a/quarto/integral_vector_calculus/double_triple_integrals.qmd
+++ b/quarto/integral_vector_calculus/double_triple_integrals.qmd
@@ -1,33 +1,7 @@
# Multi-dimensional integrals
-```{julia}
-#| echo: false
-
-import Logging
-Logging.disable_logging(Logging.Info) # or e.g. Logging.Info
-Logging.disable_logging(Logging.Warn)
-
-import SymPy
-function Base.show(io::IO, ::MIME"text/html", x::T) where {T <: SymPy.SymbolicObject}
- println(io, " ")
- println(io, "\\[")
- println(io, sympy.latex(x))
- println(io, "\\]")
- println(io, "")
-end
-
-# hack to work around issue
-import Markdown
-import CalculusWithJulia
-function CalculusWithJulia.WeaveSupport.ImageFile(d::Symbol, f::AbstractString, caption; kwargs...)
- nm = joinpath("..", string(d), f)
- u = ""
- Markdown.parse(u)
-end
-
-nothing
-```
+{{< include ../_common_code.qmd >}}
This section uses these add-on packages:
diff --git a/quarto/integral_vector_calculus/line_integrals.qmd b/quarto/integral_vector_calculus/line_integrals.qmd
index 8e63d45..2aa1936 100644
--- a/quarto/integral_vector_calculus/line_integrals.qmd
+++ b/quarto/integral_vector_calculus/line_integrals.qmd
@@ -1,33 +1,7 @@
# Line and Surface Integrals
-```{julia}
-#| echo: false
-
-import Logging
-Logging.disable_logging(Logging.Info) # or e.g. Logging.Info
-Logging.disable_logging(Logging.Warn)
-
-import SymPy
-function Base.show(io::IO, ::MIME"text/html", x::T) where {T <: SymPy.SymbolicObject}
- println(io, " ")
- println(io, "\\[")
- println(io, sympy.latex(x))
- println(io, "\\]")
- println(io, "")
-end
-
-# hack to work around issue
-import Markdown
-import CalculusWithJulia
-function CalculusWithJulia.WeaveSupport.ImageFile(d::Symbol, f::AbstractString, caption; kwargs...)
- nm = joinpath("..", string(d), f)
- u = ""
- Markdown.parse(u)
-end
-
-nothing
-```
+{{< include ../_common_code.qmd >}}
This section uses these add-on packages:
diff --git a/quarto/integral_vector_calculus/process.jl b/quarto/integral_vector_calculus/process.jl
deleted file mode 100644
index f61af14..0000000
--- a/quarto/integral_vector_calculus/process.jl
+++ /dev/null
@@ -1,35 +0,0 @@
-using WeavePynb
-using Mustache
-
-mmd(fname) = mmd_to_html(fname, BRAND_HREF="../toc.html", BRAND_NAME="Calculus with Julia")
-## uncomment to generate just .md files
-#mmd(fname) = mmd_to_md(fname, BRAND_HREF="../toc.html", BRAND_NAME="Calculus with Julia")
-
-
-
-
-fnames = [
- "double_triple_integrals",
- "line_integrals",
- "div_grad_curl",
- "stokes_theorem",
- "review"
-]
-
-function process_file(nm, twice=false)
- include("$nm.jl")
- mmd_to_md("$nm.mmd")
- markdownToHTML("$nm.md")
- twice && markdownToHTML("$nm.md")
-end
-
-process_files(twice=false) = [process_file(nm, twice) for nm in fnames]
-
-
-
-
-"""
-## TODO integral_vector_calculus
-* line integrals needs an image (lasso?)
-* more questions
-"""
diff --git a/quarto/integral_vector_calculus/review.qmd b/quarto/integral_vector_calculus/review.qmd
index 03fdea2..558b535 100644
--- a/quarto/integral_vector_calculus/review.qmd
+++ b/quarto/integral_vector_calculus/review.qmd
@@ -1,33 +1,7 @@
# Quick Review of Vector Calculus
-```{julia}
-#| echo: false
-
-import Logging
-Logging.disable_logging(Logging.Info) # or e.g. Logging.Info
-Logging.disable_logging(Logging.Warn)
-
-import SymPy
-function Base.show(io::IO, ::MIME"text/html", x::T) where {T <: SymPy.SymbolicObject}
- println(io, " ")
- println(io, "\\[")
- println(io, sympy.latex(x))
- println(io, "\\]")
- println(io, "")
-end
-
-# hack to work around issue
-import Markdown
-import CalculusWithJulia
-function CalculusWithJulia.WeaveSupport.ImageFile(d::Symbol, f::AbstractString, caption; kwargs...)
- nm = joinpath("..", string(d), f)
- u = ""
- Markdown.parse(u)
-end
-
-nothing
-```
+{{< include ../_common_code.qmd >}}
```{julia}
#| echo: false
diff --git a/quarto/integral_vector_calculus/stokes_theorem.qmd b/quarto/integral_vector_calculus/stokes_theorem.qmd
index 6d347bc..c90f708 100644
--- a/quarto/integral_vector_calculus/stokes_theorem.qmd
+++ b/quarto/integral_vector_calculus/stokes_theorem.qmd
@@ -1,33 +1,7 @@
# Green's Theorem, Stokes' Theorem, and the Divergence Theorem
-```{julia}
-#| echo: false
-
-import Logging
-Logging.disable_logging(Logging.Info) # or e.g. Logging.Info
-Logging.disable_logging(Logging.Warn)
-
-import SymPy
-function Base.show(io::IO, ::MIME"text/html", x::T) where {T <: SymPy.SymbolicObject}
- println(io, " ")
- println(io, "\\[")
- println(io, sympy.latex(x))
- println(io, "\\]")
- println(io, "")
-end
-
-# hack to work around issue
-import Markdown
-import CalculusWithJulia
-function CalculusWithJulia.WeaveSupport.ImageFile(d::Symbol, f::AbstractString, caption; kwargs...)
- nm = joinpath("..", string(d), f)
- u = ""
- Markdown.parse(u)
-end
-
-nothing
-```
+{{< include ../_common_code.qmd >}}
This section uses these add-on packages:
diff --git a/quarto/integrals/arc_length.qmd b/quarto/integrals/arc_length.qmd
index 68c9e9a..6633e41 100644
--- a/quarto/integrals/arc_length.qmd
+++ b/quarto/integrals/arc_length.qmd
@@ -1,33 +1,7 @@
# Arc length
-```{julia}
-#| echo: false
-
-import Logging
-Logging.disable_logging(Logging.Info) # or e.g. Logging.Info
-Logging.disable_logging(Logging.Warn)
-
-import SymPy
-function Base.show(io::IO, ::MIME"text/html", x::T) where {T <: SymPy.SymbolicObject}
- println(io, " ")
- println(io, "\\[")
- println(io, sympy.latex(x))
- println(io, "\\]")
- println(io, "")
-end
-
-# hack to work around issue
-import Markdown
-import CalculusWithJulia
-function CalculusWithJulia.WeaveSupport.ImageFile(d::Symbol, f::AbstractString, caption; kwargs...)
- nm = joinpath("..", string(d), f)
- u = ""
- Markdown.parse(u)
-end
-
-nothing
-```
+{{< include ../_common_code.qmd >}}
This section uses these add-on packages:
diff --git a/quarto/integrals/area.qmd b/quarto/integrals/area.qmd
index 00d4346..9c0d7dd 100644
--- a/quarto/integrals/area.qmd
+++ b/quarto/integrals/area.qmd
@@ -1,33 +1,7 @@
# Area under a curve
-```{julia}
-#| echo: false
-
-import Logging
-Logging.disable_logging(Logging.Info) # or e.g. Logging.Info
-Logging.disable_logging(Logging.Warn)
-
-import SymPy
-function Base.show(io::IO, ::MIME"text/html", x::T) where {T <: SymPy.SymbolicObject}
- println(io, " ")
- println(io, "\\[")
- println(io, sympy.latex(x))
- println(io, "\\]")
- println(io, "")
-end
-
-# hack to work around issue
-import Markdown
-import CalculusWithJulia
-function CalculusWithJulia.WeaveSupport.ImageFile(d::Symbol, f::AbstractString, caption; kwargs...)
- nm = joinpath("..", string(d), f)
- u = ""
- Markdown.parse(u)
-end
-
-nothing
-```
+{{< include ../_common_code.qmd >}}
This section uses these add-on packages:
@@ -1442,9 +1416,45 @@ The area under a curve approximated by a Riemann sum.
# url = "riemann.js"
#CalculusWithJulia.WeaveSupport.JSXGraph(:integrals, url, caption)
# This is just wrong...
-url = "https://raw.githubusercontent.com/jverzani/CalculusWithJulia.jl/master/CwJ/integrals/riemann.js"
-url = "./riemann.js"
-CalculusWithJulia.WeaveSupport.JSXGraph(url, caption)
+#CalculusWithJulia.WeaveSupport.JSXGraph(url, caption)
+nothing
+```
+
+```{=html}
+
+```
+
+```{ojs}
+//| echo: false
+//| output: false
+JXG = require("jsxgraph");
+
+b = JXG.JSXGraph.initBoard('jsxgraph', {
+ boundingbox: [-0.5,0.3,1.5,-1/4], axis:true
+});
+
+g = function(x) { return x*x*x*x + 10*x*x - 60* x + 100}
+f = function(x) {return 1/Math.sqrt(g(x))};
+
+type = "right";
+l = 0;
+r = 1;
+rsum = function() {
+ return JXG.Math.Numerics.riemannsum(f,n.Value(), type, l, r);
+};
+n = b.create('slider', [[0.1, -0.05],[0.75,-0.05], [2,1,50]],{name:'n',snapWidth:1});
+
+graph = b.create('functiongraph', [f, l, r]);
+os = b.create('riemannsum',
+ [f,
+ function(){ return n.Value();},
+ type, l, r
+ ],
+ {fillColor:'#ffff00', fillOpacity:0.3});
+
+b.create('text', [0.1,0.25, function(){
+ return 'Riemann sum='+(rsum().toFixed(4));
+}]);
```
The interactive graphic shows the area of a right-Riemann sum for different partitions. The function is
diff --git a/quarto/integrals/area_between_curves.qmd b/quarto/integrals/area_between_curves.qmd
index cf0491e..6c5781b 100644
--- a/quarto/integrals/area_between_curves.qmd
+++ b/quarto/integrals/area_between_curves.qmd
@@ -1,33 +1,7 @@
# Area between two curves
-```{julia}
-#| echo: false
-
-import Logging
-Logging.disable_logging(Logging.Info) # or e.g. Logging.Info
-Logging.disable_logging(Logging.Warn)
-
-import SymPy
-function Base.show(io::IO, ::MIME"text/html", x::T) where {T <: SymPy.SymbolicObject}
- println(io, " ")
- println(io, "\\[")
- println(io, sympy.latex(x))
- println(io, "\\]")
- println(io, "")
-end
-
-# hack to work around issue
-import Markdown
-import CalculusWithJulia
-function CalculusWithJulia.WeaveSupport.ImageFile(d::Symbol, f::AbstractString, caption; kwargs...)
- nm = joinpath("..", string(d), f)
- u = ""
- Markdown.parse(u)
-end
-
-nothing
-```
+{{< include ../_common_code.qmd >}}
This section uses these add-on packages:
diff --git a/quarto/integrals/center_of_mass.qmd b/quarto/integrals/center_of_mass.qmd
index 85b27e8..3e64c05 100644
--- a/quarto/integrals/center_of_mass.qmd
+++ b/quarto/integrals/center_of_mass.qmd
@@ -1,33 +1,7 @@
# Center of Mass
-```{julia}
-#| echo: false
-
-import Logging
-Logging.disable_logging(Logging.Info) # or e.g. Logging.Info
-Logging.disable_logging(Logging.Warn)
-
-import SymPy
-function Base.show(io::IO, ::MIME"text/html", x::T) where {T <: SymPy.SymbolicObject}
- println(io, " ")
- println(io, "\\[")
- println(io, sympy.latex(x))
- println(io, "\\]")
- println(io, "")
-end
-
-# hack to work around issue
-import Markdown
-import CalculusWithJulia
-function CalculusWithJulia.WeaveSupport.ImageFile(d::Symbol, f::AbstractString, caption; kwargs...)
- nm = joinpath("..", string(d), f)
- u = ""
- Markdown.parse(u)
-end
-
-nothing
-```
+{{< include ../_common_code.qmd >}}
This section uses these add-on packages:
diff --git a/quarto/integrals/ftc.qmd b/quarto/integrals/ftc.qmd
index dc10b00..0c7b6da 100644
--- a/quarto/integrals/ftc.qmd
+++ b/quarto/integrals/ftc.qmd
@@ -1,33 +1,7 @@
# Fundamental Theorem or Calculus
-```{julia}
-#| echo: false
-
-import Logging
-Logging.disable_logging(Logging.Info) # or e.g. Logging.Info
-Logging.disable_logging(Logging.Warn)
-
-import SymPy
-function Base.show(io::IO, ::MIME"text/html", x::T) where {T <: SymPy.SymbolicObject}
- println(io, " ")
- println(io, "\\[")
- println(io, sympy.latex(x))
- println(io, "\\]")
- println(io, "")
-end
-
-# hack to work around issue
-import Markdown
-import CalculusWithJulia
-function CalculusWithJulia.WeaveSupport.ImageFile(d::Symbol, f::AbstractString, caption; kwargs...)
- nm = joinpath("..", string(d), f)
- u = ""
- Markdown.parse(u)
-end
-
-nothing
-```
+{{< include ../_common_code.qmd >}}
This section uses these add-on packages:
diff --git a/quarto/integrals/improper_integrals.qmd b/quarto/integrals/improper_integrals.qmd
index af49409..1db8842 100644
--- a/quarto/integrals/improper_integrals.qmd
+++ b/quarto/integrals/improper_integrals.qmd
@@ -1,33 +1,7 @@
# Improper Integrals
-```{julia}
-#| echo: false
-
-import Logging
-Logging.disable_logging(Logging.Info) # or e.g. Logging.Info
-Logging.disable_logging(Logging.Warn)
-
-import SymPy
-function Base.show(io::IO, ::MIME"text/html", x::T) where {T <: SymPy.SymbolicObject}
- println(io, " ")
- println(io, "\\[")
- println(io, sympy.latex(x))
- println(io, "\\]")
- println(io, "")
-end
-
-# hack to work around issue
-import Markdown
-import CalculusWithJulia
-function CalculusWithJulia.WeaveSupport.ImageFile(d::Symbol, f::AbstractString, caption; kwargs...)
- nm = joinpath("..", string(d), f)
- u = ""
- Markdown.parse(u)
-end
-
-nothing
-```
+{{< include ../_common_code.qmd >}}
This section uses these add-on packages:
diff --git a/quarto/integrals/integration_by_parts.qmd b/quarto/integrals/integration_by_parts.qmd
index 23b4e9a..baa40e2 100644
--- a/quarto/integrals/integration_by_parts.qmd
+++ b/quarto/integrals/integration_by_parts.qmd
@@ -1,33 +1,7 @@
# Integration By Parts
-```{julia}
-#| echo: false
-
-import Logging
-Logging.disable_logging(Logging.Info) # or e.g. Logging.Info
-Logging.disable_logging(Logging.Warn)
-
-import SymPy
-function Base.show(io::IO, ::MIME"text/html", x::T) where {T <: SymPy.SymbolicObject}
- println(io, " ")
- println(io, "\\[")
- println(io, sympy.latex(x))
- println(io, "\\]")
- println(io, "")
-end
-
-# hack to work around issue
-import Markdown
-import CalculusWithJulia
-function CalculusWithJulia.WeaveSupport.ImageFile(d::Symbol, f::AbstractString, caption; kwargs...)
- nm = joinpath("..", string(d), f)
- u = ""
- Markdown.parse(u)
-end
-
-nothing
-```
+{{< include ../_common_code.qmd >}}
This section uses these add-on packages:
diff --git a/quarto/integrals/mean_value_theorem.qmd b/quarto/integrals/mean_value_theorem.qmd
index 645fe9b..5699f0a 100644
--- a/quarto/integrals/mean_value_theorem.qmd
+++ b/quarto/integrals/mean_value_theorem.qmd
@@ -1,33 +1,7 @@
# Mean value theorem for integrals
-```{julia}
-#| echo: false
-
-import Logging
-Logging.disable_logging(Logging.Info) # or e.g. Logging.Info
-Logging.disable_logging(Logging.Warn)
-
-import SymPy
-function Base.show(io::IO, ::MIME"text/html", x::T) where {T <: SymPy.SymbolicObject}
- println(io, " ")
- println(io, "\\[")
- println(io, sympy.latex(x))
- println(io, "\\]")
- println(io, "")
-end
-
-# hack to work around issue
-import Markdown
-import CalculusWithJulia
-function CalculusWithJulia.WeaveSupport.ImageFile(d::Symbol, f::AbstractString, caption; kwargs...)
- nm = joinpath("..", string(d), f)
- u = ""
- Markdown.parse(u)
-end
-
-nothing
-```
+{{< include ../_common_code.qmd >}}
This section uses these add-on packages:
diff --git a/quarto/integrals/partial_fractions.qmd b/quarto/integrals/partial_fractions.qmd
index 34e9bd7..c975e9d 100644
--- a/quarto/integrals/partial_fractions.qmd
+++ b/quarto/integrals/partial_fractions.qmd
@@ -1,33 +1,7 @@
# Partial Fractions
-```{julia}
-#| echo: false
-
-import Logging
-Logging.disable_logging(Logging.Info) # or e.g. Logging.Info
-Logging.disable_logging(Logging.Warn)
-
-import SymPy
-function Base.show(io::IO, ::MIME"text/html", x::T) where {T <: SymPy.SymbolicObject}
- println(io, " ")
- println(io, "\\[")
- println(io, sympy.latex(x))
- println(io, "\\]")
- println(io, "")
-end
-
-# hack to work around issue
-import Markdown
-import CalculusWithJulia
-function CalculusWithJulia.WeaveSupport.ImageFile(d::Symbol, f::AbstractString, caption; kwargs...)
- nm = joinpath("..", string(d), f)
- u = ""
- Markdown.parse(u)
-end
-
-nothing
-```
+{{< include ../_common_code.qmd >}}
```{julia}
using CalculusWithJulia
diff --git a/quarto/integrals/process.jl b/quarto/integrals/process.jl
deleted file mode 100644
index a9e21b8..0000000
--- a/quarto/integrals/process.jl
+++ /dev/null
@@ -1,41 +0,0 @@
-
-fnames = [
- "area",
- "ftc",
-
- "substitution",
- "integration_by_parts",
- "partial_fractions", # XX add in trig integrals (cos()sin() stuff? mx or ^m... XXX
- "improper_integrals", ##
-
- "mean_value_theorem",
- "area_between_curves",
- "center_of_mass",
- "volumes_slice",
- #"volumes_shell", ## XXX add this in if needed, but not really that excited to now XXX
- "arc_length",
- "surface_area"
-]
-
-
-
-function process_file(nm, twice=false)
- include("$nm.jl")
- mmd_to_md("$nm.mmd")
- markdownToHTML("$nm.md")
- twice && markdownToHTML("$nm.md")
-end
-
-process_files(twice=false) = [process_file(nm, twice) for nm in fnames]
-
-
-
-
-"""
-## TODO integrals
-
-* add in volumes shell???
-* mean value theorem is light?
-* could add surface area problems
-
-"""
diff --git a/quarto/integrals/substitution.qmd b/quarto/integrals/substitution.qmd
index 7d23348..de45539 100644
--- a/quarto/integrals/substitution.qmd
+++ b/quarto/integrals/substitution.qmd
@@ -1,33 +1,7 @@
# Substitution
-```{julia}
-#| echo: false
-
-import Logging
-Logging.disable_logging(Logging.Info) # or e.g. Logging.Info
-Logging.disable_logging(Logging.Warn)
-
-import SymPy
-function Base.show(io::IO, ::MIME"text/html", x::T) where {T <: SymPy.SymbolicObject}
- println(io, " ")
- println(io, "\\[")
- println(io, sympy.latex(x))
- println(io, "\\]")
- println(io, "")
-end
-
-# hack to work around issue
-import Markdown
-import CalculusWithJulia
-function CalculusWithJulia.WeaveSupport.ImageFile(d::Symbol, f::AbstractString, caption; kwargs...)
- nm = joinpath("..", string(d), f)
- u = ""
- Markdown.parse(u)
-end
-
-nothing
-```
+{{< include ../_common_code.qmd >}}
This section uses these add-on packages:
diff --git a/quarto/integrals/surface_area.qmd b/quarto/integrals/surface_area.qmd
index 4a95847..f13a93a 100644
--- a/quarto/integrals/surface_area.qmd
+++ b/quarto/integrals/surface_area.qmd
@@ -1,33 +1,7 @@
# Surface Area
-```{julia}
-#| echo: false
-
-import Logging
-Logging.disable_logging(Logging.Info) # or e.g. Logging.Info
-Logging.disable_logging(Logging.Warn)
-
-import SymPy
-function Base.show(io::IO, ::MIME"text/html", x::T) where {T <: SymPy.SymbolicObject}
- println(io, " ")
- println(io, "\\[")
- println(io, sympy.latex(x))
- println(io, "\\]")
- println(io, "")
-end
-
-# hack to work around issue
-import Markdown
-import CalculusWithJulia
-function CalculusWithJulia.WeaveSupport.ImageFile(d::Symbol, f::AbstractString, caption; kwargs...)
- nm = joinpath("..", string(d), f)
- u = ""
- Markdown.parse(u)
-end
-
-nothing
-```
+{{< include ../_common_code.qmd >}}
This section uses these add-on packages:
diff --git a/quarto/integrals/volumes_slice.qmd b/quarto/integrals/volumes_slice.qmd
index e1a99d3..44a5fbe 100644
--- a/quarto/integrals/volumes_slice.qmd
+++ b/quarto/integrals/volumes_slice.qmd
@@ -1,33 +1,7 @@
# Volumes by slicing
-```{julia}
-#| echo: false
-
-import Logging
-Logging.disable_logging(Logging.Info) # or e.g. Logging.Info
-Logging.disable_logging(Logging.Warn)
-
-import SymPy
-function Base.show(io::IO, ::MIME"text/html", x::T) where {T <: SymPy.SymbolicObject}
- println(io, " ")
- println(io, "\\[")
- println(io, sympy.latex(x))
- println(io, "\\]")
- println(io, "")
-end
-
-# hack to work around issue
-import Markdown
-import CalculusWithJulia
-function CalculusWithJulia.WeaveSupport.ImageFile(d::Symbol, f::AbstractString, caption; kwargs...)
- nm = joinpath("..", string(d), f)
- u = ""
- Markdown.parse(u)
-end
-
-nothing
-```
+{{< include ../_common_code.qmd >}}
This section uses these add-on packages:
diff --git a/quarto/limits/continuity.qmd b/quarto/limits/continuity.qmd
index 0d628d7..a289ec4 100644
--- a/quarto/limits/continuity.qmd
+++ b/quarto/limits/continuity.qmd
@@ -1,33 +1,7 @@
# Continuity
-```{julia}
-#| echo: false
-
-import Logging
-Logging.disable_logging(Logging.Info) # or e.g. Logging.Info
-Logging.disable_logging(Logging.Warn)
-
-import SymPy
-function Base.show(io::IO, ::MIME"text/html", x::T) where {T <: SymPy.SymbolicObject}
- println(io, " ")
- println(io, "\\[")
- println(io, sympy.latex(x))
- println(io, "\\]")
- println(io, "")
-end
-
-# hack to work around issue
-import Markdown
-import CalculusWithJulia
-function CalculusWithJulia.WeaveSupport.ImageFile(d::Symbol, f::AbstractString, caption; kwargs...)
- nm = joinpath("..", string(d), f)
- u = ""
- Markdown.parse(u)
-end
-
-nothing
-```
+{{< include ../_common_code.qmd >}}
This section uses these add-on packages:
diff --git a/quarto/limits/intermediate_value_theorem.qmd b/quarto/limits/intermediate_value_theorem.qmd
index 484e8a1..c72e5d3 100644
--- a/quarto/limits/intermediate_value_theorem.qmd
+++ b/quarto/limits/intermediate_value_theorem.qmd
@@ -1,33 +1,7 @@
# Implications of continuity
-```{julia}
-#| echo: false
-
-import Logging
-Logging.disable_logging(Logging.Info) # or e.g. Logging.Info
-Logging.disable_logging(Logging.Warn)
-
-import SymPy
-function Base.show(io::IO, ::MIME"text/html", x::T) where {T <: SymPy.SymbolicObject}
- println(io, " ")
- println(io, "\\[")
- println(io, sympy.latex(x))
- println(io, "\\]")
- println(io, "")
-end
-
-# hack to work around issue
-import Markdown
-import CalculusWithJulia
-function CalculusWithJulia.WeaveSupport.ImageFile(d::Symbol, f::AbstractString, caption; kwargs...)
- nm = joinpath("..", string(d), f)
- u = ""
- Markdown.parse(u)
-end
-
-nothing
-```
+{{< include ../_common_code.qmd >}}
This section uses these add-on packages:
diff --git a/quarto/limits/limits.qmd b/quarto/limits/limits.qmd
index 9c1710c..3d89e63 100644
--- a/quarto/limits/limits.qmd
+++ b/quarto/limits/limits.qmd
@@ -1,33 +1,7 @@
# Limits
-```{julia}
-#| echo: false
-
-import Logging
-Logging.disable_logging(Logging.Info) # or e.g. Logging.Info
-Logging.disable_logging(Logging.Warn)
-
-import SymPy
-function Base.show(io::IO, ::MIME"text/html", x::T) where {T <: SymPy.SymbolicObject}
- println(io, " ")
- println(io, "\\[")
- println(io, sympy.latex(x))
- println(io, "\\]")
- println(io, "")
-end
-
-# hack to work around issue
-import Markdown
-import CalculusWithJulia
-function CalculusWithJulia.WeaveSupport.ImageFile(d::Symbol, f::AbstractString, caption; kwargs...)
- nm = joinpath("..", string(d), f)
- u = ""
- Markdown.parse(u)
-end
-
-nothing
-```
+{{< include ../_common_code.qmd >}}
This section uses the following add-on packages:
@@ -407,6 +381,43 @@ The graphical approach to limits - plotting $f(x)$ around $c$ and observing if t
##### Example
+This example illustrates the same limit a different way. Sliding the $x$ value towards $0$ shows $f(x) = \sin(x)/x$ approaches a value of $1$.
+
+
+```{=html}
+
+```
+
+```{ojs}
+//| echo: false
+//| output: false
+
+JXG = require("jsxgraph")
+
+b = JXG.JSXGraph.initBoard('jsxgraph', {
+ boundingbox: [-6, 1.2, 6,-1.2], axis:true
+});
+
+f = function(x) {return Math.sin(x) / x;};
+graph = b.create("functiongraph", [f, -6, 6])
+seg = b.create("line", [[-6,0], [6,0]], {fixed:true});
+
+X = b.create("glider", [2, 0, seg], {name:"x", size:4});
+P = b.create("point", [function() {return X.X()}, function() {return f(X.X())}], {name:""});
+Q = b.create("point", [0, function() {return P.Y();}], {name:"f(x)"});
+
+segup = b.create("segment", [P,X], {dash:2});
+segover = b.create("segment", [P, [0, function() {return P.Y()}]], {dash:2});
+
+
+txt = b.create('text', [2, 1, function() {
+ return "x = " + X.X().toFixed(4) + ", f(x) = " + P.Y().toFixed(4);
+}]);
+```
+
+##### Example
+
+
Consider now the following limit
diff --git a/quarto/limits/limits_extensions.qmd b/quarto/limits/limits_extensions.qmd
index 2ccd218..5bb06d8 100644
--- a/quarto/limits/limits_extensions.qmd
+++ b/quarto/limits/limits_extensions.qmd
@@ -1,33 +1,7 @@
# Limits, issues, extensions of the concept
-```{julia}
-#| echo: false
-
-import Logging
-Logging.disable_logging(Logging.Info) # or e.g. Logging.Info
-Logging.disable_logging(Logging.Warn)
-
-import SymPy
-function Base.show(io::IO, ::MIME"text/html", x::T) where {T <: SymPy.SymbolicObject}
- println(io, " ")
- println(io, "\\[")
- println(io, sympy.latex(x))
- println(io, "\\]")
- println(io, "")
-end
-
-# hack to work around issue
-import Markdown
-import CalculusWithJulia
-function CalculusWithJulia.WeaveSupport.ImageFile(d::Symbol, f::AbstractString, caption; kwargs...)
- nm = joinpath("..", string(d), f)
- u = ""
- Markdown.parse(u)
-end
-
-nothing
-```
+{{< include ../_common_code.qmd >}}
This section uses the following add-on packages:
diff --git a/quarto/limits/process.jl b/quarto/limits/process.jl
deleted file mode 100644
index 67f63e8..0000000
--- a/quarto/limits/process.jl
+++ /dev/null
@@ -1,26 +0,0 @@
-using CwJWeaveTpl
-
-fnames = [
- "limits",
- "limits_extensions",
- #
- "continuity",
- "intermediate_value_theorem"
- ]
-
-
-process_file(nm; cache=:off) = CwJWeaveTpl.mmd(nm * ".jmd", cache=cache)
-
-function process_files(;cache=:user)
- for f in fnames
- @show f
- process_file(f, cache=cache)
- end
-end
-
-
-
-"""
-## TODO limits
-
-"""
diff --git a/quarto/make_qmd.jl b/quarto/make_qmd.jl
index 2778b30..68a0502 100644
--- a/quarto/make_qmd.jl
+++ b/quarto/make_qmd.jl
@@ -45,6 +45,7 @@ for DIR ∈ DIRS
else
_, ext = splitext(f)
ext == ".toml" && continue
+ f == "process.jl" && continueg
@show :cp, f
try
force = isfile(joinpath(DIR, f))
diff --git a/quarto/misc/calculus_with_julia.qmd b/quarto/misc/calculus_with_julia.qmd
index 0a6589c..aa66f74 100644
--- a/quarto/misc/calculus_with_julia.qmd
+++ b/quarto/misc/calculus_with_julia.qmd
@@ -1,33 +1,7 @@
# The `CalculusWithJulia` package
-```{julia}
-#| echo: false
-
-import Logging
-Logging.disable_logging(Logging.Info) # or e.g. Logging.Info
-Logging.disable_logging(Logging.Warn)
-
-import SymPy
-function Base.show(io::IO, ::MIME"text/html", x::T) where {T <: SymPy.SymbolicObject}
- println(io, " ")
- println(io, "\\[")
- println(io, sympy.latex(x))
- println(io, "\\]")
- println(io, "")
-end
-
-# hack to work around issue
-import Markdown
-import CalculusWithJulia
-function CalculusWithJulia.WeaveSupport.ImageFile(d::Symbol, f::AbstractString, caption; kwargs...)
- nm = joinpath("..", string(d), f)
- u = ""
- Markdown.parse(u)
-end
-
-nothing
-```
+{{< include ../_common_code.qmd >}}
To run the commands in these notes, some external packages must be installed and loaded.
diff --git a/quarto/misc/getting_started_with_julia.qmd b/quarto/misc/getting_started_with_julia.qmd
index e2a5e40..5b88f52 100644
--- a/quarto/misc/getting_started_with_julia.qmd
+++ b/quarto/misc/getting_started_with_julia.qmd
@@ -1,33 +1,7 @@
# Getting started with Julia
-```{julia}
-#| echo: false
-
-import Logging
-Logging.disable_logging(Logging.Info) # or e.g. Logging.Info
-Logging.disable_logging(Logging.Warn)
-
-import SymPy
-function Base.show(io::IO, ::MIME"text/html", x::T) where {T <: SymPy.SymbolicObject}
- println(io, " ")
- println(io, "\\[")
- println(io, sympy.latex(x))
- println(io, "\\]")
- println(io, "")
-end
-
-# hack to work around issue
-import Markdown
-import CalculusWithJulia
-function CalculusWithJulia.WeaveSupport.ImageFile(d::Symbol, f::AbstractString, caption; kwargs...)
- nm = joinpath("..", string(d), f)
- u = ""
- Markdown.parse(u)
-end
-
-nothing
-```
+{{< include ../_common_code.qmd >}}
```{julia}
#| echo: false
diff --git a/quarto/misc/julia_interfaces.qmd b/quarto/misc/julia_interfaces.qmd
index cf6c1d8..ecb43fc 100644
--- a/quarto/misc/julia_interfaces.qmd
+++ b/quarto/misc/julia_interfaces.qmd
@@ -1,33 +1,7 @@
# Julia interfaces
-```{julia}
-#| echo: false
-
-import Logging
-Logging.disable_logging(Logging.Info) # or e.g. Logging.Info
-Logging.disable_logging(Logging.Warn)
-
-import SymPy
-function Base.show(io::IO, ::MIME"text/html", x::T) where {T <: SymPy.SymbolicObject}
- println(io, " ")
- println(io, "\\[")
- println(io, sympy.latex(x))
- println(io, "\\]")
- println(io, "")
-end
-
-# hack to work around issue
-import Markdown
-import CalculusWithJulia
-function CalculusWithJulia.WeaveSupport.ImageFile(d::Symbol, f::AbstractString, caption; kwargs...)
- nm = joinpath("..", string(d), f)
- u = ""
- Markdown.parse(u)
-end
-
-nothing
-```
+{{< include ../_common_code.qmd >}}
```{julia}
#| echo: false
diff --git a/quarto/misc/quick_notes.qmd b/quarto/misc/quick_notes.qmd
index 2004500..a203ff9 100644
--- a/quarto/misc/quick_notes.qmd
+++ b/quarto/misc/quick_notes.qmd
@@ -1,33 +1,7 @@
# Quick introduction to Calculus with Julia
-```{julia}
-#| echo: false
-
-import Logging
-Logging.disable_logging(Logging.Info) # or e.g. Logging.Info
-Logging.disable_logging(Logging.Warn)
-
-import SymPy
-function Base.show(io::IO, ::MIME"text/html", x::T) where {T <: SymPy.SymbolicObject}
- println(io, " ")
- println(io, "\\[")
- println(io, sympy.latex(x))
- println(io, "\\]")
- println(io, "")
-end
-
-# hack to work around issue
-import Markdown
-import CalculusWithJulia
-function CalculusWithJulia.WeaveSupport.ImageFile(d::Symbol, f::AbstractString, caption; kwargs...)
- nm = joinpath("..", string(d), f)
- u = ""
- Markdown.parse(u)
-end
-
-nothing
-```
+{{< include ../_common_code.qmd >}}
The `Julia` programming language with a design that makes it well suited as a supplement for the learning of calculus, as this collection of notes is intended to illustrate.
diff --git a/quarto/misc/toc.qmd b/quarto/misc/toc.qmd
index 1845819..6ab4d2d 100644
--- a/quarto/misc/toc.qmd
+++ b/quarto/misc/toc.qmd
@@ -10,33 +10,7 @@ txt = """
CalculusWithJulia.WeaveSupport.HTMLoutput(txt)
```
-```{julia}
-#| echo: false
-
-import Logging
-Logging.disable_logging(Logging.Info) # or e.g. Logging.Info
-Logging.disable_logging(Logging.Warn)
-
-import SymPy
-function Base.show(io::IO, ::MIME"text/html", x::T) where {T <: SymPy.SymbolicObject}
- println(io, " ")
- println(io, "\\[")
- println(io, sympy.latex(x))
- println(io, "\\]")
- println(io, "")
-end
-
-# hack to work around issue
-import Markdown
-import CalculusWithJulia
-function CalculusWithJulia.WeaveSupport.ImageFile(d::Symbol, f::AbstractString, caption; kwargs...)
- nm = joinpath("..", string(d), f)
- u = ""
- Markdown.parse(u)
-end
-
-nothing
-```
+{{< include ../_common_code.qmd >}}
# Calculus with Julia
diff --git a/quarto/misc/unicode.qmd b/quarto/misc/unicode.qmd
index 15e9873..0638a4b 100644
--- a/quarto/misc/unicode.qmd
+++ b/quarto/misc/unicode.qmd
@@ -1,33 +1,7 @@
# Usages of Unicode symbols
-```{julia}
-#| echo: false
-
-import Logging
-Logging.disable_logging(Logging.Info) # or e.g. Logging.Info
-Logging.disable_logging(Logging.Warn)
-
-import SymPy
-function Base.show(io::IO, ::MIME"text/html", x::T) where {T <: SymPy.SymbolicObject}
- println(io, " ")
- println(io, "\\[")
- println(io, sympy.latex(x))
- println(io, "\\]")
- println(io, "")
-end
-
-# hack to work around issue
-import Markdown
-import CalculusWithJulia
-function CalculusWithJulia.WeaveSupport.ImageFile(d::Symbol, f::AbstractString, caption; kwargs...)
- nm = joinpath("..", string(d), f)
- u = ""
- Markdown.parse(u)
-end
-
-nothing
-```
+{{< include ../_common_code.qmd >}}
`Julia` allows the use of *Unicode* symbols to replace variable names and for function calls. Unicode operations are entered in this pattern `\name[tab]`. That is a slash, `\`, the name (e.g., `alpha`), and then a press of the `tab` key.
diff --git a/quarto/misc/using-pluto.qmd b/quarto/misc/using-pluto.qmd
index 06d2e3e..7daf290 100644
--- a/quarto/misc/using-pluto.qmd
+++ b/quarto/misc/using-pluto.qmd
@@ -1,33 +1,7 @@
# Using Pluto
-```{julia}
-#| echo: false
-
-import Logging
-Logging.disable_logging(Logging.Info) # or e.g. Logging.Info
-Logging.disable_logging(Logging.Warn)
-
-import SymPy
-function Base.show(io::IO, ::MIME"text/html", x::T) where {T <: SymPy.SymbolicObject}
- println(io, " ")
- println(io, "\\[")
- println(io, sympy.latex(x))
- println(io, "\\]")
- println(io, "")
-end
-
-# hack to work around issue
-import Markdown
-import CalculusWithJulia
-function CalculusWithJulia.WeaveSupport.ImageFile(d::Symbol, f::AbstractString, caption; kwargs...)
- nm = joinpath("..", string(d), f)
- u = ""
- Markdown.parse(u)
-end
-
-nothing
-```
+{{< include ../_common_code.qmd >}}
:::{.callout-note}
## Note
diff --git a/quarto/precalc/calculator.qmd b/quarto/precalc/calculator.qmd
index fbf8af5..26edd7c 100644
--- a/quarto/precalc/calculator.qmd
+++ b/quarto/precalc/calculator.qmd
@@ -1,33 +1,7 @@
# From calculator to computer
-```{julia}
-#| echo: false
-
-import Logging
-Logging.disable_logging(Logging.Info) # or e.g. Logging.Info
-Logging.disable_logging(Logging.Warn)
-
-import SymPy
-function Base.show(io::IO, ::MIME"text/html", x::T) where {T <: SymPy.SymbolicObject}
- println(io, " ")
- println(io, "\\[")
- println(io, sympy.latex(x))
- println(io, "\\]")
- println(io, "")
-end
-
-# hack to work around issue
-import Markdown
-import CalculusWithJulia
-function CalculusWithJulia.WeaveSupport.ImageFile(d::Symbol, f::AbstractString, caption; kwargs...)
- nm = joinpath("..", string(d), f)
- u = ""
- Markdown.parse(u)
-end
-
-nothing
-```
+{{< include ../_common_code.qmd >}}
```{julia}
#| echo: false
diff --git a/quarto/precalc/exp_log_functions.qmd b/quarto/precalc/exp_log_functions.qmd
index 5772be4..6716a25 100644
--- a/quarto/precalc/exp_log_functions.qmd
+++ b/quarto/precalc/exp_log_functions.qmd
@@ -1,33 +1,7 @@
# Exponential and logarithmic functions
-```{julia}
-#| echo: false
-
-import Logging
-Logging.disable_logging(Logging.Info) # or e.g. Logging.Info
-Logging.disable_logging(Logging.Warn)
-
-import SymPy
-function Base.show(io::IO, ::MIME"text/html", x::T) where {T <: SymPy.SymbolicObject}
- println(io, " ")
- println(io, "\\[")
- println(io, sympy.latex(x))
- println(io, "\\]")
- println(io, "")
-end
-
-# hack to work around issue
-import Markdown
-import CalculusWithJulia
-function CalculusWithJulia.WeaveSupport.ImageFile(d::Symbol, f::AbstractString, caption; kwargs...)
- nm = joinpath("..", string(d), f)
- u = ""
- Markdown.parse(u)
-end
-
-nothing
-```
+{{< include ../_common_code.qmd >}}
This section uses the following add-on packages:
diff --git a/quarto/precalc/functions.qmd b/quarto/precalc/functions.qmd
index cd7d1cf..fdd6185 100644
--- a/quarto/precalc/functions.qmd
+++ b/quarto/precalc/functions.qmd
@@ -1,33 +1,7 @@
# Functions
-```{julia}
-#| echo: false
-
-import Logging
-Logging.disable_logging(Logging.Info) # or e.g. Logging.Info
-Logging.disable_logging(Logging.Warn)
-
-import SymPy
-function Base.show(io::IO, ::MIME"text/html", x::T) where {T <: SymPy.SymbolicObject}
- println(io, " ")
- println(io, "\\[")
- println(io, sympy.latex(x))
- println(io, "\\]")
- println(io, "")
-end
-
-# hack to work around issue
-import Markdown
-import CalculusWithJulia
-function CalculusWithJulia.WeaveSupport.ImageFile(d::Symbol, f::AbstractString, caption; kwargs...)
- nm = joinpath("..", string(d), f)
- u = ""
- Markdown.parse(u)
-end
-
-nothing
-```
+{{< include ../_common_code.qmd >}}
This section will use the following add-on packages:
diff --git a/quarto/precalc/inversefunctions.qmd b/quarto/precalc/inversefunctions.qmd
index a245ea9..2f3ec56 100644
--- a/quarto/precalc/inversefunctions.qmd
+++ b/quarto/precalc/inversefunctions.qmd
@@ -1,33 +1,7 @@
# The Inverse of a Function
-```{julia}
-#| echo: false
-
-import Logging
-Logging.disable_logging(Logging.Info) # or e.g. Logging.Info
-Logging.disable_logging(Logging.Warn)
-
-import SymPy
-function Base.show(io::IO, ::MIME"text/html", x::T) where {T <: SymPy.SymbolicObject}
- println(io, " ")
- println(io, "\\[")
- println(io, sympy.latex(x))
- println(io, "\\]")
- println(io, "")
-end
-
-# hack to work around issue
-import Markdown
-import CalculusWithJulia
-function CalculusWithJulia.WeaveSupport.ImageFile(d::Symbol, f::AbstractString, caption; kwargs...)
- nm = joinpath("..", string(d), f)
- u = ""
- Markdown.parse(u)
-end
-
-nothing
-```
+{{< include ../_common_code.qmd >}}
In this section we will use these add-on packages:
diff --git a/quarto/precalc/julia_overview.qmd b/quarto/precalc/julia_overview.qmd
index 81c5179..5252ccd 100644
--- a/quarto/precalc/julia_overview.qmd
+++ b/quarto/precalc/julia_overview.qmd
@@ -1,33 +1,7 @@
# Overview of Julia commands
-```{julia}
-#| echo: false
-
-import Logging
-Logging.disable_logging(Logging.Info) # or e.g. Logging.Info
-Logging.disable_logging(Logging.Warn)
-
-import SymPy
-function Base.show(io::IO, ::MIME"text/html", x::T) where {T <: SymPy.SymbolicObject}
- println(io, " ")
- println(io, "\\[")
- println(io, sympy.latex(x))
- println(io, "\\]")
- println(io, "")
-end
-
-# hack to work around issue
-import Markdown
-import CalculusWithJulia
-function CalculusWithJulia.WeaveSupport.ImageFile(d::Symbol, f::AbstractString, caption; kwargs...)
- nm = joinpath("..", string(d), f)
- u = ""
- Markdown.parse(u)
-end
-
-nothing
-```
+{{< include ../_common_code.qmd >}}
```{julia}
#| echo: false
diff --git a/quarto/precalc/logical_expressions.qmd b/quarto/precalc/logical_expressions.qmd
index 584e1d3..1ec15d8 100644
--- a/quarto/precalc/logical_expressions.qmd
+++ b/quarto/precalc/logical_expressions.qmd
@@ -1,33 +1,7 @@
# Inequalities, Logical expressions
-```{julia}
-#| echo: false
-
-import Logging
-Logging.disable_logging(Logging.Info) # or e.g. Logging.Info
-Logging.disable_logging(Logging.Warn)
-
-import SymPy
-function Base.show(io::IO, ::MIME"text/html", x::T) where {T <: SymPy.SymbolicObject}
- println(io, " ")
- println(io, "\\[")
- println(io, sympy.latex(x))
- println(io, "\\]")
- println(io, "")
-end
-
-# hack to work around issue
-import Markdown
-import CalculusWithJulia
-function CalculusWithJulia.WeaveSupport.ImageFile(d::Symbol, f::AbstractString, caption; kwargs...)
- nm = joinpath("..", string(d), f)
- u = ""
- Markdown.parse(u)
-end
-
-nothing
-```
+{{< include ../_common_code.qmd >}}
In this section we use the following package:
diff --git a/quarto/precalc/numbers_types.qmd b/quarto/precalc/numbers_types.qmd
index 2e7011c..d2048a5 100644
--- a/quarto/precalc/numbers_types.qmd
+++ b/quarto/precalc/numbers_types.qmd
@@ -1,33 +1,7 @@
# Number systems
-```{julia}
-#| echo: false
-
-import Logging
-Logging.disable_logging(Logging.Info) # or e.g. Logging.Info
-Logging.disable_logging(Logging.Warn)
-
-import SymPy
-function Base.show(io::IO, ::MIME"text/html", x::T) where {T <: SymPy.SymbolicObject}
- println(io, " ")
- println(io, "\\[")
- println(io, sympy.latex(x))
- println(io, "\\]")
- println(io, "")
-end
-
-# hack to work around issue
-import Markdown
-import CalculusWithJulia
-function CalculusWithJulia.WeaveSupport.ImageFile(d::Symbol, f::AbstractString, caption; kwargs...)
- nm = joinpath("..", string(d), f)
- u = ""
- Markdown.parse(u)
-end
-
-nothing
-```
+{{< include ../_common_code.qmd >}}
```{julia}
#| echo: false
diff --git a/quarto/precalc/plotting.qmd b/quarto/precalc/plotting.qmd
index cda42f0..10cae73 100644
--- a/quarto/precalc/plotting.qmd
+++ b/quarto/precalc/plotting.qmd
@@ -1,33 +1,7 @@
# The Graph of a Function
-```{julia}
-#| echo: false
-
-import Logging
-Logging.disable_logging(Logging.Info) # or e.g. Logging.Info
-Logging.disable_logging(Logging.Warn)
-
-import SymPy
-function Base.show(io::IO, ::MIME"text/html", x::T) where {T <: SymPy.SymbolicObject}
- println(io, " ")
- println(io, "\\[")
- println(io, sympy.latex(x))
- println(io, "\\]")
- println(io, "")
-end
-
-# hack to work around issue
-import Markdown
-import CalculusWithJulia
-function CalculusWithJulia.WeaveSupport.ImageFile(d::Symbol, f::AbstractString, caption; kwargs...)
- nm = joinpath("..", string(d), f)
- u = ""
- Markdown.parse(u)
-end
-
-nothing
-```
+{{< include ../_common_code.qmd >}}
This section will use the following packages:
diff --git a/quarto/precalc/polynomial.qmd b/quarto/precalc/polynomial.qmd
index 3107fb4..3b77c81 100644
--- a/quarto/precalc/polynomial.qmd
+++ b/quarto/precalc/polynomial.qmd
@@ -1,33 +1,7 @@
# Polynomials
-```{julia}
-#| echo: false
-
-import Logging
-Logging.disable_logging(Logging.Info) # or e.g. Logging.Info
-Logging.disable_logging(Logging.Warn)
-
-import SymPy
-function Base.show(io::IO, ::MIME"text/html", x::T) where {T <: SymPy.SymbolicObject}
- println(io, " ")
- println(io, "\\[")
- println(io, sympy.latex(x))
- println(io, "\\]")
- println(io, "")
-end
-
-# hack to work around issue
-import Markdown
-import CalculusWithJulia
-function CalculusWithJulia.WeaveSupport.ImageFile(d::Symbol, f::AbstractString, caption; kwargs...)
- nm = joinpath("..", string(d), f)
- u = ""
- Markdown.parse(u)
-end
-
-nothing
-```
+{{< include ../_common_code.qmd >}}
In this section we use the following add-on packages:
diff --git a/quarto/precalc/polynomial_roots.qmd b/quarto/precalc/polynomial_roots.qmd
index 1e20369..366c8fc 100644
--- a/quarto/precalc/polynomial_roots.qmd
+++ b/quarto/precalc/polynomial_roots.qmd
@@ -1,33 +1,7 @@
# Roots of a polynomial
-```{julia}
-#| echo: false
-
-import Logging
-Logging.disable_logging(Logging.Info) # or e.g. Logging.Info
-Logging.disable_logging(Logging.Warn)
-
-import SymPy
-function Base.show(io::IO, ::MIME"text/html", x::T) where {T <: SymPy.SymbolicObject}
- println(io, " ")
- println(io, "\\[")
- println(io, sympy.latex(x))
- println(io, "\\]")
- println(io, "")
-end
-
-# hack to work around issue
-import Markdown
-import CalculusWithJulia
-function CalculusWithJulia.WeaveSupport.ImageFile(d::Symbol, f::AbstractString, caption; kwargs...)
- nm = joinpath("..", string(d), f)
- u = ""
- Markdown.parse(u)
-end
-
-nothing
-```
+{{< include ../_common_code.qmd >}}
In this section we use the following add on packages:
diff --git a/quarto/precalc/polynomials_package.qmd b/quarto/precalc/polynomials_package.qmd
index 06834eb..8203def 100644
--- a/quarto/precalc/polynomials_package.qmd
+++ b/quarto/precalc/polynomials_package.qmd
@@ -1,33 +1,7 @@
# The Polynomials package
-```{julia}
-#| echo: false
-
-import Logging
-Logging.disable_logging(Logging.Info) # or e.g. Logging.Info
-Logging.disable_logging(Logging.Warn)
-
-import SymPy
-function Base.show(io::IO, ::MIME"text/html", x::T) where {T <: SymPy.SymbolicObject}
- println(io, " ")
- println(io, "\\[")
- println(io, sympy.latex(x))
- println(io, "\\]")
- println(io, "")
-end
-
-# hack to work around issue
-import Markdown
-import CalculusWithJulia
-function CalculusWithJulia.WeaveSupport.ImageFile(d::Symbol, f::AbstractString, caption; kwargs...)
- nm = joinpath("..", string(d), f)
- u = ""
- Markdown.parse(u)
-end
-
-nothing
-```
+{{< include ../_common_code.qmd >}}
This section will use the following add-on packages:
diff --git a/quarto/precalc/ranges.qmd b/quarto/precalc/ranges.qmd
index ed50fad..60320a5 100644
--- a/quarto/precalc/ranges.qmd
+++ b/quarto/precalc/ranges.qmd
@@ -1,33 +1,7 @@
# Ranges and Sets
-```{julia}
-#| echo: false
-
-import Logging
-Logging.disable_logging(Logging.Info) # or e.g. Logging.Info
-Logging.disable_logging(Logging.Warn)
-
-import SymPy
-function Base.show(io::IO, ::MIME"text/html", x::T) where {T <: SymPy.SymbolicObject}
- println(io, " ")
- println(io, "\\[")
- println(io, sympy.latex(x))
- println(io, "\\]")
- println(io, "")
-end
-
-# hack to work around issue
-import Markdown
-import CalculusWithJulia
-function CalculusWithJulia.WeaveSupport.ImageFile(d::Symbol, f::AbstractString, caption; kwargs...)
- nm = joinpath("..", string(d), f)
- u = ""
- Markdown.parse(u)
-end
-
-nothing
-```
+{{< include ../_common_code.qmd >}}
```{julia}
#| echo: false
diff --git a/quarto/precalc/rational_functions.qmd b/quarto/precalc/rational_functions.qmd
index f761b2a..5713104 100644
--- a/quarto/precalc/rational_functions.qmd
+++ b/quarto/precalc/rational_functions.qmd
@@ -1,33 +1,7 @@
# Rational functions
-```{julia}
-#| echo: false
-
-import Logging
-Logging.disable_logging(Logging.Info) # or e.g. Logging.Info
-Logging.disable_logging(Logging.Warn)
-
-import SymPy
-function Base.show(io::IO, ::MIME"text/html", x::T) where {T <: SymPy.SymbolicObject}
- println(io, " ")
- println(io, "\\[")
- println(io, sympy.latex(x))
- println(io, "\\]")
- println(io, "")
-end
-
-# hack to work around issue
-import Markdown
-import CalculusWithJulia
-function CalculusWithJulia.WeaveSupport.ImageFile(d::Symbol, f::AbstractString, caption; kwargs...)
- nm = joinpath("..", string(d), f)
- u = ""
- Markdown.parse(u)
-end
-
-nothing
-```
+{{< include ../_common_code.qmd >}}
This section uses the following add-on packages:
diff --git a/quarto/precalc/transformations.qmd b/quarto/precalc/transformations.qmd
index 345874b..a17b485 100644
--- a/quarto/precalc/transformations.qmd
+++ b/quarto/precalc/transformations.qmd
@@ -1,33 +1,7 @@
# Function manipulations
-```{julia}
-#| echo: false
-
-import Logging
-Logging.disable_logging(Logging.Info) # or e.g. Logging.Info
-Logging.disable_logging(Logging.Warn)
-
-import SymPy
-function Base.show(io::IO, ::MIME"text/html", x::T) where {T <: SymPy.SymbolicObject}
- println(io, " ")
- println(io, "\\[")
- println(io, sympy.latex(x))
- println(io, "\\]")
- println(io, "")
-end
-
-# hack to work around issue
-import Markdown
-import CalculusWithJulia
-function CalculusWithJulia.WeaveSupport.ImageFile(d::Symbol, f::AbstractString, caption; kwargs...)
- nm = joinpath("..", string(d), f)
- u = ""
- Markdown.parse(u)
-end
-
-nothing
-```
+{{< include ../_common_code.qmd >}}
In this section we will use these add-on packages:
diff --git a/quarto/precalc/trig_functions.qmd b/quarto/precalc/trig_functions.qmd
index 6594d5b..5bb1a6e 100644
--- a/quarto/precalc/trig_functions.qmd
+++ b/quarto/precalc/trig_functions.qmd
@@ -1,33 +1,7 @@
# Trigonometric functions
-```{julia}
-#| echo: false
-
-import Logging
-Logging.disable_logging(Logging.Info) # or e.g. Logging.Info
-Logging.disable_logging(Logging.Warn)
-
-import SymPy
-function Base.show(io::IO, ::MIME"text/html", x::T) where {T <: SymPy.SymbolicObject}
- println(io, " ")
- println(io, "\\[")
- println(io, sympy.latex(x))
- println(io, "\\]")
- println(io, "")
-end
-
-# hack to work around issue
-import Markdown
-import CalculusWithJulia
-function CalculusWithJulia.WeaveSupport.ImageFile(d::Symbol, f::AbstractString, caption; kwargs...)
- nm = joinpath("..", string(d), f)
- u = ""
- Markdown.parse(u)
-end
-
-nothing
-```
+{{< include ../_common_code.qmd >}}
This section uses the following add-on packages:
diff --git a/quarto/precalc/variables.qmd b/quarto/precalc/variables.qmd
index 3b266a9..86f5e22 100644
--- a/quarto/precalc/variables.qmd
+++ b/quarto/precalc/variables.qmd
@@ -1,33 +1,7 @@
# Variables
-```{julia}
-#| echo: false
-
-import Logging
-Logging.disable_logging(Logging.Info) # or e.g. Logging.Info
-Logging.disable_logging(Logging.Warn)
-
-import SymPy
-function Base.show(io::IO, ::MIME"text/html", x::T) where {T <: SymPy.SymbolicObject}
- println(io, " ")
- println(io, "\\[")
- println(io, sympy.latex(x))
- println(io, "\\]")
- println(io, "")
-end
-
-# hack to work around issue
-import Markdown
-import CalculusWithJulia
-function CalculusWithJulia.WeaveSupport.ImageFile(d::Symbol, f::AbstractString, caption; kwargs...)
- nm = joinpath("..", string(d), f)
- u = ""
- Markdown.parse(u)
-end
-
-nothing
-```
+{{< include ../_common_code.qmd >}}
## Assignment
diff --git a/quarto/precalc/vectors.qmd b/quarto/precalc/vectors.qmd
index ca53362..9613a54 100644
--- a/quarto/precalc/vectors.qmd
+++ b/quarto/precalc/vectors.qmd
@@ -1,33 +1,7 @@
# Vectors
-```{julia}
-#| echo: false
-
-import Logging
-Logging.disable_logging(Logging.Info) # or e.g. Logging.Info
-Logging.disable_logging(Logging.Warn)
-
-import SymPy
-function Base.show(io::IO, ::MIME"text/html", x::T) where {T <: SymPy.SymbolicObject}
- println(io, " ")
- println(io, "\\[")
- println(io, sympy.latex(x))
- println(io, "\\]")
- println(io, "")
-end
-
-# hack to work around issue
-import Markdown
-import CalculusWithJulia
-function CalculusWithJulia.WeaveSupport.ImageFile(d::Symbol, f::AbstractString, caption; kwargs...)
- nm = joinpath("..", string(d), f)
- u = ""
- Markdown.parse(u)
-end
-
-nothing
-```
+{{< include ../_common_code.qmd >}}
```{julia}
#| echo: false